"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.09.0-win64/inc/win/accctrl.bi" (1 Jan 2022, 18374 Bytes) of package /windows/misc/FreeBASIC-1.09.0-win64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' FreeBASIC binding for mingw-w64-v4.0.4
    2 ''
    3 '' based on the C header files:
    4 ''   This Software is provided under the Zope Public License (ZPL) Version 2.1.
    5 ''
    6 ''   Copyright (c) 2009, 2010 by the mingw-w64 project
    7 ''
    8 ''   See the AUTHORS file for the list of contributors to the mingw-w64 project.
    9 ''
   10 ''   This license has been certified as open source. It has also been designated
   11 ''   as GPL compatible by the Free Software Foundation (FSF).
   12 ''
   13 ''   Redistribution and use in source and binary forms, with or without
   14 ''   modification, are permitted provided that the following conditions are met:
   15 ''
   16 ''     1. Redistributions in source code must retain the accompanying copyright
   17 ''        notice, this list of conditions, and the following disclaimer.
   18 ''     2. Redistributions in binary form must reproduce the accompanying
   19 ''        copyright notice, this list of conditions, and the following disclaimer
   20 ''        in the documentation and/or other materials provided with the
   21 ''        distribution.
   22 ''     3. Names of the copyright holders must not be used to endorse or promote
   23 ''        products derived from this software without prior written permission
   24 ''        from the copyright holders.
   25 ''     4. The right to distribute this software or to use it for any purpose does
   26 ''        not give you the right to use Servicemarks (sm) or Trademarks (tm) of
   27 ''        the copyright holders.  Use of them is covered by separate agreement
   28 ''        with the copyright holders.
   29 ''     5. If any files are modified, you must cause the modified files to carry
   30 ''        prominent notices stating that you changed the files and the date of
   31 ''        any change.
   32 ''
   33 ''   Disclaimer
   34 ''
   35 ''   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED
   36 ''   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   37 ''   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
   38 ''   EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
   39 ''   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   40 ''   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
   41 ''   OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   42 ''   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   43 ''   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
   44 ''   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   45 ''
   46 '' translated to FreeBASIC by:
   47 ''   Copyright © 2015 FreeBASIC development team
   48 
   49 #pragma once
   50 
   51 #include once "_mingw_unicode.bi"
   52 #include once "wtypes.bi"
   53 #include once "winapifamily.bi"
   54 
   55 #ifdef __FB_64BIT__
   56     extern "C"
   57 #else
   58     extern "Windows"
   59 #endif
   60 
   61 #define __ACCESS_CONTROL__
   62 declare function AccFree alias "LocalFree"(byval hMem as HLOCAL) as HLOCAL
   63 
   64 type _SE_OBJECT_TYPE as long
   65 enum
   66     SE_UNKNOWN_OBJECT_TYPE = 0
   67     SE_FILE_OBJECT
   68     SE_SERVICE
   69     SE_PRINTER
   70     SE_REGISTRY_KEY
   71     SE_LMSHARE
   72     SE_KERNEL_OBJECT
   73     SE_WINDOW_OBJECT
   74     SE_DS_OBJECT
   75     SE_DS_OBJECT_ALL
   76     SE_PROVIDER_DEFINED_OBJECT
   77     SE_WMIGUID_OBJECT
   78     SE_REGISTRY_WOW64_32KEY
   79 end enum
   80 
   81 type SE_OBJECT_TYPE as _SE_OBJECT_TYPE
   82 
   83 type _TRUSTEE_TYPE as long
   84 enum
   85     TRUSTEE_IS_UNKNOWN
   86     TRUSTEE_IS_USER
   87     TRUSTEE_IS_GROUP
   88     TRUSTEE_IS_DOMAIN
   89     TRUSTEE_IS_ALIAS
   90     TRUSTEE_IS_WELL_KNOWN_GROUP
   91     TRUSTEE_IS_DELETED
   92     TRUSTEE_IS_INVALID
   93     TRUSTEE_IS_COMPUTER
   94 end enum
   95 
   96 type TRUSTEE_TYPE as _TRUSTEE_TYPE
   97 
   98 type _TRUSTEE_FORM as long
   99 enum
  100     TRUSTEE_IS_SID
  101     TRUSTEE_IS_NAME
  102     TRUSTEE_BAD_FORM
  103     TRUSTEE_IS_OBJECTS_AND_SID
  104     TRUSTEE_IS_OBJECTS_AND_NAME
  105 end enum
  106 
  107 type TRUSTEE_FORM as _TRUSTEE_FORM
  108 
  109 type _MULTIPLE_TRUSTEE_OPERATION as long
  110 enum
  111     NO_MULTIPLE_TRUSTEE
  112     TRUSTEE_IS_IMPERSONATE
  113 end enum
  114 
  115 type MULTIPLE_TRUSTEE_OPERATION as _MULTIPLE_TRUSTEE_OPERATION
  116 
  117 type _OBJECTS_AND_SID
  118     ObjectsPresent as DWORD
  119     ObjectTypeGuid as GUID
  120     InheritedObjectTypeGuid as GUID
  121     pSid as SID ptr
  122 end type
  123 
  124 type OBJECTS_AND_SID as _OBJECTS_AND_SID
  125 type POBJECTS_AND_SID as _OBJECTS_AND_SID ptr
  126 
  127 type _OBJECTS_AND_NAME_A
  128     ObjectsPresent as DWORD
  129     ObjectType as SE_OBJECT_TYPE
  130     ObjectTypeName as LPSTR
  131     InheritedObjectTypeName as LPSTR
  132     ptstrName as LPSTR
  133 end type
  134 
  135 type OBJECTS_AND_NAME_A as _OBJECTS_AND_NAME_A
  136 type POBJECTS_AND_NAME_A as _OBJECTS_AND_NAME_A ptr
  137 
  138 type _OBJECTS_AND_NAME_W
  139     ObjectsPresent as DWORD
  140     ObjectType as SE_OBJECT_TYPE
  141     ObjectTypeName as LPWSTR
  142     InheritedObjectTypeName as LPWSTR
  143     ptstrName as LPWSTR
  144 end type
  145 
  146 type OBJECTS_AND_NAME_W as _OBJECTS_AND_NAME_W
  147 type POBJECTS_AND_NAME_W as _OBJECTS_AND_NAME_W ptr
  148 
  149 #ifdef UNICODE
  150     type OBJECTS_AND_NAME_ as OBJECTS_AND_NAME_W
  151     type POBJECTS_AND_NAME_ as POBJECTS_AND_NAME_W
  152 #else
  153     type OBJECTS_AND_NAME_ as OBJECTS_AND_NAME_A
  154     type POBJECTS_AND_NAME_ as POBJECTS_AND_NAME_A
  155 #endif
  156 
  157 type _TRUSTEE_A
  158     pMultipleTrustee as _TRUSTEE_A ptr
  159     MultipleTrusteeOperation as MULTIPLE_TRUSTEE_OPERATION
  160     TrusteeForm as TRUSTEE_FORM
  161     TrusteeType as TRUSTEE_TYPE
  162     ptstrName as LPSTR
  163 end type
  164 
  165 type TRUSTEE_A as _TRUSTEE_A
  166 type PTRUSTEE_A as _TRUSTEE_A ptr
  167 type TRUSTEEA as _TRUSTEE_A
  168 type PTRUSTEEA as _TRUSTEE_A ptr
  169 
  170 type _TRUSTEE_W
  171     pMultipleTrustee as _TRUSTEE_W ptr
  172     MultipleTrusteeOperation as MULTIPLE_TRUSTEE_OPERATION
  173     TrusteeForm as TRUSTEE_FORM
  174     TrusteeType as TRUSTEE_TYPE
  175     ptstrName as LPWSTR
  176 end type
  177 
  178 type TRUSTEE_W as _TRUSTEE_W
  179 type PTRUSTEE_W as _TRUSTEE_W ptr
  180 type TRUSTEEW as _TRUSTEE_W
  181 type PTRUSTEEW as _TRUSTEE_W ptr
  182 
  183 #ifdef UNICODE
  184     type TRUSTEE_ as TRUSTEE_W
  185     type PTRUSTEE_ as PTRUSTEE_W
  186     type TRUSTEE as TRUSTEEW
  187     type PTRUSTEE as PTRUSTEEW
  188 #else
  189     type TRUSTEE_ as TRUSTEE_A
  190     type PTRUSTEE_ as PTRUSTEE_A
  191     type TRUSTEE as TRUSTEEA
  192     type PTRUSTEE as PTRUSTEEA
  193 #endif
  194 
  195 type _ACCESS_MODE as long
  196 enum
  197     NOT_USED_ACCESS = 0
  198     GRANT_ACCESS
  199     SET_ACCESS
  200     DENY_ACCESS
  201     REVOKE_ACCESS
  202     SET_AUDIT_SUCCESS
  203     SET_AUDIT_FAILURE
  204 end enum
  205 
  206 type ACCESS_MODE as _ACCESS_MODE
  207 const NO_INHERITANCE = &h0
  208 const SUB_OBJECTS_ONLY_INHERIT = &h1
  209 const SUB_CONTAINERS_ONLY_INHERIT = &h2
  210 const SUB_CONTAINERS_AND_OBJECTS_INHERIT = &h3
  211 const INHERIT_NO_PROPAGATE = &h4
  212 const INHERIT_ONLY = &h8
  213 const INHERITED_ACCESS_ENTRY = &h10
  214 const INHERITED_PARENT = &h10000000
  215 const INHERITED_GRANDPARENT = &h20000000
  216 
  217 type _EXPLICIT_ACCESS_A
  218     grfAccessPermissions as DWORD
  219     grfAccessMode as ACCESS_MODE
  220     grfInheritance as DWORD
  221     Trustee as TRUSTEE_A
  222 end type
  223 
  224 type EXPLICIT_ACCESS_A as _EXPLICIT_ACCESS_A
  225 type PEXPLICIT_ACCESS_A as _EXPLICIT_ACCESS_A ptr
  226 type EXPLICIT_ACCESSA as _EXPLICIT_ACCESS_A
  227 type PEXPLICIT_ACCESSA as _EXPLICIT_ACCESS_A ptr
  228 
  229 type _EXPLICIT_ACCESS_W
  230     grfAccessPermissions as DWORD
  231     grfAccessMode as ACCESS_MODE
  232     grfInheritance as DWORD
  233     Trustee as TRUSTEE_W
  234 end type
  235 
  236 type EXPLICIT_ACCESS_W as _EXPLICIT_ACCESS_W
  237 type PEXPLICIT_ACCESS_W as _EXPLICIT_ACCESS_W ptr
  238 type EXPLICIT_ACCESSW as _EXPLICIT_ACCESS_W
  239 type PEXPLICIT_ACCESSW as _EXPLICIT_ACCESS_W ptr
  240 
  241 #ifdef UNICODE
  242     type EXPLICIT_ACCESS_ as EXPLICIT_ACCESS_W
  243     type PEXPLICIT_ACCESS_ as PEXPLICIT_ACCESS_W
  244     type EXPLICIT_ACCESS as EXPLICIT_ACCESSW
  245     type PEXPLICIT_ACCESS as PEXPLICIT_ACCESSW
  246 #else
  247     type EXPLICIT_ACCESS_ as EXPLICIT_ACCESS_A
  248     type PEXPLICIT_ACCESS_ as PEXPLICIT_ACCESS_A
  249     type EXPLICIT_ACCESS as EXPLICIT_ACCESSA
  250     type PEXPLICIT_ACCESS as PEXPLICIT_ACCESSA
  251 #endif
  252 
  253 #define ACCCTRL_DEFAULT_PROVIDERA "Windows NT Access Provider"
  254 #define ACCCTRL_DEFAULT_PROVIDERW wstr("Windows NT Access Provider")
  255 
  256 #ifdef UNICODE
  257     #define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERW
  258 #else
  259     #define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERA
  260 #endif
  261 
  262 type ACCESS_RIGHTS as ULONG
  263 type PACCESS_RIGHTS as ULONG ptr
  264 type INHERIT_FLAGS as ULONG
  265 type PINHERIT_FLAGS as ULONG ptr
  266 
  267 type _ACTRL_ACCESS_ENTRYA
  268     Trustee as TRUSTEE_A
  269     fAccessFlags as ULONG
  270     Access as ACCESS_RIGHTS
  271     ProvSpecificAccess as ACCESS_RIGHTS
  272     Inheritance as INHERIT_FLAGS
  273     lpInheritProperty as LPSTR
  274 end type
  275 
  276 type ACTRL_ACCESS_ENTRYA as _ACTRL_ACCESS_ENTRYA
  277 type PACTRL_ACCESS_ENTRYA as _ACTRL_ACCESS_ENTRYA ptr
  278 
  279 type _ACTRL_ACCESS_ENTRYW
  280     Trustee as TRUSTEE_W
  281     fAccessFlags as ULONG
  282     Access as ACCESS_RIGHTS
  283     ProvSpecificAccess as ACCESS_RIGHTS
  284     Inheritance as INHERIT_FLAGS
  285     lpInheritProperty as LPWSTR
  286 end type
  287 
  288 type ACTRL_ACCESS_ENTRYW as _ACTRL_ACCESS_ENTRYW
  289 type PACTRL_ACCESS_ENTRYW as _ACTRL_ACCESS_ENTRYW ptr
  290 
  291 #ifdef UNICODE
  292     type ACTRL_ACCESS_ENTRY as ACTRL_ACCESS_ENTRYW
  293     type PACTRL_ACCESS_ENTRY as PACTRL_ACCESS_ENTRYW
  294 #else
  295     type ACTRL_ACCESS_ENTRY as ACTRL_ACCESS_ENTRYA
  296     type PACTRL_ACCESS_ENTRY as PACTRL_ACCESS_ENTRYA
  297 #endif
  298 
  299 type _ACTRL_ACCESS_ENTRY_LISTA
  300     cEntries as ULONG
  301     pAccessList as ACTRL_ACCESS_ENTRYA ptr
  302 end type
  303 
  304 type ACTRL_ACCESS_ENTRY_LISTA as _ACTRL_ACCESS_ENTRY_LISTA
  305 type PACTRL_ACCESS_ENTRY_LISTA as _ACTRL_ACCESS_ENTRY_LISTA ptr
  306 
  307 type _ACTRL_ACCESS_ENTRY_LISTW
  308     cEntries as ULONG
  309     pAccessList as ACTRL_ACCESS_ENTRYW ptr
  310 end type
  311 
  312 type ACTRL_ACCESS_ENTRY_LISTW as _ACTRL_ACCESS_ENTRY_LISTW
  313 type PACTRL_ACCESS_ENTRY_LISTW as _ACTRL_ACCESS_ENTRY_LISTW ptr
  314 
  315 #ifdef UNICODE
  316     type ACTRL_ACCESS_ENTRY_LIST as ACTRL_ACCESS_ENTRY_LISTW
  317     type PACTRL_ACCESS_ENTRY_LIST as PACTRL_ACCESS_ENTRY_LISTW
  318 #else
  319     type ACTRL_ACCESS_ENTRY_LIST as ACTRL_ACCESS_ENTRY_LISTA
  320     type PACTRL_ACCESS_ENTRY_LIST as PACTRL_ACCESS_ENTRY_LISTA
  321 #endif
  322 
  323 type _ACTRL_PROPERTY_ENTRYA
  324     lpProperty as LPSTR
  325     pAccessEntryList as PACTRL_ACCESS_ENTRY_LISTA
  326     fListFlags as ULONG
  327 end type
  328 
  329 type ACTRL_PROPERTY_ENTRYA as _ACTRL_PROPERTY_ENTRYA
  330 type PACTRL_PROPERTY_ENTRYA as _ACTRL_PROPERTY_ENTRYA ptr
  331 
  332 type _ACTRL_PROPERTY_ENTRYW
  333     lpProperty as LPWSTR
  334     pAccessEntryList as PACTRL_ACCESS_ENTRY_LISTW
  335     fListFlags as ULONG
  336 end type
  337 
  338 type ACTRL_PROPERTY_ENTRYW as _ACTRL_PROPERTY_ENTRYW
  339 type PACTRL_PROPERTY_ENTRYW as _ACTRL_PROPERTY_ENTRYW ptr
  340 
  341 #ifdef UNICODE
  342     type ACTRL_PROPERTY_ENTRY as ACTRL_PROPERTY_ENTRYW
  343     type PACTRL_PROPERTY_ENTRY as PACTRL_PROPERTY_ENTRYW
  344 #else
  345     type ACTRL_PROPERTY_ENTRY as ACTRL_PROPERTY_ENTRYA
  346     type PACTRL_PROPERTY_ENTRY as PACTRL_PROPERTY_ENTRYA
  347 #endif
  348 
  349 type _ACTRL_ALISTA
  350     cEntries as ULONG
  351     pPropertyAccessList as PACTRL_PROPERTY_ENTRYA
  352 end type
  353 
  354 type ACTRL_ACCESSA as _ACTRL_ALISTA
  355 type PACTRL_ACCESSA as _ACTRL_ALISTA ptr
  356 type ACTRL_AUDITA as _ACTRL_ALISTA
  357 type PACTRL_AUDITA as _ACTRL_ALISTA ptr
  358 
  359 type _ACTRL_ALISTW
  360     cEntries as ULONG
  361     pPropertyAccessList as PACTRL_PROPERTY_ENTRYW
  362 end type
  363 
  364 type ACTRL_ACCESSW as _ACTRL_ALISTW
  365 type PACTRL_ACCESSW as _ACTRL_ALISTW ptr
  366 type ACTRL_AUDITW as _ACTRL_ALISTW
  367 type PACTRL_AUDITW as _ACTRL_ALISTW ptr
  368 
  369 #ifdef UNICODE
  370     type ACTRL_ACCESS as ACTRL_ACCESSW
  371     type PACTRL_ACCESS as PACTRL_ACCESSW
  372     type ACTRL_AUDIT as ACTRL_AUDITW
  373     type PACTRL_AUDIT as PACTRL_AUDITW
  374 #else
  375     type ACTRL_ACCESS as ACTRL_ACCESSA
  376     type PACTRL_ACCESS as PACTRL_ACCESSA
  377     type ACTRL_AUDIT as ACTRL_AUDITA
  378     type PACTRL_AUDIT as PACTRL_AUDITA
  379 #endif
  380 
  381 const TRUSTEE_ACCESS_ALLOWED = &h1
  382 const TRUSTEE_ACCESS_READ = &h2
  383 const TRUSTEE_ACCESS_WRITE = &h4
  384 const TRUSTEE_ACCESS_EXPLICIT = &h1
  385 const TRUSTEE_ACCESS_READ_WRITE = TRUSTEE_ACCESS_READ or TRUSTEE_ACCESS_WRITE
  386 const TRUSTEE_ACCESS_ALL = &hffffffff
  387 
  388 type _TRUSTEE_ACCESSA
  389     lpProperty as LPSTR
  390     Access as ACCESS_RIGHTS
  391     fAccessFlags as ULONG
  392     fReturnedAccess as ULONG
  393 end type
  394 
  395 type TRUSTEE_ACCESSA as _TRUSTEE_ACCESSA
  396 type PTRUSTEE_ACCESSA as _TRUSTEE_ACCESSA ptr
  397 
  398 type _TRUSTEE_ACCESSW
  399     lpProperty as LPWSTR
  400     Access as ACCESS_RIGHTS
  401     fAccessFlags as ULONG
  402     fReturnedAccess as ULONG
  403 end type
  404 
  405 type TRUSTEE_ACCESSW as _TRUSTEE_ACCESSW
  406 type PTRUSTEE_ACCESSW as _TRUSTEE_ACCESSW ptr
  407 
  408 #ifdef UNICODE
  409     type TRUSTEE_ACCESS as TRUSTEE_ACCESSW
  410     type PTRUSTEE_ACCESS as PTRUSTEE_ACCESSW
  411 #else
  412     type TRUSTEE_ACCESS as TRUSTEE_ACCESSA
  413     type PTRUSTEE_ACCESS as PTRUSTEE_ACCESSA
  414 #endif
  415 
  416 const ACTRL_RESERVED = &h00000000
  417 const ACTRL_PERM_1 = &h00000001
  418 const ACTRL_PERM_2 = &h00000002
  419 const ACTRL_PERM_3 = &h00000004
  420 const ACTRL_PERM_4 = &h00000008
  421 const ACTRL_PERM_5 = &h00000010
  422 const ACTRL_PERM_6 = &h00000020
  423 const ACTRL_PERM_7 = &h00000040
  424 const ACTRL_PERM_8 = &h00000080
  425 const ACTRL_PERM_9 = &h00000100
  426 const ACTRL_PERM_10 = &h00000200
  427 const ACTRL_PERM_11 = &h00000400
  428 const ACTRL_PERM_12 = &h00000800
  429 const ACTRL_PERM_13 = &h00001000
  430 const ACTRL_PERM_14 = &h00002000
  431 const ACTRL_PERM_15 = &h00004000
  432 const ACTRL_PERM_16 = &h00008000
  433 const ACTRL_PERM_17 = &h00010000
  434 const ACTRL_PERM_18 = &h00020000
  435 const ACTRL_PERM_19 = &h00040000
  436 const ACTRL_PERM_20 = &h00080000
  437 const ACTRL_ACCESS_ALLOWED = &h00000001
  438 const ACTRL_ACCESS_DENIED = &h00000002
  439 const ACTRL_AUDIT_SUCCESS = &h00000004
  440 const ACTRL_AUDIT_FAILURE = &h00000008
  441 const ACTRL_ACCESS_PROTECTED = &h00000001
  442 const ACTRL_SYSTEM_ACCESS = &h04000000
  443 const ACTRL_DELETE = &h08000000
  444 const ACTRL_READ_CONTROL = &h10000000
  445 const ACTRL_CHANGE_ACCESS = &h20000000
  446 const ACTRL_CHANGE_OWNER = &h40000000
  447 const ACTRL_SYNCHRONIZE = &h80000000
  448 const ACTRL_STD_RIGHTS_ALL = &hf8000000
  449 const ACTRL_STD_RIGHT_REQUIRED = ACTRL_STD_RIGHTS_ALL and (not ACTRL_SYNCHRONIZE)
  450 #define _DS_CONTROL_BITS_DEFINED_
  451 const ACTRL_DS_OPEN = ACTRL_RESERVED
  452 const ACTRL_DS_CREATE_CHILD = ACTRL_PERM_1
  453 const ACTRL_DS_DELETE_CHILD = ACTRL_PERM_2
  454 const ACTRL_DS_LIST = ACTRL_PERM_3
  455 const ACTRL_DS_SELF = ACTRL_PERM_4
  456 const ACTRL_DS_READ_PROP = ACTRL_PERM_5
  457 const ACTRL_DS_WRITE_PROP = ACTRL_PERM_6
  458 const ACTRL_DS_DELETE_TREE = ACTRL_PERM_7
  459 const ACTRL_DS_LIST_OBJECT = ACTRL_PERM_8
  460 const ACTRL_DS_CONTROL_ACCESS = ACTRL_PERM_9
  461 const ACTRL_FILE_READ = ACTRL_PERM_1
  462 const ACTRL_FILE_WRITE = ACTRL_PERM_2
  463 const ACTRL_FILE_APPEND = ACTRL_PERM_3
  464 const ACTRL_FILE_READ_PROP = ACTRL_PERM_4
  465 const ACTRL_FILE_WRITE_PROP = ACTRL_PERM_5
  466 const ACTRL_FILE_EXECUTE = ACTRL_PERM_6
  467 const ACTRL_FILE_READ_ATTRIB = ACTRL_PERM_8
  468 const ACTRL_FILE_WRITE_ATTRIB = ACTRL_PERM_9
  469 const ACTRL_FILE_CREATE_PIPE = ACTRL_PERM_10
  470 const ACTRL_DIR_LIST = ACTRL_PERM_1
  471 const ACTRL_DIR_CREATE_OBJECT = ACTRL_PERM_2
  472 const ACTRL_DIR_CREATE_CHILD = ACTRL_PERM_3
  473 const ACTRL_DIR_DELETE_CHILD = ACTRL_PERM_7
  474 const ACTRL_DIR_TRAVERSE = ACTRL_PERM_6
  475 const ACTRL_KERNEL_TERMINATE = ACTRL_PERM_1
  476 const ACTRL_KERNEL_THREAD = ACTRL_PERM_2
  477 const ACTRL_KERNEL_VM = ACTRL_PERM_3
  478 const ACTRL_KERNEL_VM_READ = ACTRL_PERM_4
  479 const ACTRL_KERNEL_VM_WRITE = ACTRL_PERM_5
  480 const ACTRL_KERNEL_DUP_HANDLE = ACTRL_PERM_6
  481 const ACTRL_KERNEL_PROCESS = ACTRL_PERM_7
  482 const ACTRL_KERNEL_SET_INFO = ACTRL_PERM_8
  483 const ACTRL_KERNEL_GET_INFO = ACTRL_PERM_9
  484 const ACTRL_KERNEL_CONTROL = ACTRL_PERM_10
  485 const ACTRL_KERNEL_ALERT = ACTRL_PERM_11
  486 const ACTRL_KERNEL_GET_CONTEXT = ACTRL_PERM_12
  487 const ACTRL_KERNEL_SET_CONTEXT = ACTRL_PERM_13
  488 const ACTRL_KERNEL_TOKEN = ACTRL_PERM_14
  489 const ACTRL_KERNEL_IMPERSONATE = ACTRL_PERM_15
  490 const ACTRL_KERNEL_DIMPERSONATE = ACTRL_PERM_16
  491 const ACTRL_PRINT_SADMIN = ACTRL_PERM_1
  492 const ACTRL_PRINT_SLIST = ACTRL_PERM_2
  493 const ACTRL_PRINT_PADMIN = ACTRL_PERM_3
  494 const ACTRL_PRINT_PUSE = ACTRL_PERM_4
  495 const ACTRL_PRINT_JADMIN = ACTRL_PERM_5
  496 const ACTRL_SVC_GET_INFO = ACTRL_PERM_1
  497 const ACTRL_SVC_SET_INFO = ACTRL_PERM_2
  498 const ACTRL_SVC_STATUS = ACTRL_PERM_3
  499 const ACTRL_SVC_LIST = ACTRL_PERM_4
  500 const ACTRL_SVC_START = ACTRL_PERM_5
  501 const ACTRL_SVC_STOP = ACTRL_PERM_6
  502 const ACTRL_SVC_PAUSE = ACTRL_PERM_7
  503 const ACTRL_SVC_INTERROGATE = ACTRL_PERM_8
  504 const ACTRL_SVC_UCONTROL = ACTRL_PERM_9
  505 const ACTRL_REG_QUERY = ACTRL_PERM_1
  506 const ACTRL_REG_SET = ACTRL_PERM_2
  507 const ACTRL_REG_CREATE_CHILD = ACTRL_PERM_3
  508 const ACTRL_REG_LIST = ACTRL_PERM_4
  509 const ACTRL_REG_NOTIFY = ACTRL_PERM_5
  510 const ACTRL_REG_LINK = ACTRL_PERM_6
  511 const ACTRL_WIN_CLIPBRD = ACTRL_PERM_1
  512 const ACTRL_WIN_GLOBAL_ATOMS = ACTRL_PERM_2
  513 const ACTRL_WIN_CREATE = ACTRL_PERM_3
  514 const ACTRL_WIN_LIST_DESK = ACTRL_PERM_4
  515 const ACTRL_WIN_LIST = ACTRL_PERM_5
  516 const ACTRL_WIN_READ_ATTRIBS = ACTRL_PERM_6
  517 const ACTRL_WIN_WRITE_ATTRIBS = ACTRL_PERM_7
  518 const ACTRL_WIN_SCREEN = ACTRL_PERM_8
  519 const ACTRL_WIN_EXIT = ACTRL_PERM_9
  520 
  521 type _ACTRL_OVERLAPPED
  522     union
  523         Provider as PVOID
  524         Reserved1 as ULONG
  525     end union
  526 
  527     Reserved2 as ULONG
  528     hEvent as HANDLE
  529 end type
  530 
  531 type ACTRL_OVERLAPPED as _ACTRL_OVERLAPPED
  532 type PACTRL_OVERLAPPED as _ACTRL_OVERLAPPED ptr
  533 
  534 type _ACTRL_ACCESS_INFOA
  535     fAccessPermission as ULONG
  536     lpAccessPermissionName as LPSTR
  537 end type
  538 
  539 type ACTRL_ACCESS_INFOA as _ACTRL_ACCESS_INFOA
  540 type PACTRL_ACCESS_INFOA as _ACTRL_ACCESS_INFOA ptr
  541 
  542 type _ACTRL_ACCESS_INFOW
  543     fAccessPermission as ULONG
  544     lpAccessPermissionName as LPWSTR
  545 end type
  546 
  547 type ACTRL_ACCESS_INFOW as _ACTRL_ACCESS_INFOW
  548 type PACTRL_ACCESS_INFOW as _ACTRL_ACCESS_INFOW ptr
  549 
  550 #ifdef UNICODE
  551     type ACTRL_ACCESS_INFO as ACTRL_ACCESS_INFOW
  552     type PACTRL_ACCESS_INFO as PACTRL_ACCESS_INFOW
  553 #else
  554     type ACTRL_ACCESS_INFO as ACTRL_ACCESS_INFOA
  555     type PACTRL_ACCESS_INFO as PACTRL_ACCESS_INFOA
  556 #endif
  557 
  558 type _ACTRL_CONTROL_INFOA
  559     lpControlId as LPSTR
  560     lpControlName as LPSTR
  561 end type
  562 
  563 type ACTRL_CONTROL_INFOA as _ACTRL_CONTROL_INFOA
  564 type PACTRL_CONTROL_INFOA as _ACTRL_CONTROL_INFOA ptr
  565 
  566 type _ACTRL_CONTROL_INFOW
  567     lpControlId as LPWSTR
  568     lpControlName as LPWSTR
  569 end type
  570 
  571 type ACTRL_CONTROL_INFOW as _ACTRL_CONTROL_INFOW
  572 type PACTRL_CONTROL_INFOW as _ACTRL_CONTROL_INFOW ptr
  573 
  574 #ifdef UNICODE
  575     type ACTRL_CONTROL_INFO as ACTRL_CONTROL_INFOW
  576     type PACTRL_CONTROL_INFO as PACTRL_CONTROL_INFOW
  577 #else
  578     type ACTRL_CONTROL_INFO as ACTRL_CONTROL_INFOA
  579     type PACTRL_CONTROL_INFO as PACTRL_CONTROL_INFOA
  580 #endif
  581 
  582 const ACTRL_ACCESS_NO_OPTIONS = &h0
  583 const ACTRL_ACCESS_SUPPORTS_OBJECT_ENTRIES = &h1
  584 
  585 #if _WIN32_WINNT >= &h0600
  586     const TREE_SEC_INFO_SET = &h00000001
  587     const TREE_SEC_INFO_RESET = &h00000002
  588     const TREE_SEC_INFO_RESET_KEEP_EXPLICIT = &h00000003
  589 #endif
  590 
  591 type _PROGRESS_INVOKE_SETTING as long
  592 enum
  593     ProgressInvokeNever = 1
  594     ProgressInvokeEveryObject
  595     ProgressInvokeOnError
  596     ProgressCancelOperation
  597     ProgressRetryOperation
  598 
  599     #if _WIN32_WINNT >= &h0600
  600         ProgressInvokePrePostError
  601     #endif
  602 end enum
  603 
  604 type PROG_INVOKE_SETTING as _PROGRESS_INVOKE_SETTING
  605 type PPROG_INVOKE_SETTING as _PROGRESS_INVOKE_SETTING ptr
  606 
  607 type _FN_OBJECT_MGR_FUNCTIONS
  608     Placeholder as ULONG
  609 end type
  610 
  611 type FN_OBJECT_MGR_FUNCTS as _FN_OBJECT_MGR_FUNCTIONS
  612 type PFN_OBJECT_MGR_FUNCTS as _FN_OBJECT_MGR_FUNCTIONS ptr
  613 
  614 type _INHERITED_FROMA
  615     GenerationGap as LONG
  616     AncestorName as LPSTR
  617 end type
  618 
  619 type INHERITED_FROMA as _INHERITED_FROMA
  620 type PINHERITED_FROMA as _INHERITED_FROMA ptr
  621 
  622 type _INHERITED_FROMW
  623     GenerationGap as LONG
  624     AncestorName as LPWSTR
  625 end type
  626 
  627 type INHERITED_FROMW as _INHERITED_FROMW
  628 type PINHERITED_FROMW as _INHERITED_FROMW ptr
  629 
  630 #ifdef UNICODE
  631     type INHERITED_FROM as INHERITED_FROMW
  632     type PINHERITED_FROM as PINHERITED_FROMW
  633 #else
  634     type INHERITED_FROM as INHERITED_FROMA
  635     type PINHERITED_FROM as PINHERITED_FROMA
  636 #endif
  637 
  638 end extern