-
Notifications
You must be signed in to change notification settings - Fork 0
/
security.h
160 lines (136 loc) · 7.49 KB
/
security.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#pragma once
#ifdef __RREGEDIT__
#include <aclui.h>
#endif
BOOL
InitializeAclUiDll(VOID);
VOID
UnloadAclUiDll(VOID);
#define REGEDIT_IMPLEMENT_ISECURITYINFORMATION2 0
/******************************************************************************
ISecurityInformation
******************************************************************************/
typedef struct ISecurityInformation *LPSECURITYINFORMATION;
typedef struct ifaceISecuritInformationVbtl ifaceISecurityInformationVbtl;
struct ifaceISecurityInformationVbtl
{
/* IUnknown */
HRESULT (STDMETHODCALLTYPE *QueryInterface)(struct ISecurityInformation *this,
REFIID iid,
PVOID *pvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(struct ISecurityInformation *this);
ULONG (STDMETHODCALLTYPE *Release)(struct ISecurityInformation *this);
/* ISecurityInformation */
HRESULT (STDMETHODCALLTYPE *GetObjectInformation)(struct ISecurityInformation *this,
PSI_OBJECT_INFO pObjectInfo);
HRESULT (STDMETHODCALLTYPE *GetSecurity)(struct ISecurityInformation *this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor,
BOOL fDefault);
HRESULT (STDMETHODCALLTYPE *SetSecurity)(struct ISecurityInformation *this,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor);
HRESULT (STDMETHODCALLTYPE *GetAccessRights)(struct ISecurityInformation *this,
const GUID* pguidObjectType,
DWORD dwFlags,
PSI_ACCESS* ppAccess,
ULONG* pcAccesses,
ULONG* piDefaultAccess);
HRESULT (STDMETHODCALLTYPE *MapGeneric)(struct ISecurityInformation *this,
const GUID* pguidObjectType,
UCHAR* pAceFlags,
ACCESS_MASK* pMask);
HRESULT (STDMETHODCALLTYPE *GetInheritTypes)(struct ISecurityInformation *this,
PSI_INHERIT_TYPE* ppInheritTypes,
ULONG* pcInheritTypes);
HRESULT (STDMETHODCALLTYPE *PropertySheetPageCallback)(struct ISecurityInformation *this,
HWND hwnd,
UINT uMsg,
SI_PAGE_TYPE uPage);
};
#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
/******************************************************************************
ISecurityInformation2
******************************************************************************/
typedef struct ISecurityInformation2 *LPSECURITYINFORMATION2;
typedef struct ifaceISecurityInformation2Vbtl ifaceISecurityInformation2Vbtl;
struct ifaceISecurityInformation2Vbtl
{
/* IUnknown */
HRESULT (STDMETHODCALLTYPE *QueryInterface)(struct ISecurityInformation2 *this,
REFIID iid,
PVOID *pvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(struct ISecurityInformation2 *this);
ULONG (STDMETHODCALLTYPE *Release)(struct ISecurityInformation2 *this);
/* ISecurityInformation2 */
BOOL (STDMETHODCALLTYPE *IsDaclCanonical)(struct ISecurityInformation2 *this,
PACL pDacl);
HRESULT (STDMETHODCALLTYPE *LookupSids)(struct ISecurityInformation2 *this,
ULONG cSids,
PSID* rgpSids,
LPDATAOBJECT* ppdo);
};
#endif
/******************************************************************************
IEffectivePermission
******************************************************************************/
typedef struct IEffectivePermission *LPEFFECTIVEPERMISSION;
typedef struct ifaceIEffectivePermissionVbtl ifaceIEffectivePermissionVbtl;
struct ifaceIEffectivePermissionVbtl
{
/* IUnknown */
HRESULT (STDMETHODCALLTYPE *QueryInterface)(struct IEffectivePermission *this,
REFIID iid,
PVOID *pvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(struct IEffectivePermission *this);
ULONG (STDMETHODCALLTYPE *Release)(struct IEffectivePermission *this);
/* IEffectivePermission */
HRESULT (STDMETHODCALLTYPE *GetEffectivePermission)(struct IEffectivePermission *this,
const GUID* pguidObjectType,
PSID pUserSid,
LPCWSTR pszServerName,
PSECURITY_DESCRIPTOR pSD,
POBJECT_TYPE_LIST* ppObjectTypeList,
ULONG* pcObjectTypeListLength,
PACCESS_MASK* ppGrantedAccessList,
ULONG* pcGrantedAccessListLength);
};
/******************************************************************************
ISecurityObjectTypeInfo
******************************************************************************/
typedef struct ISecurityObjectTypeInfo *LPSECURITYOBJECTTYPEINFO;
typedef struct ifaceISecurityObjectTypeInfoVbtl ifaceISecurityObjectTypeInfoVbtl;
struct ifaceISecurityObjectTypeInfoVbtl
{
/* IUnknown */
HRESULT (STDMETHODCALLTYPE *QueryInterface)(struct ISecurityObjectTypeInfo *this,
REFIID iid,
PVOID *pvObject);
ULONG (STDMETHODCALLTYPE *AddRef)(struct ISecurityObjectTypeInfo *this);
ULONG (STDMETHODCALLTYPE *Release)(struct ISecurityObjectTypeInfo *this);
/* ISecurityObjectTypeInfo */
HRESULT (STDMETHODCALLTYPE *GetInheritSource)(struct ISecurityObjectTypeInfo *this,
SECURITY_INFORMATION si,
PACL pACL,
PINHERITED_FROM* ppInheritArray);
};
/******************************************************************************
CRegKeySecurity
******************************************************************************/
typedef struct _CRegKeySecurity
{
/* IUnknown fields and interfaces */
const struct ifaceISecurityInformationVbtl *lpISecurityInformationVtbl;
#if REGEDIT_IMPLEMENT_ISECURITYINFORMATION2
const struct ifaceISecurityInformation2Vbtl *lpISecurityInformation2Vtbl;
#endif
const struct ifaceIEffectivePermissionVbtl *lpIEffectivePermissionVtbl;
const struct ifaceISecurityObjectTypeInfoVbtl *lpISecurityObjectTypeInfoVtbl;
DWORD ref;
/* CRegKeySecurity fields */
SI_OBJECT_INFO ObjectInfo;
BOOL *Btn;
HKEY hRootKey;
WCHAR szRegKey[1];
} CRegKeySecurity, *PCRegKeySecurity;
/* EOF */