home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / ACCCTRL.PAS next >
Pascal/Delphi Source File  |  1999-08-11  |  28KB  |  715 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Run-time Library                 }
  5. {       Win32 Security API Interface Unit               }
  6. {                                                       }
  7. {       Copyright (c) 1985-1999, Microsoft Corporation  }
  8. {                                                       }
  9. {       Translator: Inprise Corporation                 }
  10. {                                                       }
  11. {*******************************************************}
  12.  
  13. unit AccCtrl;
  14.  
  15. {$WEAKPACKAGEUNIT}
  16.  
  17. interface
  18.  
  19. (*$HPPEMIT '#include <accCtrl.h>' *)
  20.  
  21. uses
  22.   Windows;
  23.  
  24. { Definition: TRUSTEE_TYPE }
  25. { This enumerated type specifies the type of trustee account for the trustee }
  26. { returned by the API described in this document. }
  27. { TRUSTEE_IS_UNKNOWN - The trustee is an unknown, but not necessarily invalid }
  28. {                      type.  This field is not validated on input to the APIs }
  29. {                      that take Trustees. }
  30. { TRUSTEE_IS_USER      The trustee account is a user account. }
  31. { TRUSTEE_IS_GROUP     The trustee account is a group account. }
  32.  
  33. type
  34.   TRUSTEE_TYPE = ( 
  35.     TRUSTEE_IS_UNKNOWN,
  36.     TRUSTEE_IS_USER,
  37.     TRUSTEE_IS_GROUP,
  38.     TRUSTEE_IS_DOMAIN,
  39.     TRUSTEE_IS_ALIAS,
  40.     TRUSTEE_IS_WELL_KNOWN_GROUP,
  41.     TRUSTEE_IS_DELETED,
  42.     TRUSTEE_IS_INVALID
  43.   );
  44.   {$EXTERNALSYM TRUSTEE_TYPE}
  45.   
  46. { Definition: TRUSTEE_FORM }
  47. { This enumerated type specifies the form the trustee identifier is in for a }
  48. { particular trustee. }
  49. { TRUSTEE_IS_SID       The trustee is identified with a SID rather than with a name. }
  50. { TRUSTEE_IS_NAME      The trustee is identified with a name. }
  51.  
  52.   TRUSTEE_FORM = (
  53.     TRUSTEE_IS_SID,
  54.     TRUSTEE_IS_NAME,
  55.     TRUSTEE_BAD_FORM
  56.   );
  57.   {$EXTERNALSYM TRUSTEE_FORM}
  58.  
  59. { Definition: MULTIPLE_TRUSTEE_OPERATION }
  60. { If the trustee is a multiple trustee, this enumerated type specifies the type. }
  61. { TRUSTEE_IS_IMPERSONATE       The trustee is an impersonate trustee and the multiple }
  62. {                          trustee field in the trustee points to another trustee }
  63. {                          that is a trustee for the server that will be doing the }
  64. {                          impersonation. }
  65.  
  66.   MULTIPLE_TRUSTEE_OPERATION = ( 
  67.     NO_MULTIPLE_TRUSTEE,
  68.     TRUSTEE_IS_IMPERSONATE
  69.   );
  70.   {$EXTERNALSYM MULTIPLE_TRUSTEE_OPERATION}
  71.  
  72. { Definition: TRUSTEE }
  73. { This structure is used to pass account information into and out of the system }
  74. { using the API defined in this document. }
  75. { PMultipleTrustee     - if NON-NULL, points to another trustee structure, as }
  76. {                    defined by the multiple trustee operation field. }
  77. { MultipleTrusteeOperation - Defines the multiple trustee operation/type. }
  78. { TrusteeForm - defines if the trustee is defined by name or SID. }
  79. { TrusteeType - defines if the trustee type is unknown, a user or a group. }
  80. { PwcsName     - points to the trustee name or the trustee SID. }
  81.  
  82.   P_TRUSTEE_A = ^_TRUSTEE_A; 
  83.   {$EXTERNALSYM P_TRUSTEE_A}
  84.   _TRUSTEE_A = packed record
  85.     pMultipleTrustee: P_TRUSTEE_A;
  86.     MultipleTrusteeOperation: MULTIPLE_TRUSTEE_OPERATION;
  87.     TrusteeForm: TRUSTEE_FORM;
  88.     TrusteeType: TRUSTEE_TYPE;
  89.     ptstrName: PAnsiChar;
  90.   end;
  91.   {$EXTERNALSYM _TRUSTEE_A}
  92.   P_TRUSTEE_W = ^_TRUSTEE_W; 
  93.   {$EXTERNALSYM P_TRUSTEE_W}
  94.   _TRUSTEE_W = packed record
  95.     pMultipleTrustee: P_TRUSTEE_W;
  96.     MultipleTrusteeOperation: MULTIPLE_TRUSTEE_OPERATION;
  97.     TrusteeForm: TRUSTEE_FORM;
  98.     TrusteeType: TRUSTEE_TYPE;
  99.     ptstrName: PAnsiChar;
  100.   end;
  101.   {$EXTERNALSYM _TRUSTEE_W}
  102.   P_TRUSTEE_ = P_TRUSTEE_A;
  103.   TRUSTEEA = _TRUSTEE_A;
  104.   {$EXTERNALSYM TRUSTEEA}
  105.   TRUSTEEW = _TRUSTEE_W;
  106.   {$EXTERNALSYM TRUSTEEW}
  107.   TRUSTEE = TRUSTEEA;
  108.   PTRUSTEEA = ^TRUSTEEA;
  109.   {$EXTERNALSYM PTRUSTEEA}
  110.   PTRUSTEEW = ^TRUSTEEW;
  111.   {$EXTERNALSYM PTRUSTEEW}
  112.   PTRUSTEE = PTRUSTEEA;
  113.   TRUSTEE_A = TRUSTEEA;
  114.   {$EXTERNALSYM TRUSTEE_A}
  115.   TRUSTEE_W = TRUSTEEW;
  116.   {$EXTERNALSYM TRUSTEE_W}
  117.   TRUSTEE_ = TRUSTEE_A;
  118.   PTRUSTEE_A = PTRUSTEEA;
  119.   {$EXTERNALSYM PTRUSTEE_A}
  120.   PTRUSTEE_W = PTRUSTEEW;
  121.   {$EXTERNALSYM PTRUSTEE_W}
  122.   PTRUSTEE_ = PTRUSTEE_A;
  123.  
  124. { Definition: ACCESS_MODE }
  125. { This enumerated type specifies how permissions are (requested)/to be applied }
  126. {  for the trustee by the access control entry.  On input this field can by any }
  127. {  of the values, although it is not meaningful to mix access control and audit }
  128. {  control entries.  On output this field will be either SET_ACCESS, DENY_ACCESS, }
  129. { SET_AUDIT_SUCCESS, SET_AUDIT_FAILURE. }
  130. { The following descriptions define how this type effects an explicit access }
  131. { request to apply access permissions to an object. }
  132. { GRANT_ACCESS - The trustee will have at least the requested permissions upon }
  133. {                successful completion of the command. (If the trustee has }
  134. {                additional permissions they will not be removed). }
  135. { SET_ACCESS - The trustee will have exactly the requested permissions upon }
  136. {              successful completion of the command. }
  137. { DENY_ACCESS - The trustee will be denied the specified permissions. }
  138. { REVOKE_ACCESS - Any explicit access rights the trustee has will be revoked. }
  139. { SET_AUDIT_SUCCESS - The trustee will be audited for successful opens of the }
  140. {                     object using the requested permissions. }
  141. { SET_AUDIT_FAILURE - The trustee will be audited for failed opens of the object }
  142. {                     using the requested permissions. }
  143.  
  144.  
  145.   ACCESS_MODE = ( 
  146.     NOT_USED_ACCESS,
  147.     GRANT_ACCESS,
  148.     SET_ACCESS,
  149.     DENY_ACCESS,
  150.     REVOKE_ACCESS,
  151.     SET_AUDIT_SUCCESS,
  152.     SET_AUDIT_FAILURE
  153.   );
  154.   {$EXTERNALSYM ACCESS_MODE}
  155.  
  156. { Definition: Inheritance flags }
  157. { These bit masks are provided to allow simple application of inheritance in }
  158. { explicit access requests on containers. }
  159. { NO_INHERITANCE       The specific access permissions will only be applied to }
  160. {                  the container, and will not be inherited by objects created }
  161. {                  within the container. }
  162. { SUB_CONTAINERS_ONLY_INHERIT  The specific access permissions will be inherited }
  163. {                              and applied to sub containers created within the }
  164. {                              container, and will be applied to the container }
  165. {                              itself. }
  166. { SUB_OBJECTS_ONLY_INHERIT     The specific access permissions will only be inherited }
  167. {                              by objects created within the specific container. }
  168. {                              The access permissions will not be applied to the }
  169. {                              container itself. }
  170. { SUB_CONTAINERS_AND_OBJECTS_INHERIT   The specific access permissions will be }
  171. {                                      inherited by containers created within the }
  172. {                                      specific container, will be applied to }
  173. {                                      objects created within the container, but }
  174. {                                      will not be applied to the container itself. }
  175.  
  176. const
  177.   NO_INHERITANCE                          = $0; 
  178.   {$EXTERNALSYM NO_INHERITANCE}
  179.   SUB_OBJECTS_ONLY_INHERIT                = $1;
  180.   {$EXTERNALSYM SUB_OBJECTS_ONLY_INHERIT}
  181.   SUB_CONTAINERS_ONLY_INHERIT             = $2;
  182.   {$EXTERNALSYM SUB_CONTAINERS_ONLY_INHERIT}
  183.   SUB_CONTAINERS_AND_OBJECTS_INHERIT      = $3;
  184.   {$EXTERNALSYM SUB_CONTAINERS_AND_OBJECTS_INHERIT}
  185.   INHERIT_NO_PROPAGATE                    = $4;
  186.   {$EXTERNALSYM INHERIT_NO_PROPAGATE}
  187.   INHERIT_ONLY                            = $8;
  188.   {$EXTERNALSYM INHERIT_ONLY}
  189.  
  190. { Informational bit that is returned }
  191.  
  192.   INHERITED_ACCESS_ENTRY                  = $10; 
  193.   {$EXTERNALSYM INHERITED_ACCESS_ENTRY}
  194.  
  195. { Informational bit that tells where a node was inherited from.  Valid only }
  196. { for NT 5 APIs }
  197.  
  198.   INHERITED_PARENT                        = $10000000; 
  199.   {$EXTERNALSYM INHERITED_PARENT}
  200.   INHERITED_GRANDPARENT                   = $20000000;
  201.   {$EXTERNALSYM INHERITED_GRANDPARENT}
  202.  
  203. { Definition: }
  204. { This enumerated type defines the objects supported by the get/set API within }
  205. { this document.  See section 3.1, Object Types for a detailed definition of the }
  206. { supported object types, and their name formats. }
  207.  
  208. type
  209.   SE_OBJECT_TYPE = ( 
  210.     SE_UNKNOWN_OBJECT_TYPE,
  211.     SE_FILE_OBJECT,
  212.     SE_SERVICE,
  213.     SE_PRINTER,
  214.     SE_REGISTRY_KEY,
  215.     SE_LMSHARE,
  216.     SE_KERNEL_OBJECT,
  217.     SE_WINDOW_OBJECT,
  218.     SE_DS_OBJECT,
  219.     SE_DS_OBJECT_ALL,
  220.     SE_PROVIDER_DEFINED_OBJECT,
  221.     SE_WMIGUID_OBJECT
  222.   );
  223.   {$EXTERNALSYM SE_OBJECT_TYPE}
  224.  
  225. { Definition: EXPLICIT_ACCESS }
  226. { This structure is used to pass access control entry information into and out }
  227. { of the system using the API defined in this document. }
  228. { grfAccessPermissions - This contains the access permissions to assign for the }
  229. {                     trustee.  It is in the form of an NT access mask. }
  230. { grfAccessMode - This field defines how the permissions are to be applied for }
  231. {                 the trustee. }
  232. { grfInheritance - For containers, this field defines how the access control }
  233. {                  entry is/(is requested) to be inherited on }
  234. {                  objects/sub-containers created within the container. }
  235. { Trustee - This field contains the definition of the trustee account the }
  236. {           explicit access applies to. }
  237.  
  238.   PEXPLICIT_ACCESS_A = ^EXPLICIT_ACCESS_A;
  239.   {$EXTERNALSYM PEXPLICIT_ACCESS_A}
  240.   EXPLICIT_ACCESS_A = packed record
  241.     grfAccessPermissions: DWORD;
  242.     grfAccessMode: ACCESS_MODE;
  243.     grfInheritance: DWORD;
  244.     Trustee: TRUSTEE_A;
  245.   end;
  246.   {$EXTERNALSYM EXPLICIT_ACCESS_A}
  247.   PEXPLICIT_ACCESS_W = ^EXPLICIT_ACCESS_W;
  248.   {$EXTERNALSYM PEXPLICIT_ACCESS_W}
  249.   EXPLICIT_ACCESS_W = packed record
  250.     grfAccessPermissions: DWORD;
  251.     grfAccessMode: ACCESS_MODE;
  252.     grfInheritance: DWORD;
  253.     Trustee: TRUSTEE_W;
  254.   end;
  255.   {$EXTERNALSYM EXPLICIT_ACCESS_W}
  256.   PEXPLICIT_ACCESS_ = PEXPLICIT_ACCESS_A;
  257.   EXPLICIT_ACCESSA = EXPLICIT_ACCESS_A;
  258.   {$EXTERNALSYM EXPLICIT_ACCESSA}
  259.   EXPLICIT_ACCESSW = EXPLICIT_ACCESS_W;
  260.   {$EXTERNALSYM EXPLICIT_ACCESSW}
  261.   EXPLICIT_ACCESS = EXPLICIT_ACCESSA;
  262.   PEXPLICIT_ACCESSA = ^EXPLICIT_ACCESS_A;
  263.   {$EXTERNALSYM PEXPLICIT_ACCESSA}
  264.   PEXPLICIT_ACCESSW = ^EXPLICIT_ACCESS_W;
  265.   {$EXTERNALSYM PEXPLICIT_ACCESSW}
  266.   PEXPLICIT_ACCESS = PEXPLICIT_ACCESSA;
  267.  
  268. { ---------------------------------------------------------------------------- }
  269.  
  270. {                                  NT5 APIs }
  271.  
  272. { ---------------------------------------------------------------------------- }
  273.  
  274. { Default provider }
  275.  
  276. const
  277.   ACCCTRL_DEFAULT_PROVIDERA       = 'Windows NT Access Provider';
  278.   {$EXTERNALSYM ACCCTRL_DEFAULT_PROVIDERA}
  279.   ACCCTRL_DEFAULT_PROVIDERW       = 'Windows NT Access Provider';
  280.   {$EXTERNALSYM ACCCTRL_DEFAULT_PROVIDERW}
  281.   ACCCTRL_DEFAULT_PROVIDER = ACCCTRL_DEFAULT_PROVIDERA;
  282.  
  283. { / Access rights }
  284.  
  285. type
  286.   ACCESS_RIGHTS = ULONG; 
  287.   {$EXTERNALSYM ACCESS_RIGHTS}
  288.   PACCESS_RIGHTS = ^ACCESS_RIGHTS;
  289.   {$EXTERNALSYM PACCESS_RIGHTS}
  290.  
  291. { Inheritance flags }
  292.  
  293.   INHERIT_FLAGS = ULONG; 
  294.   {$EXTERNALSYM INHERIT_FLAGS}
  295.   PINHERIT_FLAGS = ^INHERIT_FLAGS;
  296.   {$EXTERNALSYM PINHERIT_FLAGS}
  297.  
  298. { Access / Audit structures }
  299.  
  300.   PACTRL_ACCESS_ENTRYA = ^ACTRL_ACCESS_ENTRYA;
  301.   {$EXTERNALSYM PACTRL_ACCESS_ENTRYA}
  302.   ACTRL_ACCESS_ENTRYA = packed record
  303.     Trustee: TRUSTEE_A;
  304.     fAccessFlags: ULONG;
  305.     Access: ACCESS_RIGHTS;
  306.     ProvSpecificAccess: ACCESS_RIGHTS;
  307.     Inheritance: INHERIT_FLAGS;
  308.     lpInheritProperty: PAnsiChar;
  309.   end;
  310.   {$EXTERNALSYM ACTRL_ACCESS_ENTRYA}
  311.   PACTRL_ACCESS_ENTRYW = ^ACTRL_ACCESS_ENTRYW;
  312.   {$EXTERNALSYM PACTRL_ACCESS_ENTRYW}
  313.   ACTRL_ACCESS_ENTRYW = packed record
  314.     Trustee: TRUSTEE_W;
  315.     fAccessFlags: ULONG;
  316.     Access: ACCESS_RIGHTS;
  317.     ProvSpecificAccess: ACCESS_RIGHTS;
  318.     Inheritance: INHERIT_FLAGS;
  319.     lpInheritProperty: PAnsiChar;
  320.   end;
  321.   {$EXTERNALSYM ACTRL_ACCESS_ENTRYW}
  322.   PACTRL_ACCESS_ENTRY = PACTRL_ACCESS_ENTRYA;
  323.  
  324.   PACTRL_ACCESS_ENTRY_LISTA = ^ACTRL_ACCESS_ENTRY_LISTA;
  325.   {$EXTERNALSYM PACTRL_ACCESS_ENTRY_LISTA}
  326.   ACTRL_ACCESS_ENTRY_LISTA = packed record
  327.     cEntries: ULONG;
  328.     pAccessList: ^ACTRL_ACCESS_ENTRYA;
  329.   end;
  330.   {$EXTERNALSYM ACTRL_ACCESS_ENTRY_LISTA}
  331.   PACTRL_ACCESS_ENTRY_LISTW = ^ACTRL_ACCESS_ENTRY_LISTW;
  332.   {$EXTERNALSYM PACTRL_ACCESS_ENTRY_LISTW}
  333.   ACTRL_ACCESS_ENTRY_LISTW = packed record
  334.     cEntries: ULONG;
  335.     pAccessList: ^ACTRL_ACCESS_ENTRYW;
  336.   end;
  337.   {$EXTERNALSYM ACTRL_ACCESS_ENTRY_LISTW}
  338.   PACTRL_ACCESS_ENTRY_LIST = PACTRL_ACCESS_ENTRY_LISTA;
  339.  
  340.   PACTRL_PROPERTY_ENTRYA = ^ACTRL_PROPERTY_ENTRYA;
  341.   {$EXTERNALSYM PACTRL_PROPERTY_ENTRYA}
  342.   ACTRL_PROPERTY_ENTRYA = packed record
  343.     lpProperty: PAnsiChar;
  344.     pAccessEntryList: PACTRL_ACCESS_ENTRY_LISTA;
  345.     fListFlags: ULONG;
  346.   end;
  347.   {$EXTERNALSYM ACTRL_PROPERTY_ENTRYA}
  348.   PACTRL_PROPERTY_ENTRYW = ^ACTRL_PROPERTY_ENTRYW;
  349.   {$EXTERNALSYM PACTRL_PROPERTY_ENTRYW}
  350.   ACTRL_PROPERTY_ENTRYW = packed record
  351.     lpProperty: PAnsiChar;
  352.     pAccessEntryList: PACTRL_ACCESS_ENTRY_LISTW;
  353.     fListFlags: ULONG;
  354.   end;
  355.   {$EXTERNALSYM ACTRL_PROPERTY_ENTRYW}
  356.   PACTRL_PROPERTY_ENTRY = PACTRL_PROPERTY_ENTRYA;
  357.  
  358.   PACTRL_ACCESSA = ^ACTRL_ACCESSA;
  359.   {$EXTERNALSYM PACTRL_ACCESSA}
  360.   ACTRL_ACCESSA = packed record
  361.     cEntries: ULONG;
  362.     pPropertyAccessList: PACTRL_PROPERTY_ENTRYA;
  363.   end;
  364.   {$EXTERNALSYM ACTRL_ACCESSA}
  365.   PACTRL_ACCESSW = ^ACTRL_ACCESSW;
  366.   {$EXTERNALSYM PACTRL_ACCESSW}
  367.   ACTRL_ACCESSW = packed record
  368.     cEntries: ULONG;
  369.     pPropertyAccessList: PACTRL_PROPERTY_ENTRYW;
  370.   end;
  371.   {$EXTERNALSYM ACTRL_ACCESSW}
  372.   PACTRL_ACCESS = PACTRL_ACCESSA;
  373.   PPACTRL_ACCESSA = ^PACTRL_ACCESSA;
  374.   {$EXTERNALSYM PPACTRL_ACCESSA}
  375.   PPACTRL_ACCESSW = ^PACTRL_ACCESSW;
  376.   {$EXTERNALSYM PPACTRL_ACCESSW}
  377.   PPACTRL_ACCESS = PPACTRL_ACCESSA;
  378.   ACTRL_AUDITA = ACTRL_ACCESSA;
  379.   {$EXTERNALSYM ACTRL_AUDITA}
  380.   ACTRL_AUDITW = ACTRL_ACCESSW;
  381.   {$EXTERNALSYM ACTRL_AUDITW}
  382.   ACTRL_AUDIT = ACTRL_AUDITA;
  383.   PACTRL_AUDITA = ^ACTRL_AUDITA;
  384.   {$EXTERNALSYM PACTRL_AUDITA}
  385.   PACTRL_AUDITW = ^ACTRL_AUDITW;
  386.   {$EXTERNALSYM PACTRL_AUDITW}
  387.   PACTRL_AUDIT = PACTRL_AUDITA;
  388.   PPACTRL_AUDITA = ^PACTRL_AUDITA;
  389.   {$EXTERNALSYM PPACTRL_AUDITA}
  390.   PPACTRL_AUDITW = ^PACTRL_AUDITW;
  391.   {$EXTERNALSYM PPACTRL_AUDITW}
  392.   PPACTRL_AUDIT = PPACTRL_AUDITA;
  393.  
  394. { TRUSTEE_ACCESS flags }
  395.  
  396. const
  397.   TRUSTEE_ACCESS_ALLOWED          = $00000001; 
  398.   {$EXTERNALSYM TRUSTEE_ACCESS_ALLOWED}
  399.   TRUSTEE_ACCESS_READ             = $00000002;
  400.   {$EXTERNALSYM TRUSTEE_ACCESS_READ}
  401.   TRUSTEE_ACCESS_WRITE            = $00000004;
  402.   {$EXTERNALSYM TRUSTEE_ACCESS_WRITE}
  403.  
  404.   TRUSTEE_ACCESS_EXPLICIT         = $00000001;
  405.   {$EXTERNALSYM TRUSTEE_ACCESS_EXPLICIT}
  406.   TRUSTEE_ACCESS_READ_WRITE       = TRUSTEE_ACCESS_READ or
  407.                                      TRUSTEE_ACCESS_WRITE;
  408.   {$EXTERNALSYM TRUSTEE_ACCESS_READ_WRITE}
  409.  
  410.   TRUSTEE_ACCESS_ALL              = $FFFFFFFF;
  411.   {$EXTERNALSYM TRUSTEE_ACCESS_ALL}
  412.  
  413. type
  414.   PTRUSTEE_ACCESSA = ^TRUSTEE_ACCESSA;
  415.   {$EXTERNALSYM PTRUSTEE_ACCESSA}
  416.   TRUSTEE_ACCESSA = packed record
  417.     lpProperty: PAnsiChar;
  418.     Access: ACCESS_RIGHTS;
  419.     fAccessFlags: ULONG;
  420.     fReturnedAccess: ULONG;
  421.   end;
  422.   {$EXTERNALSYM TRUSTEE_ACCESSA}
  423.   PTRUSTEE_ACCESSW = ^TRUSTEE_ACCESSW;
  424.   {$EXTERNALSYM PTRUSTEE_ACCESSW}
  425.   TRUSTEE_ACCESSW = packed record
  426.     lpProperty: PAnsiChar;
  427.     Access: ACCESS_RIGHTS;
  428.     fAccessFlags: ULONG;
  429.     fReturnedAccess: ULONG;
  430.   end;
  431.   {$EXTERNALSYM TRUSTEE_ACCESSW}
  432.   PTRUSTEE_ACCESS = PTRUSTEE_ACCESSA;
  433.  
  434. { Generic permission values }
  435.  
  436. const
  437.   ACTRL_RESERVED              = $00000000;
  438.   {$EXTERNALSYM ACTRL_RESERVED}
  439.   ACTRL_PERM_1                = $00000001;
  440.   {$EXTERNALSYM ACTRL_PERM_1}
  441.   ACTRL_PERM_2                = $00000002;
  442.   {$EXTERNALSYM ACTRL_PERM_2}
  443.   ACTRL_PERM_3                = $00000004;
  444.   {$EXTERNALSYM ACTRL_PERM_3}
  445.   ACTRL_PERM_4                = $00000008;
  446.   {$EXTERNALSYM ACTRL_PERM_4}
  447.   ACTRL_PERM_5                = $00000010;
  448.   {$EXTERNALSYM ACTRL_PERM_5}
  449.   ACTRL_PERM_6                = $00000020;
  450.   {$EXTERNALSYM ACTRL_PERM_6}
  451.   ACTRL_PERM_7                = $00000040;
  452.   {$EXTERNALSYM ACTRL_PERM_7}
  453.   ACTRL_PERM_8                = $00000080;
  454.   {$EXTERNALSYM ACTRL_PERM_8}
  455.   ACTRL_PERM_9                = $00000100;
  456.   {$EXTERNALSYM ACTRL_PERM_9}
  457.   ACTRL_PERM_10               = $00000200;
  458.   {$EXTERNALSYM ACTRL_PERM_10}
  459.   ACTRL_PERM_11               = $00000400;
  460.   {$EXTERNALSYM ACTRL_PERM_11}
  461.   ACTRL_PERM_12               = $00000800;
  462.   {$EXTERNALSYM ACTRL_PERM_12}
  463.   ACTRL_PERM_13               = $00001000;
  464.   {$EXTERNALSYM ACTRL_PERM_13}
  465.   ACTRL_PERM_14               = $00002000;
  466.   {$EXTERNALSYM ACTRL_PERM_14}
  467.   ACTRL_PERM_15               = $00004000;
  468.   {$EXTERNALSYM ACTRL_PERM_15}
  469.   ACTRL_PERM_16               = $00008000;
  470.   {$EXTERNALSYM ACTRL_PERM_16}
  471.   ACTRL_PERM_17               = $00010000;
  472.   {$EXTERNALSYM ACTRL_PERM_17}
  473.   ACTRL_PERM_18               = $00020000;
  474.   {$EXTERNALSYM ACTRL_PERM_18}
  475.   ACTRL_PERM_19               = $00040000;
  476.   {$EXTERNALSYM ACTRL_PERM_19}
  477.   ACTRL_PERM_20               = $00080000;
  478.   {$EXTERNALSYM ACTRL_PERM_20}
  479.  
  480. { Access permissions }
  481.  
  482.   ACTRL_ACCESS_ALLOWED            = $00000001;
  483.   {$EXTERNALSYM ACTRL_ACCESS_ALLOWED}
  484.   ACTRL_ACCESS_DENIED             = $00000002;
  485.   {$EXTERNALSYM ACTRL_ACCESS_DENIED}
  486.   ACTRL_AUDIT_SUCCESS             = $00000004;
  487.   {$EXTERNALSYM ACTRL_AUDIT_SUCCESS}
  488.   ACTRL_AUDIT_FAILURE             = $00000008;
  489.   {$EXTERNALSYM ACTRL_AUDIT_FAILURE}
  490.  
  491. { Property list flags }
  492.  
  493.   ACTRL_ACCESS_PROTECTED          = $00000001;
  494.   {$EXTERNALSYM ACTRL_ACCESS_PROTECTED}
  495.  
  496. { Standard and object rights }
  497.  
  498.   ACTRL_SYSTEM_ACCESS             = $04000000;
  499.   {$EXTERNALSYM ACTRL_SYSTEM_ACCESS}
  500.   ACTRL_DELETE                    = $08000000;
  501.   {$EXTERNALSYM ACTRL_DELETE}
  502.   ACTRL_READ_CONTROL              = $10000000;
  503.   {$EXTERNALSYM ACTRL_READ_CONTROL}
  504.   ACTRL_CHANGE_ACCESS             = $20000000;
  505.   {$EXTERNALSYM ACTRL_CHANGE_ACCESS}
  506.   ACTRL_CHANGE_OWNER              = $40000000;
  507.   {$EXTERNALSYM ACTRL_CHANGE_OWNER}
  508.   ACTRL_SYNCHRONIZE               = $80000000;
  509.   {$EXTERNALSYM ACTRL_SYNCHRONIZE}
  510.   ACTRL_STD_RIGHTS_ALL            = $f8000000;
  511.   {$EXTERNALSYM ACTRL_STD_RIGHTS_ALL}
  512.   ACTRL_STD_RIGHT_REQUIRED        =  ACTRL_STD_RIGHTS_ALL and not ACTRL_SYNCHRONIZE;
  513.   {$EXTERNALSYM ACTRL_STD_RIGHT_REQUIRED}
  514.  
  515.   ACTRL_DS_OPEN                               = ACTRL_RESERVED;
  516.   {$EXTERNALSYM ACTRL_DS_OPEN}
  517.   ACTRL_DS_CREATE_CHILD                       = ACTRL_PERM_1;
  518.   {$EXTERNALSYM ACTRL_DS_CREATE_CHILD}
  519.   ACTRL_DS_DELETE_CHILD                       = ACTRL_PERM_2;
  520.   {$EXTERNALSYM ACTRL_DS_DELETE_CHILD}
  521.   ACTRL_DS_LIST                               = ACTRL_PERM_3;
  522.   {$EXTERNALSYM ACTRL_DS_LIST}
  523.   ACTRL_DS_SELF                               = ACTRL_PERM_4;
  524.   {$EXTERNALSYM ACTRL_DS_SELF}
  525.   ACTRL_DS_READ_PROP                          = ACTRL_PERM_5;
  526.   {$EXTERNALSYM ACTRL_DS_READ_PROP}
  527.   ACTRL_DS_WRITE_PROP                         = ACTRL_PERM_6;
  528.   {$EXTERNALSYM ACTRL_DS_WRITE_PROP}
  529.   ACTRL_DS_DELETE_TREE                        = ACTRL_PERM_7;
  530.   {$EXTERNALSYM ACTRL_DS_DELETE_TREE}
  531.   ACTRL_DS_LIST_OBJECT                        = ACTRL_PERM_8;
  532.   {$EXTERNALSYM ACTRL_DS_LIST_OBJECT}
  533.   ACTRL_DS_CONTROL_ACCESS                     = ACTRL_PERM_9;
  534.   {$EXTERNALSYM ACTRL_DS_CONTROL_ACCESS}
  535.  
  536.   ACTRL_FILE_READ                             = ACTRL_PERM_1; 
  537.   {$EXTERNALSYM ACTRL_FILE_READ}
  538.   ACTRL_FILE_WRITE                            = ACTRL_PERM_2;
  539.   {$EXTERNALSYM ACTRL_FILE_WRITE}
  540.   ACTRL_FILE_APPEND                           = ACTRL_PERM_3;
  541.   {$EXTERNALSYM ACTRL_FILE_APPEND}
  542.   ACTRL_FILE_READ_PROP                        = ACTRL_PERM_4;
  543.   {$EXTERNALSYM ACTRL_FILE_READ_PROP}
  544.   ACTRL_FILE_WRITE_PROP                       = ACTRL_PERM_5;
  545.   {$EXTERNALSYM ACTRL_FILE_WRITE_PROP}
  546.   ACTRL_FILE_EXECUTE                          = ACTRL_PERM_6;
  547.   {$EXTERNALSYM ACTRL_FILE_EXECUTE}
  548.   ACTRL_FILE_READ_ATTRIB                      = ACTRL_PERM_8;
  549.   {$EXTERNALSYM ACTRL_FILE_READ_ATTRIB}
  550.   ACTRL_FILE_WRITE_ATTRIB                     = ACTRL_PERM_9;
  551.   {$EXTERNALSYM ACTRL_FILE_WRITE_ATTRIB}
  552.   ACTRL_FILE_CREATE_PIPE                      = ACTRL_PERM_10;
  553.   {$EXTERNALSYM ACTRL_FILE_CREATE_PIPE}
  554.   ACTRL_DIR_LIST                              = ACTRL_PERM_1;
  555.   {$EXTERNALSYM ACTRL_DIR_LIST}
  556.   ACTRL_DIR_CREATE_OBJECT                     = ACTRL_PERM_2;
  557.   {$EXTERNALSYM ACTRL_DIR_CREATE_OBJECT}
  558.   ACTRL_DIR_CREATE_CHILD                      = ACTRL_PERM_3;
  559.   {$EXTERNALSYM ACTRL_DIR_CREATE_CHILD}
  560.   ACTRL_DIR_DELETE_CHILD                      = ACTRL_PERM_7;
  561.   {$EXTERNALSYM ACTRL_DIR_DELETE_CHILD}
  562.   ACTRL_DIR_TRAVERSE                          = ACTRL_PERM_6;
  563.   {$EXTERNALSYM ACTRL_DIR_TRAVERSE}
  564.   ACTRL_KERNEL_TERMINATE                      = ACTRL_PERM_1;
  565.   {$EXTERNALSYM ACTRL_KERNEL_TERMINATE}
  566.   ACTRL_KERNEL_THREAD                         = ACTRL_PERM_2;
  567.   {$EXTERNALSYM ACTRL_KERNEL_THREAD}
  568.   ACTRL_KERNEL_VM                             = ACTRL_PERM_3;
  569.   {$EXTERNALSYM ACTRL_KERNEL_VM}
  570.   ACTRL_KERNEL_VM_READ                        = ACTRL_PERM_4;
  571.   {$EXTERNALSYM ACTRL_KERNEL_VM_READ}
  572.   ACTRL_KERNEL_VM_WRITE                       = ACTRL_PERM_5;
  573.   {$EXTERNALSYM ACTRL_KERNEL_VM_WRITE}
  574.   ACTRL_KERNEL_DUP_HANDLE                     = ACTRL_PERM_6;
  575.   {$EXTERNALSYM ACTRL_KERNEL_DUP_HANDLE}
  576.   ACTRL_KERNEL_PROCESS                        = ACTRL_PERM_7;
  577.   {$EXTERNALSYM ACTRL_KERNEL_PROCESS}
  578.   ACTRL_KERNEL_SET_INFO                       = ACTRL_PERM_8;
  579.   {$EXTERNALSYM ACTRL_KERNEL_SET_INFO}
  580.   ACTRL_KERNEL_GET_INFO                       = ACTRL_PERM_9;
  581.   {$EXTERNALSYM ACTRL_KERNEL_GET_INFO}
  582.   ACTRL_KERNEL_CONTROL                        = ACTRL_PERM_10;
  583.   {$EXTERNALSYM ACTRL_KERNEL_CONTROL}
  584.   ACTRL_KERNEL_ALERT                          = ACTRL_PERM_11;
  585.   {$EXTERNALSYM ACTRL_KERNEL_ALERT}
  586.   ACTRL_KERNEL_GET_CONTEXT                    = ACTRL_PERM_12;
  587.   {$EXTERNALSYM ACTRL_KERNEL_GET_CONTEXT}
  588.   ACTRL_KERNEL_SET_CONTEXT                    = ACTRL_PERM_13;
  589.   {$EXTERNALSYM ACTRL_KERNEL_SET_CONTEXT}
  590.   ACTRL_KERNEL_TOKEN                          = ACTRL_PERM_14;
  591.   {$EXTERNALSYM ACTRL_KERNEL_TOKEN}
  592.   ACTRL_KERNEL_IMPERSONATE                    = ACTRL_PERM_15;
  593.   {$EXTERNALSYM ACTRL_KERNEL_IMPERSONATE}
  594.   ACTRL_KERNEL_DIMPERSONATE                   = ACTRL_PERM_16;
  595.   {$EXTERNALSYM ACTRL_KERNEL_DIMPERSONATE}
  596.   ACTRL_PRINT_SADMIN                          = ACTRL_PERM_1;
  597.   {$EXTERNALSYM ACTRL_PRINT_SADMIN}
  598.   ACTRL_PRINT_SLIST                           = ACTRL_PERM_2;
  599.   {$EXTERNALSYM ACTRL_PRINT_SLIST}
  600.   ACTRL_PRINT_PADMIN                          = ACTRL_PERM_3;
  601.   {$EXTERNALSYM ACTRL_PRINT_PADMIN}
  602.   ACTRL_PRINT_PUSE                            = ACTRL_PERM_4;
  603.   {$EXTERNALSYM ACTRL_PRINT_PUSE}
  604.   ACTRL_PRINT_JADMIN                          = ACTRL_PERM_5;
  605.   {$EXTERNALSYM ACTRL_PRINT_JADMIN}
  606.   ACTRL_SVC_GET_INFO                          = ACTRL_PERM_1;
  607.   {$EXTERNALSYM ACTRL_SVC_GET_INFO}
  608.   ACTRL_SVC_SET_INFO                          = ACTRL_PERM_2;
  609.   {$EXTERNALSYM ACTRL_SVC_SET_INFO}
  610.   ACTRL_SVC_STATUS                            = ACTRL_PERM_3;
  611.   {$EXTERNALSYM ACTRL_SVC_STATUS}
  612.   ACTRL_SVC_LIST                              = ACTRL_PERM_4;
  613.   {$EXTERNALSYM ACTRL_SVC_LIST}
  614.   ACTRL_SVC_START                             = ACTRL_PERM_5;
  615.   {$EXTERNALSYM ACTRL_SVC_START}
  616.   ACTRL_SVC_STOP                              = ACTRL_PERM_6;
  617.   {$EXTERNALSYM ACTRL_SVC_STOP}
  618.   ACTRL_SVC_PAUSE                             = ACTRL_PERM_7;
  619.   {$EXTERNALSYM ACTRL_SVC_PAUSE}
  620.   ACTRL_SVC_INTERROGATE                       = ACTRL_PERM_8;
  621.   {$EXTERNALSYM ACTRL_SVC_INTERROGATE}
  622.   ACTRL_SVC_UCONTROL                          = ACTRL_PERM_9;
  623.   {$EXTERNALSYM ACTRL_SVC_UCONTROL}
  624.   ACTRL_REG_QUERY                             = ACTRL_PERM_1;
  625.   {$EXTERNALSYM ACTRL_REG_QUERY}
  626.   ACTRL_REG_SET                               = ACTRL_PERM_2;
  627.   {$EXTERNALSYM ACTRL_REG_SET}
  628.   ACTRL_REG_CREATE_CHILD                      = ACTRL_PERM_3;
  629.   {$EXTERNALSYM ACTRL_REG_CREATE_CHILD}
  630.   ACTRL_REG_LIST                              = ACTRL_PERM_4;
  631.   {$EXTERNALSYM ACTRL_REG_LIST}
  632.   ACTRL_REG_NOTIFY                            = ACTRL_PERM_5;
  633.   {$EXTERNALSYM ACTRL_REG_NOTIFY}
  634.   ACTRL_REG_LINK                              = ACTRL_PERM_6;
  635.   {$EXTERNALSYM ACTRL_REG_LINK}
  636.   ACTRL_WIN_CLIPBRD                           = ACTRL_PERM_1;
  637.   {$EXTERNALSYM ACTRL_WIN_CLIPBRD}
  638.   ACTRL_WIN_GLOBAL_ATOMS                      = ACTRL_PERM_2;
  639.   {$EXTERNALSYM ACTRL_WIN_GLOBAL_ATOMS}
  640.   ACTRL_WIN_CREATE                            = ACTRL_PERM_3;
  641.   {$EXTERNALSYM ACTRL_WIN_CREATE}
  642.   ACTRL_WIN_LIST_DESK                         = ACTRL_PERM_4;
  643.   {$EXTERNALSYM ACTRL_WIN_LIST_DESK}
  644.   ACTRL_WIN_LIST                              = ACTRL_PERM_5;
  645.   {$EXTERNALSYM ACTRL_WIN_LIST}
  646.   ACTRL_WIN_READ_ATTRIBS                      = ACTRL_PERM_6;
  647.   {$EXTERNALSYM ACTRL_WIN_READ_ATTRIBS}
  648.   ACTRL_WIN_WRITE_ATTRIBS                     = ACTRL_PERM_7;
  649.   {$EXTERNALSYM ACTRL_WIN_WRITE_ATTRIBS}
  650.   ACTRL_WIN_SCREEN                            = ACTRL_PERM_8;
  651.   {$EXTERNALSYM ACTRL_WIN_SCREEN}
  652.   ACTRL_WIN_EXIT                              = ACTRL_PERM_9;
  653.   {$EXTERNALSYM ACTRL_WIN_EXIT}
  654.  
  655. type
  656.   PACTRL_OVERLAPPED = ^ACTRL_OVERLAPPED;
  657.   {$EXTERNALSYM PACTRL_OVERLAPPED}
  658.   ACTRL_OVERLAPPED = packed record
  659.     case Integer of
  660.       0: (Provider: Pointer; Rsrvd2: ULONG; hEvnt: THandle);
  661.       1: (Reserved1: ULONG; Reserved2: ULONG; hEvent: THandle);
  662.   end;
  663.   {$EXTERNALSYM ACTRL_OVERLAPPED}
  664.  
  665.   PACTRL_ACCESS_INFOA = ^ACTRL_ACCESS_INFOA;
  666.   {$EXTERNALSYM PACTRL_ACCESS_INFOA}
  667.   ACTRL_ACCESS_INFOA = packed record
  668.     fAccessPermission: ULONG;
  669.     lpAccessPermissionName: PAnsiChar;
  670.   end;
  671.   {$EXTERNALSYM ACTRL_ACCESS_INFOA}
  672.   PACTRL_ACCESS_INFOW = ^ACTRL_ACCESS_INFOW;
  673.   {$EXTERNALSYM PACTRL_ACCESS_INFOW}
  674.   ACTRL_ACCESS_INFOW = packed record
  675.     fAccessPermission: ULONG;
  676.     lpAccessPermissionName: PAnsiChar;
  677.   end;
  678.   {$EXTERNALSYM ACTRL_ACCESS_INFOW}
  679.   PACTRL_ACCESS_INFO = PACTRL_ACCESS_INFOA;
  680.   PPACTRL_ACCESS_INFOA = ^PACTRL_ACCESS_INFOA;
  681.   {$EXTERNALSYM PPACTRL_ACCESS_INFOA}
  682.   PPACTRL_ACCESS_INFOW = ^PACTRL_ACCESS_INFOW;
  683.   {$EXTERNALSYM PPACTRL_ACCESS_INFOW}
  684.   PPACTRL_ACCESS_INFO = PPACTRL_ACCESS_INFOA;
  685.  
  686.   PACTRL_CONTROL_INFOA = ^ACTRL_CONTROL_INFOA;
  687.   {$EXTERNALSYM PACTRL_CONTROL_INFOA}
  688.   ACTRL_CONTROL_INFOA = packed record
  689.     lpControlId: PAnsiChar;
  690.     lpControlName: PAnsiChar;
  691.   end;
  692.   {$EXTERNALSYM ACTRL_CONTROL_INFOA}
  693.   PACTRL_CONTROL_INFOW = ^ACTRL_CONTROL_INFOW;
  694.   {$EXTERNALSYM PACTRL_CONTROL_INFOW}
  695.   ACTRL_CONTROL_INFOW = packed record
  696.     lpControlId: PAnsiChar;
  697.     lpControlName: PAnsiChar;
  698.   end;
  699.   {$EXTERNALSYM ACTRL_CONTROL_INFOW}
  700.   PACTRL_CONTROL_INFO = PACTRL_CONTROL_INFOA;
  701.   PPACTRL_CONTROL_INFOA = ^PACTRL_CONTROL_INFOA;
  702.   {$EXTERNALSYM PPACTRL_CONTROL_INFOA}
  703.   PPACTRL_CONTROL_INFOW = ^PACTRL_CONTROL_INFOW;
  704.   {$EXTERNALSYM PPACTRL_CONTROL_INFOW}
  705.   PPACTRL_CONTROL_INFO = PPACTRL_CONTROL_INFOA;
  706. const
  707.   ACTRL_ACCESS_NO_OPTIONS                     = $00000000; 
  708.   {$EXTERNALSYM ACTRL_ACCESS_NO_OPTIONS}
  709.   ACTRL_ACCESS_SUPPORTS_OBJECT_ENTRIES        = $00000001;
  710.   {$EXTERNALSYM ACTRL_ACCESS_SUPPORTS_OBJECT_ENTRIES}
  711.  
  712. implementation
  713.  
  714. end.
  715.