home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / accctrl.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  22KB  |  629 lines

  1. //+-------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1993-1997.
  5. //
  6. //  File:       accctrl.h
  7. //
  8. //  Contents:   common includes for new style Win32 Access Control
  9. //              APIs
  10. //
  11. //
  12. //--------------------------------------------------------------------
  13. #ifndef __ACCESS_CONTROL__
  14. #define __ACCESS_CONTROL__
  15.  
  16. #ifndef __midl
  17. #include <wtypes.h>
  18. #endif
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. #define AccFree LocalFree
  25.  
  26. //
  27. // Definition: TRUSTEE_TYPE
  28. // This enumerated type specifies the type of trustee account for the trustee
  29. // returned by the API described in this document.
  30. // TRUSTEE_IS_UNKNOWN - The trustee is an unknown, but not necessarily invalid
  31. //                      type.  This field is not validated on input to the APIs
  32. //                      that take Trustees.
  33. // TRUSTEE_IS_USER      The trustee account is a user account.
  34. // TRUSTEE_IS_GROUP     The trustee account is a group account.
  35. //
  36.  
  37. typedef enum _TRUSTEE_TYPE
  38. {
  39.     TRUSTEE_IS_UNKNOWN,
  40.     TRUSTEE_IS_USER,
  41.     TRUSTEE_IS_GROUP,
  42.     TRUSTEE_IS_DOMAIN,
  43.     TRUSTEE_IS_ALIAS,
  44.     TRUSTEE_IS_WELL_KNOWN_GROUP,
  45.     TRUSTEE_IS_DELETED,
  46.     TRUSTEE_IS_INVALID,
  47. } TRUSTEE_TYPE;
  48.  
  49.  
  50. //
  51. // Definition: TRUSTEE_FORM
  52. // This enumerated type specifies the form the trustee identifier is in for a
  53. // particular trustee.
  54. // TRUSTEE_IS_SID       The trustee is identified with a SID rather than with a name.
  55. // TRUSTEE_IS_NAME      The trustee is identified with a name.
  56. //
  57.  
  58. typedef enum _TRUSTEE_FORM
  59. {
  60.     TRUSTEE_IS_SID,
  61.     TRUSTEE_IS_NAME,
  62.     TRUSTEE_BAD_FORM
  63. } TRUSTEE_FORM;
  64.  
  65.  
  66. //
  67. // Definition: MULTIPLE_TRUSTEE_OPERATION
  68. // If the trustee is a multiple trustee, this enumerated type specifies the type.
  69. // TRUSTEE_IS_IMPERSONATE       The trustee is an impersonate trustee and the multiple
  70. //                          trustee field in the trustee points to another trustee
  71. //                          that is a trustee for the server that will be doing the
  72. //                          impersonation.
  73. //
  74.  
  75. typedef enum _MULTIPLE_TRUSTEE_OPERATION
  76. {
  77.     NO_MULTIPLE_TRUSTEE,
  78.     TRUSTEE_IS_IMPERSONATE,
  79. } MULTIPLE_TRUSTEE_OPERATION;
  80.  
  81.  
  82. //
  83. // Definition: TRUSTEE
  84. // This structure is used to pass account information into and out of the system
  85. // using the API defined in this document.
  86. // PMultipleTrustee     - if NON-NULL, points to another trustee structure, as
  87. //                    defined by the multiple trustee operation field.
  88. // MultipleTrusteeOperation - Defines the multiple trustee operation/type.
  89. // TrusteeForm - defines if the trustee is defined by name or SID.
  90. // TrusteeType - defines if the trustee type is unknown, a user or a group.
  91. // PwcsName     - points to the trustee name or the trustee SID.
  92. //
  93.  
  94. typedef struct _TRUSTEE_A
  95. {
  96.     struct _TRUSTEE_A          *pMultipleTrustee;
  97.     MULTIPLE_TRUSTEE_OPERATION  MultipleTrusteeOperation;
  98.     TRUSTEE_FORM                TrusteeForm;
  99.     TRUSTEE_TYPE                TrusteeType;
  100. #ifdef __midl
  101.     [switch_is(TrusteeForm)]
  102.     union
  103.     {
  104.     [case(TRUSTEE_IS_NAME)]
  105.         LPSTR                   ptstrName;
  106.     [case(TRUSTEE_IS_SID)]
  107.         SID                    *pSid;
  108.     };
  109. #else
  110.     LPSTR                       ptstrName;
  111. #endif
  112. } TRUSTEE_A, *PTRUSTEE_A, TRUSTEEA, *PTRUSTEEA;
  113. typedef struct _TRUSTEE_W
  114. {
  115.     struct _TRUSTEE_W          *pMultipleTrustee;
  116.     MULTIPLE_TRUSTEE_OPERATION  MultipleTrusteeOperation;
  117.     TRUSTEE_FORM                TrusteeForm;
  118.     TRUSTEE_TYPE                TrusteeType;
  119. #ifdef __midl
  120.     [switch_is(TrusteeForm)]
  121.     union
  122.     {
  123.     [case(TRUSTEE_IS_NAME)]
  124.         LPWSTR                  ptstrName;
  125.     [case(TRUSTEE_IS_SID)]
  126.         SID                    *pSid;
  127.     };
  128. #else
  129.     LPWSTR                      ptstrName;
  130. #endif
  131. } TRUSTEE_W, *PTRUSTEE_W, TRUSTEEW, *PTRUSTEEW;
  132. #ifdef UNICODE
  133. typedef TRUSTEE_W TRUSTEE_;
  134. typedef PTRUSTEE_W PTRUSTEE_;
  135. typedef TRUSTEEW TRUSTEE;
  136. typedef PTRUSTEEW PTRUSTEE;
  137. #else
  138. typedef TRUSTEE_A TRUSTEE_;
  139. typedef PTRUSTEE_A PTRUSTEE_;
  140. typedef TRUSTEEA TRUSTEE;
  141. typedef PTRUSTEEA PTRUSTEE;
  142. #endif // UNICODE
  143.  
  144.  
  145. //
  146. // Definition: ACCESS_MODE
  147. // This enumerated type specifies how permissions are (requested)/to be applied
  148. //  for the trustee by the access control entry.  On input this field can by any
  149. //  of the values, although it is not meaningful to mix access control and audit
  150. //  control entries.  On output this field will be either SET_ACCESS, DENY_ACCESS,
  151. // SET_AUDIT_SUCCESS, SET_AUDIT_FAILURE.
  152. // The following descriptions define how this type effects an explicit access
  153. // request to apply access permissions to an object.
  154. // GRANT_ACCESS - The trustee will have at least the requested permissions upon
  155. //                successful completion of the command. (If the trustee has
  156. //                additional permissions they will not be removed).
  157. // SET_ACCESS - The trustee will have exactly the requested permissions upon
  158. //              successful completion of the command.
  159. // DENY_ACCESS - The trustee will be denied the specified permissions.
  160. // REVOKE_ACCESS - Any explicit access rights the trustee has will be revoked.
  161. // SET_AUDIT_SUCCESS - The trustee will be audited for successful opens of the
  162. //                     object using the requested permissions.
  163. // SET_AUDIT_FAILURE - The trustee will be audited for failed opens of the object
  164. //                     using the requested permissions.
  165. //
  166.  
  167. typedef enum _ACCESS_MODE
  168. {
  169.     NOT_USED_ACCESS = 0,
  170.     GRANT_ACCESS,
  171.     SET_ACCESS,
  172.     DENY_ACCESS,
  173.     REVOKE_ACCESS,
  174.     SET_AUDIT_SUCCESS,
  175.     SET_AUDIT_FAILURE
  176. } ACCESS_MODE;
  177.  
  178. //
  179. // Definition: Inheritance flags
  180. // These bit masks are provided to allow simple application of inheritance in
  181. // explicit access requests on containers.
  182. // NO_INHERITANCE       The specific access permissions will only be applied to
  183. //                  the container, and will not be inherited by objects created
  184. //                  within the container.
  185. // SUB_CONTAINERS_ONLY_INHERIT  The specific access permissions will be inherited
  186. //                              and applied to sub containers created within the
  187. //                              container, and will be applied to the container
  188. //                              itself.
  189. // SUB_OBJECTS_ONLY_INHERIT     The specific access permissions will only be inherited
  190. //                              by objects created within the specific container.
  191. //                              The access permissions will not be applied to the
  192. //                              container itself.
  193. // SUB_CONTAINERS_AND_OBJECTS_INHERIT   The specific access permissions will be
  194. //                                      inherited by containers created within the
  195. //                                      specific container, will be applied to
  196. //                                      objects created within the container, but
  197. //                                      will not be applied to the container itself.
  198. //
  199. #define NO_INHERITANCE 0x0
  200. #define SUB_OBJECTS_ONLY_INHERIT            0x1
  201. #define SUB_CONTAINERS_ONLY_INHERIT         0x2
  202. #define SUB_CONTAINERS_AND_OBJECTS_INHERIT  0x3
  203. #define INHERIT_NO_PROPAGATE                0x4
  204. #define INHERIT_ONLY                        0x8
  205.  
  206. //
  207. // Informational bit that is returned
  208. //
  209. #define INHERITED_ACCESS_ENTRY              0x10
  210.  
  211. //
  212. // Informational bit that tells where a node was inherited from.  Valid only
  213. // for NT 5 APIs
  214. //
  215. #define INHERITED_PARENT                    0x10000000
  216. #define INHERITED_GRANDPARENT               0x20000000
  217.  
  218.  
  219. //
  220. // Definition:
  221. // This enumerated type defines the objects supported by the get/set API within
  222. // this document.  See section 3.1, Object Types for a detailed definition of the
  223. // supported object types, and their name formats.
  224. //
  225. typedef enum _SE_OBJECT_TYPE
  226. {
  227.     SE_UNKNOWN_OBJECT_TYPE = 0,
  228.     SE_FILE_OBJECT,
  229.     SE_SERVICE,
  230.     SE_PRINTER,
  231.     SE_REGISTRY_KEY,
  232.     SE_LMSHARE,
  233.     SE_KERNEL_OBJECT,
  234.     SE_WINDOW_OBJECT,
  235.     SE_DS_OBJECT,
  236.     SE_DS_OBJECT_ALL,
  237.     SE_PROVIDER_DEFINED_OBJECT
  238. } SE_OBJECT_TYPE;
  239.  
  240.  
  241. //
  242. // Definition: EXPLICIT_ACCESS
  243. // This structure is used to pass access control entry information into and out
  244. // of the system using the API defined in this document.
  245. // grfAccessPermissions - This contains the access permissions to assign for the
  246. //                     trustee.  It is in the form of an NT access mask.
  247. // grfAccessMode - This field defines how the permissions are to be applied for
  248. //                 the trustee.
  249. // grfInheritance - For containers, this field defines how the access control
  250. //                  entry is/(is requested) to be inherited on
  251. //                  objects/sub-containers created within the container.
  252. // Trustee - This field contains the definition of the trustee account the
  253. //           explicit access applies to.
  254. //
  255.  
  256. typedef struct _EXPLICIT_ACCESS_A
  257. {
  258.     DWORD        grfAccessPermissions;
  259.     ACCESS_MODE  grfAccessMode;
  260.     DWORD        grfInheritance;
  261.     TRUSTEE_A    Trustee;
  262. } EXPLICIT_ACCESS_A, *PEXPLICIT_ACCESS_A, EXPLICIT_ACCESSA, *PEXPLICIT_ACCESSA;
  263. typedef struct _EXPLICIT_ACCESS_W
  264. {
  265.     DWORD        grfAccessPermissions;
  266.     ACCESS_MODE  grfAccessMode;
  267.     DWORD        grfInheritance;
  268.     TRUSTEE_W    Trustee;
  269. } EXPLICIT_ACCESS_W, *PEXPLICIT_ACCESS_W, EXPLICIT_ACCESSW, *PEXPLICIT_ACCESSW;
  270. #ifdef UNICODE
  271. typedef EXPLICIT_ACCESS_W EXPLICIT_ACCESS_;
  272. typedef PEXPLICIT_ACCESS_W PEXPLICIT_ACCESS_;
  273. typedef EXPLICIT_ACCESSW EXPLICIT_ACCESS;
  274. typedef PEXPLICIT_ACCESSW PEXPLICIT_ACCESS;
  275. #else
  276. typedef EXPLICIT_ACCESS_A EXPLICIT_ACCESS_;
  277. typedef PEXPLICIT_ACCESS_A PEXPLICIT_ACCESS_;
  278. typedef EXPLICIT_ACCESSA EXPLICIT_ACCESS;
  279. typedef PEXPLICIT_ACCESSA PEXPLICIT_ACCESS;
  280. #endif // UNICODE
  281.  
  282.  
  283.  
  284. //----------------------------------------------------------------------------
  285. //
  286. //                                  NT5 APIs
  287. //
  288. //----------------------------------------------------------------------------
  289.  
  290. //
  291. // Default provider
  292. //
  293. #define ACCCTRL_DEFAULT_PROVIDER  TEXT("Windows NT Access Provider")
  294.  
  295. //
  296. /// Access rights
  297. //
  298. typedef     ULONG   ACCESS_RIGHTS, *PACCESS_RIGHTS;
  299.  
  300. //
  301. // Inheritance flags
  302. //
  303. typedef ULONG INHERIT_FLAGS, *PINHERIT_FLAGS;
  304.  
  305.  
  306. //
  307. // Access / Audit structures
  308. //
  309. typedef struct _ACTRL_ACCESS_ENTRYA
  310. {
  311.     TRUSTEE_A       Trustee;
  312.     ULONG           fAccessFlags;
  313.     ACCESS_RIGHTS   Access;
  314.     ACCESS_RIGHTS   ProvSpecificAccess;
  315.     INHERIT_FLAGS   Inheritance;
  316.     LPSTR           lpInheritProperty;
  317. } ACTRL_ACCESS_ENTRYA, *PACTRL_ACCESS_ENTRYA;
  318. //
  319. // Access / Audit structures
  320. //
  321. typedef struct _ACTRL_ACCESS_ENTRYW
  322. {
  323.     TRUSTEE_W       Trustee;
  324.     ULONG           fAccessFlags;
  325.     ACCESS_RIGHTS   Access;
  326.     ACCESS_RIGHTS   ProvSpecificAccess;
  327.     INHERIT_FLAGS   Inheritance;
  328.     LPWSTR          lpInheritProperty;
  329. } ACTRL_ACCESS_ENTRYW, *PACTRL_ACCESS_ENTRYW;
  330. #ifdef UNICODE
  331. typedef ACTRL_ACCESS_ENTRYW ACTRL_ACCESS_ENTRY;
  332. typedef PACTRL_ACCESS_ENTRYW PACTRL_ACCESS_ENTRY;
  333. #else
  334. typedef ACTRL_ACCESS_ENTRYA ACTRL_ACCESS_ENTRY;
  335. typedef PACTRL_ACCESS_ENTRYA PACTRL_ACCESS_ENTRY;
  336. #endif // UNICODE
  337.  
  338.  
  339.  
  340. typedef struct _ACTRL_ACCESS_ENTRY_LISTA
  341. {
  342.     ULONG                   cEntries;
  343. #ifdef __midl
  344.     [size_is(cEntries)]
  345. #endif
  346.     ACTRL_ACCESS_ENTRYA    *pAccessList;
  347. } ACTRL_ACCESS_ENTRY_LISTA, *PACTRL_ACCESS_ENTRY_LISTA;
  348. typedef struct _ACTRL_ACCESS_ENTRY_LISTW
  349. {
  350.     ULONG                   cEntries;
  351. #ifdef __midl
  352.     [size_is(cEntries)]
  353. #endif
  354.     ACTRL_ACCESS_ENTRYW    *pAccessList;
  355. } ACTRL_ACCESS_ENTRY_LISTW, *PACTRL_ACCESS_ENTRY_LISTW;
  356. #ifdef UNICODE
  357. typedef ACTRL_ACCESS_ENTRY_LISTW ACTRL_ACCESS_ENTRY_LIST;
  358. typedef PACTRL_ACCESS_ENTRY_LISTW PACTRL_ACCESS_ENTRY_LIST;
  359. #else
  360. typedef ACTRL_ACCESS_ENTRY_LISTA ACTRL_ACCESS_ENTRY_LIST;
  361. typedef PACTRL_ACCESS_ENTRY_LISTA PACTRL_ACCESS_ENTRY_LIST;
  362. #endif // UNICODE
  363.  
  364.  
  365.  
  366. typedef struct _ACTRL_PROPERTY_ENTRYA
  367. {
  368.     LPSTR                       lpProperty;
  369.     PACTRL_ACCESS_ENTRY_LISTA   pAccessEntryList;
  370.     ULONG                       fListFlags;
  371. } ACTRL_PROPERTY_ENTRYA, *PACTRL_PROPERTY_ENTRYA;
  372. typedef struct _ACTRL_PROPERTY_ENTRYW
  373. {
  374.     LPWSTR                      lpProperty;
  375.     PACTRL_ACCESS_ENTRY_LISTW   pAccessEntryList;
  376.     ULONG                       fListFlags;
  377. } ACTRL_PROPERTY_ENTRYW, *PACTRL_PROPERTY_ENTRYW;
  378. #ifdef UNICODE
  379. typedef ACTRL_PROPERTY_ENTRYW ACTRL_PROPERTY_ENTRY;
  380. typedef PACTRL_PROPERTY_ENTRYW PACTRL_PROPERTY_ENTRY;
  381. #else
  382. typedef ACTRL_PROPERTY_ENTRYA ACTRL_PROPERTY_ENTRY;
  383. typedef PACTRL_PROPERTY_ENTRYA PACTRL_PROPERTY_ENTRY;
  384. #endif // UNICODE
  385.  
  386.  
  387.  
  388. typedef struct _ACTRL_ALISTA
  389. {
  390.     ULONG                       cEntries;
  391. #ifdef __midl
  392.     [size_is(cEntries)]
  393. #endif
  394.     PACTRL_PROPERTY_ENTRYA      pPropertyAccessList;
  395. } ACTRL_ACCESSA, *PACTRL_ACCESSA, ACTRL_AUDITA, *PACTRL_AUDITA;
  396. typedef struct _ACTRL_ALISTW
  397. {
  398.     ULONG                       cEntries;
  399. #ifdef __midl
  400.     [size_is(cEntries)]
  401. #endif
  402.     PACTRL_PROPERTY_ENTRYW      pPropertyAccessList;
  403. } ACTRL_ACCESSW, *PACTRL_ACCESSW, ACTRL_AUDITW, *PACTRL_AUDITW;
  404. #ifdef UNICODE
  405. typedef ACTRL_ACCESSW ACTRL_ACCESS;
  406. typedef PACTRL_ACCESSW PACTRL_ACCESS;
  407. typedef ACTRL_AUDITW ACTRL_AUDIT;
  408. typedef PACTRL_AUDITW PACTRL_AUDIT;
  409. #else
  410. typedef ACTRL_ACCESSA ACTRL_ACCESS;
  411. typedef PACTRL_ACCESSA PACTRL_ACCESS;
  412. typedef ACTRL_AUDITA ACTRL_AUDIT;
  413. typedef PACTRL_AUDITA PACTRL_AUDIT;
  414. #endif // UNICODE
  415.  
  416.  
  417.  
  418. //
  419. // TRUSTEE_ACCESS flags
  420. //
  421. #define TRUSTEE_ACCESS_ALLOWED      0x00000001L
  422. #define TRUSTEE_ACCESS_READ         0x00000002L
  423. #define TRUSTEE_ACCESS_WRITE        0x00000004L
  424.  
  425. #define TRUSTEE_ACCESS_EXPLICIT     0x00000001L
  426. #define TRUSTEE_ACCESS_READ_WRITE   (TRUSTEE_ACCESS_READ |                  \
  427.                                      TRUSTEE_ACCESS_WRITE)
  428.  
  429.  
  430. #define TRUSTEE_ACCESS_ALL          0xFFFFFFFFL
  431.  
  432. typedef struct _TRUSTEE_ACCESSA
  433. {
  434.     LPSTR           lpProperty;
  435.     ACCESS_RIGHTS   Access;
  436.     ULONG           fAccessFlags;
  437.     ULONG           fReturnedAccess;
  438. } TRUSTEE_ACCESSA, *PTRUSTEE_ACCESSA;
  439. typedef struct _TRUSTEE_ACCESSW
  440. {
  441.     LPWSTR          lpProperty;
  442.     ACCESS_RIGHTS   Access;
  443.     ULONG           fAccessFlags;
  444.     ULONG           fReturnedAccess;
  445. } TRUSTEE_ACCESSW, *PTRUSTEE_ACCESSW;
  446. #ifdef UNICODE
  447. typedef TRUSTEE_ACCESSW TRUSTEE_ACCESS;
  448. typedef PTRUSTEE_ACCESSW PTRUSTEE_ACCESS;
  449. #else
  450. typedef TRUSTEE_ACCESSA TRUSTEE_ACCESS;
  451. typedef PTRUSTEE_ACCESSA PTRUSTEE_ACCESS;
  452. #endif // UNICODE
  453.  
  454.  
  455.  
  456. //
  457. // Generic permission values
  458. //
  459. #define ACTRL_RESERVED          0x00000000
  460. #define ACTRL_PERM_1            0x00000001
  461. #define ACTRL_PERM_2            0x00000002
  462. #define ACTRL_PERM_3            0x00000004
  463. #define ACTRL_PERM_4            0x00000008
  464. #define ACTRL_PERM_5            0x00000010
  465. #define ACTRL_PERM_6            0x00000020
  466. #define ACTRL_PERM_7            0x00000040
  467. #define ACTRL_PERM_8            0x00000080
  468. #define ACTRL_PERM_9            0x00000100
  469. #define ACTRL_PERM_10           0x00000200
  470. #define ACTRL_PERM_11           0x00000400
  471. #define ACTRL_PERM_12           0x00000800
  472. #define ACTRL_PERM_13           0x00001000
  473. #define ACTRL_PERM_14           0x00002000
  474. #define ACTRL_PERM_15           0x00004000
  475. #define ACTRL_PERM_16           0x00008000
  476. #define ACTRL_PERM_17           0x00010000
  477. #define ACTRL_PERM_18           0x00020000
  478. #define ACTRL_PERM_19           0x00040000
  479. #define ACTRL_PERM_20           0x00080000
  480.  
  481. //
  482. // Access permissions
  483. //
  484. #define ACTRL_ACCESS_ALLOWED        0x00000001
  485. #define ACTRL_ACCESS_DENIED         0x00000002
  486. #define ACTRL_AUDIT_SUCCESS         0x00000004
  487. #define ACTRL_AUDIT_FAILURE         0x00000008
  488.  
  489. //
  490. // Property list flags
  491. //
  492. #define ACTRL_ACCESS_PROTECTED      0x00000001
  493.  
  494. //
  495. // Standard and object rights
  496. //
  497. #define ACTRL_SYSTEM_ACCESS         0x04000000
  498. #define ACTRL_DELETE                0x08000000
  499. #define ACTRL_READ_CONTROL          0x10000000
  500. #define ACTRL_CHANGE_ACCESS         0x20000000
  501. #define ACTRL_CHANGE_OWNER          0x40000000
  502. #define ACTRL_SYNCHRONIZE           0x80000000
  503. #define ACTRL_STD_RIGHTS_ALL        0xf8000000
  504.  
  505. #define ACTRL_DS_OPEN                           ACTRL_RESERVED
  506. #define ACTRL_DS_CREATE_CHILD                   ACTRL_PERM_1
  507. #define ACTRL_DS_DELETE_CHILD                   ACTRL_PERM_2
  508. #define ACTRL_DS_LIST                           ACTRL_PERM_3
  509. #define ACTRL_DS_SELF                           ACTRL_PERM_4
  510. #define ACTRL_DS_READ_PROP                      ACTRL_PERM_5
  511. #define ACTRL_DS_WRITE_PROP                     ACTRL_PERM_6
  512. #define ACTRL_FILE_READ                         ACTRL_PERM_1
  513. #define ACTRL_FILE_WRITE                        ACTRL_PERM_2
  514. #define ACTRL_FILE_APPEND                       ACTRL_PERM_3
  515. #define ACTRL_FILE_READ_PROP                    ACTRL_PERM_4
  516. #define ACTRL_FILE_WRITE_PROP                   ACTRL_PERM_5
  517. #define ACTRL_FILE_EXECUTE                      ACTRL_PERM_6
  518. #define ACTRL_FILE_READ_ATTRIB                  ACTRL_PERM_7
  519. #define ACTRL_FILE_WRITE_ATTRIB                 ACTRL_PERM_8
  520. #define ACTRL_DIR_LIST                          ACTRL_PERM_1
  521. #define ACTRL_DIR_CREATE_OBJECT                 ACTRL_PERM_2
  522. #define ACTRL_DIR_CREATE_CHILD                  ACTRL_PERM_3
  523. #define ACTRL_DIR_DELETE_CHILD                  ACTRL_PERM_4
  524. #define ACTRL_DIR_TRAVERSE                      ACTRL_PERM_6
  525. #define ACTRL_KERNEL_TERMINATE                  ACTRL_PERM_1
  526. #define ACTRL_KERNEL_THREAD                     ACTRL_PERM_2
  527. #define ACTRL_KERNEL_VM                         ACTRL_PERM_3
  528. #define ACTRL_KERNEL_VM_READ                    ACTRL_PERM_4
  529. #define ACTRL_KERNEL_VM_WRITE                   ACTRL_PERM_5
  530. #define ACTRL_KERNEL_DUP_HANDLE                 ACTRL_PERM_6
  531. #define ACTRL_KERNEL_PROCESS                    ACTRL_PERM_7
  532. #define ACTRL_KERNEL_SET_INFO                   ACTRL_PERM_8
  533. #define ACTRL_KERNEL_GET_INFO                   ACTRL_PERM_9
  534. #define ACTRL_KERNEL_CONTROL                    ACTRL_PERM_10
  535. #define ACTRL_KERNEL_ALERT                      ACTRL_PERM_11
  536. #define ACTRL_KERNEL_GET_CONTEXT                ACTRL_PERM_12
  537. #define ACTRL_KERNEL_SET_CONTEXT                ACTRL_PERM_13
  538. #define ACTRL_KERNEL_TOKEN                      ACTRL_PERM_14
  539. #define ACTRL_KERNEL_IMPERSONATE                ACTRL_PERM_15
  540. #define ACTRL_KERNEL_DIMPERSONATE               ACTRL_PERM_16
  541. #define ACTRL_PRINT_SADMIN                      ACTRL_PERM_1
  542. #define ACTRL_PRINT_SLIST                       ACTRL_PERM_2
  543. #define ACTRL_PRINT_PADMIN                      ACTRL_PERM_3
  544. #define ACTRL_PRINT_PUSE                        ACTRL_PERM_4
  545. #define ACTRL_PRINT_JADMIN                      ACTRL_PERM_5
  546. #define ACTRL_SVC_GET_INFO                      ACTRL_PERM_1
  547. #define ACTRL_SVC_SET_INFO                      ACTRL_PERM_2
  548. #define ACTRL_SVC_STATUS                        ACTRL_PERM_3
  549. #define ACTRL_SVC_LIST                          ACTRL_PERM_4
  550. #define ACTRL_SVC_START                         ACTRL_PERM_5
  551. #define ACTRL_SVC_STOP                          ACTRL_PERM_6
  552. #define ACTRL_SVC_PAUSE                         ACTRL_PERM_7
  553. #define ACTRL_SVC_INTERROGATE                   ACTRL_PERM_8
  554. #define ACTRL_SVC_UCONTROL                      ACTRL_PERM_9
  555. #define ACTRL_REG_QUERY                         ACTRL_PERM_1
  556. #define ACTRL_REG_SET                           ACTRL_PERM_2
  557. #define ACTRL_REG_CREATE_CHILD                  ACTRL_PERM_3
  558. #define ACTRL_REG_LIST                          ACTRL_PERM_4
  559. #define ACTRL_REG_NOTIFY                        ACTRL_PERM_5
  560. #define ACTRL_REG_LINK                          ACTRL_PERM_6
  561. #define ACTRL_WIN_CLIPBRD                       ACTRL_PERM_1
  562. #define ACTRL_WIN_GLOBAL_ATOMS                  ACTRL_PERM_2
  563. #define ACTRL_WIN_CREATE                        ACTRL_PERM_3
  564. #define ACTRL_WIN_LIST_DESK                     ACTRL_PERM_4
  565. #define ACTRL_WIN_LIST                          ACTRL_PERM_5
  566. #define ACTRL_WIN_READ_ATTRIBS                  ACTRL_PERM_6
  567. #define ACTRL_WIN_WRITE_ATTRIBS                 ACTRL_PERM_7
  568. #define ACTRL_WIN_SCREEN                        ACTRL_PERM_8
  569. #define ACTRL_WIN_EXIT                          ACTRL_PERM_9
  570.  
  571.  
  572.  
  573.  
  574. typedef struct _ACTRL_OVERLAPPED
  575. {
  576.     ULONG       Reserved1;
  577.     ULONG       Reserved2;
  578.     HANDLE      hEvent;
  579.  
  580. } ACTRL_OVERLAPPED, *PACTRL_OVERLAPPED;
  581.  
  582. typedef struct _ACTRL_ACCESS_INFOA
  583. {
  584.     ULONG       fAccessPermission;
  585.     LPSTR       lpAccessPermissionName;
  586. } ACTRL_ACCESS_INFOA, *PACTRL_ACCESS_INFOA;
  587. typedef struct _ACTRL_ACCESS_INFOW
  588. {
  589.     ULONG       fAccessPermission;
  590.     LPWSTR      lpAccessPermissionName;
  591. } ACTRL_ACCESS_INFOW, *PACTRL_ACCESS_INFOW;
  592. #ifdef UNICODE
  593. typedef ACTRL_ACCESS_INFOW ACTRL_ACCESS_INFO;
  594. typedef PACTRL_ACCESS_INFOW PACTRL_ACCESS_INFO;
  595. #else
  596. typedef ACTRL_ACCESS_INFOA ACTRL_ACCESS_INFO;
  597. typedef PACTRL_ACCESS_INFOA PACTRL_ACCESS_INFO;
  598. #endif // UNICODE
  599.  
  600. typedef struct _ACTRL_CONTROL_INFOA
  601. {
  602.     LPSTR          lpControlId;
  603.     LPSTR          lpControlName;
  604. } ACTRL_CONTROL_INFOA, *PACTRL_CONTROL_INFOA;
  605. typedef struct _ACTRL_CONTROL_INFOW
  606. {
  607.     LPWSTR         lpControlId;
  608.     LPWSTR         lpControlName;
  609. } ACTRL_CONTROL_INFOW, *PACTRL_CONTROL_INFOW;
  610. #ifdef UNICODE
  611. typedef ACTRL_CONTROL_INFOW ACTRL_CONTROL_INFO;
  612. typedef PACTRL_CONTROL_INFOW PACTRL_CONTROL_INFO;
  613. #else
  614. typedef ACTRL_CONTROL_INFOA ACTRL_CONTROL_INFO;
  615. typedef PACTRL_CONTROL_INFOA PACTRL_CONTROL_INFO;
  616. #endif // UNICODE
  617.  
  618.  
  619. #define ACTRL_ACCESS_NO_OPTIONS                 0x00000000
  620. #define ACTRL_ACCESS_SUPPORTS_OBJECT_ENTRIES    0x00000001
  621.  
  622.  
  623. #ifdef __cplusplus
  624. }
  625. #endif
  626.  
  627. #endif // __ACCESS_CONTROL__
  628.  
  629.