[1166] | 1 | /**
|
---|
| 2 | * This file is part of the mingw-w64 runtime package.
|
---|
| 3 | * No warranty is given; refer to the file DISCLAIMER within this package.
|
---|
| 4 | */
|
---|
| 5 | #ifndef _ACLUI_H_
|
---|
| 6 | #define _ACLUI_H_
|
---|
| 7 |
|
---|
| 8 | #include <winapifamily.h>
|
---|
| 9 |
|
---|
| 10 | #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
|
---|
| 11 |
|
---|
| 12 | #include <objbase.h>
|
---|
| 13 | #include <commctrl.h>
|
---|
| 14 | #include <accctrl.h>
|
---|
| 15 | #include <authz.h>
|
---|
| 16 |
|
---|
| 17 | #ifndef _ACLUI_
|
---|
| 18 | #define ACLUIAPI DECLSPEC_IMPORT WINAPI
|
---|
| 19 | #else
|
---|
| 20 | #define ACLUIAPI WINAPI
|
---|
| 21 | #endif
|
---|
| 22 |
|
---|
| 23 | #ifdef __cplusplus
|
---|
| 24 | extern "C" {
|
---|
| 25 | #endif
|
---|
| 26 |
|
---|
| 27 | typedef struct _SI_OBJECT_INFO {
|
---|
| 28 | DWORD dwFlags;
|
---|
| 29 | HINSTANCE hInstance;
|
---|
| 30 | LPWSTR pszServerName;
|
---|
| 31 | LPWSTR pszObjectName;
|
---|
| 32 | LPWSTR pszPageTitle;
|
---|
| 33 | GUID guidObjectType;
|
---|
| 34 | } SI_OBJECT_INFO,*PSI_OBJECT_INFO;
|
---|
| 35 |
|
---|
| 36 | #define SI_EDIT_PERMS __MSABI_LONG(0x00000000)
|
---|
| 37 | #define SI_EDIT_OWNER __MSABI_LONG(0x00000001)
|
---|
| 38 | #define SI_EDIT_AUDITS __MSABI_LONG(0x00000002)
|
---|
| 39 | #define SI_CONTAINER __MSABI_LONG(0x00000004)
|
---|
| 40 | #define SI_READONLY __MSABI_LONG(0x00000008)
|
---|
| 41 | #define SI_ADVANCED __MSABI_LONG(0x00000010)
|
---|
| 42 | #define SI_RESET __MSABI_LONG(0x00000020)
|
---|
| 43 | #define SI_OWNER_READONLY __MSABI_LONG(0x00000040)
|
---|
| 44 | #define SI_EDIT_PROPERTIES __MSABI_LONG(0x00000080)
|
---|
| 45 | #define SI_OWNER_RECURSE __MSABI_LONG(0x00000100)
|
---|
| 46 | #define SI_NO_ACL_PROTECT __MSABI_LONG(0x00000200)
|
---|
| 47 | #define SI_NO_TREE_APPLY __MSABI_LONG(0x00000400)
|
---|
| 48 | #define SI_PAGE_TITLE __MSABI_LONG(0x00000800)
|
---|
| 49 | #define SI_SERVER_IS_DC __MSABI_LONG(0x00001000)
|
---|
| 50 | #define SI_RESET_DACL_TREE __MSABI_LONG(0x00004000)
|
---|
| 51 | #define SI_RESET_SACL_TREE __MSABI_LONG(0x00008000)
|
---|
| 52 | #define SI_OBJECT_GUID __MSABI_LONG(0x00010000)
|
---|
| 53 | #define SI_EDIT_EFFECTIVE __MSABI_LONG(0x00020000)
|
---|
| 54 | #define SI_RESET_DACL __MSABI_LONG(0x00040000)
|
---|
| 55 | #define SI_RESET_SACL __MSABI_LONG(0x00080000)
|
---|
| 56 | #define SI_RESET_OWNER __MSABI_LONG(0x00100000)
|
---|
| 57 | #define SI_NO_ADDITIONAL_PERMISSION __MSABI_LONG(0x00200000)
|
---|
| 58 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 59 | #define SI_VIEW_ONLY __MSABI_LONG(0x00400000)
|
---|
| 60 | #define SI_PERMS_ELEVATION_REQUIRED __MSABI_LONG(0x01000000)
|
---|
| 61 | #define SI_AUDITS_ELEVATION_REQUIRED __MSABI_LONG(0x02000000)
|
---|
| 62 | #define SI_OWNER_ELEVATION_REQUIRED __MSABI_LONG(0x04000000)
|
---|
| 63 | #endif
|
---|
| 64 | #if NTDDI_VERSION >= 0x06020000
|
---|
| 65 | #define SI_SCOPE_ELEVATION_REQUIRED __MSABI_LONG(0x08000000)
|
---|
| 66 | #endif
|
---|
| 67 | #define SI_MAY_WRITE __MSABI_LONG(0x10000000)
|
---|
| 68 | #if NTDDI_VERSION >= 0x06020000
|
---|
| 69 | #define SI_ENABLE_EDIT_ATTRIBUTE_CONDITION __MSABI_LONG(0x20000000)
|
---|
| 70 | #define SI_ENABLE_CENTRAL_POLICY __MSABI_LONG(0x40000000)
|
---|
| 71 | #define SI_DISABLE_DENY_ACE __MSABI_LONG(0x80000000)
|
---|
| 72 | #endif
|
---|
| 73 |
|
---|
| 74 | #define SI_EDIT_ALL (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS)
|
---|
| 75 |
|
---|
| 76 | typedef struct _SI_ACCESS {
|
---|
| 77 | const GUID *pguid;
|
---|
| 78 | ACCESS_MASK mask;
|
---|
| 79 | LPCWSTR pszName;
|
---|
| 80 | DWORD dwFlags;
|
---|
| 81 | } SI_ACCESS, *PSI_ACCESS;
|
---|
| 82 |
|
---|
| 83 | #define SI_ACCESS_SPECIFIC __MSABI_LONG(0x00010000)
|
---|
| 84 | #define SI_ACCESS_GENERAL __MSABI_LONG(0x00020000)
|
---|
| 85 | #define SI_ACCESS_CONTAINER __MSABI_LONG(0x00040000)
|
---|
| 86 | #define SI_ACCESS_PROPERTY __MSABI_LONG(0x00080000)
|
---|
| 87 |
|
---|
| 88 | typedef struct _SI_INHERIT_TYPE {
|
---|
| 89 | const GUID *pguid;
|
---|
| 90 | ULONG dwFlags;
|
---|
| 91 | LPCWSTR pszName;
|
---|
| 92 | } SI_INHERIT_TYPE, *PSI_INHERIT_TYPE;
|
---|
| 93 |
|
---|
| 94 | typedef enum _SI_PAGE_TYPE {
|
---|
| 95 | SI_PAGE_PERM=0,
|
---|
| 96 | SI_PAGE_ADVPERM,
|
---|
| 97 | SI_PAGE_AUDIT,
|
---|
| 98 | SI_PAGE_OWNER,
|
---|
| 99 | SI_PAGE_EFFECTIVE
|
---|
| 100 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 101 | , SI_PAGE_TAKEOWNERSHIP
|
---|
| 102 | #endif
|
---|
| 103 | #if NTDDI_VERSION >= 0x06020000
|
---|
| 104 | , SI_PAGE_SHARE
|
---|
| 105 | #endif
|
---|
| 106 | } SI_PAGE_TYPE;
|
---|
| 107 |
|
---|
| 108 | typedef enum _SI_PAGE_ACTIVATED {
|
---|
| 109 | SI_SHOW_DEFAULT=0,
|
---|
| 110 | SI_SHOW_PERM_ACTIVATED,
|
---|
| 111 | SI_SHOW_AUDIT_ACTIVATED,
|
---|
| 112 | SI_SHOW_OWNER_ACTIVATED,
|
---|
| 113 | SI_SHOW_EFFECTIVE_ACTIVATED,
|
---|
| 114 | SI_SHOW_SHARE_ACTIVATED,
|
---|
| 115 | SI_SHOW_CENTRAL_POLICY_ACTIVATED,
|
---|
| 116 | } SI_PAGE_ACTIVATED;
|
---|
| 117 |
|
---|
| 118 | #define GET_PAGE_TYPE(X) (UINT) ((X) &0x0000ffff)
|
---|
| 119 | #define GET_ACTIVATION_TYPE(Y) (UINT) (((Y) >> 16) &0x0000ffff)
|
---|
| 120 | #define COMBINE_PAGE_ACTIVATION(X, Y) (UINT) (((Y) << 16) | X)
|
---|
| 121 |
|
---|
| 122 | #define DOBJ_RES_CONT __MSABI_LONG(0x00000001)
|
---|
| 123 | #define DOBJ_RES_ROOT __MSABI_LONG(0x00000002)
|
---|
| 124 | #define DOBJ_VOL_NTACLS __MSABI_LONG(0x00000004)
|
---|
| 125 | #define DOBJ_COND_NTACLS __MSABI_LONG(0x00000008)
|
---|
| 126 | #define DOBJ_RIBBON_LAUNCH __MSABI_LONG(0x00000010)
|
---|
| 127 |
|
---|
| 128 | #define PSPCB_SI_INITDIALOG (WM_USER + 1)
|
---|
| 129 |
|
---|
| 130 | #undef INTERFACE
|
---|
| 131 | #define INTERFACE ISecurityInformation
|
---|
| 132 |
|
---|
| 133 | DECLARE_INTERFACE_IID_ (ISecurityInformation, IUnknown, "965FC360-16FF-11d0-91CB-00AA00BBB723") {
|
---|
| 134 | STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
|
---|
| 135 | STDMETHOD_ (ULONG, AddRef) (THIS) PURE;
|
---|
| 136 | STDMETHOD_ (ULONG, Release) (THIS) PURE;
|
---|
| 137 | STDMETHOD (GetObjectInformation) (THIS_ PSI_OBJECT_INFO pObjectInfo) PURE;
|
---|
| 138 | STDMETHOD (GetSecurity) (THIS_ SECURITY_INFORMATION RequestedInformation, PSECURITY_DESCRIPTOR *ppSecurityDescriptor, WINBOOL fDefault) PURE;
|
---|
| 139 | STDMETHOD (SetSecurity) (THIS_ SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor) PURE;
|
---|
| 140 | STDMETHOD (GetAccessRights) (THIS_ const GUID *pguidObjectType, DWORD dwFlags, PSI_ACCESS *ppAccess, ULONG *pcAccesses, ULONG *piDefaultAccess) PURE;
|
---|
| 141 | STDMETHOD (MapGeneric) (THIS_ const GUID *pguidObjectType, UCHAR *pAceFlags, ACCESS_MASK *pMask) PURE;
|
---|
| 142 | STDMETHOD (GetInheritTypes) (THIS_ PSI_INHERIT_TYPE *ppInheritTypes, ULONG *pcInheritTypes) PURE;
|
---|
| 143 | STDMETHOD (PropertySheetPageCallback) (THIS_ HWND hwnd, UINT uMsg, SI_PAGE_TYPE uPage) PURE;
|
---|
| 144 | };
|
---|
| 145 |
|
---|
| 146 | typedef ISecurityInformation *LPSECURITYINFO;
|
---|
| 147 | #undef INTERFACE
|
---|
| 148 | #define INTERFACE ISecurityInformation2
|
---|
| 149 |
|
---|
| 150 | DECLARE_INTERFACE_IID_ (ISecurityInformation2, IUnknown, "c3ccfdb4-6f88-11d2-a3ce-00c04fb1782a") {
|
---|
| 151 | STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
|
---|
| 152 | STDMETHOD_ (ULONG, AddRef) (THIS) PURE;
|
---|
| 153 | STDMETHOD_ (ULONG, Release) (THIS) PURE;
|
---|
| 154 | STDMETHOD_ (WINBOOL, IsDaclCanonical) (THIS_ PACL pDacl) PURE;
|
---|
| 155 | STDMETHOD (LookupSids) (THIS_ ULONG cSids, PSID *rgpSids, LPDATAOBJECT *ppdo) PURE;
|
---|
| 156 | };
|
---|
| 157 |
|
---|
| 158 | typedef ISecurityInformation2 *LPSECURITYINFO2;
|
---|
| 159 |
|
---|
| 160 | #define CFSTR_ACLUI_SID_INFO_LIST TEXT ("CFSTR_ACLUI_SID_INFO_LIST")
|
---|
| 161 |
|
---|
| 162 | typedef struct _SID_INFO {
|
---|
| 163 | PSID pSid;
|
---|
| 164 | PWSTR pwzCommonName;
|
---|
| 165 | PWSTR pwzClass;
|
---|
| 166 | PWSTR pwzUPN;
|
---|
| 167 | } SID_INFO, *PSID_INFO;
|
---|
| 168 |
|
---|
| 169 | typedef struct _SID_INFO_LIST {
|
---|
| 170 | ULONG cItems;
|
---|
| 171 | SID_INFO aSidInfo[ANYSIZE_ARRAY];
|
---|
| 172 | } SID_INFO_LIST, *PSID_INFO_LIST;
|
---|
| 173 |
|
---|
| 174 | #undef INTERFACE
|
---|
| 175 | #define INTERFACE IEffectivePermission
|
---|
| 176 |
|
---|
| 177 | DECLARE_INTERFACE_IID_ (IEffectivePermission, IUnknown, "3853DC76-9F35-407c-88A1-D19344365FBC") {
|
---|
| 178 | STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
|
---|
| 179 | STDMETHOD_ (ULONG, AddRef) (THIS) PURE;
|
---|
| 180 | STDMETHOD_ (ULONG, Release) (THIS) PURE;
|
---|
| 181 | STDMETHOD (GetEffectivePermission) (THIS_ const GUID *pguidObjectType, PSID pUserSid, LPCWSTR pszServerName, PSECURITY_DESCRIPTOR pSD, POBJECT_TYPE_LIST *ppObjectTypeList, ULONG *pcObjectTypeListLength, PACCESS_MASK *ppGrantedAccessList, ULONG *pcGrantedAccessListLength) PURE;
|
---|
| 182 | };
|
---|
| 183 |
|
---|
| 184 | typedef IEffectivePermission *LPEFFECTIVEPERMISSION;
|
---|
| 185 |
|
---|
| 186 | #undef INTERFACE
|
---|
| 187 | #define INTERFACE ISecurityObjectTypeInfo
|
---|
| 188 |
|
---|
| 189 | DECLARE_INTERFACE_IID_ (ISecurityObjectTypeInfo, IUnknown, "FC3066EB-79EF-444b-9111-D18A75EBF2FA") {
|
---|
| 190 | STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
|
---|
| 191 | STDMETHOD_ (ULONG, AddRef) (THIS) PURE;
|
---|
| 192 | STDMETHOD_ (ULONG, Release) (THIS) PURE;
|
---|
| 193 | STDMETHOD (GetInheritSource) (SECURITY_INFORMATION si, PACL pACL, PINHERITED_FROM *ppInheritArray) PURE;
|
---|
| 194 | };
|
---|
| 195 |
|
---|
| 196 | typedef ISecurityObjectTypeInfo *LPSecurityObjectTypeInfo;
|
---|
| 197 |
|
---|
| 198 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 199 | #undef INTERFACE
|
---|
| 200 | #define INTERFACE ISecurityInformation3
|
---|
| 201 | DECLARE_INTERFACE_IID_ (ISecurityInformation3, IUnknown, "E2CDC9CC-31BD-4f8f-8C8B-B641AF516A1A") {
|
---|
| 202 | STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
|
---|
| 203 | STDMETHOD_ (ULONG, AddRef) (THIS) PURE;
|
---|
| 204 | STDMETHOD_ (ULONG, Release) (THIS) PURE;
|
---|
| 205 | STDMETHOD (GetFullResourceName) (THIS_ LPWSTR *ppszResourceName) PURE;
|
---|
| 206 | STDMETHOD (OpenElevatedEditor) (THIS_ HWND hWnd, SI_PAGE_TYPE uPage) PURE;
|
---|
| 207 | };
|
---|
| 208 |
|
---|
| 209 | typedef ISecurityInformation3 *LPSECURITYINFO3;
|
---|
| 210 | #endif
|
---|
| 211 |
|
---|
| 212 | #if NTDDI_VERSION >= 0x06020000
|
---|
| 213 | typedef struct _SECURITY_OBJECT {
|
---|
| 214 | PWSTR pwszName;
|
---|
| 215 | PVOID pData;
|
---|
| 216 | DWORD cbData;
|
---|
| 217 | PVOID pData2;
|
---|
| 218 | DWORD cbData2;
|
---|
| 219 | DWORD Id;
|
---|
| 220 | BOOLEAN fWellKnown;
|
---|
| 221 | } SECURITY_OBJECT, *PSECURITY_OBJECT;
|
---|
| 222 |
|
---|
| 223 | #define SECURITY_OBJECT_ID_OBJECT_SD 1
|
---|
| 224 | #define SECURITY_OBJECT_ID_SHARE 2
|
---|
| 225 | #define SECURITY_OBJECT_ID_CENTRAL_POLICY 3
|
---|
| 226 | #define SECURITY_OBJECT_ID_CENTRAL_ACCESS_RULE 4
|
---|
| 227 |
|
---|
| 228 | typedef struct _EFFPERM_RESULT_LIST {
|
---|
| 229 | BOOLEAN fEvaluated;
|
---|
| 230 | ULONG cObjectTypeListLength;
|
---|
| 231 | OBJECT_TYPE_LIST *pObjectTypeList;
|
---|
| 232 | ACCESS_MASK *pGrantedAccessList;
|
---|
| 233 | } EFFPERM_RESULT_LIST, *PEFFPERM_RESULT_LIST;
|
---|
| 234 |
|
---|
| 235 | #undef INTERFACE
|
---|
| 236 | #define INTERFACE ISecurityInformation4
|
---|
| 237 |
|
---|
| 238 | DECLARE_INTERFACE_IID_ (ISecurityInformation4, IUnknown, "EA961070-CD14-4621-ACE4-F63C03E583E4") {
|
---|
| 239 | STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
|
---|
| 240 | STDMETHOD_ (ULONG, AddRef) (THIS) PURE;
|
---|
| 241 | STDMETHOD_ (ULONG, Release) (THIS) PURE;
|
---|
| 242 | STDMETHOD (GetSecondarySecurity) (THIS_ PSECURITY_OBJECT *pSecurityObjects, PULONG pSecurityObjectCount) PURE;
|
---|
| 243 | };
|
---|
| 244 |
|
---|
| 245 | typedef ISecurityInformation4 *LPSECURITYINFO4;
|
---|
| 246 |
|
---|
| 247 | #undef INTERFACE
|
---|
| 248 | #define INTERFACE IEffectivePermission
|
---|
| 249 |
|
---|
| 250 | DECLARE_INTERFACE_IID_ (IEffectivePermission2, IUnknown, "941FABCA-DD47-4FCA-90BB-B0E10255F20D") {
|
---|
| 251 | STDMETHOD (QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
|
---|
| 252 | STDMETHOD_ (ULONG, AddRef) (THIS) PURE;
|
---|
| 253 | STDMETHOD_ (ULONG, Release) (THIS) PURE;
|
---|
| 254 | STDMETHOD (ComputeEffectivePermissionWithSecondarySecurity) (THIS_ PSID pSid, PSID pDeviceSid, PCWSTR pszServerName, PSECURITY_OBJECT pSecurityObjects, DWORD dwSecurityObjectCount, PTOKEN_GROUPS pUserGroups, PAUTHZ_SID_OPERATION pAuthzUserGroupsOperations, PTOKEN_GROUPS pDeviceGroups, PAUTHZ_SID_OPERATION pAuthzDeviceGroupsOperations, PAUTHZ_SECURITY_ATTRIBUTES_INFORMATION pAuthzUserClaims, PAUTHZ_SECURITY_ATTRIBUTE_OPERATION pAuthzUserClaimsOperations, PAUTHZ_SECURITY_ATTRIBUTES_INFORMATION pAuthzDeviceClaims, PAUTHZ_SECURITY_ATTRIBUTE_OPERATION pAuthzDeviceClaimsOperations, PEFFPERM_RESULT_LIST pEffpermResultLists);
|
---|
| 255 | };
|
---|
| 256 |
|
---|
| 257 | typedef IEffectivePermission2 *LPEFFECTIVEPERMISSION2;
|
---|
| 258 | #endif
|
---|
| 259 |
|
---|
| 260 | EXTERN_GUID (IID_ISecurityInformation, 0x965fc360, 0x16ff, 0x11d0, 0x91, 0xcb, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x23);
|
---|
| 261 | EXTERN_GUID (IID_ISecurityInformation2, 0xc3ccfdb4, 0x6f88, 0x11d2, 0xa3, 0xce, 0x0, 0xc0, 0x4f, 0xb1, 0x78, 0x2a);
|
---|
| 262 | EXTERN_GUID (IID_IEffectivePermission, 0x3853dc76, 0x9f35, 0x407c, 0x88, 0xa1, 0xd1, 0x93, 0x44, 0x36, 0x5f, 0xbc);
|
---|
| 263 | EXTERN_GUID (IID_ISecurityObjectTypeInfo, 0xfc3066eb, 0x79ef, 0x444b, 0x91, 0x11, 0xd1, 0x8a, 0x75, 0xeb, 0xf2, 0xfa);
|
---|
| 264 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 265 | EXTERN_GUID (IID_ISecurityInformation3, 0xe2cdc9cc, 0x31bd, 0x4f8f, 0x8c, 0x8b, 0xb6, 0x41, 0xaf, 0x51, 0x6a, 0x1a);
|
---|
| 266 | #endif
|
---|
| 267 | #if NTDDI_VERSION >= 0x06020000
|
---|
| 268 | EXTERN_GUID (IID_ISecurityInformation4, 0xea961070, 0xcd14, 0x4621, 0xac, 0xe4, 0xf6, 0x3c, 0x3, 0xe5, 0x83, 0xe4);
|
---|
| 269 | EXTERN_GUID (IID_IEffectivePermission2, 0x941fabca, 0xdd47, 0x4fca, 0x90, 0xbb, 0xb0, 0xe1, 0x2, 0x55, 0xf2, 0xd);
|
---|
| 270 | #endif
|
---|
| 271 |
|
---|
| 272 | HPROPSHEETPAGE ACLUIAPI CreateSecurityPage (LPSECURITYINFO psi);
|
---|
| 273 | WINBOOL ACLUIAPI EditSecurity (HWND hwndOwner, LPSECURITYINFO psi);
|
---|
| 274 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 275 | HRESULT ACLUIAPI EditSecurityAdvanced (HWND hwndOwner, LPSECURITYINFO psi, SI_PAGE_TYPE uSIPage);
|
---|
| 276 | #endif
|
---|
| 277 |
|
---|
| 278 | #ifdef __cplusplus
|
---|
| 279 | }
|
---|
| 280 | #endif
|
---|
| 281 | #endif
|
---|
| 282 | #endif
|
---|