ReactOS 0.4.16-dev-334-g4d9f67c
security.c
Go to the documentation of this file.
1/*
2 * Regedit ACL Editor for Registry Keys
3 *
4 * Copyright (C) 2004-2006 Thomas Weidenmueller <w3seek@reactos.com>
5 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
6 */
7
8#include "regedit.h"
9
10#define INITGUID
11#include <guiddef.h>
12
13/* FIXME - shouldn't be defined here... */
14DEFINE_GUID(IID_IRegKeySecurity, 0x965fc360, 0x16ff, 0x11d0, 0x0091, 0xcb,0x00,0xaa,0x00,0xbb,0xb7,0x23);
15#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
16DEFINE_GUID(IID_IRegKeySecurity2, 0xc3ccfdb4, 0x6f88, 0x11d2, 0x00a3, 0xce,0x00,0xc0,0x4f,0xb1,0x78,0x2a);
17#endif
18
19/* FIXME: already defined in aclui.h - causing problems when compiling with MSVC/PSDK*/
20#ifdef _MSC_VER
21#pragma message ("INVESTIGATE ME")
22#endif
23
24#if 1 //#ifndef _MSC_VER
25DEFINE_GUID(IID_IEffectivePermission, 0x3853dc76, 0x9f35, 0x407c, 0x0088, 0xa1,0xd1,0x93,0x44,0x36,0x5f,0xbc);
26DEFINE_GUID(IID_ISecurityObjectTypeInfo, 0xfc3066eb, 0x79ef, 0x444b, 0x0091, 0x11,0xd1,0x8a,0x75,0xeb,0xf2,0xfa);
27#endif
28
29/******************************************************************************
30 Implementation of the IUnknown methods of CRegKeySecurity
31 ******************************************************************************/
32
33static __inline PCRegKeySecurity
34impl_from_ISecurityInformation(struct ISecurityInformation *iface)
35{
37 lpISecurityInformationVtbl));
38}
39
40#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
41static __inline PCRegKeySecurity
42impl_from_ISecurityInformation2(struct ISecurityInformation2 *iface)
43{
45 lpISecurityInformation2Vtbl));
46}
47#endif
48
49static __inline PCRegKeySecurity
50impl_from_ISecurityObjectTypeInfo(struct ISecurityObjectTypeInfo *iface)
51{
53 lpISecurityObjectTypeInfoVtbl));
54}
55
56static __inline PCRegKeySecurity
57impl_from_IEffectivePermission(struct IEffectivePermission *iface)
58{
60 lpIEffectivePermissionVtbl));
61}
62
63#define impl_to_interface(impl,iface) (struct iface *)(&(impl)->lp##iface##Vtbl)
64
65static __inline ULONG
67{
68 return (ULONG)InterlockedIncrement((LONG*)&obj->ref);
69}
70
71static __inline ULONG
73{
74 ULONG Ret;
75
76 Ret = (ULONG)InterlockedDecrement((LONG*)&obj->ref);
77 if (Ret == 0)
78 {
80 }
81
82 return Ret;
83}
84
85static __inline HRESULT
87 REFIID iid,
88 PVOID *pvObject)
89{
90 PVOID pvObj = NULL;
91
92 if (IsEqualGUID(iid, &IID_IRegKeySecurity))
93 {
94 pvObj = (PVOID)impl_to_interface(obj, ISecurityInformation);
95 }
96#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
97 else if (IsEqualGUID(iid, &IID_IRegKeySecurity2))
98 {
99 pvObj = (PVOID)impl_to_interface(obj, ISecurityInformation2);
100 }
101#endif
102 else if (IsEqualGUID(iid, &IID_IEffectivePermission))
103 {
104 pvObj = (PVOID)impl_to_interface(obj, IEffectivePermission);
105 }
106 else if (IsEqualGUID(iid, &IID_ISecurityObjectTypeInfo))
107 {
108 pvObj = (PVOID)impl_to_interface(obj, ISecurityObjectTypeInfo);
109 }
110
111 if (pvObj == NULL)
112 {
113 return E_NOINTERFACE;
114 }
115
116 *pvObject = pvObj;
118
119 return S_OK;
120}
121
122
123/******************************************************************************
124 Definition of the ISecurityInformation interface
125 ******************************************************************************/
126
127/* IUnknown */
129ISecurityInformation_fnQueryInterface(struct ISecurityInformation *this,
130 REFIID iid,
131 PVOID *pvObject);
132
134ISecurityInformation_fnAddRef(struct ISecurityInformation *this);
135
137ISecurityInformation_fnRelease(struct ISecurityInformation *this);
138
139/* ISecurityInformation */
141ISecurityInformation_fnGetObjectInformation(struct ISecurityInformation *this,
142 PSI_OBJECT_INFO pObjectInfo);
143
145ISecurityInformation_fnGetSecurity(struct ISecurityInformation *this,
146 SECURITY_INFORMATION RequestedInformation,
147 PSECURITY_DESCRIPTOR* ppSecurityDescriptor,
148 BOOL fDefault);
149
151ISecurityInformation_fnSetSecurity(struct ISecurityInformation *this,
152 SECURITY_INFORMATION RequestedInformation,
153 PSECURITY_DESCRIPTOR pSecurityDescriptor);
154
156ISecurityInformation_fnGetAccessRights(struct ISecurityInformation *this,
157 const GUID* pguidObjectType,
159 PSI_ACCESS* ppAccess,
160 ULONG* pcAccesses,
161 ULONG* piDefaultAccess);
162
164ISecurityInformation_fnMapGeneric(struct ISecurityInformation *this,
165 const GUID* pguidObjectType,
166 UCHAR* pAceFlags,
167 ACCESS_MASK* pMask);
168
170ISecurityInformation_fnGetInheritTypes(struct ISecurityInformation *this,
171 PSI_INHERIT_TYPE* ppInheritTypes,
172 ULONG* pcInheritTypes);
174ISecurityInformation_fnPropertySheetPageCallback(struct ISecurityInformation *this,
175 HWND hwnd,
176 UINT uMsg,
177 SI_PAGE_TYPE uPage);
178
180{
181 /* IUnknown methods */
185
186 /* ISecurityInformation methods */
194};
195
196#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
197/******************************************************************************
198 Definition of the ISecurityInformation2 interface
199 ******************************************************************************/
200
201/* IUnknown */
203ISecurityInformation2_fnQueryInterface(struct ISecurityInformation2 *this,
204 REFIID iid,
205 PVOID *pvObject);
206
208ISecurityInformation2_fnAddRef(struct ISecurityInformation2 *this);
209
211ISecurityInformation2_fnRelease(struct ISecurityInformation2 *this);
212
213/* ISecurityInformation2 */
215ISecurityInformation2_fnIsDaclCanonical(struct ISecurityInformation2 *this,
216 PACL pDacl);
217
219ISecurityInformation2_fnLookupSids(struct ISecurityInformation2 *this,
220 ULONG cSids,
221 PSID* rgpSids,
222 LPDATAOBJECT* ppdo);
223
224static const struct ifaceISecurityInformation2Vbtl vtblISecurityInformation2 =
225{
226 /* IUnknown methods */
227 ISecurityInformation2_fnQueryInterface,
228 ISecurityInformation2_fnAddRef,
229 ISecurityInformation2_fnRelease,
230
231 /* ISecurityInformation2 methods */
232 ISecurityInformation2_fnIsDaclCanonical,
233 ISecurityInformation2_fnLookupSids
234};
235#endif
236
237/******************************************************************************
238 Definition of the IEffectivePermission interface
239 ******************************************************************************/
240
241/* IUnknown */
243IEffectivePermission_fnQueryInterface(struct IEffectivePermission *this,
244 REFIID iid,
245 PVOID *pvObject);
246
248IEffectivePermission_fnAddRef(struct IEffectivePermission *this);
249
251IEffectivePermission_fnRelease(struct IEffectivePermission *this);
252
253/* IEffectivePermission */
255IEffectivePermission_fnGetEffectivePermission(struct IEffectivePermission *this,
256 const GUID* pguidObjectType,
257 PSID pUserSid,
258 LPCWSTR pszServerName,
260 POBJECT_TYPE_LIST* ppObjectTypeList,
261 ULONG* pcObjectTypeListLength,
262 PACCESS_MASK* ppGrantedAccessList,
263 ULONG* pcGrantedAccessListLength);
264
266{
267 /* IUnknown methods */
271
272 /* IEffectivePermissions methods */
274};
275
276/******************************************************************************
277 Definition of the ISecurityObjectTypeInfo interface
278 ******************************************************************************/
279
280/* IUnknown */
282ISecurityObjectTypeInfo_fnQueryInterface(struct ISecurityObjectTypeInfo *this,
283 REFIID iid,
284 PVOID *pvObject);
285
287ISecurityObjectTypeInfo_fnAddRef(struct ISecurityObjectTypeInfo *this);
288
290ISecurityObjectTypeInfo_fnRelease(struct ISecurityObjectTypeInfo *this);
291
292/* ISecurityObjectTypeInfo */
294ISecurityObjectTypeInfo_fnGetInheritSource(struct ISecurityObjectTypeInfo *this,
296 PACL pACL,
297 PINHERITED_FROM* ppInheritArray);
298
300{
301 /* IUnknown methods */
305
306 /* ISecurityObjectTypeInfo methods */
308};
309
310
311/******************************************************************************
312 Implementation of the ISecurityInformation interface
313 ******************************************************************************/
314
328};
329
330static const DWORD RegDefaultAccess = 1; /* KEY_READ */
331
333 KEY_READ,
334 KEY_WRITE,
337};
338
343};
344
346ISecurityInformation_fnQueryInterface(struct ISecurityInformation *this,
347 REFIID iid,
349{
351 {
352 *pvObject = (PVOID)this;
354 return S_OK;
355 }
356
358 iid,
359 pvObject);
360}
361
363ISecurityInformation_fnAddRef(struct ISecurityInformation *this)
364{
366}
367
369ISecurityInformation_fnRelease(struct ISecurityInformation *this)
370{
372}
373
375ISecurityInformation_fnGetObjectInformation(struct ISecurityInformation *this,
376 PSI_OBJECT_INFO pObjectInfo)
377{
379
380 *pObjectInfo = obj->ObjectInfo;
381 return S_OK;
382}
383
385ISecurityInformation_fnGetSecurity(struct ISecurityInformation *this,
386 SECURITY_INFORMATION RequestedInformation,
387 PSECURITY_DESCRIPTOR* ppSecurityDescriptor,
388 BOOL fDefault)
389{
392
395 RequestedInformation,
396 NULL,
397 NULL,
398 NULL,
399 NULL,
400 ppSecurityDescriptor);
401
403}
404
406ISecurityInformation_fnSetSecurity(struct ISecurityInformation *this,
407 SECURITY_INFORMATION RequestedInformation,
408 PSECURITY_DESCRIPTOR pSecurityDescriptor)
409{
411
412 /* FIXME */
413 *obj->Btn = TRUE;
414 return S_OK;
415}
416
418ISecurityInformation_fnGetAccessRights(struct ISecurityInformation *this,
419 const GUID* pguidObjectType,
421 PSI_ACCESS* ppAccess,
422 ULONG* pcAccesses,
423 ULONG* piDefaultAccess)
424{
425 *ppAccess = RegAccess;
426 *pcAccesses = ARRAY_SIZE(RegAccess);
427 *piDefaultAccess = RegDefaultAccess;
428 return S_OK;
429}
430
432ISecurityInformation_fnMapGeneric(struct ISecurityInformation *this,
433 const GUID* pguidObjectType,
434 UCHAR* pAceFlags,
435 ACCESS_MASK* pMask)
436{
438 *pMask &= ~SYNCHRONIZE;
439 return S_OK;
440}
441
443ISecurityInformation_fnGetInheritTypes(struct ISecurityInformation *this,
444 PSI_INHERIT_TYPE* ppInheritTypes,
445 ULONG* pcInheritTypes)
446{
448
449 /* FIXME */
450 if (obj->ObjectInfo.dwFlags & SI_CONTAINER)
451 {
452 *ppInheritTypes = RegInheritTypes;
453 *pcInheritTypes = ARRAY_SIZE(RegInheritTypes);
454 return S_OK;
455 }
456
457 return E_NOTIMPL;
458}
459
461ISecurityInformation_fnPropertySheetPageCallback(struct ISecurityInformation *this,
462 HWND hwnd,
463 UINT uMsg,
464 SI_PAGE_TYPE uPage)
465{
466 return S_OK;
467}
468
469#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
470/******************************************************************************
471 Implementation of the ISecurityInformation2 interface
472 ******************************************************************************/
473
475ISecurityInformation2_fnQueryInterface(struct ISecurityInformation2 *this,
476 REFIID iid,
478{
480 {
481 *pvObject = (PVOID)this;
482 ISecurityInformation2_fnAddRef(this);
483 return S_OK;
484 }
485
486 return CRegKeySecurity_fnQueryInterface(impl_from_ISecurityInformation2(this),
487 iid,
488 pvObject);
489}
490
492ISecurityInformation2_fnAddRef(struct ISecurityInformation2 *this)
493{
494 return CRegKeySecurity_fnAddRef(impl_from_ISecurityInformation2(this));
495}
496
498ISecurityInformation2_fnRelease(struct ISecurityInformation2 *this)
499{
500 return CRegKeySecurity_fnRelease(impl_from_ISecurityInformation2(this));
501}
502
504ISecurityInformation2_fnIsDaclCanonical(struct ISecurityInformation2 *this,
505 PACL pDacl)
506{
507 /* FIXME */
508 return TRUE;
509}
510
512ISecurityInformation2_fnLookupSids(struct ISecurityInformation2 *this,
513 ULONG cSids,
514 PSID* rgpSids,
515 LPDATAOBJECT* ppdo)
516{
517 /* FIXME */
518 return E_NOTIMPL;
519}
520#endif
521
522/******************************************************************************
523 Implementation of the IEffectivePermission interface
524 ******************************************************************************/
525
527IEffectivePermission_fnQueryInterface(struct IEffectivePermission *this,
528 REFIID iid,
530{
532 {
533 *pvObject = (PVOID)this;
535 return S_OK;
536 }
537
539 iid,
540 pvObject);
541}
542
544IEffectivePermission_fnAddRef(struct IEffectivePermission *this)
545{
547}
548
550IEffectivePermission_fnRelease(struct IEffectivePermission *this)
551{
553}
554
556IEffectivePermission_fnGetEffectivePermission(struct IEffectivePermission *this,
557 const GUID* pguidObjectType,
558 PSID pUserSid,
559 LPCWSTR pszServerName,
561 POBJECT_TYPE_LIST* ppObjectTypeList,
562 ULONG* pcObjectTypeListLength,
563 PACCESS_MASK* ppGrantedAccessList,
564 ULONG* pcGrantedAccessListLength)
565{
566 PACL Dacl = NULL;
568 PACCESS_MASK GrantedAccessList;
570 TRUSTEE Trustee = {0};
571 static OBJECT_TYPE_LIST DefObjTypeList = {0};
572
573 *ppObjectTypeList = &DefObjTypeList;
574 *pcObjectTypeListLength = 1;
575
576 BuildTrusteeWithSid(&Trustee, pUserSid);
577
580 &Dacl,
582 {
583 GrantedAccessList = (PACCESS_MASK)LocalAlloc(LMEM_FIXED,
584 sizeof(ACCESS_MASK));
585 if (GrantedAccessList == NULL)
586 {
587 goto Fail;
588 }
589
591 &Trustee,
592 GrantedAccessList);
594 {
595 *ppGrantedAccessList = GrantedAccessList;
596 *pcGrantedAccessListLength = 1;
597 }
598 else
599 LocalFree((HLOCAL)GrantedAccessList);
600 }
601 else
602Fail:
604
606}
607
608/******************************************************************************
609 Implementation of the ISecurityObjectTypeInfo interface
610 ******************************************************************************/
611
613ISecurityObjectTypeInfo_fnQueryInterface(struct ISecurityObjectTypeInfo *this,
614 REFIID iid,
616{
618 {
619 *pvObject = (PVOID)this;
621 return S_OK;
622 }
623
625 iid,
626 pvObject);
627}
628
630ISecurityObjectTypeInfo_fnAddRef(struct ISecurityObjectTypeInfo *this)
631{
633}
634
636ISecurityObjectTypeInfo_fnRelease(struct ISecurityObjectTypeInfo *this)
637{
639}
640
642ISecurityObjectTypeInfo_fnGetInheritSource(struct ISecurityObjectTypeInfo *this,
644 PACL pACL,
645 PINHERITED_FROM* ppInheritArray)
646{
648 PINHERITED_FROM pif, pif2;
649 SIZE_T pifSize;
651 LPWSTR lpBuf;
652
653 pifSize = pACL->AceCount * sizeof(INHERITED_FROM);
654 pif = (PINHERITED_FROM)HeapAlloc(GetProcessHeap(), 0, pifSize);
655 if (pif == NULL)
656 return E_OUTOFMEMORY;
657
660 si,
661 (obj->ObjectInfo.dwFlags & SI_CONTAINER) != 0,
662 NULL,
663 0,
664 pACL,
665 NULL,
667 pif);
669 {
670 /* Calculate the size of the buffer to return */
671 for (i = 0; i < pACL->AceCount; i++)
672 {
673 if (pif[i].AncestorName != NULL)
674 pifSize += (wcslen(pif[i].AncestorName) + 1) * sizeof(WCHAR);
675 }
676
677 /* Allocate enough space for the array and the strings */
678 pif2 = (PINHERITED_FROM)LocalAlloc(LMEM_FIXED, pifSize);
679 if (pif2 == NULL)
680 {
682 goto Cleanup;
683 }
684
685 /* copy the array and strings to the buffer */
686 lpBuf = (LPWSTR)((ULONG_PTR)pif2 + (pACL->AceCount * sizeof(INHERITED_FROM)));
687 for (i = 0; i < pACL->AceCount; i++)
688 {
689 pif2[i].GenerationGap = pif[i].GenerationGap;
690 if (pif[i].AncestorName != NULL)
691 {
692 pif2[i].AncestorName = lpBuf;
693 wcscpy(lpBuf,
694 pif[i].AncestorName);
695 lpBuf += wcslen(pif[i].AncestorName) + 1;
696 }
697 else
698 pif2[i].AncestorName = NULL;
699 }
700
701 /* return the newly allocated array */
702 *ppInheritArray = pif2;
703 }
704
705Cleanup:
707 HeapFree(GetProcessHeap(), 0, pif);
708
710}
711
712/******************************************************************************
713 Implementation of the CRegKeySecurity constructor
714 ******************************************************************************/
715
716static PCRegKeySecurity
718 HKEY hRootKey,
719 SI_OBJECT_INFO *ObjectInfo,
720 BOOL *Btn)
721{
723
727 szRegKey[wcslen(lpRegKey) + 1]));
728 if (obj != NULL)
729 {
730 obj->ref = 1;
731 obj->lpISecurityInformationVtbl = &vtblISecurityInformation;
732#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
733 obj->lpISecurityInformation2Vtbl = &vtblISecurityInformation2;
734#endif
735 obj->lpIEffectivePermissionVtbl = &vtblIEffectivePermission;
736 obj->lpISecurityObjectTypeInfoVtbl = &vtblISecurityObjectTypeInfo;
737 obj->ObjectInfo = *ObjectInfo;
738 obj->Btn = Btn;
739 obj->hRootKey = hRootKey;
740 StringCbCopyW(obj->szRegKey, sizeof(obj->szRegKey), lpRegKey);
741 }
742 else
744
745 return obj;
746}
747
748/******************************************************************************/
749/******************************************************************************/
750/******************************************************************************/
751
752typedef struct _CHANGE_CONTEXT
753{
757
758typedef BOOL (WINAPI *PEDITSECURITY)(HWND hwndOwner,
759 struct ISecurityInformation *psi);
760
763
764BOOL
766{
767 if (!(hAclUiDll = LoadLibraryW(L"aclui.dll")))
768 {
769 return FALSE;
770 }
771
773 "EditSecurity")))
774 {
776 hAclUiDll = NULL;
777 return FALSE;
778 }
779
780 return TRUE;
781}
782
783VOID
785{
786 if (hAclUiDll != NULL)
787 {
789 }
790}
791
792BOOL
794 HKEY hKey,
795 LPCWSTR lpMachine,
796 LPCWSTR lpKeyName)
797{
798 BOOL Result = FALSE;
799 LPCWSTR lphKey = NULL;
800 LPWSTR lpKeyPath = NULL;
801 PCRegKeySecurity RegKeySecurity;
802 SI_OBJECT_INFO ObjectInfo;
803 size_t lnMachine = 0, lnKeyName = 0;
804
805 if (pfnEditSecurity == NULL)
806 {
807 return FALSE;
808 }
809
810 if (lpMachine != NULL)
811 lnMachine = wcslen(lpMachine);
812 if (lpKeyName != NULL)
813 lnKeyName = wcslen(lpKeyName);
814
815 /* build registry path */
816 if (lpMachine != NULL &&
817 (lpMachine[0] == L'\0' ||
818 (lpMachine[0] == L'.' && lpMachine[1] == L'.')))
819 {
820 lnMachine = 0;
821 }
822
823 if (hKey == HKEY_CLASSES_ROOT)
824 lphKey = L"CLASSES_ROOT";
825 else if (hKey == HKEY_CURRENT_USER)
826 lphKey = L"CURRENT_USER";
827 else if (hKey == HKEY_LOCAL_MACHINE)
828 lphKey = L"MACHINE";
829 else if (hKey == HKEY_USERS)
830 lphKey = L"USERS";
831 else if (hKey == HKEY_CURRENT_CONFIG)
832 lphKey = L"CONFIG";
833 else
834 goto Cleanup;
835
836 lpKeyPath = HeapAlloc(GetProcessHeap(),
837 0,
838 (2 + lnMachine + 1 + wcslen(lphKey) + 1 + lnKeyName) * sizeof(WCHAR));
839 if (lpKeyPath == NULL)
840 {
842 goto Cleanup;
843 }
844 lpKeyPath[0] = L'\0';
845
846 if (lnMachine != 0)
847 {
848 wcscat(lpKeyPath, L"\\\\");
849 wcscat(lpKeyPath, lpMachine);
850 wcscat(lpKeyPath, L"\\");
851 }
852
853 wcscat(lpKeyPath, lphKey);
854 if (lpKeyName != NULL && lpKeyName[0] != L'\0')
855 {
856 if (lpKeyName[0] != L'\\')
857 wcscat(lpKeyPath, L"\\");
858
859 wcscat(lpKeyPath, lpKeyName);
860 }
861
864 ObjectInfo.hInstance = hInst;
865 ObjectInfo.pszServerName = (LPWSTR)lpMachine;
866 ObjectInfo.pszObjectName = (LPWSTR)lpKeyName; /* FIXME */
867 ObjectInfo.pszPageTitle = (LPWSTR)lpKeyName; /* FIXME */
868
869 if (!(RegKeySecurity = CRegKeySecurity_fnConstructor(lpKeyPath,
870 hKey,
871 &ObjectInfo,
872 &Result)))
873 {
874 goto Cleanup;
875 }
876
877 /* display the security editor dialog */
878 pfnEditSecurity(hWndOwner, impl_to_interface(RegKeySecurity, ISecurityInformation));
879
880 /* dereference the interface, it should be destroyed here */
881 CRegKeySecurity_fnRelease(RegKeySecurity);
882
883Cleanup:
884 if (lpKeyPath != NULL)
885 HeapFree(GetProcessHeap(), 0, lpKeyPath);
886
887 return Result;
888}
889
890/* EOF */
DWORD WINAPI GetInheritanceSourceW(LPWSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, BOOL Container, GUID **pObjectClassGuids OPTIONAL, DWORD GuidCount, PACL pAcl, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL, PGENERIC_MAPPING pGenericMapping, PINHERITED_FROMW pInheritArray)
Definition: ac.c:115
DWORD WINAPI FreeInheritedFromArray(PINHERITED_FROMW pInheritArray, USHORT AceCnt, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL)
Definition: ac.c:175
#define SI_CONTAINER
Definition: accctrl.h:116
@ SE_REGISTRY_KEY
Definition: accctrl.h:163
enum _SI_PAGE_TYPE SI_PAGE_TYPE
#define SI_RESET_DACL_TREE
Definition: accctrl.h:127
#define SI_OWNER_RECURSE
Definition: accctrl.h:122
#define SI_EDIT_ALL
Definition: accctrl.h:136
#define SI_ACCESS_SPECIFIC
Definition: accctrl.h:138
#define SI_ACCESS_GENERAL
Definition: accctrl.h:139
#define SI_EDIT_PERMS
Definition: accctrl.h:113
#define SI_EDIT_EFFECTIVE
Definition: accctrl.h:130
#define SI_RESET_SACL_TREE
Definition: accctrl.h:128
#define SI_ADVANCED
Definition: accctrl.h:118
#define BuildTrusteeWithSid
Definition: aclapi.h:230
#define GetEffectiveRightsFromAcl
Definition: aclapi.h:232
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define ARRAY_SIZE(A)
Definition: main.h:20
#define IDS_ACCESS_CREATELINK
Definition: resource.h:134
#define IDS_ACCESS_WRITEOWNER
Definition: resource.h:137
#define IDS_ACCESS_READ
Definition: resource.h:128
#define IDS_ACCESS_READCONTROL
Definition: resource.h:138
#define IDS_INHERIT_SUBKEYSONLY
Definition: resource.h:142
#define IDS_ACCESS_SETVALUE
Definition: resource.h:130
#define IDS_ACCESS_ENUMERATESUBKEYS
Definition: resource.h:132
#define IDS_ACCESS_NOTIFY
Definition: resource.h:133
#define IDS_ACCESS_FULLCONTROL
Definition: resource.h:127
#define IDS_ACCESS_QUERYVALUE
Definition: resource.h:129
#define IDS_ACCESS_WRITEDAC
Definition: resource.h:136
#define IDS_INHERIT_THISKEYONLY
Definition: resource.h:140
#define IDS_INHERIT_THISKEYANDSUBKEYS
Definition: resource.h:141
#define IDS_ACCESS_CREATESUBKEY
Definition: resource.h:131
#define IDS_ACCESS_DELETE
Definition: resource.h:135
static HRESULT STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnQueryInterface(struct ISecurityObjectTypeInfo *this, REFIID iid, PVOID *pvObject)
Definition: security.c:613
static ULONG STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnAddRef(struct ISecurityObjectTypeInfo *this)
Definition: security.c:630
static HRESULT STDMETHODCALLTYPE IEffectivePermission_fnQueryInterface(struct IEffectivePermission *this, REFIID iid, PVOID *pvObject)
Definition: security.c:527
static __inline PCRegKeySecurity impl_from_ISecurityInformation(struct ISecurityInformation *iface)
Definition: security.c:34
static HRESULT STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnGetInheritSource(struct ISecurityObjectTypeInfo *this, SECURITY_INFORMATION si, PACL pACL, PINHERITED_FROM *ppInheritArray)
Definition: security.c:642
static __inline PCRegKeySecurity impl_from_IEffectivePermission(struct IEffectivePermission *iface)
Definition: security.c:57
static HRESULT STDMETHODCALLTYPE IEffectivePermission_fnGetEffectivePermission(struct IEffectivePermission *this, const GUID *pguidObjectType, PSID pUserSid, LPCWSTR pszServerName, PSECURITY_DESCRIPTOR pSD, POBJECT_TYPE_LIST *ppObjectTypeList, ULONG *pcObjectTypeListLength, PACCESS_MASK *ppGrantedAccessList, ULONG *pcGrantedAccessListLength)
Definition: security.c:556
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnQueryInterface(struct ISecurityInformation *this, REFIID iid, PVOID *pvObject)
Definition: security.c:346
BOOL(WINAPI * PEDITSECURITY)(HWND hwndOwner, struct ISecurityInformation *psi)
Definition: security.c:758
static ULONG STDMETHODCALLTYPE ISecurityInformation_fnAddRef(struct ISecurityInformation *this)
Definition: security.c:363
static ULONG STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnRelease(struct ISecurityObjectTypeInfo *this)
Definition: security.c:636
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetSecurity(struct ISecurityInformation *this, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR *ppSecurityDescriptor, BOOL fDefault)
Definition: security.c:385
BOOL InitializeAclUiDll(VOID)
Definition: security.c:765
static ULONG STDMETHODCALLTYPE ISecurityInformation_fnRelease(struct ISecurityInformation *this)
Definition: security.c:369
static __inline ULONG CRegKeySecurity_fnAddRef(PCRegKeySecurity obj)
Definition: security.c:66
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnMapGeneric(struct ISecurityInformation *this, const GUID *pguidObjectType, UCHAR *pAceFlags, ACCESS_MASK *pMask)
Definition: security.c:432
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnSetSecurity(struct ISecurityInformation *this, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor)
Definition: security.c:406
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetObjectInformation(struct ISecurityInformation *this, PSI_OBJECT_INFO pObjectInfo)
Definition: security.c:375
static __inline HRESULT CRegKeySecurity_fnQueryInterface(PCRegKeySecurity obj, REFIID iid, PVOID *pvObject)
Definition: security.c:86
VOID UnloadAclUiDll(VOID)
Definition: security.c:784
static __inline ULONG CRegKeySecurity_fnRelease(PCRegKeySecurity obj)
Definition: security.c:72
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetInheritTypes(struct ISecurityInformation *this, PSI_INHERIT_TYPE *ppInheritTypes, ULONG *pcInheritTypes)
Definition: security.c:443
static const struct ifaceIEffectivePermissionVbtl vtblIEffectivePermission
Definition: security.c:265
static SI_ACCESS RegAccess[]
Definition: security.c:315
static GENERIC_MAPPING RegAccessMasks
Definition: security.c:332
static PCRegKeySecurity CRegKeySecurity_fnConstructor(LPWSTR lpRegKey, HKEY hRootKey, SI_OBJECT_INFO *ObjectInfo, BOOL *Btn)
Definition: security.c:717
#define impl_to_interface(impl, iface)
Definition: security.c:63
static const struct ifaceISecurityInformationVbtl vtblISecurityInformation
Definition: security.c:179
static const struct ifaceISecurityObjectTypeInfoVbtl vtblISecurityObjectTypeInfo
Definition: security.c:299
BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName)
Definition: security.c:793
static PEDITSECURITY pfnEditSecurity
Definition: security.c:761
static HMODULE hAclUiDll
Definition: security.c:762
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnPropertySheetPageCallback(struct ISecurityInformation *this, HWND hwnd, UINT uMsg, SI_PAGE_TYPE uPage)
Definition: security.c:461
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetAccessRights(struct ISecurityInformation *this, const GUID *pguidObjectType, DWORD dwFlags, PSI_ACCESS *ppAccess, ULONG *pcAccesses, ULONG *piDefaultAccess)
Definition: security.c:418
static SI_INHERIT_TYPE RegInheritTypes[]
Definition: security.c:339
static ULONG STDMETHODCALLTYPE IEffectivePermission_fnAddRef(struct IEffectivePermission *this)
Definition: security.c:544
static ULONG STDMETHODCALLTYPE IEffectivePermission_fnRelease(struct IEffectivePermission *this)
Definition: security.c:550
struct _CHANGE_CONTEXT * PCHANGE_CONTEXT
static const DWORD RegDefaultAccess
Definition: security.c:330
static __inline PCRegKeySecurity impl_from_ISecurityObjectTypeInfo(struct ISecurityObjectTypeInfo *iface)
Definition: security.c:50
struct _CHANGE_CONTEXT CHANGE_CONTEXT
struct _CRegKeySecurity * PCRegKeySecurity
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
DWORD WINAPI GetNamedSecurityInfoW(LPWSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, PSID *ppsidOwner, PSID *ppsidGroup, PACL *ppDacl, PACL *ppSacl, PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
Definition: misc.c:1147
#define GetProcessHeap()
Definition: compat.h:736
#define SetLastError(x)
Definition: compat.h:752
#define GetProcAddress(x, y)
Definition: compat.h:753
#define HeapAlloc
Definition: compat.h:733
#define FreeLibrary(x)
Definition: compat.h:748
#define HeapFree(x, y, z)
Definition: compat.h:735
#define LoadLibraryW(x)
Definition: compat.h:747
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static const WCHAR Cleanup[]
Definition: register.c:80
#define ULONG_PTR
Definition: config.h:101
HINSTANCE hInst
Definition: dxdiag.c:13
int Fail
Definition: ehthrow.cxx:24
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define S_OK
Definition: intsafe.h:52
#define GUID_NULL
Definition: ks.h:106
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
unsigned int UINT
Definition: ndis.h:50
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1605
_In_ BOOLEAN DaclPresent
Definition: rtlfuncs.h:1647
_In_ BOOLEAN _In_opt_ PACL _In_opt_ BOOLEAN DaclDefaulted
Definition: rtlfuncs.h:1650
#define BOOL
Definition: nt_native.h:43
#define WRITE_DAC
Definition: nt_native.h:59
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define KEY_READ
Definition: nt_native.h:1023
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define KEY_EXECUTE
Definition: nt_native.h:1037
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
#define DELETE
Definition: nt_native.h:57
#define KEY_WRITE
Definition: nt_native.h:1031
#define READ_CONTROL
Definition: nt_native.h:58
#define WRITE_OWNER
Definition: nt_native.h:60
#define KEY_CREATE_LINK
Definition: nt_native.h:1021
#define KEY_NOTIFY
Definition: nt_native.h:1020
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define L(x)
Definition: ntvdm.h:50
interface IDataObject * LPDATAOBJECT
Definition: objfwd.h:21
long LONG
Definition: pedump.c:60
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL *pDacl, LPBOOL lpbDaclDefaulted)
Definition: sec.c:45
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
USHORT AceCount
Definition: ms-dtyp.idl:297
LPWSTR KeyString
Definition: security.c:755
LPWSTR pszObjectName
Definition: accctrl.h:391
LPWSTR pszPageTitle
Definition: accctrl.h:392
DWORD dwFlags
Definition: accctrl.h:388
HINSTANCE hInstance
Definition: accctrl.h:389
LPWSTR pszServerName
Definition: accctrl.h:390
REFIID PVOID * pvObject
Definition: security.h:95
REFIID PVOID * pvObject
Definition: security.h:23
SECURITY_INFORMATION si
Definition: security.h:129
SECURITY_INFORMATION PACL PINHERITED_FROM * ppInheritArray
Definition: security.h:131
SECURITY_INFORMATION PACL pACL
Definition: security.h:130
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
void * PVOID
Definition: typedefs.h:50
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
VOID WINAPI MapGenericMask(PDWORD, PGENERIC_MAPPING)
#define LMEM_FIXED
Definition: winbase.h:394
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
#define CONTAINER_INHERIT_ACE
Definition: setypes.h:747
#define INHERIT_ONLY_ACE
Definition: setypes.h:749
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185