1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef __ACCESS_CONTROL_API__ 7 #define __ACCESS_CONTROL_API__ 8 9 #include <_mingw_unicode.h> 10 #include <windows.h> 11 #include <accctrl.h> 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 typedef VOID (*FN_PROGRESS)(LPWSTR pObjectName,DWORD Status,PPROG_INVOKE_SETTING pInvokeSetting,PVOID Args,WINBOOL SecuritySet); 18 19 #define SetEntriesInAcl __MINGW_NAME_AW(SetEntriesInAcl) 20 #define GetExplicitEntriesFromAcl __MINGW_NAME_AW(GetExplicitEntriesFromAcl) 21 #define GetEffectiveRightsFromAcl __MINGW_NAME_AW(GetEffectiveRightsFromAcl) 22 #define GetAuditedPermissionsFromAcl __MINGW_NAME_AW(GetAuditedPermissionsFromAcl) 23 #define GetNamedSecurityInfo __MINGW_NAME_AW(GetNamedSecurityInfo) 24 #define SetNamedSecurityInfo __MINGW_NAME_AW(SetNamedSecurityInfo) 25 #define GetInheritanceSource __MINGW_NAME_AW(GetInheritanceSource) 26 #define TreeResetNamedSecurityInfo __MINGW_NAME_AW(TreeResetNamedSecurityInfo) 27 #define BuildSecurityDescriptor __MINGW_NAME_AW(BuildSecurityDescriptor) 28 #define LookupSecurityDescriptorParts __MINGW_NAME_AW(LookupSecurityDescriptorParts) 29 #define BuildExplicitAccessWithName __MINGW_NAME_AW(BuildExplicitAccessWithName) 30 #define BuildImpersonateExplicitAccessWithName __MINGW_NAME_AW(BuildImpersonateExplicitAccessWithName) 31 32 #define BuildTrusteeWithName __MINGW_NAME_AW(BuildTrusteeWithName) 33 #define BuildImpersonateTrustee __MINGW_NAME_AW(BuildImpersonateTrustee) 34 #define BuildTrusteeWithSid __MINGW_NAME_AW(BuildTrusteeWithSid) 35 #define BuildTrusteeWithObjectsAndSid __MINGW_NAME_AW(BuildTrusteeWithObjectsAndSid) 36 #define BuildTrusteeWithObjectsAndName __MINGW_NAME_AW(BuildTrusteeWithObjectsAndName) 37 #define GetTrusteeName __MINGW_NAME_AW(GetTrusteeName) 38 #define GetTrusteeType __MINGW_NAME_AW(GetTrusteeType) 39 #define GetTrusteeForm __MINGW_NAME_AW(GetTrusteeForm) 40 #define GetMultipleTrusteeOperation __MINGW_NAME_AW(GetMultipleTrusteeOperation) 41 #define GetMultipleTrustee __MINGW_NAME_AW(GetMultipleTrustee) 42 43 WINADVAPI DWORD WINAPI SetEntriesInAclA(ULONG cCountOfExplicitEntries,PEXPLICIT_ACCESS_A pListOfExplicitEntries,PACL OldAcl,PACL *NewAcl); 44 WINADVAPI DWORD WINAPI SetEntriesInAclW(ULONG cCountOfExplicitEntries,PEXPLICIT_ACCESS_W pListOfExplicitEntries,PACL OldAcl,PACL *NewAcl); 45 WINADVAPI DWORD WINAPI GetExplicitEntriesFromAclA(PACL pacl,PULONG pcCountOfExplicitEntries,PEXPLICIT_ACCESS_A *pListOfExplicitEntries); 46 WINADVAPI DWORD WINAPI GetExplicitEntriesFromAclW(PACL pacl,PULONG pcCountOfExplicitEntries,PEXPLICIT_ACCESS_W *pListOfExplicitEntries); 47 WINADVAPI DWORD WINAPI GetEffectiveRightsFromAclA(PACL pacl,PTRUSTEE_A pTrustee,PACCESS_MASK pAccessRights); 48 WINADVAPI DWORD WINAPI GetEffectiveRightsFromAclW(PACL pacl,PTRUSTEE_W pTrustee,PACCESS_MASK pAccessRights); 49 WINADVAPI DWORD WINAPI GetAuditedPermissionsFromAclA(PACL pacl,PTRUSTEE_A pTrustee,PACCESS_MASK pSuccessfulAuditedRights,PACCESS_MASK pFailedAuditRights); 50 WINADVAPI DWORD WINAPI GetAuditedPermissionsFromAclW(PACL pacl,PTRUSTEE_W pTrustee,PACCESS_MASK pSuccessfulAuditedRights,PACCESS_MASK pFailedAuditRights); 51 WINADVAPI DWORD WINAPI GetNamedSecurityInfoA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID *ppsidOwner,PSID *ppsidGroup,PACL *ppDacl,PACL *ppSacl,PSECURITY_DESCRIPTOR *ppSecurityDescriptor); 52 WINADVAPI DWORD WINAPI GetNamedSecurityInfoW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID *ppsidOwner,PSID *ppsidGroup,PACL *ppDacl,PACL *ppSacl,PSECURITY_DESCRIPTOR *ppSecurityDescriptor); 53 WINADVAPI DWORD WINAPI GetSecurityInfo(HANDLE handle,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID *ppsidOwner,PSID *ppsidGroup,PACL *ppDacl,PACL *ppSacl,PSECURITY_DESCRIPTOR *ppSecurityDescriptor); 54 WINADVAPI DWORD WINAPI SetNamedSecurityInfoA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID psidOwner,PSID psidGroup,PACL pDacl,PACL pSacl); 55 WINADVAPI DWORD WINAPI SetNamedSecurityInfoW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID psidOwner,PSID psidGroup,PACL pDacl,PACL pSacl); 56 WINADVAPI DWORD WINAPI SetSecurityInfo(HANDLE handle,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID psidOwner,PSID psidGroup,PACL pDacl,PACL pSacl); 57 WINADVAPI DWORD WINAPI GetInheritanceSourceA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,WINBOOL Container,GUID **pObjectClassGuids,DWORD GuidCount,PACL pAcl,PFN_OBJECT_MGR_FUNCTS pfnArray,PGENERIC_MAPPING pGenericMapping,PINHERITED_FROMA pInheritArray); 58 WINADVAPI DWORD WINAPI GetInheritanceSourceW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,WINBOOL Container,GUID **pObjectClassGuids,DWORD GuidCount,PACL pAcl,PFN_OBJECT_MGR_FUNCTS pfnArray,PGENERIC_MAPPING pGenericMapping,PINHERITED_FROMW pInheritArray); 59 WINADVAPI DWORD WINAPI FreeInheritedFromArray(PINHERITED_FROMW pInheritArray,USHORT AceCnt,PFN_OBJECT_MGR_FUNCTS pfnArray); 60 WINADVAPI DWORD WINAPI TreeResetNamedSecurityInfoA(LPSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID pOwner,PSID pGroup,PACL pDacl,PACL pSacl,WINBOOL KeepExplicit,FN_PROGRESS fnProgress,PROG_INVOKE_SETTING ProgressInvokeSetting,PVOID Args); 61 WINADVAPI DWORD WINAPI TreeResetNamedSecurityInfoW(LPWSTR pObjectName,SE_OBJECT_TYPE ObjectType,SECURITY_INFORMATION SecurityInfo,PSID pOwner,PSID pGroup,PACL pDacl,PACL pSacl,WINBOOL KeepExplicit,FN_PROGRESS fnProgress,PROG_INVOKE_SETTING ProgressInvokeSetting,PVOID Args); 62 WINADVAPI DWORD WINAPI BuildSecurityDescriptorA(PTRUSTEE_A pOwner,PTRUSTEE_A pGroup,ULONG cCountOfAccessEntries,PEXPLICIT_ACCESS_A pListOfAccessEntries,ULONG cCountOfAuditEntries,PEXPLICIT_ACCESS_A pListOfAuditEntries,PSECURITY_DESCRIPTOR pOldSD,PULONG pSizeNewSD,PSECURITY_DESCRIPTOR *pNewSD); 63 WINADVAPI DWORD WINAPI BuildSecurityDescriptorW(PTRUSTEE_W pOwner,PTRUSTEE_W pGroup,ULONG cCountOfAccessEntries,PEXPLICIT_ACCESS_W pListOfAccessEntries,ULONG cCountOfAuditEntries,PEXPLICIT_ACCESS_W pListOfAuditEntries,PSECURITY_DESCRIPTOR pOldSD,PULONG pSizeNewSD,PSECURITY_DESCRIPTOR *pNewSD); 64 WINADVAPI DWORD WINAPI LookupSecurityDescriptorPartsA(PTRUSTEE_A *ppOwner,PTRUSTEE_A *ppGroup,PULONG pcCountOfAccessEntries,PEXPLICIT_ACCESS_A *ppListOfAccessEntries,PULONG pcCountOfAuditEntries,PEXPLICIT_ACCESS_A *ppListOfAuditEntries,PSECURITY_DESCRIPTOR pSD); 65 WINADVAPI DWORD WINAPI LookupSecurityDescriptorPartsW(PTRUSTEE_W *ppOwner,PTRUSTEE_W *ppGroup,PULONG pcCountOfAccessEntries,PEXPLICIT_ACCESS_W *ppListOfAccessEntries,PULONG pcCountOfAuditEntries,PEXPLICIT_ACCESS_W *ppListOfAuditEntries,PSECURITY_DESCRIPTOR pSD); 66 WINADVAPI VOID WINAPI BuildExplicitAccessWithNameA(PEXPLICIT_ACCESS_A pExplicitAccess,LPSTR pTrusteeName,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance); 67 WINADVAPI VOID WINAPI BuildExplicitAccessWithNameW(PEXPLICIT_ACCESS_W pExplicitAccess,LPWSTR pTrusteeName,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance); 68 WINADVAPI VOID WINAPI BuildImpersonateExplicitAccessWithNameA(PEXPLICIT_ACCESS_A pExplicitAccess,LPSTR pTrusteeName,PTRUSTEE_A pTrustee,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance); 69 WINADVAPI VOID WINAPI BuildImpersonateExplicitAccessWithNameW(PEXPLICIT_ACCESS_W pExplicitAccess,LPWSTR pTrusteeName,PTRUSTEE_W pTrustee,DWORD AccessPermissions,ACCESS_MODE AccessMode,DWORD Inheritance); 70 WINADVAPI VOID WINAPI BuildTrusteeWithNameA(PTRUSTEE_A pTrustee,LPSTR pName); 71 WINADVAPI VOID WINAPI BuildTrusteeWithNameW(PTRUSTEE_W pTrustee,LPWSTR pName); 72 WINADVAPI VOID WINAPI BuildImpersonateTrusteeA(PTRUSTEE_A pTrustee,PTRUSTEE_A pImpersonateTrustee); 73 WINADVAPI VOID WINAPI BuildImpersonateTrusteeW(PTRUSTEE_W pTrustee,PTRUSTEE_W pImpersonateTrustee); 74 WINADVAPI VOID WINAPI BuildTrusteeWithSidA(PTRUSTEE_A pTrustee,PSID pSid); 75 WINADVAPI VOID WINAPI BuildTrusteeWithSidW(PTRUSTEE_W pTrustee,PSID pSid); 76 WINADVAPI VOID WINAPI BuildTrusteeWithObjectsAndSidA(PTRUSTEE_A pTrustee,POBJECTS_AND_SID pObjSid,GUID *pObjectGuid,GUID *pInheritedObjectGuid,PSID pSid); 77 WINADVAPI VOID WINAPI BuildTrusteeWithObjectsAndSidW(PTRUSTEE_W pTrustee,POBJECTS_AND_SID pObjSid,GUID *pObjectGuid,GUID *pInheritedObjectGuid,PSID pSid); 78 WINADVAPI VOID WINAPI BuildTrusteeWithObjectsAndNameA(PTRUSTEE_A pTrustee,POBJECTS_AND_NAME_A pObjName,SE_OBJECT_TYPE ObjectType,LPSTR ObjectTypeName,LPSTR InheritedObjectTypeName,LPSTR Name); 79 WINADVAPI VOID WINAPI BuildTrusteeWithObjectsAndNameW(PTRUSTEE_W pTrustee,POBJECTS_AND_NAME_W pObjName,SE_OBJECT_TYPE ObjectType,LPWSTR ObjectTypeName,LPWSTR InheritedObjectTypeName,LPWSTR Name); 80 WINADVAPI LPSTR WINAPI GetTrusteeNameA(PTRUSTEE_A pTrustee); 81 WINADVAPI LPWSTR WINAPI GetTrusteeNameW(PTRUSTEE_W pTrustee); 82 WINADVAPI TRUSTEE_TYPE WINAPI GetTrusteeTypeA(PTRUSTEE_A pTrustee); 83 WINADVAPI TRUSTEE_TYPE WINAPI GetTrusteeTypeW(PTRUSTEE_W pTrustee); 84 WINADVAPI TRUSTEE_FORM WINAPI GetTrusteeFormA(PTRUSTEE_A pTrustee); 85 WINADVAPI TRUSTEE_FORM WINAPI GetTrusteeFormW(PTRUSTEE_W pTrustee); 86 WINADVAPI MULTIPLE_TRUSTEE_OPERATION WINAPI GetMultipleTrusteeOperationA(PTRUSTEE_A pTrustee); 87 WINADVAPI MULTIPLE_TRUSTEE_OPERATION WINAPI GetMultipleTrusteeOperationW(PTRUSTEE_W pTrustee); 88 WINADVAPI PTRUSTEE_A WINAPI GetMultipleTrusteeA(PTRUSTEE_A pTrustee); 89 WINADVAPI PTRUSTEE_W WINAPI GetMultipleTrusteeW(PTRUSTEE_W pTrustee); 90 91 #define AccProvInit(err) 92 93 #if (_WIN32_WINNT >= 0x0600) 94 #define TreeSetNamedSecurityInfo __MINGW_NAME_AW(TreeSetNamedSecurityInfo) 95 WINADVAPI DWORD WINAPI TreeSetNamedSecurityInfoA( 96 LPSTR pObjectName, 97 SE_OBJECT_TYPE ObjectType, 98 SECURITY_INFORMATION SecurityInfo, 99 PSID pOwner, 100 PSID pGroup, 101 PACL pDacl, 102 PACL pSacl, 103 DWORD dwAction, 104 FN_PROGRESS fnProgress, 105 PROG_INVOKE_SETTING ProgressInvokeSetting, 106 PVOID Args 107 ); 108 109 WINADVAPI DWORD WINAPI TreeSetNamedSecurityInfoW( 110 LPWSTR pObjectName, 111 SE_OBJECT_TYPE ObjectType, 112 SECURITY_INFORMATION SecurityInfo, 113 PSID pOwner, 114 PSID pGroup, 115 PACL pDacl, 116 PACL pSacl, 117 DWORD dwAction, 118 FN_PROGRESS fnProgress, 119 PROG_INVOKE_SETTING ProgressInvokeSetting, 120 PVOID Args 121 ); 122 123 #endif /*(_WIN32_WINNT >= 0x0600)*/ 124 125 #ifdef __cplusplus 126 } 127 #endif 128 #endif 129