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);
21#pragma message ("INVESTIGATE ME")
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);
37 lpISecurityInformationVtbl));
40#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
42impl_from_ISecurityInformation2(
struct ISecurityInformation2 *iface)
45 lpISecurityInformation2Vtbl));
53 lpISecurityObjectTypeInfoVtbl));
60 lpIEffectivePermissionVtbl));
63#define impl_to_interface(impl,iface) (struct iface *)(&(impl)->lp##iface##Vtbl)
96#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
102 else if (
IsEqualGUID(iid, &IID_IEffectivePermission))
106 else if (
IsEqualGUID(iid, &IID_ISecurityObjectTypeInfo))
157 const GUID* pguidObjectType,
161 ULONG* piDefaultAccess);
165 const GUID* pguidObjectType,
172 ULONG* pcInheritTypes);
196#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
203ISecurityInformation2_fnQueryInterface(
struct ISecurityInformation2 *
this,
208ISecurityInformation2_fnAddRef(
struct ISecurityInformation2 *
this);
211ISecurityInformation2_fnRelease(
struct ISecurityInformation2 *
this);
215ISecurityInformation2_fnIsDaclCanonical(
struct ISecurityInformation2 *
this,
219ISecurityInformation2_fnLookupSids(
struct ISecurityInformation2 *
this,
224static const struct ifaceISecurityInformation2Vbtl vtblISecurityInformation2 =
227 ISecurityInformation2_fnQueryInterface,
228 ISecurityInformation2_fnAddRef,
229 ISecurityInformation2_fnRelease,
232 ISecurityInformation2_fnIsDaclCanonical,
233 ISecurityInformation2_fnLookupSids
256 const GUID* pguidObjectType,
261 ULONG* pcObjectTypeListLength,
263 ULONG* pcGrantedAccessListLength);
297 PINHERITED_FROM* ppInheritArray);
380 *pObjectInfo =
obj->ObjectInfo;
395 RequestedInformation,
400 ppSecurityDescriptor);
419 const GUID* pguidObjectType,
423 ULONG* piDefaultAccess)
433 const GUID* pguidObjectType,
438 *pMask &= ~SYNCHRONIZE;
445 ULONG* pcInheritTypes)
469#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
475ISecurityInformation2_fnQueryInterface(
struct ISecurityInformation2 *
this,
482 ISecurityInformation2_fnAddRef(
this);
492ISecurityInformation2_fnAddRef(
struct ISecurityInformation2 *
this)
498ISecurityInformation2_fnRelease(
struct ISecurityInformation2 *
this)
504ISecurityInformation2_fnIsDaclCanonical(
struct ISecurityInformation2 *
this,
512ISecurityInformation2_fnLookupSids(
struct ISecurityInformation2 *
this,
557 const GUID* pguidObjectType,
562 ULONG* pcObjectTypeListLength,
564 ULONG* pcGrantedAccessListLength)
573 *ppObjectTypeList = &DefObjTypeList;
574 *pcObjectTypeListLength = 1;
585 if (GrantedAccessList ==
NULL)
595 *ppGrantedAccessList = GrantedAccessList;
596 *pcGrantedAccessListLength = 1;
648 PINHERITED_FROM pif, pif2;
673 if (pif[
i].AncestorName !=
NULL)
674 pifSize += (
wcslen(pif[
i].AncestorName) + 1) *
sizeof(
WCHAR);
689 pif2[
i].GenerationGap = pif[
i].GenerationGap;
690 if (pif[
i].AncestorName !=
NULL)
692 pif2[
i].AncestorName = lpBuf;
694 pif[
i].AncestorName);
695 lpBuf +=
wcslen(pif[
i].AncestorName) + 1;
698 pif2[
i].AncestorName =
NULL;
727 szRegKey[
wcslen(lpRegKey) + 1]));
732#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
733 obj->lpISecurityInformation2Vtbl = &vtblISecurityInformation2;
737 obj->ObjectInfo = *ObjectInfo;
739 obj->hRootKey = hRootKey;
759 struct ISecurityInformation *psi);
803 size_t lnMachine = 0, lnKeyName = 0;
810 if (lpMachine !=
NULL)
811 lnMachine =
wcslen(lpMachine);
812 if (lpKeyName !=
NULL)
813 lnKeyName =
wcslen(lpKeyName);
816 if (lpMachine !=
NULL &&
817 (lpMachine[0] ==
L'\0' ||
818 (lpMachine[0] ==
L'.' && lpMachine[1] ==
L'.')))
824 lphKey =
L"CLASSES_ROOT";
826 lphKey =
L"CURRENT_USER";
838 (2 + lnMachine + 1 +
wcslen(lphKey) + 1 + lnKeyName) *
sizeof(
WCHAR));
839 if (lpKeyPath ==
NULL)
844 lpKeyPath[0] =
L'\0';
849 wcscat(lpKeyPath, lpMachine);
853 wcscat(lpKeyPath, lphKey);
854 if (lpKeyName !=
NULL && lpKeyName[0] !=
L'\0')
856 if (lpKeyName[0] !=
L'\\')
859 wcscat(lpKeyPath, lpKeyName);
884 if (lpKeyPath !=
NULL)
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)
DWORD WINAPI FreeInheritedFromArray(PINHERITED_FROMW pInheritArray, USHORT AceCnt, PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL)
enum _SI_PAGE_TYPE SI_PAGE_TYPE
#define SI_RESET_DACL_TREE
#define SI_ACCESS_SPECIFIC
#define SI_ACCESS_GENERAL
#define SI_EDIT_EFFECTIVE
#define SI_RESET_SACL_TREE
#define BuildTrusteeWithSid
#define GetEffectiveRightsFromAcl
#define InterlockedIncrement
#define InterlockedDecrement
#define IDS_ACCESS_CREATELINK
#define IDS_ACCESS_WRITEOWNER
#define IDS_ACCESS_READCONTROL
#define IDS_INHERIT_SUBKEYSONLY
#define IDS_ACCESS_SETVALUE
#define IDS_ACCESS_ENUMERATESUBKEYS
#define IDS_ACCESS_NOTIFY
#define IDS_ACCESS_FULLCONTROL
#define IDS_ACCESS_QUERYVALUE
#define IDS_ACCESS_WRITEDAC
#define IDS_INHERIT_THISKEYONLY
#define IDS_INHERIT_THISKEYANDSUBKEYS
#define IDS_ACCESS_CREATESUBKEY
#define IDS_ACCESS_DELETE
static HRESULT STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnQueryInterface(struct ISecurityObjectTypeInfo *this, REFIID iid, PVOID *pvObject)
static ULONG STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnAddRef(struct ISecurityObjectTypeInfo *this)
static HRESULT STDMETHODCALLTYPE IEffectivePermission_fnQueryInterface(struct IEffectivePermission *this, REFIID iid, PVOID *pvObject)
static __inline PCRegKeySecurity impl_from_ISecurityInformation(struct ISecurityInformation *iface)
static HRESULT STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnGetInheritSource(struct ISecurityObjectTypeInfo *this, SECURITY_INFORMATION si, PACL pACL, PINHERITED_FROM *ppInheritArray)
static __inline PCRegKeySecurity impl_from_IEffectivePermission(struct IEffectivePermission *iface)
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)
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnQueryInterface(struct ISecurityInformation *this, REFIID iid, PVOID *pvObject)
BOOL(WINAPI * PEDITSECURITY)(HWND hwndOwner, struct ISecurityInformation *psi)
static ULONG STDMETHODCALLTYPE ISecurityInformation_fnAddRef(struct ISecurityInformation *this)
static ULONG STDMETHODCALLTYPE ISecurityObjectTypeInfo_fnRelease(struct ISecurityObjectTypeInfo *this)
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetSecurity(struct ISecurityInformation *this, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR *ppSecurityDescriptor, BOOL fDefault)
BOOL InitializeAclUiDll(VOID)
static ULONG STDMETHODCALLTYPE ISecurityInformation_fnRelease(struct ISecurityInformation *this)
static __inline ULONG CRegKeySecurity_fnAddRef(PCRegKeySecurity obj)
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnMapGeneric(struct ISecurityInformation *this, const GUID *pguidObjectType, UCHAR *pAceFlags, ACCESS_MASK *pMask)
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnSetSecurity(struct ISecurityInformation *this, SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor)
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetObjectInformation(struct ISecurityInformation *this, PSI_OBJECT_INFO pObjectInfo)
static __inline HRESULT CRegKeySecurity_fnQueryInterface(PCRegKeySecurity obj, REFIID iid, PVOID *pvObject)
VOID UnloadAclUiDll(VOID)
static __inline ULONG CRegKeySecurity_fnRelease(PCRegKeySecurity obj)
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetInheritTypes(struct ISecurityInformation *this, PSI_INHERIT_TYPE *ppInheritTypes, ULONG *pcInheritTypes)
static const struct ifaceIEffectivePermissionVbtl vtblIEffectivePermission
static SI_ACCESS RegAccess[]
static GENERIC_MAPPING RegAccessMasks
static PCRegKeySecurity CRegKeySecurity_fnConstructor(LPWSTR lpRegKey, HKEY hRootKey, SI_OBJECT_INFO *ObjectInfo, BOOL *Btn)
#define impl_to_interface(impl, iface)
static const struct ifaceISecurityInformationVbtl vtblISecurityInformation
static const struct ifaceISecurityObjectTypeInfoVbtl vtblISecurityObjectTypeInfo
BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName)
static PEDITSECURITY pfnEditSecurity
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnPropertySheetPageCallback(struct ISecurityInformation *this, HWND hwnd, UINT uMsg, SI_PAGE_TYPE uPage)
static HRESULT STDMETHODCALLTYPE ISecurityInformation_fnGetAccessRights(struct ISecurityInformation *this, const GUID *pguidObjectType, DWORD dwFlags, PSI_ACCESS *ppAccess, ULONG *pcAccesses, ULONG *piDefaultAccess)
static SI_INHERIT_TYPE RegInheritTypes[]
static ULONG STDMETHODCALLTYPE IEffectivePermission_fnAddRef(struct IEffectivePermission *this)
static ULONG STDMETHODCALLTYPE IEffectivePermission_fnRelease(struct IEffectivePermission *this)
struct _CHANGE_CONTEXT * PCHANGE_CONTEXT
static const DWORD RegDefaultAccess
static __inline PCRegKeySecurity impl_from_ISecurityObjectTypeInfo(struct ISecurityObjectTypeInfo *iface)
struct _CHANGE_CONTEXT CHANGE_CONTEXT
struct _CRegKeySecurity * PCRegKeySecurity
#define STDMETHODCALLTYPE
#define ERROR_NOT_ENOUGH_MEMORY
DWORD WINAPI GetNamedSecurityInfoW(LPWSTR pObjectName, SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, PSID *ppsidOwner, PSID *ppsidGroup, PACL *ppDacl, PACL *ppSacl, PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
static const WCHAR Cleanup[]
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
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
DWORD SECURITY_INFORMATION
_In_ NDIS_ERROR_CODE ErrorCode
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
_In_ BOOLEAN _In_opt_ PACL _In_opt_ BOOLEAN DaclDefaulted
ACCESS_MASK * PACCESS_MASK
#define KEY_CREATE_SUB_KEY
#define KEY_ENUMERATE_SUB_KEYS
interface IDataObject * LPDATAOBJECT
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
#define IsEqualGUID(rguid1, rguid2)
_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)
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
SECURITY_INFORMATION PACL PINHERITED_FROM * ppInheritArray
SECURITY_INFORMATION PACL pACL
#define FIELD_OFFSET(t, f)
DWORD WINAPI GetLastError(void)
VOID WINAPI MapGenericMask(PDWORD, PGENERIC_MAPPING)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define HRESULT_FROM_WIN32(x)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_CONFIG
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT
#define MAKEINTRESOURCEW(i)
_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
#define CONTAINER_INHERIT_ACE