home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / win32 / Aclapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-08  |  13.8 KB  |  433 lines

  1. //+-------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1993-1996.
  5. //
  6. //  File:        aclapi.h
  7. //
  8. //  Contents:    public header file for acl and trusted server access control
  9. //               APIs
  10. //
  11. //--------------------------------------------------------------------
  12. #ifndef __ACCESS_CONTROL_API__
  13. #define __ACCESS_CONTROL_API__
  14.  
  15. #include <windows.h>
  16. #include <accctrl.h>
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. DWORD
  23. WINAPI
  24. SetEntriesInAclW( IN  ULONG               cCountOfExplicitEntries,
  25.                   IN  PEXPLICIT_ACCESS_W  pListOfExplicitEntries,
  26.                   IN  PACL                OldAcl,
  27.                   OUT PACL              * NewAcl);
  28.  
  29. DWORD
  30. WINAPI
  31. SetEntriesInAclA( IN  ULONG               cCountOfExplicitEntries,
  32.                   IN  PEXPLICIT_ACCESS_A  pListOfExplicitEntries,
  33.                   IN  PACL                OldAcl,
  34.                   OUT PACL              * NewAcl);
  35.  
  36. #ifdef UNICODE
  37.     #define SetEntriesInAcl     SetEntriesInAclW
  38. #else
  39.     #define SetEntriesInAcl     SetEntriesInAclA
  40. #endif
  41.  
  42.  
  43. DWORD
  44. WINAPI
  45. GetExplicitEntriesFromAclW( IN  PACL                  pacl,
  46.                             OUT PULONG                pcCountOfExplicitEntries,
  47.                             OUT PEXPLICIT_ACCESS_W  * pListOfExplicitEntries);
  48.  
  49. DWORD
  50. WINAPI
  51. GetExplicitEntriesFromAclA( IN  PACL                  pacl,
  52.                             OUT PULONG                pcCountOfExplicitEntries,
  53.                             OUT PEXPLICIT_ACCESS_A  * pListOfExplicitEntries);
  54.  
  55. #ifdef UNICODE
  56.     #define GetExplicitEntriesFromAcl       GetExplicitEntriesFromAclW
  57. #else
  58.     #define GetExplicitEntriesFromAcl       GetExplicitEntriesFromAclA
  59. #endif
  60.  
  61.  
  62. DWORD
  63. WINAPI
  64. GetEffectiveRightsFromAclW( IN  PACL          pacl,
  65.                             IN  PTRUSTEE_W    pTrustee,
  66.                             OUT PACCESS_MASK  pAccessRights);
  67.  
  68. DWORD
  69. WINAPI
  70. GetEffectiveRightsFromAclA( IN  PACL          pacl,
  71.                             IN  PTRUSTEE_A    pTrustee,
  72.                             OUT PACCESS_MASK  pAccessRights);
  73.  
  74. #ifdef UNICODE
  75.     #define GetEffectiveRightsFromAcl       GetEffectiveRightsFromAclW
  76. #else
  77.     #define GetEffectiveRightsFromAcl       GetEffectiveRightsFromAclA
  78. #endif
  79.  
  80.  
  81. DWORD
  82. WINAPI
  83. GetAuditedPermissionsFromAclW( IN  PACL          pacl,
  84.                                IN  PTRUSTEE_W    pTrustee,
  85.                                OUT PACCESS_MASK  pSuccessfulAuditedRights,
  86.                                OUT PACCESS_MASK  pFailedAuditRights);
  87.  
  88. DWORD
  89. WINAPI
  90. GetAuditedPermissionsFromAclA( IN  PACL          pacl,
  91.                                IN  PTRUSTEE_A    pTrustee,
  92.                                OUT PACCESS_MASK  pSuccessfulAuditedRights,
  93.                                OUT PACCESS_MASK  pFailedAuditRights);
  94.  
  95. #ifdef UNICODE
  96.     #define GetAuditedPermissionsFromAcl    GetAuditedPermissionsFromAclW
  97. #else
  98.     #define GetAuditedPermissionsFromAcl    GetAuditedPermissionsFromAclA
  99. #endif
  100.  
  101.  
  102.  
  103. DWORD
  104. WINAPI
  105. GetNamedSecurityInfoW( IN  LPWSTR                 pObjectName,
  106.                        IN  SE_OBJECT_TYPE         ObjectType,
  107.                        IN  SECURITY_INFORMATION   SecurityInfo,
  108.                        OUT PSID                 * ppsidOowner,
  109.                        OUT PSID                 * ppsidGroup,
  110.                        OUT PACL                 * ppDacl,
  111.                        OUT PACL                 * ppSacl,
  112.                        OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor);
  113.  
  114. DWORD
  115. WINAPI
  116. GetNamedSecurityInfoA( IN  LPSTR                  pObjectName,
  117.                        IN  SE_OBJECT_TYPE         ObjectType,
  118.                        IN  SECURITY_INFORMATION   SecurityInfo,
  119.                        OUT PSID                 * ppsidOowner,
  120.                        OUT PSID                 * ppsidGroup,
  121.                        OUT PACL                 * ppDacl,
  122.                        OUT PACL                 * ppSacl,
  123.                        OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor);
  124.  
  125. #ifdef UNICODE
  126.     #define GetNamedSecurityInfo        GetNamedSecurityInfoW
  127. #else
  128.     #define GetNamedSecurityInfo        GetNamedSecurityInfoA
  129. #endif
  130.  
  131.  
  132. DWORD
  133. WINAPI
  134. GetSecurityInfo( IN  HANDLE                 handle,
  135.                  IN  SE_OBJECT_TYPE         ObjectType,
  136.                  IN  SECURITY_INFORMATION   SecurityInfo,
  137.                  OUT PSID                 * ppsidOowner,
  138.                  OUT PSID                 * ppsidGroup,
  139.                  OUT PACL                 * ppDacl,
  140.                  OUT PACL                 * ppSacl,
  141.                  OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor);
  142.  
  143.  
  144. DWORD
  145. WINAPI
  146. SetNamedSecurityInfoW( IN LPWSTR                pObjectName,
  147.                        IN SE_OBJECT_TYPE        ObjectType,
  148.                        IN SECURITY_INFORMATION  SecurityInfo,
  149.                        IN PSID                  psidOowner,
  150.                        IN PSID                  psidGroup,
  151.                        IN PACL                  pDacl,
  152.                        IN PACL                  pSacl);
  153.  
  154. DWORD
  155. WINAPI
  156. SetNamedSecurityInfoA( IN LPSTR                 pObjectName,
  157.                        IN SE_OBJECT_TYPE        ObjectType,
  158.                        IN SECURITY_INFORMATION  SecurityInfo,
  159.                        IN PSID                  psidOowner,
  160.                        IN PSID                  psidGroup,
  161.                        IN PACL                  pDacl,
  162.                        IN PACL                  pSacl);
  163.  
  164. #ifdef UNICODE
  165.     #define SetNamedSecurityInfo        SetNamedSecurityInfoW
  166. #else
  167.     #define SetNamedSecurityInfo        SetNamedSecurityInfoA
  168. #endif
  169.  
  170.  
  171. DWORD
  172. WINAPI
  173. SetSecurityInfo( IN HANDLE                handle,
  174.                  IN SE_OBJECT_TYPE        ObjectType,
  175.                  IN SECURITY_INFORMATION  SecurityInfo,
  176.                  IN PSID                  psidOowner,
  177.                  IN PSID                  psidGroup,
  178.                  IN PACL                  pDacl,
  179.                  IN PACL                  pSacl);
  180.  
  181.  
  182. //----------------------------------------------------------------------------
  183. // The following API are provided for trusted servers to use to
  184. // implement access control on their own objects.
  185. //----------------------------------------------------------------------------
  186.  
  187. DWORD
  188. WINAPI
  189. BuildSecurityDescriptorW( IN  PTRUSTEE_W              pOwner,
  190.                           IN  PTRUSTEE_W              pGroup,
  191.                           IN  ULONG                   cCountOfAccessEntries,
  192.                           IN  PEXPLICIT_ACCESS_W      pListOfAccessEntries,
  193.                           IN  ULONG                   cCountOfAuditEntries,
  194.                           IN  PEXPLICIT_ACCESS_W      pListOfAuditEntries,
  195.                           IN  PSECURITY_DESCRIPTOR    pOldSD,
  196.                           OUT PULONG                  pSizeNewSD,
  197.                           OUT PSECURITY_DESCRIPTOR  * pNewSD);
  198.  
  199. DWORD
  200. WINAPI
  201. BuildSecurityDescriptorA( IN  PTRUSTEE_A              pOwner,
  202.                           IN  PTRUSTEE_A              pGroup,
  203.                           IN  ULONG                   cCountOfAccessEntries,
  204.                           IN  PEXPLICIT_ACCESS_A      pListOfAccessEntries,
  205.                           IN  ULONG                   cCountOfAuditEntries,
  206.                           IN  PEXPLICIT_ACCESS_A      pListOfAuditEntries,
  207.                           IN  PSECURITY_DESCRIPTOR    pOldSD,
  208.                           OUT PULONG                  pSizeNewSD,
  209.                           OUT PSECURITY_DESCRIPTOR  * pNewSD);
  210.  
  211.  
  212. #ifdef UNICODE
  213.     #define BuildSecurityDescriptor     BuildSecurityDescriptorW
  214. #else
  215.     #define BuildSecurityDescriptor     BuildSecurityDescriptorA
  216. #endif
  217.  
  218.  
  219. DWORD
  220. WINAPI
  221. LookupSecurityDescriptorPartsW( OUT PTRUSTEE_W         * pOwner,
  222.                                 OUT PTRUSTEE_W         * pGroup,
  223.                                 OUT PULONG               cCountOfAccessEntries,
  224.                                 OUT PEXPLICIT_ACCESS_W * pListOfAccessEntries,
  225.                                 OUT PULONG               cCountOfAuditEntries,
  226.                                 OUT PEXPLICIT_ACCESS_W * pListOfAuditEntries,
  227.                                 IN  PSECURITY_DESCRIPTOR pSD);
  228.  
  229. DWORD
  230. WINAPI
  231. LookupSecurityDescriptorPartsA( OUT PTRUSTEE_A         * pOwner,
  232.                                 OUT PTRUSTEE_A         * pGroup,
  233.                                 OUT PULONG               cCountOfAccessEntries,
  234.                                 OUT PEXPLICIT_ACCESS_A * pListOfAccessEntries,
  235.                                 OUT PULONG               cCountOfAuditEntries,
  236.                                 OUT PEXPLICIT_ACCESS_A * pListOfAuditEntries,
  237.                                 IN  PSECURITY_DESCRIPTOR pSD);
  238.  
  239. #ifdef UNICODE
  240.     #define LookupSecurityDescriptorParts       LookupSecurityDescriptorPartsW
  241. #else
  242.     #define LookupSecurityDescriptorParts       LookupSecurityDescriptorPartsA
  243. #endif
  244.  
  245.  
  246. //----------------------------------------------------------------------------
  247. // The following helper API are provided for building
  248. // access control structures.
  249. //----------------------------------------------------------------------------
  250.  
  251. VOID
  252. WINAPI
  253. BuildExplicitAccessWithNameW( IN OUT PEXPLICIT_ACCESS_W  pExplicitAccess,
  254.                               IN     LPWSTR              pTrusteeName,
  255.                               IN     DWORD               AccessPermissions,
  256.                               IN     ACCESS_MODE         AccessMode,
  257.                               IN     DWORD               Inheritance);
  258.  
  259. VOID
  260. WINAPI
  261. BuildExplicitAccessWithNameA( IN OUT PEXPLICIT_ACCESS_A  pExplicitAccess,
  262.                               IN     LPSTR               pTrusteeName,
  263.                               IN     DWORD               AccessPermissions,
  264.                               IN     ACCESS_MODE         AccessMode,
  265.                               IN     DWORD               Inheritance);
  266.  
  267. #ifdef UNICODE
  268.     #define BuildExplicitAccessWithName     BuildExplicitAccessWithNameW
  269. #else
  270.     #define BuildExplicitAccessWithName     BuildExplicitAccessWithNameA
  271. #endif
  272.  
  273.  
  274. VOID
  275. WINAPI
  276. BuildImpersonateExplicitAccessWithNameW(
  277.     IN OUT PEXPLICIT_ACCESS_W  pExplicitAccess,
  278.     IN     LPWSTR              pTrusteeName,
  279.     IN     PTRUSTEE_W          pTrustee,
  280.     IN     DWORD               AccessPermissions,
  281.     IN     ACCESS_MODE         AccessMode,
  282.     IN     DWORD               Inheritance);
  283.  
  284. VOID
  285. WINAPI
  286. BuildImpersonateExplicitAccessWithNameA(
  287.     IN OUT PEXPLICIT_ACCESS_A  pExplicitAccess,
  288.     IN     LPSTR               pTrusteeName,
  289.     IN     PTRUSTEE_A          pTrustee,
  290.     IN     DWORD               AccessPermissions,
  291.     IN     ACCESS_MODE         AccessMode,
  292.     IN     DWORD               Inheritance);
  293.  
  294. #ifdef UNICODE
  295.     #define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWithNameW
  296. #else
  297.     #define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWithNameA
  298. #endif
  299.  
  300.  
  301. VOID
  302. WINAPI
  303. BuildTrusteeWithNameW( IN OUT PTRUSTEE_W  pTrustee,
  304.                        IN     LPWSTR      pName);
  305.  
  306. VOID
  307. WINAPI
  308. BuildTrusteeWithNameA( IN OUT PTRUSTEE_A  pTrustee,
  309.                        IN     LPSTR       pName);
  310.  
  311. #ifdef UNICODE
  312.     #define BuildTrusteeWithName        BuildTrusteeWithNameW
  313. #else
  314.     #define BuildTrusteeWithName        BuildTrusteeWithNameA
  315. #endif
  316.  
  317.  
  318. VOID
  319. WINAPI
  320. BuildImpersonateTrusteeW( IN OUT PTRUSTEE_W  pTrustee,
  321.                           IN     PTRUSTEE_W  pImpersonateTrustee);
  322.  
  323. VOID
  324. WINAPI
  325. BuildImpersonateTrusteeA( IN OUT PTRUSTEE_A  pTrustee,
  326.                           IN     PTRUSTEE_A  pImpersonateTrustee);
  327.  
  328. #ifdef UNICODE
  329.     #define BuildImpersonateTrustee     BuildImpersonateTrusteeW
  330. #else
  331.     #define BuildImpersonateTrustee     BuildImpersonateTrusteeA
  332. #endif
  333.  
  334.  
  335. VOID
  336. WINAPI
  337. BuildTrusteeWithSidW( IN OUT PTRUSTEE_W  pTrustee,
  338.                       IN     PSID        pSid);
  339.  
  340. VOID
  341. WINAPI
  342. BuildTrusteeWithSidA( IN OUT PTRUSTEE_A  pTrustee,
  343.                       IN     PSID        pSid);
  344.  
  345. #ifdef UNICODE
  346.     #define BuildTrusteeWithSid     BuildTrusteeWithSidW
  347. #else
  348.     #define BuildTrusteeWithSid     BuildTrusteeWithSidA
  349. #endif
  350.  
  351.  
  352. LPWSTR
  353. WINAPI
  354. GetTrusteeNameW( IN PTRUSTEE_W  pTrustee);
  355.  
  356. LPSTR
  357. WINAPI
  358. GetTrusteeNameA( IN PTRUSTEE_A  pTrustee);
  359.  
  360. #ifdef UNICODE
  361.     #define GetTrusteeName     GetTrusteeNameW
  362. #else
  363.     #define GetTrusteeName     GetTrusteeNameA
  364. #endif
  365.  
  366.  
  367. TRUSTEE_TYPE
  368. WINAPI
  369. GetTrusteeTypeW( IN PTRUSTEE_W  pTrustee);
  370.  
  371. TRUSTEE_TYPE
  372. WINAPI
  373. GetTrusteeTypeA( IN PTRUSTEE_A  pTrustee);
  374.  
  375. #ifdef UNICODE
  376.     #define GetTrusteeType     GetTrusteeTypeW
  377. #else
  378.     #define GetTrusteeType     GetTrusteeTypeA
  379. #endif
  380.  
  381.  
  382. TRUSTEE_FORM
  383. WINAPI
  384. GetTrusteeFormW( IN PTRUSTEE_W  pTrustee);
  385.  
  386. TRUSTEE_FORM
  387. WINAPI
  388. GetTrusteeFormA( IN PTRUSTEE_A  pTrustee);
  389.  
  390. #ifdef UNICODE
  391.     #define GetTrusteeForm     GetTrusteeFormW
  392. #else
  393.     #define GetTrusteeForm     GetTrusteeFormA
  394. #endif
  395.  
  396.  
  397. MULTIPLE_TRUSTEE_OPERATION
  398. WINAPI
  399. GetMultipleTrusteeOperationW( IN PTRUSTEE_W  pTrustee);
  400.  
  401. MULTIPLE_TRUSTEE_OPERATION
  402. WINAPI
  403. GetMultipleTrusteeOperationA( IN PTRUSTEE_A  pTrustee);
  404.  
  405. #ifdef UNICODE
  406.     #define GetMultipleTrusteeOperation        GetMultipleTrusteeOperationW
  407. #else
  408.     #define GetMultipleTrusteeOperation        GetMultipleTrusteeOperationA
  409. #endif
  410.  
  411.  
  412. PTRUSTEE_W
  413. WINAPI
  414. GetMultipleTrusteeW( IN PTRUSTEE_W  pTrustee);
  415.  
  416. PTRUSTEE_A
  417. WINAPI
  418. GetMultipleTrusteeA( IN PTRUSTEE_A  pTrustee);
  419.  
  420. #ifdef UNICODE
  421.     #define GetMultipleTrustee     GetMultipleTrusteeW
  422. #else
  423.     #define GetMultipleTrustee     GetMultipleTrusteeA
  424. #endif
  425.  
  426.  
  427. #ifdef __cplusplus
  428. }
  429. #endif
  430. #endif // __ACCESS_CONTROL_API__
  431.  
  432.  
  433.