Hex Artifact Content

Not logged in

Artifact 34591f7cd56d8568f4b6d3f3030ec7e57e76f27f:


0000: 6d 6f 64 75 6c 65 20 77 69 6e 33 32 2e 61 6e 73  module win32.ans
0010: 69 2e 77 69 6e 62 61 73 65 3b 0d 0a 0d 0a 2f 2f  i.winbase;....//
0020: 20 54 72 61 6e 73 6c 61 74 65 64 20 66 72 6f 6d   Translated from
0030: 20 4d 69 63 72 6f 73 6f 66 74 20 50 6c 61 74 66   Microsoft Platf
0040: 6f 72 6d 20 53 44 4b 20 41 75 67 75 73 74 20 32  orm SDK August 2
0050: 30 30 31 20 45 64 69 74 69 6f 6e 0d 0a 2f 2f 20  001 Edition..// 
0060: 62 79 20 59 2e 54 6f 6d 69 6e 6f 20 28 64 65 6d  by Y.Tomino (dem
0070: 6f 6f 6e 6c 69 74 40 69 6e 74 65 72 37 2e 6a 70  oonlit@inter7.jp
0080: 29 0d 0a 0d 0a 69 6d 70 6f 72 74 20 77 69 6e 33  )....import win3
0090: 32 2e 61 6e 73 69 2e 77 69 6e 64 65 66 3b 0d 0a  2.ansi.windef;..
00a0: 0d 0a 2f 2f 20 23 69 66 6e 64 65 66 20 5f 57 49  ..// #ifndef _WI
00b0: 4e 42 41 53 45 5f 0d 0a 2f 2f 20 23 64 65 66 69  NBASE_..// #defi
00c0: 6e 65 20 5f 57 49 4e 42 41 53 45 5f 0d 0a 0d 0a  ne _WINBASE_....
00d0: 2f 2f 20 23 69 66 20 5f 4d 53 43 5f 56 45 52 20  // #if _MSC_VER 
00e0: 3e 20 31 30 30 30 0d 0a 2f 2f 20 23 70 72 61 67  > 1000..// #prag
00f0: 6d 61 20 6f 6e 63 65 0d 0a 2f 2f 20 23 65 6e 64  ma once..// #end
0100: 69 66 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65 66 20  if....// #ifdef 
0110: 5f 4d 41 43 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  _MAC..// #...../
0120: 2f 20 23 65 6e 64 69 66 20 2f 2f 5f 4d 41 43 0d  / #endif //_MAC.
0130: 0a 0d 0a 2f 2f 20 23 69 66 20 21 64 65 66 69 6e  ...// #if !defin
0140: 65 64 28 5f 41 44 56 41 50 49 33 32 5f 29 0d 0a  ed(_ADVAPI32_)..
0150: 2f 2f 20 23 64 65 66 69 6e 65 20 57 49 4e 41 44  // #define WINAD
0160: 56 41 50 49 20 44 45 43 4c 53 50 45 43 5f 49 4d  VAPI DECLSPEC_IM
0170: 50 4f 52 54 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  PORT..// #else..
0180: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64  // #.....// #end
0190: 69 66 0d 0a 0d 0a 2f 2f 20 23 69 66 20 21 64 65  if....// #if !de
01a0: 66 69 6e 65 64 28 5f 4b 45 52 4e 45 4c 33 32 5f  fined(_KERNEL32_
01b0: 29 0d 0a 2f 2f 20 23 64 65 66 69 6e 65 20 57 49  )..// #define WI
01c0: 4e 42 41 53 45 41 50 49 20 44 45 43 4c 53 50 45  NBASEAPI DECLSPE
01d0: 43 5f 49 4d 50 4f 52 54 0d 0a 2f 2f 20 23 65 6c  C_IMPORT..// #el
01e0: 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  se..// #.....// 
01f0: 23 65 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23 69 66  #endif....// #if
0200: 20 21 64 65 66 69 6e 65 64 28 5f 5a 41 57 50 52   !defined(_ZAWPR
0210: 4f 58 59 5f 29 0d 0a 2f 2f 20 23 64 65 66 69 6e  OXY_)..// #defin
0220: 65 20 5a 41 57 50 52 4f 58 59 41 50 49 20 44 45  e ZAWPROXYAPI DE
0230: 43 4c 53 50 45 43 5f 49 4d 50 4f 52 54 0d 0a 2f  CLSPEC_IMPORT../
0240: 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e  / #else..// #...
0250: 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 0d 0a 2f  ..// #endif..../
0260: 2f 20 23 69 66 64 65 66 20 5f 5f 63 70 6c 75 73  / #ifdef __cplus
0270: 70 6c 75 73 0d 0a 2f 2f 20 65 78 74 65 72 6e 20  plus..// extern 
0280: 22 43 22 20 7b 0d 0a 2f 2f 20 23 65 6e 64 69 66  "C" {..// #endif
0290: 0d 0a 0d 0a 2f 2f 20 23 64 65 66 69 6e 65 20 44  ....// #define D
02a0: 65 66 69 6e 65 48 61 6e 64 6c 65 54 61 62 6c 65  efineHandleTable
02b0: 28 77 29 20 28 28 77 29 2c 54 52 55 45 29 0d 0a  (w) ((w),TRUE)..
02c0: 2f 2f 20 23 64 65 66 69 6e 65 20 4c 69 6d 69 74  // #define Limit
02d0: 45 6d 73 50 61 67 65 73 28 64 77 29 0d 0a 2f 2f  EmsPages(dw)..//
02e0: 20 23 64 65 66 69 6e 65 20 53 65 74 53 77 61 70   #define SetSwap
02f0: 41 72 65 61 53 69 7a 65 28 77 29 20 28 77 29 0d  AreaSize(w) (w).
0300: 0a 2f 2f 20 23 64 65 66 69 6e 65 20 4c 6f 63 6b  .// #define Lock
0310: 53 65 67 6d 65 6e 74 28 77 29 20 47 6c 6f 62 61  Segment(w) Globa
0320: 6c 46 69 78 28 28 48 41 4e 44 4c 45 29 28 77 29  lFix((HANDLE)(w)
0330: 29 0d 0a 2f 2f 20 23 64 65 66 69 6e 65 20 55 6e  )..// #define Un
0340: 6c 6f 63 6b 53 65 67 6d 65 6e 74 28 77 29 20 47  lockSegment(w) G
0350: 6c 6f 62 61 6c 55 6e 66 69 78 28 28 48 41 4e 44  lobalUnfix((HAND
0360: 4c 45 29 28 77 29 29 0d 0a 61 6c 69 61 73 20 47  LE)(w))..alias G
0370: 65 74 54 69 63 6b 43 6f 75 6e 74 20 47 65 74 43  etTickCount GetC
0380: 75 72 72 65 6e 74 54 69 6d 65 3b 0d 0a 0d 0a 2f  urrentTime;..../
0390: 2f 20 23 64 65 66 69 6e 65 20 59 69 65 6c 64 28  / #define Yield(
03a0: 29 0d 0a 0d 0a 48 41 4e 44 4c 45 20 49 4e 56 41  )....HANDLE INVA
03b0: 4c 49 44 5f 48 41 4e 44 4c 45 5f 56 41 4c 55 45  LID_HANDLE_VALUE
03c0: 20 3d 20 63 61 73 74 28 48 41 4e 44 4c 45 29 2d   = cast(HANDLE)-
03d0: 31 3b 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44  1;..enum : DWORD
03e0: 20 7b 20 49 4e 56 41 4c 49 44 5f 46 49 4c 45 5f   { INVALID_FILE_
03f0: 53 49 5a 45 20 3d 20 30 78 46 46 46 46 46 46 46  SIZE = 0xFFFFFFF
0400: 46 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52  F }..enum : DWOR
0410: 44 20 7b 20 49 4e 56 41 4c 49 44 5f 53 45 54 5f  D { INVALID_SET_
0420: 46 49 4c 45 5f 50 4f 49 4e 54 45 52 20 3d 20 63  FILE_POINTER = c
0430: 61 73 74 28 44 57 4f 52 44 29 2d 31 20 7d 0d 0a  ast(DWORD)-1 }..
0440: 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 49  enum : DWORD { I
0450: 4e 56 41 4c 49 44 5f 46 49 4c 45 5f 41 54 54 52  NVALID_FILE_ATTR
0460: 49 42 55 54 45 53 20 3d 20 63 61 73 74 28 44 57  IBUTES = cast(DW
0470: 4f 52 44 29 2d 31 20 7d 0d 0a 0d 0a 65 6e 75 6d  ORD)-1 }....enum
0480: 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 42   : uint { FILE_B
0490: 45 47 49 4e 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d  EGIN = 0 }..enum
04a0: 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 43   : uint { FILE_C
04b0: 55 52 52 45 4e 54 20 3d 20 31 20 7d 0d 0a 65 6e  URRENT = 1 }..en
04c0: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45  um : uint { FILE
04d0: 5f 45 4e 44 20 3d 20 32 20 7d 0d 0a 0d 0a 65 6e  _END = 2 }....en
04e0: 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 54 49 4d  um : DWORD { TIM
04f0: 45 5f 5a 4f 4e 45 5f 49 44 5f 49 4e 56 41 4c 49  E_ZONE_ID_INVALI
0500: 44 20 3d 20 30 78 46 46 46 46 46 46 46 46 20 7d  D = 0xFFFFFFFF }
0510: 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44  ....enum : DWORD
0520: 20 7b 20 57 41 49 54 5f 46 41 49 4c 45 44 20 3d   { WAIT_FAILED =
0530: 20 30 78 46 46 46 46 46 46 46 46 20 7d 0d 0a 61   0xFFFFFFFF }..a
0540: 6c 69 61 73 20 53 54 41 54 55 53 5f 57 41 49 54  lias STATUS_WAIT
0550: 5f 30 20 57 41 49 54 5f 4f 42 4a 45 43 54 5f 30  _0 WAIT_OBJECT_0
0560: 3b 0d 0a 0d 0a 61 6c 69 61 73 20 53 54 41 54 55  ;....alias STATU
0570: 53 5f 41 42 41 4e 44 4f 4e 45 44 5f 57 41 49 54  S_ABANDONED_WAIT
0580: 5f 30 20 57 41 49 54 5f 41 42 41 4e 44 4f 4e 45  _0 WAIT_ABANDONE
0590: 44 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54 55 53  D;..alias STATUS
05a0: 5f 41 42 41 4e 44 4f 4e 45 44 5f 57 41 49 54 5f  _ABANDONED_WAIT_
05b0: 30 20 57 41 49 54 5f 41 42 41 4e 44 4f 4e 45 44  0 WAIT_ABANDONED
05c0: 5f 30 3b 0d 0a 0d 0a 61 6c 69 61 73 20 53 54 41  _0;....alias STA
05d0: 54 55 53 5f 55 53 45 52 5f 41 50 43 20 57 41 49  TUS_USER_APC WAI
05e0: 54 5f 49 4f 5f 43 4f 4d 50 4c 45 54 49 4f 4e 3b  T_IO_COMPLETION;
05f0: 0d 0a 61 6c 69 61 73 20 53 54 41 54 55 53 5f 50  ..alias STATUS_P
0600: 45 4e 44 49 4e 47 20 53 54 49 4c 4c 5f 41 43 54  ENDING STILL_ACT
0610: 49 56 45 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54  IVE;..alias STAT
0620: 55 53 5f 41 43 43 45 53 53 5f 56 49 4f 4c 41 54  US_ACCESS_VIOLAT
0630: 49 4f 4e 20 45 58 43 45 50 54 49 4f 4e 5f 41 43  ION EXCEPTION_AC
0640: 43 45 53 53 5f 56 49 4f 4c 41 54 49 4f 4e 3b 0d  CESS_VIOLATION;.
0650: 0a 61 6c 69 61 73 20 53 54 41 54 55 53 5f 44 41  .alias STATUS_DA
0660: 54 41 54 59 50 45 5f 4d 49 53 41 4c 49 47 4e 4d  TATYPE_MISALIGNM
0670: 45 4e 54 20 45 58 43 45 50 54 49 4f 4e 5f 44 41  ENT EXCEPTION_DA
0680: 54 41 54 59 50 45 5f 4d 49 53 41 4c 49 47 4e 4d  TATYPE_MISALIGNM
0690: 45 4e 54 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54  ENT;..alias STAT
06a0: 55 53 5f 42 52 45 41 4b 50 4f 49 4e 54 20 45 58  US_BREAKPOINT EX
06b0: 43 45 50 54 49 4f 4e 5f 42 52 45 41 4b 50 4f 49  CEPTION_BREAKPOI
06c0: 4e 54 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54 55  NT;..alias STATU
06d0: 53 5f 53 49 4e 47 4c 45 5f 53 54 45 50 20 45 58  S_SINGLE_STEP EX
06e0: 43 45 50 54 49 4f 4e 5f 53 49 4e 47 4c 45 5f 53  CEPTION_SINGLE_S
06f0: 54 45 50 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54  TEP;..alias STAT
0700: 55 53 5f 41 52 52 41 59 5f 42 4f 55 4e 44 53 5f  US_ARRAY_BOUNDS_
0710: 45 58 43 45 45 44 45 44 20 45 58 43 45 50 54 49  EXCEEDED EXCEPTI
0720: 4f 4e 5f 41 52 52 41 59 5f 42 4f 55 4e 44 53 5f  ON_ARRAY_BOUNDS_
0730: 45 58 43 45 45 44 45 44 3b 0d 0a 61 6c 69 61 73  EXCEEDED;..alias
0740: 20 53 54 41 54 55 53 5f 46 4c 4f 41 54 5f 44 45   STATUS_FLOAT_DE
0750: 4e 4f 52 4d 41 4c 5f 4f 50 45 52 41 4e 44 20 45  NORMAL_OPERAND E
0760: 58 43 45 50 54 49 4f 4e 5f 46 4c 54 5f 44 45 4e  XCEPTION_FLT_DEN
0770: 4f 52 4d 41 4c 5f 4f 50 45 52 41 4e 44 3b 0d 0a  ORMAL_OPERAND;..
0780: 61 6c 69 61 73 20 53 54 41 54 55 53 5f 46 4c 4f  alias STATUS_FLO
0790: 41 54 5f 44 49 56 49 44 45 5f 42 59 5f 5a 45 52  AT_DIVIDE_BY_ZER
07a0: 4f 20 45 58 43 45 50 54 49 4f 4e 5f 46 4c 54 5f  O EXCEPTION_FLT_
07b0: 44 49 56 49 44 45 5f 42 59 5f 5a 45 52 4f 3b 0d  DIVIDE_BY_ZERO;.
07c0: 0a 61 6c 69 61 73 20 53 54 41 54 55 53 5f 46 4c  .alias STATUS_FL
07d0: 4f 41 54 5f 49 4e 45 58 41 43 54 5f 52 45 53 55  OAT_INEXACT_RESU
07e0: 4c 54 20 45 58 43 45 50 54 49 4f 4e 5f 46 4c 54  LT EXCEPTION_FLT
07f0: 5f 49 4e 45 58 41 43 54 5f 52 45 53 55 4c 54 3b  _INEXACT_RESULT;
0800: 0d 0a 61 6c 69 61 73 20 53 54 41 54 55 53 5f 46  ..alias STATUS_F
0810: 4c 4f 41 54 5f 49 4e 56 41 4c 49 44 5f 4f 50 45  LOAT_INVALID_OPE
0820: 52 41 54 49 4f 4e 20 45 58 43 45 50 54 49 4f 4e  RATION EXCEPTION
0830: 5f 46 4c 54 5f 49 4e 56 41 4c 49 44 5f 4f 50 45  _FLT_INVALID_OPE
0840: 52 41 54 49 4f 4e 3b 0d 0a 61 6c 69 61 73 20 53  RATION;..alias S
0850: 54 41 54 55 53 5f 46 4c 4f 41 54 5f 4f 56 45 52  TATUS_FLOAT_OVER
0860: 46 4c 4f 57 20 45 58 43 45 50 54 49 4f 4e 5f 46  FLOW EXCEPTION_F
0870: 4c 54 5f 4f 56 45 52 46 4c 4f 57 3b 0d 0a 61 6c  LT_OVERFLOW;..al
0880: 69 61 73 20 53 54 41 54 55 53 5f 46 4c 4f 41 54  ias STATUS_FLOAT
0890: 5f 53 54 41 43 4b 5f 43 48 45 43 4b 20 45 58 43  _STACK_CHECK EXC
08a0: 45 50 54 49 4f 4e 5f 46 4c 54 5f 53 54 41 43 4b  EPTION_FLT_STACK
08b0: 5f 43 48 45 43 4b 3b 0d 0a 61 6c 69 61 73 20 53  _CHECK;..alias S
08c0: 54 41 54 55 53 5f 46 4c 4f 41 54 5f 55 4e 44 45  TATUS_FLOAT_UNDE
08d0: 52 46 4c 4f 57 20 45 58 43 45 50 54 49 4f 4e 5f  RFLOW EXCEPTION_
08e0: 46 4c 54 5f 55 4e 44 45 52 46 4c 4f 57 3b 0d 0a  FLT_UNDERFLOW;..
08f0: 61 6c 69 61 73 20 53 54 41 54 55 53 5f 49 4e 54  alias STATUS_INT
0900: 45 47 45 52 5f 44 49 56 49 44 45 5f 42 59 5f 5a  EGER_DIVIDE_BY_Z
0910: 45 52 4f 20 45 58 43 45 50 54 49 4f 4e 5f 49 4e  ERO EXCEPTION_IN
0920: 54 5f 44 49 56 49 44 45 5f 42 59 5f 5a 45 52 4f  T_DIVIDE_BY_ZERO
0930: 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54 55 53 5f  ;..alias STATUS_
0940: 49 4e 54 45 47 45 52 5f 4f 56 45 52 46 4c 4f 57  INTEGER_OVERFLOW
0950: 20 45 58 43 45 50 54 49 4f 4e 5f 49 4e 54 5f 4f   EXCEPTION_INT_O
0960: 56 45 52 46 4c 4f 57 3b 0d 0a 61 6c 69 61 73 20  VERFLOW;..alias 
0970: 53 54 41 54 55 53 5f 50 52 49 56 49 4c 45 47 45  STATUS_PRIVILEGE
0980: 44 5f 49 4e 53 54 52 55 43 54 49 4f 4e 20 45 58  D_INSTRUCTION EX
0990: 43 45 50 54 49 4f 4e 5f 50 52 49 56 5f 49 4e 53  CEPTION_PRIV_INS
09a0: 54 52 55 43 54 49 4f 4e 3b 0d 0a 61 6c 69 61 73  TRUCTION;..alias
09b0: 20 53 54 41 54 55 53 5f 49 4e 5f 50 41 47 45 5f   STATUS_IN_PAGE_
09c0: 45 52 52 4f 52 20 45 58 43 45 50 54 49 4f 4e 5f  ERROR EXCEPTION_
09d0: 49 4e 5f 50 41 47 45 5f 45 52 52 4f 52 3b 0d 0a  IN_PAGE_ERROR;..
09e0: 61 6c 69 61 73 20 53 54 41 54 55 53 5f 49 4c 4c  alias STATUS_ILL
09f0: 45 47 41 4c 5f 49 4e 53 54 52 55 43 54 49 4f 4e  EGAL_INSTRUCTION
0a00: 20 45 58 43 45 50 54 49 4f 4e 5f 49 4c 4c 45 47   EXCEPTION_ILLEG
0a10: 41 4c 5f 49 4e 53 54 52 55 43 54 49 4f 4e 3b 0d  AL_INSTRUCTION;.
0a20: 0a 61 6c 69 61 73 20 53 54 41 54 55 53 5f 4e 4f  .alias STATUS_NO
0a30: 4e 43 4f 4e 54 49 4e 55 41 42 4c 45 5f 45 58 43  NCONTINUABLE_EXC
0a40: 45 50 54 49 4f 4e 20 45 58 43 45 50 54 49 4f 4e  EPTION EXCEPTION
0a50: 5f 4e 4f 4e 43 4f 4e 54 49 4e 55 41 42 4c 45 5f  _NONCONTINUABLE_
0a60: 45 58 43 45 50 54 49 4f 4e 3b 0d 0a 61 6c 69 61  EXCEPTION;..alia
0a70: 73 20 53 54 41 54 55 53 5f 53 54 41 43 4b 5f 4f  s STATUS_STACK_O
0a80: 56 45 52 46 4c 4f 57 20 45 58 43 45 50 54 49 4f  VERFLOW EXCEPTIO
0a90: 4e 5f 53 54 41 43 4b 5f 4f 56 45 52 46 4c 4f 57  N_STACK_OVERFLOW
0aa0: 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54 55 53 5f  ;..alias STATUS_
0ab0: 49 4e 56 41 4c 49 44 5f 44 49 53 50 4f 53 49 54  INVALID_DISPOSIT
0ac0: 49 4f 4e 20 45 58 43 45 50 54 49 4f 4e 5f 49 4e  ION EXCEPTION_IN
0ad0: 56 41 4c 49 44 5f 44 49 53 50 4f 53 49 54 49 4f  VALID_DISPOSITIO
0ae0: 4e 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54 55 53  N;..alias STATUS
0af0: 5f 47 55 41 52 44 5f 50 41 47 45 5f 56 49 4f 4c  _GUARD_PAGE_VIOL
0b00: 41 54 49 4f 4e 20 45 58 43 45 50 54 49 4f 4e 5f  ATION EXCEPTION_
0b10: 47 55 41 52 44 5f 50 41 47 45 3b 0d 0a 61 6c 69  GUARD_PAGE;..ali
0b20: 61 73 20 53 54 41 54 55 53 5f 49 4e 56 41 4c 49  as STATUS_INVALI
0b30: 44 5f 48 41 4e 44 4c 45 20 45 58 43 45 50 54 49  D_HANDLE EXCEPTI
0b40: 4f 4e 5f 49 4e 56 41 4c 49 44 5f 48 41 4e 44 4c  ON_INVALID_HANDL
0b50: 45 3b 0d 0a 61 6c 69 61 73 20 53 54 41 54 55 53  E;..alias STATUS
0b60: 5f 43 4f 4e 54 52 4f 4c 5f 43 5f 45 58 49 54 20  _CONTROL_C_EXIT 
0b70: 43 4f 4e 54 52 4f 4c 5f 43 5f 45 58 49 54 3b 0d  CONTROL_C_EXIT;.
0b80: 0a 61 6c 69 61 73 20 52 74 6c 4d 6f 76 65 4d 65  .alias RtlMoveMe
0b90: 6d 6f 72 79 20 4d 6f 76 65 4d 65 6d 6f 72 79 3b  mory MoveMemory;
0ba0: 0d 0a 61 6c 69 61 73 20 52 74 6c 43 6f 70 79 4d  ..alias RtlCopyM
0bb0: 65 6d 6f 72 79 20 43 6f 70 79 4d 65 6d 6f 72 79  emory CopyMemory
0bc0: 3b 0d 0a 61 6c 69 61 73 20 52 74 6c 46 69 6c 6c  ;..alias RtlFill
0bd0: 4d 65 6d 6f 72 79 20 46 69 6c 6c 4d 65 6d 6f 72  Memory FillMemor
0be0: 79 3b 0d 0a 61 6c 69 61 73 20 52 74 6c 5a 65 72  y;..alias RtlZer
0bf0: 6f 4d 65 6d 6f 72 79 20 5a 65 72 6f 4d 65 6d 6f  oMemory ZeroMemo
0c00: 72 79 3b 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69  ry;....enum : ui
0c10: 6e 74 20 7b 20 46 49 4c 45 5f 46 4c 41 47 5f 57  nt { FILE_FLAG_W
0c20: 52 49 54 45 5f 54 48 52 4f 55 47 48 20 3d 20 30  RITE_THROUGH = 0
0c30: 78 38 30 30 30 30 30 30 30 20 7d 0d 0a 65 6e 75  x80000000 }..enu
0c40: 6d 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f  m : uint { FILE_
0c50: 46 4c 41 47 5f 4f 56 45 52 4c 41 50 50 45 44 20  FLAG_OVERLAPPED 
0c60: 3d 20 30 78 34 30 30 30 30 30 30 30 20 7d 0d 0a  = 0x40000000 }..
0c70: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46 49  enum : uint { FI
0c80: 4c 45 5f 46 4c 41 47 5f 4e 4f 5f 42 55 46 46 45  LE_FLAG_NO_BUFFE
0c90: 52 49 4e 47 20 3d 20 30 78 32 30 30 30 30 30 30  RING = 0x2000000
0ca0: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
0cb0: 20 7b 20 46 49 4c 45 5f 46 4c 41 47 5f 52 41 4e   { FILE_FLAG_RAN
0cc0: 44 4f 4d 5f 41 43 43 45 53 53 20 3d 20 30 78 31  DOM_ACCESS = 0x1
0cd0: 30 30 30 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20  0000000 }..enum 
0ce0: 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 46 4c  : uint { FILE_FL
0cf0: 41 47 5f 53 45 51 55 45 4e 54 49 41 4c 5f 53 43  AG_SEQUENTIAL_SC
0d00: 41 4e 20 3d 20 30 78 30 38 30 30 30 30 30 30 20  AN = 0x08000000 
0d10: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
0d20: 20 46 49 4c 45 5f 46 4c 41 47 5f 44 45 4c 45 54   FILE_FLAG_DELET
0d30: 45 5f 4f 4e 5f 43 4c 4f 53 45 20 3d 20 30 78 30  E_ON_CLOSE = 0x0
0d40: 34 30 30 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20  4000000 }..enum 
0d50: 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 46 4c  : uint { FILE_FL
0d60: 41 47 5f 42 41 43 4b 55 50 5f 53 45 4d 41 4e 54  AG_BACKUP_SEMANT
0d70: 49 43 53 20 3d 20 30 78 30 32 30 30 30 30 30 30  ICS = 0x02000000
0d80: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
0d90: 7b 20 46 49 4c 45 5f 46 4c 41 47 5f 50 4f 53 49  { FILE_FLAG_POSI
0da0: 58 5f 53 45 4d 41 4e 54 49 43 53 20 3d 20 30 78  X_SEMANTICS = 0x
0db0: 30 31 30 30 30 30 30 30 20 7d 0d 0a 65 6e 75 6d  01000000 }..enum
0dc0: 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 46   : uint { FILE_F
0dd0: 4c 41 47 5f 4f 50 45 4e 5f 52 45 50 41 52 53 45  LAG_OPEN_REPARSE
0de0: 5f 50 4f 49 4e 54 20 3d 20 30 78 30 30 32 30 30  _POINT = 0x00200
0df0: 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  000 }..enum : ui
0e00: 6e 74 20 7b 20 46 49 4c 45 5f 46 4c 41 47 5f 4f  nt { FILE_FLAG_O
0e10: 50 45 4e 5f 4e 4f 5f 52 45 43 41 4c 4c 20 3d 20  PEN_NO_RECALL = 
0e20: 30 78 30 30 31 30 30 30 30 30 20 7d 0d 0a 65 6e  0x00100000 }..en
0e30: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45  um : uint { FILE
0e40: 5f 46 4c 41 47 5f 46 49 52 53 54 5f 50 49 50 45  _FLAG_FIRST_PIPE
0e50: 5f 49 4e 53 54 41 4e 43 45 20 3d 20 30 78 30 30  _INSTANCE = 0x00
0e60: 30 38 30 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d  080000 }....enum
0e70: 20 3a 20 75 69 6e 74 20 7b 20 43 52 45 41 54 45   : uint { CREATE
0e80: 5f 4e 45 57 20 3d 20 31 20 7d 0d 0a 65 6e 75 6d  _NEW = 1 }..enum
0e90: 20 3a 20 75 69 6e 74 20 7b 20 43 52 45 41 54 45   : uint { CREATE
0ea0: 5f 41 4c 57 41 59 53 20 3d 20 32 20 7d 0d 0a 65  _ALWAYS = 2 }..e
0eb0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4f 50 45  num : uint { OPE
0ec0: 4e 5f 45 58 49 53 54 49 4e 47 20 3d 20 33 20 7d  N_EXISTING = 3 }
0ed0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
0ee0: 4f 50 45 4e 5f 41 4c 57 41 59 53 20 3d 20 34 20  OPEN_ALWAYS = 4 
0ef0: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
0f00: 20 54 52 55 4e 43 41 54 45 5f 45 58 49 53 54 49   TRUNCATE_EXISTI
0f10: 4e 47 20 3d 20 35 20 7d 0d 0a 0d 0a 2f 2f 20 23  NG = 5 }....// #
0f20: 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  if(_WIN32_WINNT 
0f30: 3e 3d 20 30 78 30 34 30 30 29 0d 0a 0d 0a 65 6e  >= 0x0400)....en
0f40: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 50 52 4f 47  um : uint { PROG
0f50: 52 45 53 53 5f 43 4f 4e 54 49 4e 55 45 20 3d 20  RESS_CONTINUE = 
0f60: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
0f70: 20 7b 20 50 52 4f 47 52 45 53 53 5f 43 41 4e 43   { PROGRESS_CANC
0f80: 45 4c 20 3d 20 31 20 7d 0d 0a 65 6e 75 6d 20 3a  EL = 1 }..enum :
0f90: 20 75 69 6e 74 20 7b 20 50 52 4f 47 52 45 53 53   uint { PROGRESS
0fa0: 5f 53 54 4f 50 20 3d 20 32 20 7d 0d 0a 65 6e 75  _STOP = 2 }..enu
0fb0: 6d 20 3a 20 75 69 6e 74 20 7b 20 50 52 4f 47 52  m : uint { PROGR
0fc0: 45 53 53 5f 51 55 49 45 54 20 3d 20 33 20 7d 0d  ESS_QUIET = 3 }.
0fd0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
0fe0: 20 43 41 4c 4c 42 41 43 4b 5f 43 48 55 4e 4b 5f   CALLBACK_CHUNK_
0ff0: 46 49 4e 49 53 48 45 44 20 3d 20 30 78 30 30 30  FINISHED = 0x000
1000: 30 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  00000 }..enum : 
1010: 75 69 6e 74 20 7b 20 43 41 4c 4c 42 41 43 4b 5f  uint { CALLBACK_
1020: 53 54 52 45 41 4d 5f 53 57 49 54 43 48 20 3d 20  STREAM_SWITCH = 
1030: 30 78 30 30 30 30 30 30 30 31 20 7d 0d 0a 0d 0a  0x00000001 }....
1040: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 4f  enum : uint { CO
1050: 50 59 5f 46 49 4c 45 5f 46 41 49 4c 5f 49 46 5f  PY_FILE_FAIL_IF_
1060: 45 58 49 53 54 53 20 3d 20 30 78 30 30 30 30 30  EXISTS = 0x00000
1070: 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  001 }..enum : ui
1080: 6e 74 20 7b 20 43 4f 50 59 5f 46 49 4c 45 5f 52  nt { COPY_FILE_R
1090: 45 53 54 41 52 54 41 42 4c 45 20 3d 20 30 78 30  ESTARTABLE = 0x0
10a0: 30 30 30 30 30 30 32 20 7d 0d 0a 65 6e 75 6d 20  0000002 }..enum 
10b0: 3a 20 75 69 6e 74 20 7b 20 43 4f 50 59 5f 46 49  : uint { COPY_FI
10c0: 4c 45 5f 4f 50 45 4e 5f 53 4f 55 52 43 45 5f 46  LE_OPEN_SOURCE_F
10d0: 4f 52 5f 57 52 49 54 45 20 3d 20 30 78 30 30 30  OR_WRITE = 0x000
10e0: 30 30 30 30 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20  00004 }..enum : 
10f0: 75 69 6e 74 20 7b 20 43 4f 50 59 5f 46 49 4c 45  uint { COPY_FILE
1100: 5f 41 4c 4c 4f 57 5f 44 45 43 52 59 50 54 45 44  _ALLOW_DECRYPTED
1110: 5f 44 45 53 54 49 4e 41 54 49 4f 4e 20 3d 20 30  _DESTINATION = 0
1120: 78 30 30 30 30 30 30 30 38 20 7d 0d 0a 2f 2f 20  x00000008 }..// 
1130: 23 65 6e 64 69 66 20 2f 2a 20 5f 57 49 4e 33 32  #endif /* _WIN32
1140: 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 34 30 30  _WINNT >= 0x0400
1150: 20 2a 2f 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f   */....// #if (_
1160: 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30  WIN32_WINNT >= 0
1170: 78 30 35 30 30 29 0d 0a 0d 0a 65 6e 75 6d 20 3a  x0500)....enum :
1180: 20 75 69 6e 74 20 7b 20 52 45 50 4c 41 43 45 46   uint { REPLACEF
1190: 49 4c 45 5f 57 52 49 54 45 5f 54 48 52 4f 55 47  ILE_WRITE_THROUG
11a0: 48 20 3d 20 30 78 30 30 30 30 30 30 30 31 20 7d  H = 0x00000001 }
11b0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
11c0: 52 45 50 4c 41 43 45 46 49 4c 45 5f 49 47 4e 4f  REPLACEFILE_IGNO
11d0: 52 45 5f 4d 45 52 47 45 5f 45 52 52 4f 52 53 20  RE_MERGE_ERRORS 
11e0: 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d 0d 0a  = 0x00000002 }..
11f0: 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 23  ..// #endif // #
1200: 69 66 20 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54  if (_WIN32_WINNT
1210: 20 3e 3d 20 30 78 30 35 30 30 29 0d 0a 0d 0a 65   >= 0x0500)....e
1220: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 50 49 50  num : uint { PIP
1230: 45 5f 41 43 43 45 53 53 5f 49 4e 42 4f 55 4e 44  E_ACCESS_INBOUND
1240: 20 3d 20 30 78 30 30 30 30 30 30 30 31 20 7d 0d   = 0x00000001 }.
1250: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 50  .enum : uint { P
1260: 49 50 45 5f 41 43 43 45 53 53 5f 4f 55 54 42 4f  IPE_ACCESS_OUTBO
1270: 55 4e 44 20 3d 20 30 78 30 30 30 30 30 30 30 32  UND = 0x00000002
1280: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
1290: 7b 20 50 49 50 45 5f 41 43 43 45 53 53 5f 44 55  { PIPE_ACCESS_DU
12a0: 50 4c 45 58 20 3d 20 30 78 30 30 30 30 30 30 30  PLEX = 0x0000000
12b0: 33 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69  3 }....enum : ui
12c0: 6e 74 20 7b 20 50 49 50 45 5f 43 4c 49 45 4e 54  nt { PIPE_CLIENT
12d0: 5f 45 4e 44 20 3d 20 30 78 30 30 30 30 30 30 30  _END = 0x0000000
12e0: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
12f0: 20 7b 20 50 49 50 45 5f 53 45 52 56 45 52 5f 45   { PIPE_SERVER_E
1300: 4e 44 20 3d 20 30 78 30 30 30 30 30 30 30 31 20  ND = 0x00000001 
1310: 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  }....enum : uint
1320: 20 7b 20 50 49 50 45 5f 57 41 49 54 20 3d 20 30   { PIPE_WAIT = 0
1330: 78 30 30 30 30 30 30 30 30 20 7d 0d 0a 65 6e 75  x00000000 }..enu
1340: 6d 20 3a 20 75 69 6e 74 20 7b 20 50 49 50 45 5f  m : uint { PIPE_
1350: 4e 4f 57 41 49 54 20 3d 20 30 78 30 30 30 30 30  NOWAIT = 0x00000
1360: 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  001 }..enum : ui
1370: 6e 74 20 7b 20 50 49 50 45 5f 52 45 41 44 4d 4f  nt { PIPE_READMO
1380: 44 45 5f 42 59 54 45 20 3d 20 30 78 30 30 30 30  DE_BYTE = 0x0000
1390: 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0000 }..enum : u
13a0: 69 6e 74 20 7b 20 50 49 50 45 5f 52 45 41 44 4d  int { PIPE_READM
13b0: 4f 44 45 5f 4d 45 53 53 41 47 45 20 3d 20 30 78  ODE_MESSAGE = 0x
13c0: 30 30 30 30 30 30 30 32 20 7d 0d 0a 65 6e 75 6d  00000002 }..enum
13d0: 20 3a 20 75 69 6e 74 20 7b 20 50 49 50 45 5f 54   : uint { PIPE_T
13e0: 59 50 45 5f 42 59 54 45 20 3d 20 30 78 30 30 30  YPE_BYTE = 0x000
13f0: 30 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  00000 }..enum : 
1400: 75 69 6e 74 20 7b 20 50 49 50 45 5f 54 59 50 45  uint { PIPE_TYPE
1410: 5f 4d 45 53 53 41 47 45 20 3d 20 30 78 30 30 30  _MESSAGE = 0x000
1420: 30 30 30 30 34 20 7d 0d 0a 0d 0a 65 6e 75 6d 20  00004 }....enum 
1430: 3a 20 75 69 6e 74 20 7b 20 50 49 50 45 5f 55 4e  : uint { PIPE_UN
1440: 4c 49 4d 49 54 45 44 5f 49 4e 53 54 41 4e 43 45  LIMITED_INSTANCE
1450: 53 20 3d 20 32 35 35 20 7d 0d 0a 0d 0a 65 6e 75  S = 255 }....enu
1460: 6d 20 3a 20 75 69 6e 74 20 7b 20 53 45 43 55 52  m : uint { SECUR
1470: 49 54 59 5f 41 4e 4f 4e 59 4d 4f 55 53 20 3d 20  ITY_ANONYMOUS = 
1480: 20 53 65 63 75 72 69 74 79 41 6e 6f 6e 79 6d 6f   SecurityAnonymo
1490: 75 73 20 3c 3c 20 31 36 20 20 7d 0d 0a 65 6e 75  us << 16  }..enu
14a0: 6d 20 3a 20 75 69 6e 74 20 7b 20 53 45 43 55 52  m : uint { SECUR
14b0: 49 54 59 5f 49 44 45 4e 54 49 46 49 43 41 54 49  ITY_IDENTIFICATI
14c0: 4f 4e 20 3d 20 20 53 65 63 75 72 69 74 79 49 64  ON =  SecurityId
14d0: 65 6e 74 69 66 69 63 61 74 69 6f 6e 20 3c 3c 20  entification << 
14e0: 31 36 20 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  16  }..enum : ui
14f0: 6e 74 20 7b 20 53 45 43 55 52 49 54 59 5f 49 4d  nt { SECURITY_IM
1500: 50 45 52 53 4f 4e 41 54 49 4f 4e 20 3d 20 20 53  PERSONATION =  S
1510: 65 63 75 72 69 74 79 49 6d 70 65 72 73 6f 6e 61  ecurityImpersona
1520: 74 69 6f 6e 20 3c 3c 20 31 36 20 20 7d 0d 0a 65  tion << 16  }..e
1530: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 45 43  num : uint { SEC
1540: 55 52 49 54 59 5f 44 45 4c 45 47 41 54 49 4f 4e  URITY_DELEGATION
1550: 20 3d 20 20 53 65 63 75 72 69 74 79 44 65 6c 65   =  SecurityDele
1560: 67 61 74 69 6f 6e 20 3c 3c 20 31 36 20 20 7d 0d  gation << 16  }.
1570: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
1580: 20 53 45 43 55 52 49 54 59 5f 43 4f 4e 54 45 58   SECURITY_CONTEX
1590: 54 5f 54 52 41 43 4b 49 4e 47 20 3d 20 30 78 30  T_TRACKING = 0x0
15a0: 30 30 34 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20  0040000 }..enum 
15b0: 3a 20 75 69 6e 74 20 7b 20 53 45 43 55 52 49 54  : uint { SECURIT
15c0: 59 5f 45 46 46 45 43 54 49 56 45 5f 4f 4e 4c 59  Y_EFFECTIVE_ONLY
15d0: 20 3d 20 30 78 30 30 30 38 30 30 30 30 20 7d 0d   = 0x00080000 }.
15e0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
15f0: 20 53 45 43 55 52 49 54 59 5f 53 51 4f 53 5f 50   SECURITY_SQOS_P
1600: 52 45 53 45 4e 54 20 3d 20 30 78 30 30 31 30 30  RESENT = 0x00100
1610: 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  000 }..enum : ui
1620: 6e 74 20 7b 20 53 45 43 55 52 49 54 59 5f 56 41  nt { SECURITY_VA
1630: 4c 49 44 5f 53 51 4f 53 5f 46 4c 41 47 53 20 3d  LID_SQOS_FLAGS =
1640: 20 30 78 30 30 31 46 30 30 30 30 20 7d 0d 0a 0d   0x001F0000 }...
1650: 0a 73 74 72 75 63 74 20 5f 4f 56 45 52 4c 41 50  .struct _OVERLAP
1660: 50 45 44 20 7b 0d 0a 20 20 55 4c 4f 4e 47 5f 50  PED {..  ULONG_P
1670: 54 52 20 49 6e 74 65 72 6e 61 6c 3b 0d 0a 20 20  TR Internal;..  
1680: 55 4c 4f 4e 47 5f 50 54 52 20 49 6e 74 65 72 6e  ULONG_PTR Intern
1690: 61 6c 48 69 67 68 3b 0d 0a 75 6e 69 6f 6e 20 7b  alHigh;..union {
16a0: 0d 0a 73 74 72 75 63 74 20 7b 0d 0a 20 20 44 57  ..struct {..  DW
16b0: 4f 52 44 20 4f 66 66 73 65 74 3b 0d 0a 20 20 44  ORD Offset;..  D
16c0: 57 4f 52 44 20 4f 66 66 73 65 74 48 69 67 68 3b  WORD OffsetHigh;
16d0: 0d 0a 7d 0d 0a 0d 0a 20 20 50 56 4f 49 44 20 50  ..}....  PVOID P
16e0: 6f 69 6e 74 65 72 3b 0d 0a 7d 0d 0a 0d 0a 20 20  ointer;..}....  
16f0: 48 41 4e 44 4c 45 20 68 45 76 65 6e 74 3b 0d 0a  HANDLE hEvent;..
1700: 7d 0d 0a 61 6c 69 61 73 20 5f 4f 56 45 52 4c 41  }..alias _OVERLA
1710: 50 50 45 44 20 4f 56 45 52 4c 41 50 50 45 44 3b  PPED OVERLAPPED;
1720: 0d 0a 61 6c 69 61 73 20 5f 4f 56 45 52 4c 41 50  ..alias _OVERLAP
1730: 50 45 44 2a 20 4c 50 4f 56 45 52 4c 41 50 50 45  PED* LPOVERLAPPE
1740: 44 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 53 45  D;....struct _SE
1750: 43 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45  CURITY_ATTRIBUTE
1760: 53 20 7b 0d 0a 20 20 44 57 4f 52 44 20 6e 4c 65  S {..  DWORD nLe
1770: 6e 67 74 68 3b 0d 0a 20 20 4c 50 56 4f 49 44 20  ngth;..  LPVOID 
1780: 6c 70 53 65 63 75 72 69 74 79 44 65 73 63 72 69  lpSecurityDescri
1790: 70 74 6f 72 3b 0d 0a 20 20 42 4f 4f 4c 20 62 49  ptor;..  BOOL bI
17a0: 6e 68 65 72 69 74 48 61 6e 64 6c 65 3b 0d 0a 7d  nheritHandle;..}
17b0: 0d 0a 61 6c 69 61 73 20 5f 53 45 43 55 52 49 54  ..alias _SECURIT
17c0: 59 5f 41 54 54 52 49 42 55 54 45 53 20 53 45 43  Y_ATTRIBUTES SEC
17d0: 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53  URITY_ATTRIBUTES
17e0: 3b 0d 0a 61 6c 69 61 73 20 5f 53 45 43 55 52 49  ;..alias _SECURI
17f0: 54 59 5f 41 54 54 52 49 42 55 54 45 53 2a 20 50  TY_ATTRIBUTES* P
1800: 53 45 43 55 52 49 54 59 5f 41 54 54 52 49 42 55  SECURITY_ATTRIBU
1810: 54 45 53 3b 0d 0a 61 6c 69 61 73 20 5f 53 45 43  TES;..alias _SEC
1820: 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53  URITY_ATTRIBUTES
1830: 2a 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54  * LPSECURITY_ATT
1840: 52 49 42 55 54 45 53 3b 0d 0a 0d 0a 73 74 72 75  RIBUTES;....stru
1850: 63 74 20 5f 50 52 4f 43 45 53 53 5f 49 4e 46 4f  ct _PROCESS_INFO
1860: 52 4d 41 54 49 4f 4e 20 7b 0d 0a 20 20 48 41 4e  RMATION {..  HAN
1870: 44 4c 45 20 68 50 72 6f 63 65 73 73 3b 0d 0a 20  DLE hProcess;.. 
1880: 20 48 41 4e 44 4c 45 20 68 54 68 72 65 61 64 3b   HANDLE hThread;
1890: 0d 0a 20 20 44 57 4f 52 44 20 64 77 50 72 6f 63  ..  DWORD dwProc
18a0: 65 73 73 49 64 3b 0d 0a 20 20 44 57 4f 52 44 20  essId;..  DWORD 
18b0: 64 77 54 68 72 65 61 64 49 64 3b 0d 0a 7d 0d 0a  dwThreadId;..}..
18c0: 61 6c 69 61 73 20 5f 50 52 4f 43 45 53 53 5f 49  alias _PROCESS_I
18d0: 4e 46 4f 52 4d 41 54 49 4f 4e 20 50 52 4f 43 45  NFORMATION PROCE
18e0: 53 53 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 3b 0d  SS_INFORMATION;.
18f0: 0a 61 6c 69 61 73 20 5f 50 52 4f 43 45 53 53 5f  .alias _PROCESS_
1900: 49 4e 46 4f 52 4d 41 54 49 4f 4e 2a 20 50 50 52  INFORMATION* PPR
1910: 4f 43 45 53 53 5f 49 4e 46 4f 52 4d 41 54 49 4f  OCESS_INFORMATIO
1920: 4e 3b 0d 0a 61 6c 69 61 73 20 5f 50 52 4f 43 45  N;..alias _PROCE
1930: 53 53 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 2a 20  SS_INFORMATION* 
1940: 4c 50 50 52 4f 43 45 53 53 5f 49 4e 46 4f 52 4d  LPPROCESS_INFORM
1950: 41 54 49 4f 4e 3b 0d 0a 0d 0a 73 74 72 75 63 74  ATION;....struct
1960: 20 5f 46 49 4c 45 54 49 4d 45 20 7b 0d 0a 20 20   _FILETIME {..  
1970: 44 57 4f 52 44 20 64 77 4c 6f 77 44 61 74 65 54  DWORD dwLowDateT
1980: 69 6d 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ime;..  DWORD dw
1990: 48 69 67 68 44 61 74 65 54 69 6d 65 3b 0d 0a 7d  HighDateTime;..}
19a0: 0d 0a 61 6c 69 61 73 20 5f 46 49 4c 45 54 49 4d  ..alias _FILETIM
19b0: 45 20 46 49 4c 45 54 49 4d 45 3b 0d 0a 61 6c 69  E FILETIME;..ali
19c0: 61 73 20 5f 46 49 4c 45 54 49 4d 45 2a 20 50 46  as _FILETIME* PF
19d0: 49 4c 45 54 49 4d 45 3b 0d 0a 61 6c 69 61 73 20  ILETIME;..alias 
19e0: 5f 46 49 4c 45 54 49 4d 45 2a 20 4c 50 46 49 4c  _FILETIME* LPFIL
19f0: 45 54 49 4d 45 3b 0d 0a 0d 0a 73 74 72 75 63 74  ETIME;....struct
1a00: 20 5f 53 59 53 54 45 4d 54 49 4d 45 20 7b 0d 0a   _SYSTEMTIME {..
1a10: 20 20 57 4f 52 44 20 77 59 65 61 72 3b 0d 0a 20    WORD wYear;.. 
1a20: 20 57 4f 52 44 20 77 4d 6f 6e 74 68 3b 0d 0a 20   WORD wMonth;.. 
1a30: 20 57 4f 52 44 20 77 44 61 79 4f 66 57 65 65 6b   WORD wDayOfWeek
1a40: 3b 0d 0a 20 20 57 4f 52 44 20 77 44 61 79 3b 0d  ;..  WORD wDay;.
1a50: 0a 20 20 57 4f 52 44 20 77 48 6f 75 72 3b 0d 0a  .  WORD wHour;..
1a60: 20 20 57 4f 52 44 20 77 4d 69 6e 75 74 65 3b 0d    WORD wMinute;.
1a70: 0a 20 20 57 4f 52 44 20 77 53 65 63 6f 6e 64 3b  .  WORD wSecond;
1a80: 0d 0a 20 20 57 4f 52 44 20 77 4d 69 6c 6c 69 73  ..  WORD wMillis
1a90: 65 63 6f 6e 64 73 3b 0d 0a 7d 0d 0a 61 6c 69 61  econds;..}..alia
1aa0: 73 20 5f 53 59 53 54 45 4d 54 49 4d 45 20 53 59  s _SYSTEMTIME SY
1ab0: 53 54 45 4d 54 49 4d 45 3b 0d 0a 61 6c 69 61 73  STEMTIME;..alias
1ac0: 20 5f 53 59 53 54 45 4d 54 49 4d 45 2a 20 50 53   _SYSTEMTIME* PS
1ad0: 59 53 54 45 4d 54 49 4d 45 3b 0d 0a 61 6c 69 61  YSTEMTIME;..alia
1ae0: 73 20 5f 53 59 53 54 45 4d 54 49 4d 45 2a 20 4c  s _SYSTEMTIME* L
1af0: 50 53 59 53 54 45 4d 54 49 4d 45 3b 0d 0a 0d 0a  PSYSTEMTIME;....
1b00: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1b10: 61 6c 69 61 73 20 44 57 4f 52 44 20 66 75 6e 63  alias DWORD func
1b20: 74 69 6f 6e 28 20 4c 50 56 4f 49 44 20 6c 70 54  tion( LPVOID lpT
1b30: 68 72 65 61 64 50 61 72 61 6d 65 74 65 72 20 29  hreadParameter )
1b40: 20 50 54 48 52 45 41 44 5f 53 54 41 52 54 5f 52   PTHREAD_START_R
1b50: 4f 55 54 49 4e 45 3b 0d 0a 61 6c 69 61 73 20 50  OUTINE;..alias P
1b60: 54 48 52 45 41 44 5f 53 54 41 52 54 5f 52 4f 55  THREAD_START_ROU
1b70: 54 49 4e 45 20 4c 50 54 48 52 45 41 44 5f 53 54  TINE LPTHREAD_ST
1b80: 41 52 54 5f 52 4f 55 54 49 4e 45 3b 0d 0a 0d 0a  ART_ROUTINE;....
1b90: 2f 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49  // #if(_WIN32_WI
1ba0: 4e 4e 54 20 3e 3d 20 30 78 30 34 30 30 29 0d 0a  NNT >= 0x0400)..
1bb0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1bc0: 61 6c 69 61 73 20 56 4f 49 44 20 66 75 6e 63 74  alias VOID funct
1bd0: 69 6f 6e 28 20 4c 50 56 4f 49 44 20 6c 70 46 69  ion( LPVOID lpFi
1be0: 62 65 72 50 61 72 61 6d 65 74 65 72 20 29 20 50  berParameter ) P
1bf0: 46 49 42 45 52 5f 53 54 41 52 54 5f 52 4f 55 54  FIBER_START_ROUT
1c00: 49 4e 45 3b 0d 0a 61 6c 69 61 73 20 50 46 49 42  INE;..alias PFIB
1c10: 45 52 5f 53 54 41 52 54 5f 52 4f 55 54 49 4e 45  ER_START_ROUTINE
1c20: 20 4c 50 46 49 42 45 52 5f 53 54 41 52 54 5f 52   LPFIBER_START_R
1c30: 4f 55 54 49 4e 45 3b 0d 0a 2f 2f 20 23 65 6e 64  OUTINE;..// #end
1c40: 69 66 20 2f 2a 20 5f 57 49 4e 33 32 5f 57 49 4e  if /* _WIN32_WIN
1c50: 4e 54 20 3e 3d 20 30 78 30 34 30 30 20 2a 2f 0d  NT >= 0x0400 */.
1c60: 0a 0d 0a 61 6c 69 61 73 20 52 54 4c 5f 43 52 49  ...alias RTL_CRI
1c70: 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20 43 52  TICAL_SECTION CR
1c80: 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 3b 0d  ITICAL_SECTION;.
1c90: 0a 61 6c 69 61 73 20 50 52 54 4c 5f 43 52 49 54  .alias PRTL_CRIT
1ca0: 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20 50 43 52  ICAL_SECTION PCR
1cb0: 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 3b 0d  ITICAL_SECTION;.
1cc0: 0a 61 6c 69 61 73 20 50 52 54 4c 5f 43 52 49 54  .alias PRTL_CRIT
1cd0: 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20 4c 50 43  ICAL_SECTION LPC
1ce0: 52 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 3b  RITICAL_SECTION;
1cf0: 0d 0a 0d 0a 61 6c 69 61 73 20 52 54 4c 5f 43 52  ....alias RTL_CR
1d00: 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 5f 44  ITICAL_SECTION_D
1d10: 45 42 55 47 20 43 52 49 54 49 43 41 4c 5f 53 45  EBUG CRITICAL_SE
1d20: 43 54 49 4f 4e 5f 44 45 42 55 47 3b 0d 0a 61 6c  CTION_DEBUG;..al
1d30: 69 61 73 20 50 52 54 4c 5f 43 52 49 54 49 43 41  ias PRTL_CRITICA
1d40: 4c 5f 53 45 43 54 49 4f 4e 5f 44 45 42 55 47 20  L_SECTION_DEBUG 
1d50: 50 43 52 49 54 49 43 41 4c 5f 53 45 43 54 49 4f  PCRITICAL_SECTIO
1d60: 4e 5f 44 45 42 55 47 3b 0d 0a 61 6c 69 61 73 20  N_DEBUG;..alias 
1d70: 50 52 54 4c 5f 43 52 49 54 49 43 41 4c 5f 53 45  PRTL_CRITICAL_SE
1d80: 43 54 49 4f 4e 5f 44 45 42 55 47 20 4c 50 43 52  CTION_DEBUG LPCR
1d90: 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 5f 44  ITICAL_SECTION_D
1da0: 45 42 55 47 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 20  EBUG;....// #if 
1db0: 64 65 66 69 6e 65 64 28 5f 58 38 36 5f 29 0d 0a  defined(_X86_)..
1dc0: 61 6c 69 61 73 20 50 4c 44 54 5f 45 4e 54 52 59  alias PLDT_ENTRY
1dd0: 20 4c 50 4c 44 54 5f 45 4e 54 52 59 3b 0d 0a 2f   LPLDT_ENTRY;../
1de0: 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20 2e 2e 2e 0d  / #else..// ....
1df0: 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 0d 0a 61 6c  .// #endif....al
1e00: 69 61 73 20 4d 55 54 41 4e 54 5f 51 55 45 52 59  ias MUTANT_QUERY
1e10: 5f 53 54 41 54 45 20 4d 55 54 45 58 5f 4d 4f 44  _STATE MUTEX_MOD
1e20: 49 46 59 5f 53 54 41 54 45 3b 0d 0a 61 6c 69 61  IFY_STATE;..alia
1e30: 73 20 4d 55 54 41 4e 54 5f 41 4c 4c 5f 41 43 43  s MUTANT_ALL_ACC
1e40: 45 53 53 20 4d 55 54 45 58 5f 41 4c 4c 5f 41 43  ESS MUTEX_ALL_AC
1e50: 43 45 53 53 3b 0d 0a 0d 0a 65 6e 75 6d 20 3a 20  CESS;....enum : 
1e60: 44 57 4f 52 44 20 7b 20 53 50 5f 53 45 52 49 41  DWORD { SP_SERIA
1e70: 4c 43 4f 4d 4d 20 3d 20 30 78 30 30 30 30 30 30  LCOMM = 0x000000
1e80: 30 31 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 44  01 }....enum : D
1e90: 57 4f 52 44 20 7b 20 50 53 54 5f 55 4e 53 50 45  WORD { PST_UNSPE
1ea0: 43 49 46 49 45 44 20 3d 20 30 78 30 30 30 30 30  CIFIED = 0x00000
1eb0: 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57  000 }..enum : DW
1ec0: 4f 52 44 20 7b 20 50 53 54 5f 52 53 32 33 32 20  ORD { PST_RS232 
1ed0: 3d 20 30 78 30 30 30 30 30 30 30 31 20 7d 0d 0a  = 0x00000001 }..
1ee0: 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 50  enum : DWORD { P
1ef0: 53 54 5f 50 41 52 41 4c 4c 45 4c 50 4f 52 54 20  ST_PARALLELPORT 
1f00: 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d 0d 0a  = 0x00000002 }..
1f10: 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 50  enum : DWORD { P
1f20: 53 54 5f 52 53 34 32 32 20 3d 20 30 78 30 30 30  ST_RS422 = 0x000
1f30: 30 30 30 30 33 20 7d 0d 0a 65 6e 75 6d 20 3a 20  00003 }..enum : 
1f40: 44 57 4f 52 44 20 7b 20 50 53 54 5f 52 53 34 32  DWORD { PST_RS42
1f50: 33 20 3d 20 30 78 30 30 30 30 30 30 30 34 20 7d  3 = 0x00000004 }
1f60: 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b  ..enum : DWORD {
1f70: 20 50 53 54 5f 52 53 34 34 39 20 3d 20 30 78 30   PST_RS449 = 0x0
1f80: 30 30 30 30 30 30 35 20 7d 0d 0a 65 6e 75 6d 20  0000005 }..enum 
1f90: 3a 20 44 57 4f 52 44 20 7b 20 50 53 54 5f 4d 4f  : DWORD { PST_MO
1fa0: 44 45 4d 20 3d 20 30 78 30 30 30 30 30 30 30 36  DEM = 0x00000006
1fb0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44   }..enum : DWORD
1fc0: 20 7b 20 50 53 54 5f 46 41 58 20 3d 20 30 78 30   { PST_FAX = 0x0
1fd0: 30 30 30 30 30 32 31 20 7d 0d 0a 65 6e 75 6d 20  0000021 }..enum 
1fe0: 3a 20 44 57 4f 52 44 20 7b 20 50 53 54 5f 53 43  : DWORD { PST_SC
1ff0: 41 4e 4e 45 52 20 3d 20 30 78 30 30 30 30 30 30  ANNER = 0x000000
2000: 32 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f  22 }..enum : DWO
2010: 52 44 20 7b 20 50 53 54 5f 4e 45 54 57 4f 52 4b  RD { PST_NETWORK
2020: 5f 42 52 49 44 47 45 20 3d 20 30 78 30 30 30 30  _BRIDGE = 0x0000
2030: 30 31 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44  0100 }..enum : D
2040: 57 4f 52 44 20 7b 20 50 53 54 5f 4c 41 54 20 3d  WORD { PST_LAT =
2050: 20 30 78 30 30 30 30 30 31 30 31 20 7d 0d 0a 65   0x00000101 }..e
2060: 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 50 53  num : DWORD { PS
2070: 54 5f 54 43 50 49 50 5f 54 45 4c 4e 45 54 20 3d  T_TCPIP_TELNET =
2080: 20 30 78 30 30 30 30 30 31 30 32 20 7d 0d 0a 65   0x00000102 }..e
2090: 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 50 53  num : DWORD { PS
20a0: 54 5f 58 32 35 20 3d 20 30 78 30 30 30 30 30 31  T_X25 = 0x000001
20b0: 30 33 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 44  03 }....enum : D
20c0: 57 4f 52 44 20 7b 20 50 43 46 5f 44 54 52 44 53  WORD { PCF_DTRDS
20d0: 52 20 3d 20 30 78 30 30 30 31 20 7d 0d 0a 65 6e  R = 0x0001 }..en
20e0: 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 50 43 46  um : DWORD { PCF
20f0: 5f 52 54 53 43 54 53 20 3d 20 30 78 30 30 30 32  _RTSCTS = 0x0002
2100: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44   }..enum : DWORD
2110: 20 7b 20 50 43 46 5f 52 4c 53 44 20 3d 20 30 78   { PCF_RLSD = 0x
2120: 30 30 30 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44  0004 }..enum : D
2130: 57 4f 52 44 20 7b 20 50 43 46 5f 50 41 52 49 54  WORD { PCF_PARIT
2140: 59 5f 43 48 45 43 4b 20 3d 20 30 78 30 30 30 38  Y_CHECK = 0x0008
2150: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44   }..enum : DWORD
2160: 20 7b 20 50 43 46 5f 58 4f 4e 58 4f 46 46 20 3d   { PCF_XONXOFF =
2170: 20 30 78 30 30 31 30 20 7d 0d 0a 65 6e 75 6d 20   0x0010 }..enum 
2180: 3a 20 44 57 4f 52 44 20 7b 20 50 43 46 5f 53 45  : DWORD { PCF_SE
2190: 54 58 43 48 41 52 20 3d 20 30 78 30 30 32 30 20  TXCHAR = 0x0020 
21a0: 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20  }..enum : DWORD 
21b0: 7b 20 50 43 46 5f 54 4f 54 41 4c 54 49 4d 45 4f  { PCF_TOTALTIMEO
21c0: 55 54 53 20 3d 20 30 78 30 30 34 30 20 7d 0d 0a  UTS = 0x0040 }..
21d0: 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 50  enum : DWORD { P
21e0: 43 46 5f 49 4e 54 54 49 4d 45 4f 55 54 53 20 3d  CF_INTTIMEOUTS =
21f0: 20 30 78 30 30 38 30 20 7d 0d 0a 65 6e 75 6d 20   0x0080 }..enum 
2200: 3a 20 44 57 4f 52 44 20 7b 20 50 43 46 5f 53 50  : DWORD { PCF_SP
2210: 45 43 49 41 4c 43 48 41 52 53 20 3d 20 30 78 30  ECIALCHARS = 0x0
2220: 31 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57  100 }..enum : DW
2230: 4f 52 44 20 7b 20 50 43 46 5f 31 36 42 49 54 4d  ORD { PCF_16BITM
2240: 4f 44 45 20 3d 20 30 78 30 32 30 30 20 7d 0d 0a  ODE = 0x0200 }..
2250: 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b  ..enum : DWORD {
2260: 20 53 50 5f 50 41 52 49 54 59 20 3d 20 30 78 30   SP_PARITY = 0x0
2270: 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57  001 }..enum : DW
2280: 4f 52 44 20 7b 20 53 50 5f 42 41 55 44 20 3d 20  ORD { SP_BAUD = 
2290: 30 78 30 30 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a  0x0002 }..enum :
22a0: 20 44 57 4f 52 44 20 7b 20 53 50 5f 44 41 54 41   DWORD { SP_DATA
22b0: 42 49 54 53 20 3d 20 30 78 30 30 30 34 20 7d 0d  BITS = 0x0004 }.
22c0: 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20  .enum : DWORD { 
22d0: 53 50 5f 53 54 4f 50 42 49 54 53 20 3d 20 30 78  SP_STOPBITS = 0x
22e0: 30 30 30 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44  0008 }..enum : D
22f0: 57 4f 52 44 20 7b 20 53 50 5f 48 41 4e 44 53 48  WORD { SP_HANDSH
2300: 41 4b 49 4e 47 20 3d 20 30 78 30 30 31 30 20 7d  AKING = 0x0010 }
2310: 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b  ..enum : DWORD {
2320: 20 53 50 5f 50 41 52 49 54 59 5f 43 48 45 43 4b   SP_PARITY_CHECK
2330: 20 3d 20 30 78 30 30 32 30 20 7d 0d 0a 65 6e 75   = 0x0020 }..enu
2340: 6d 20 3a 20 44 57 4f 52 44 20 7b 20 53 50 5f 52  m : DWORD { SP_R
2350: 4c 53 44 20 3d 20 30 78 30 30 34 30 20 7d 0d 0a  LSD = 0x0040 }..
2360: 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b  ..enum : DWORD {
2370: 20 42 41 55 44 5f 30 37 35 20 3d 20 30 78 30 30   BAUD_075 = 0x00
2380: 30 30 30 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a  000001 }..enum :
2390: 20 44 57 4f 52 44 20 7b 20 42 41 55 44 5f 31 31   DWORD { BAUD_11
23a0: 30 20 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d  0 = 0x00000002 }
23b0: 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b  ..enum : DWORD {
23c0: 20 42 41 55 44 5f 31 33 34 5f 35 20 3d 20 30 78   BAUD_134_5 = 0x
23d0: 30 30 30 30 30 30 30 34 20 7d 0d 0a 65 6e 75 6d  00000004 }..enum
23e0: 20 3a 20 44 57 4f 52 44 20 7b 20 42 41 55 44 5f   : DWORD { BAUD_
23f0: 31 35 30 20 3d 20 30 78 30 30 30 30 30 30 30 38  150 = 0x00000008
2400: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44   }..enum : DWORD
2410: 20 7b 20 42 41 55 44 5f 33 30 30 20 3d 20 30 78   { BAUD_300 = 0x
2420: 30 30 30 30 30 30 31 30 20 7d 0d 0a 65 6e 75 6d  00000010 }..enum
2430: 20 3a 20 44 57 4f 52 44 20 7b 20 42 41 55 44 5f   : DWORD { BAUD_
2440: 36 30 30 20 3d 20 30 78 30 30 30 30 30 30 32 30  600 = 0x00000020
2450: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44   }..enum : DWORD
2460: 20 7b 20 42 41 55 44 5f 31 32 30 30 20 3d 20 30   { BAUD_1200 = 0
2470: 78 30 30 30 30 30 30 34 30 20 7d 0d 0a 65 6e 75  x00000040 }..enu
2480: 6d 20 3a 20 44 57 4f 52 44 20 7b 20 42 41 55 44  m : DWORD { BAUD
2490: 5f 31 38 30 30 20 3d 20 30 78 30 30 30 30 30 30  _1800 = 0x000000
24a0: 38 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f  80 }..enum : DWO
24b0: 52 44 20 7b 20 42 41 55 44 5f 32 34 30 30 20 3d  RD { BAUD_2400 =
24c0: 20 30 78 30 30 30 30 30 31 30 30 20 7d 0d 0a 65   0x00000100 }..e
24d0: 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 42 41  num : DWORD { BA
24e0: 55 44 5f 34 38 30 30 20 3d 20 30 78 30 30 30 30  UD_4800 = 0x0000
24f0: 30 32 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44  0200 }..enum : D
2500: 57 4f 52 44 20 7b 20 42 41 55 44 5f 37 32 30 30  WORD { BAUD_7200
2510: 20 3d 20 30 78 30 30 30 30 30 34 30 30 20 7d 0d   = 0x00000400 }.
2520: 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20  .enum : DWORD { 
2530: 42 41 55 44 5f 39 36 30 30 20 3d 20 30 78 30 30  BAUD_9600 = 0x00
2540: 30 30 30 38 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a  000800 }..enum :
2550: 20 44 57 4f 52 44 20 7b 20 42 41 55 44 5f 31 34   DWORD { BAUD_14
2560: 34 30 30 20 3d 20 30 78 30 30 30 30 31 30 30 30  400 = 0x00001000
2570: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44   }..enum : DWORD
2580: 20 7b 20 42 41 55 44 5f 31 39 32 30 30 20 3d 20   { BAUD_19200 = 
2590: 30 78 30 30 30 30 32 30 30 30 20 7d 0d 0a 65 6e  0x00002000 }..en
25a0: 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 42 41 55  um : DWORD { BAU
25b0: 44 5f 33 38 34 30 30 20 3d 20 30 78 30 30 30 30  D_38400 = 0x0000
25c0: 34 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44  4000 }..enum : D
25d0: 57 4f 52 44 20 7b 20 42 41 55 44 5f 35 36 4b 20  WORD { BAUD_56K 
25e0: 3d 20 30 78 30 30 30 30 38 30 30 30 20 7d 0d 0a  = 0x00008000 }..
25f0: 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 42  enum : DWORD { B
2600: 41 55 44 5f 31 32 38 4b 20 3d 20 30 78 30 30 30  AUD_128K = 0x000
2610: 31 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  10000 }..enum : 
2620: 44 57 4f 52 44 20 7b 20 42 41 55 44 5f 31 31 35  DWORD { BAUD_115
2630: 32 30 30 20 3d 20 30 78 30 30 30 32 30 30 30 30  200 = 0x00020000
2640: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52 44   }..enum : DWORD
2650: 20 7b 20 42 41 55 44 5f 35 37 36 30 30 20 3d 20   { BAUD_57600 = 
2660: 30 78 30 30 30 34 30 30 30 30 20 7d 0d 0a 65 6e  0x00040000 }..en
2670: 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 42 41 55  um : DWORD { BAU
2680: 44 5f 55 53 45 52 20 3d 20 30 78 31 30 30 30 30  D_USER = 0x10000
2690: 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20  000 }....enum : 
26a0: 57 4f 52 44 20 7b 20 44 41 54 41 42 49 54 53 5f  WORD { DATABITS_
26b0: 35 20 3d 20 30 78 30 30 30 31 20 7d 0d 0a 65 6e  5 = 0x0001 }..en
26c0: 75 6d 20 3a 20 57 4f 52 44 20 7b 20 44 41 54 41  um : WORD { DATA
26d0: 42 49 54 53 5f 36 20 3d 20 30 78 30 30 30 32 20  BITS_6 = 0x0002 
26e0: 7d 0d 0a 65 6e 75 6d 20 3a 20 57 4f 52 44 20 7b  }..enum : WORD {
26f0: 20 44 41 54 41 42 49 54 53 5f 37 20 3d 20 30 78   DATABITS_7 = 0x
2700: 30 30 30 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 57  0004 }..enum : W
2710: 4f 52 44 20 7b 20 44 41 54 41 42 49 54 53 5f 38  ORD { DATABITS_8
2720: 20 3d 20 30 78 30 30 30 38 20 7d 0d 0a 65 6e 75   = 0x0008 }..enu
2730: 6d 20 3a 20 57 4f 52 44 20 7b 20 44 41 54 41 42  m : WORD { DATAB
2740: 49 54 53 5f 31 36 20 3d 20 30 78 30 30 31 30 20  ITS_16 = 0x0010 
2750: 7d 0d 0a 65 6e 75 6d 20 3a 20 57 4f 52 44 20 7b  }..enum : WORD {
2760: 20 44 41 54 41 42 49 54 53 5f 31 36 58 20 3d 20   DATABITS_16X = 
2770: 30 78 30 30 32 30 20 7d 0d 0a 0d 0a 65 6e 75 6d  0x0020 }....enum
2780: 20 3a 20 57 4f 52 44 20 7b 20 53 54 4f 50 42 49   : WORD { STOPBI
2790: 54 53 5f 31 30 20 3d 20 30 78 30 30 30 31 20 7d  TS_10 = 0x0001 }
27a0: 0d 0a 65 6e 75 6d 20 3a 20 57 4f 52 44 20 7b 20  ..enum : WORD { 
27b0: 53 54 4f 50 42 49 54 53 5f 31 35 20 3d 20 30 78  STOPBITS_15 = 0x
27c0: 30 30 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 57  0002 }..enum : W
27d0: 4f 52 44 20 7b 20 53 54 4f 50 42 49 54 53 5f 32  ORD { STOPBITS_2
27e0: 30 20 3d 20 30 78 30 30 30 34 20 7d 0d 0a 65 6e  0 = 0x0004 }..en
27f0: 75 6d 20 3a 20 57 4f 52 44 20 7b 20 50 41 52 49  um : WORD { PARI
2800: 54 59 5f 4e 4f 4e 45 20 3d 20 30 78 30 31 30 30  TY_NONE = 0x0100
2810: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 57 4f 52 44 20   }..enum : WORD 
2820: 7b 20 50 41 52 49 54 59 5f 4f 44 44 20 3d 20 30  { PARITY_ODD = 0
2830: 78 30 32 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  x0200 }..enum : 
2840: 57 4f 52 44 20 7b 20 50 41 52 49 54 59 5f 45 56  WORD { PARITY_EV
2850: 45 4e 20 3d 20 30 78 30 34 30 30 20 7d 0d 0a 65  EN = 0x0400 }..e
2860: 6e 75 6d 20 3a 20 57 4f 52 44 20 7b 20 50 41 52  num : WORD { PAR
2870: 49 54 59 5f 4d 41 52 4b 20 3d 20 30 78 30 38 30  ITY_MARK = 0x080
2880: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 57 4f 52 44  0 }..enum : WORD
2890: 20 7b 20 50 41 52 49 54 59 5f 53 50 41 43 45 20   { PARITY_SPACE 
28a0: 3d 20 30 78 31 30 30 30 20 7d 0d 0a 0d 0a 73 74  = 0x1000 }....st
28b0: 72 75 63 74 20 5f 43 4f 4d 4d 50 52 4f 50 20 7b  ruct _COMMPROP {
28c0: 0d 0a 20 20 57 4f 52 44 20 77 50 61 63 6b 65 74  ..  WORD wPacket
28d0: 4c 65 6e 67 74 68 3b 0d 0a 20 20 57 4f 52 44 20  Length;..  WORD 
28e0: 77 50 61 63 6b 65 74 56 65 72 73 69 6f 6e 3b 0d  wPacketVersion;.
28f0: 0a 20 20 44 57 4f 52 44 20 64 77 53 65 72 76 69  .  DWORD dwServi
2900: 63 65 4d 61 73 6b 3b 0d 0a 20 20 44 57 4f 52 44  ceMask;..  DWORD
2910: 20 64 77 52 65 73 65 72 76 65 64 31 3b 0d 0a 20   dwReserved1;.. 
2920: 20 44 57 4f 52 44 20 64 77 4d 61 78 54 78 51 75   DWORD dwMaxTxQu
2930: 65 75 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  eue;..  DWORD dw
2940: 4d 61 78 52 78 51 75 65 75 65 3b 0d 0a 20 20 44  MaxRxQueue;..  D
2950: 57 4f 52 44 20 64 77 4d 61 78 42 61 75 64 3b 0d  WORD dwMaxBaud;.
2960: 0a 20 20 44 57 4f 52 44 20 64 77 50 72 6f 76 53  .  DWORD dwProvS
2970: 75 62 54 79 70 65 3b 0d 0a 20 20 44 57 4f 52 44  ubType;..  DWORD
2980: 20 64 77 50 72 6f 76 43 61 70 61 62 69 6c 69 74   dwProvCapabilit
2990: 69 65 73 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ies;..  DWORD dw
29a0: 53 65 74 74 61 62 6c 65 50 61 72 61 6d 73 3b 0d  SettableParams;.
29b0: 0a 20 20 44 57 4f 52 44 20 64 77 53 65 74 74 61  .  DWORD dwSetta
29c0: 62 6c 65 42 61 75 64 3b 0d 0a 20 20 57 4f 52 44  bleBaud;..  WORD
29d0: 20 77 53 65 74 74 61 62 6c 65 44 61 74 61 3b 0d   wSettableData;.
29e0: 0a 20 20 57 4f 52 44 20 77 53 65 74 74 61 62 6c  .  WORD wSettabl
29f0: 65 53 74 6f 70 50 61 72 69 74 79 3b 0d 0a 20 20  eStopParity;..  
2a00: 44 57 4f 52 44 20 64 77 43 75 72 72 65 6e 74 54  DWORD dwCurrentT
2a10: 78 51 75 65 75 65 3b 0d 0a 20 20 44 57 4f 52 44  xQueue;..  DWORD
2a20: 20 64 77 43 75 72 72 65 6e 74 52 78 51 75 65 75   dwCurrentRxQueu
2a30: 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77 50 72  e;..  DWORD dwPr
2a40: 6f 76 53 70 65 63 31 3b 0d 0a 20 20 44 57 4f 52  ovSpec1;..  DWOR
2a50: 44 20 64 77 50 72 6f 76 53 70 65 63 32 3b 0d 0a  D dwProvSpec2;..
2a60: 20 20 57 43 48 41 52 20 77 63 50 72 6f 76 43 68    WCHAR wcProvCh
2a70: 61 72 5b 31 5d 3b 0d 0a 7d 0d 0a 61 6c 69 61 73  ar[1];..}..alias
2a80: 20 5f 43 4f 4d 4d 50 52 4f 50 20 43 4f 4d 4d 50   _COMMPROP COMMP
2a90: 52 4f 50 3b 0d 0a 61 6c 69 61 73 20 5f 43 4f 4d  ROP;..alias _COM
2aa0: 4d 50 52 4f 50 2a 20 4c 50 43 4f 4d 4d 50 52 4f  MPROP* LPCOMMPRO
2ab0: 50 3b 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f  P;....enum : DWO
2ac0: 52 44 20 7b 20 43 4f 4d 4d 50 52 4f 50 5f 49 4e  RD { COMMPROP_IN
2ad0: 49 54 49 41 4c 49 5a 45 44 20 3d 20 30 78 45 37  ITIALIZED = 0xE7
2ae0: 33 43 46 35 32 45 20 7d 0d 0a 0d 0a 73 74 72 75  3CF52E }....stru
2af0: 63 74 20 5f 43 4f 4d 53 54 41 54 20 7b 0d 0a 2f  ct _COMSTAT {../
2b00: 2f 20 44 57 4f 52 44 20 66 43 74 73 48 6f 6c 64  / DWORD fCtsHold
2b10: 20 3a 20 31 3b 0d 0a 2f 2f 20 44 57 4f 52 44 20   : 1;..// DWORD 
2b20: 66 44 73 72 48 6f 6c 64 20 3a 20 31 3b 0d 0a 2f  fDsrHold : 1;../
2b30: 2f 20 44 57 4f 52 44 20 66 52 6c 73 64 48 6f 6c  / DWORD fRlsdHol
2b40: 64 20 3a 20 31 3b 0d 0a 2f 2f 20 44 57 4f 52 44  d : 1;..// DWORD
2b50: 20 66 58 6f 66 66 48 6f 6c 64 20 3a 20 31 3b 0d   fXoffHold : 1;.
2b60: 0a 2f 2f 20 44 57 4f 52 44 20 66 58 6f 66 66 53  .// DWORD fXoffS
2b70: 65 6e 74 20 3a 20 31 3b 0d 0a 2f 2f 20 44 57 4f  ent : 1;..// DWO
2b80: 52 44 20 66 45 6f 66 20 3a 20 31 3b 0d 0a 2f 2f  RD fEof : 1;..//
2b90: 20 44 57 4f 52 44 20 66 54 78 69 6d 20 3a 20 31   DWORD fTxim : 1
2ba0: 3b 0d 0a 2f 2f 20 44 57 4f 52 44 20 66 52 65 73  ;..// DWORD fRes
2bb0: 65 72 76 65 64 20 3a 20 32 35 3b 0d 0a 20 20 44  erved : 25;..  D
2bc0: 57 4f 52 44 20 63 62 49 6e 51 75 65 3b 0d 0a 20  WORD cbInQue;.. 
2bd0: 20 44 57 4f 52 44 20 63 62 4f 75 74 51 75 65 3b   DWORD cbOutQue;
2be0: 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 43 4f 4d 53  ..}..alias _COMS
2bf0: 54 41 54 20 43 4f 4d 53 54 41 54 3b 0d 0a 61 6c  TAT COMSTAT;..al
2c00: 69 61 73 20 5f 43 4f 4d 53 54 41 54 2a 20 4c 50  ias _COMSTAT* LP
2c10: 43 4f 4d 53 54 41 54 3b 0d 0a 0d 0a 65 6e 75 6d  COMSTAT;....enum
2c20: 20 3a 20 75 69 6e 74 20 7b 20 44 54 52 5f 43 4f   : uint { DTR_CO
2c30: 4e 54 52 4f 4c 5f 44 49 53 41 42 4c 45 20 3d 20  NTROL_DISABLE = 
2c40: 30 78 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0x00 }..enum : u
2c50: 69 6e 74 20 7b 20 44 54 52 5f 43 4f 4e 54 52 4f  int { DTR_CONTRO
2c60: 4c 5f 45 4e 41 42 4c 45 20 3d 20 30 78 30 31 20  L_ENABLE = 0x01 
2c70: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
2c80: 20 44 54 52 5f 43 4f 4e 54 52 4f 4c 5f 48 41 4e   DTR_CONTROL_HAN
2c90: 44 53 48 41 4b 45 20 3d 20 30 78 30 32 20 7d 0d  DSHAKE = 0x02 }.
2ca0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
2cb0: 20 52 54 53 5f 43 4f 4e 54 52 4f 4c 5f 44 49 53   RTS_CONTROL_DIS
2cc0: 41 42 4c 45 20 3d 20 30 78 30 30 20 7d 0d 0a 65  ABLE = 0x00 }..e
2cd0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 52 54 53  num : uint { RTS
2ce0: 5f 43 4f 4e 54 52 4f 4c 5f 45 4e 41 42 4c 45 20  _CONTROL_ENABLE 
2cf0: 3d 20 30 78 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a  = 0x01 }..enum :
2d00: 20 75 69 6e 74 20 7b 20 52 54 53 5f 43 4f 4e 54   uint { RTS_CONT
2d10: 52 4f 4c 5f 48 41 4e 44 53 48 41 4b 45 20 3d 20  ROL_HANDSHAKE = 
2d20: 30 78 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0x02 }..enum : u
2d30: 69 6e 74 20 7b 20 52 54 53 5f 43 4f 4e 54 52 4f  int { RTS_CONTRO
2d40: 4c 5f 54 4f 47 47 4c 45 20 3d 20 30 78 30 33 20  L_TOGGLE = 0x03 
2d50: 7d 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 44 43 42  }....struct _DCB
2d60: 20 7b 0d 0a 20 20 44 57 4f 52 44 20 44 43 42 6c   {..  DWORD DCBl
2d70: 65 6e 67 74 68 3b 0d 0a 20 20 44 57 4f 52 44 20  ength;..  DWORD 
2d80: 42 61 75 64 52 61 74 65 3b 0d 0a 2f 2f 20 44 57  BaudRate;..// DW
2d90: 4f 52 44 20 66 42 69 6e 61 72 79 3a 20 31 3b 0d  ORD fBinary: 1;.
2da0: 0a 2f 2f 20 44 57 4f 52 44 20 66 50 61 72 69 74  .// DWORD fParit
2db0: 79 3a 20 31 3b 0d 0a 2f 2f 20 44 57 4f 52 44 20  y: 1;..// DWORD 
2dc0: 66 4f 75 74 78 43 74 73 46 6c 6f 77 3a 31 3b 0d  fOutxCtsFlow:1;.
2dd0: 0a 2f 2f 20 44 57 4f 52 44 20 66 4f 75 74 78 44  .// DWORD fOutxD
2de0: 73 72 46 6c 6f 77 3a 31 3b 0d 0a 2f 2f 20 44 57  srFlow:1;..// DW
2df0: 4f 52 44 20 66 44 74 72 43 6f 6e 74 72 6f 6c 3a  ORD fDtrControl:
2e00: 32 3b 0d 0a 2f 2f 20 44 57 4f 52 44 20 66 44 73  2;..// DWORD fDs
2e10: 72 53 65 6e 73 69 74 69 76 69 74 79 3a 31 3b 0d  rSensitivity:1;.
2e20: 0a 2f 2f 20 44 57 4f 52 44 20 66 54 58 43 6f 6e  .// DWORD fTXCon
2e30: 74 69 6e 75 65 4f 6e 58 6f 66 66 3a 20 31 3b 0d  tinueOnXoff: 1;.
2e40: 0a 2f 2f 20 44 57 4f 52 44 20 66 4f 75 74 58 3a  .// DWORD fOutX:
2e50: 20 31 3b 0d 0a 2f 2f 20 44 57 4f 52 44 20 66 49   1;..// DWORD fI
2e60: 6e 58 3a 20 31 3b 0d 0a 2f 2f 20 44 57 4f 52 44  nX: 1;..// DWORD
2e70: 20 66 45 72 72 6f 72 43 68 61 72 3a 20 31 3b 0d   fErrorChar: 1;.
2e80: 0a 2f 2f 20 44 57 4f 52 44 20 66 4e 75 6c 6c 3a  .// DWORD fNull:
2e90: 20 31 3b 0d 0a 2f 2f 20 44 57 4f 52 44 20 66 52   1;..// DWORD fR
2ea0: 74 73 43 6f 6e 74 72 6f 6c 3a 32 3b 0d 0a 2f 2f  tsControl:2;..//
2eb0: 20 44 57 4f 52 44 20 66 41 62 6f 72 74 4f 6e 45   DWORD fAbortOnE
2ec0: 72 72 6f 72 3a 31 3b 0d 0a 2f 2f 20 44 57 4f 52  rror:1;..// DWOR
2ed0: 44 20 66 44 75 6d 6d 79 32 3a 31 37 3b 0d 0a 20  D fDummy2:17;.. 
2ee0: 20 57 4f 52 44 20 77 52 65 73 65 72 76 65 64 3b   WORD wReserved;
2ef0: 0d 0a 20 20 57 4f 52 44 20 58 6f 6e 4c 69 6d 3b  ..  WORD XonLim;
2f00: 0d 0a 20 20 57 4f 52 44 20 58 6f 66 66 4c 69 6d  ..  WORD XoffLim
2f10: 3b 0d 0a 20 20 42 59 54 45 20 42 79 74 65 53 69  ;..  BYTE ByteSi
2f20: 7a 65 3b 0d 0a 20 20 42 59 54 45 20 50 61 72 69  ze;..  BYTE Pari
2f30: 74 79 3b 0d 0a 20 20 42 59 54 45 20 53 74 6f 70  ty;..  BYTE Stop
2f40: 42 69 74 73 3b 0d 0a 20 20 63 68 61 72 20 58 6f  Bits;..  char Xo
2f50: 6e 43 68 61 72 3b 0d 0a 20 20 63 68 61 72 20 58  nChar;..  char X
2f60: 6f 66 66 43 68 61 72 3b 0d 0a 20 20 63 68 61 72  offChar;..  char
2f70: 20 45 72 72 6f 72 43 68 61 72 3b 0d 0a 20 20 63   ErrorChar;..  c
2f80: 68 61 72 20 45 6f 66 43 68 61 72 3b 0d 0a 20 20  har EofChar;..  
2f90: 63 68 61 72 20 45 76 74 43 68 61 72 3b 0d 0a 20  char EvtChar;.. 
2fa0: 20 57 4f 52 44 20 77 52 65 73 65 72 76 65 64 31   WORD wReserved1
2fb0: 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 44 43 42  ;..}..alias _DCB
2fc0: 20 44 43 42 3b 0d 0a 61 6c 69 61 73 20 5f 44 43   DCB;..alias _DC
2fd0: 42 2a 20 4c 50 44 43 42 3b 0d 0a 0d 0a 73 74 72  B* LPDCB;....str
2fe0: 75 63 74 20 5f 43 4f 4d 4d 54 49 4d 45 4f 55 54  uct _COMMTIMEOUT
2ff0: 53 20 7b 0d 0a 20 20 44 57 4f 52 44 20 52 65 61  S {..  DWORD Rea
3000: 64 49 6e 74 65 72 76 61 6c 54 69 6d 65 6f 75 74  dIntervalTimeout
3010: 3b 0d 0a 20 20 44 57 4f 52 44 20 52 65 61 64 54  ;..  DWORD ReadT
3020: 6f 74 61 6c 54 69 6d 65 6f 75 74 4d 75 6c 74 69  otalTimeoutMulti
3030: 70 6c 69 65 72 3b 0d 0a 20 20 44 57 4f 52 44 20  plier;..  DWORD 
3040: 52 65 61 64 54 6f 74 61 6c 54 69 6d 65 6f 75 74  ReadTotalTimeout
3050: 43 6f 6e 73 74 61 6e 74 3b 0d 0a 20 20 44 57 4f  Constant;..  DWO
3060: 52 44 20 57 72 69 74 65 54 6f 74 61 6c 54 69 6d  RD WriteTotalTim
3070: 65 6f 75 74 4d 75 6c 74 69 70 6c 69 65 72 3b 0d  eoutMultiplier;.
3080: 0a 20 20 44 57 4f 52 44 20 57 72 69 74 65 54 6f  .  DWORD WriteTo
3090: 74 61 6c 54 69 6d 65 6f 75 74 43 6f 6e 73 74 61  talTimeoutConsta
30a0: 6e 74 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 43  nt;..}..alias _C
30b0: 4f 4d 4d 54 49 4d 45 4f 55 54 53 20 43 4f 4d 4d  OMMTIMEOUTS COMM
30c0: 54 49 4d 45 4f 55 54 53 3b 0d 0a 61 6c 69 61 73  TIMEOUTS;..alias
30d0: 20 5f 43 4f 4d 4d 54 49 4d 45 4f 55 54 53 2a 20   _COMMTIMEOUTS* 
30e0: 4c 50 43 4f 4d 4d 54 49 4d 45 4f 55 54 53 3b 0d  LPCOMMTIMEOUTS;.
30f0: 0a 0d 0a 73 74 72 75 63 74 20 5f 43 4f 4d 4d 43  ...struct _COMMC
3100: 4f 4e 46 49 47 20 7b 0d 0a 20 20 44 57 4f 52 44  ONFIG {..  DWORD
3110: 20 64 77 53 69 7a 65 3b 0d 0a 20 20 57 4f 52 44   dwSize;..  WORD
3120: 20 77 56 65 72 73 69 6f 6e 3b 0d 0a 20 20 57 4f   wVersion;..  WO
3130: 52 44 20 77 52 65 73 65 72 76 65 64 3b 0d 0a 20  RD wReserved;.. 
3140: 20 44 43 42 20 64 63 62 3b 0d 0a 20 20 44 57 4f   DCB dcb;..  DWO
3150: 52 44 20 64 77 50 72 6f 76 69 64 65 72 53 75 62  RD dwProviderSub
3160: 54 79 70 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64  Type;..  DWORD d
3170: 77 50 72 6f 76 69 64 65 72 4f 66 66 73 65 74 3b  wProviderOffset;
3180: 0d 0a 20 20 44 57 4f 52 44 20 64 77 50 72 6f 76  ..  DWORD dwProv
3190: 69 64 65 72 53 69 7a 65 3b 0d 0a 20 20 57 43 48  iderSize;..  WCH
31a0: 41 52 20 77 63 50 72 6f 76 69 64 65 72 44 61 74  AR wcProviderDat
31b0: 61 5b 31 5d 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20  a[1];..}..alias 
31c0: 5f 43 4f 4d 4d 43 4f 4e 46 49 47 20 43 4f 4d 4d  _COMMCONFIG COMM
31d0: 43 4f 4e 46 49 47 3b 0d 0a 61 6c 69 61 73 20 5f  CONFIG;..alias _
31e0: 43 4f 4d 4d 43 4f 4e 46 49 47 2a 20 4c 50 43 4f  COMMCONFIG* LPCO
31f0: 4d 4d 43 4f 4e 46 49 47 3b 0d 0a 0d 0a 73 74 72  MMCONFIG;....str
3200: 75 63 74 20 5f 53 59 53 54 45 4d 5f 49 4e 46 4f  uct _SYSTEM_INFO
3210: 20 7b 0d 0a 75 6e 69 6f 6e 20 7b 0d 0a 20 20 44   {..union {..  D
3220: 57 4f 52 44 20 64 77 4f 65 6d 49 64 3b 0d 0a 73  WORD dwOemId;..s
3230: 74 72 75 63 74 20 7b 0d 0a 20 20 57 4f 52 44 20  truct {..  WORD 
3240: 77 50 72 6f 63 65 73 73 6f 72 41 72 63 68 69 74  wProcessorArchit
3250: 65 63 74 75 72 65 3b 0d 0a 20 20 57 4f 52 44 20  ecture;..  WORD 
3260: 77 52 65 73 65 72 76 65 64 3b 0d 0a 7d 0d 0a 0d  wReserved;..}...
3270: 0a 7d 0d 0a 0d 0a 20 20 44 57 4f 52 44 20 64 77  .}....  DWORD dw
3280: 50 61 67 65 53 69 7a 65 3b 0d 0a 20 20 4c 50 56  PageSize;..  LPV
3290: 4f 49 44 20 6c 70 4d 69 6e 69 6d 75 6d 41 70 70  OID lpMinimumApp
32a0: 6c 69 63 61 74 69 6f 6e 41 64 64 72 65 73 73 3b  licationAddress;
32b0: 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 4d 61 78  ..  LPVOID lpMax
32c0: 69 6d 75 6d 41 70 70 6c 69 63 61 74 69 6f 6e 41  imumApplicationA
32d0: 64 64 72 65 73 73 3b 0d 0a 20 20 44 57 4f 52 44  ddress;..  DWORD
32e0: 5f 50 54 52 20 64 77 41 63 74 69 76 65 50 72 6f  _PTR dwActivePro
32f0: 63 65 73 73 6f 72 4d 61 73 6b 3b 0d 0a 20 20 44  cessorMask;..  D
3300: 57 4f 52 44 20 64 77 4e 75 6d 62 65 72 4f 66 50  WORD dwNumberOfP
3310: 72 6f 63 65 73 73 6f 72 73 3b 0d 0a 20 20 44 57  rocessors;..  DW
3320: 4f 52 44 20 64 77 50 72 6f 63 65 73 73 6f 72 54  ORD dwProcessorT
3330: 79 70 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ype;..  DWORD dw
3340: 41 6c 6c 6f 63 61 74 69 6f 6e 47 72 61 6e 75 6c  AllocationGranul
3350: 61 72 69 74 79 3b 0d 0a 20 20 57 4f 52 44 20 77  arity;..  WORD w
3360: 50 72 6f 63 65 73 73 6f 72 4c 65 76 65 6c 3b 0d  ProcessorLevel;.
3370: 0a 20 20 57 4f 52 44 20 77 50 72 6f 63 65 73 73  .  WORD wProcess
3380: 6f 72 52 65 76 69 73 69 6f 6e 3b 0d 0a 7d 0d 0a  orRevision;..}..
3390: 61 6c 69 61 73 20 5f 53 59 53 54 45 4d 5f 49 4e  alias _SYSTEM_IN
33a0: 46 4f 20 53 59 53 54 45 4d 5f 49 4e 46 4f 3b 0d  FO SYSTEM_INFO;.
33b0: 0a 61 6c 69 61 73 20 5f 53 59 53 54 45 4d 5f 49  .alias _SYSTEM_I
33c0: 4e 46 4f 2a 20 4c 50 53 59 53 54 45 4d 5f 49 4e  NFO* LPSYSTEM_IN
33d0: 46 4f 3b 0d 0a 0d 0a 61 6c 69 61 73 20 46 72 65  FO;....alias Fre
33e0: 65 4c 69 62 72 61 72 79 20 46 72 65 65 4d 6f 64  eLibrary FreeMod
33f0: 75 6c 65 3b 0d 0a 2f 2f 20 23 64 65 66 69 6e 65  ule;..// #define
3400: 20 4d 61 6b 65 50 72 6f 63 49 6e 73 74 61 6e 63   MakeProcInstanc
3410: 65 28 6c 70 50 72 6f 63 2c 68 49 6e 73 74 61 6e  e(lpProc,hInstan
3420: 63 65 29 20 28 6c 70 50 72 6f 63 29 0d 0a 2f 2f  ce) (lpProc)..//
3430: 20 23 64 65 66 69 6e 65 20 46 72 65 65 50 72 6f   #define FreePro
3440: 63 49 6e 73 74 61 6e 63 65 28 6c 70 50 72 6f 63  cInstance(lpProc
3450: 29 20 28 6c 70 50 72 6f 63 29 0d 0a 0d 0a 65 6e  ) (lpProc)....en
3460: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 47 4d 45 4d  um : uint { GMEM
3470: 5f 46 49 58 45 44 20 3d 20 30 78 30 30 30 30 20  _FIXED = 0x0000 
3480: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
3490: 20 47 4d 45 4d 5f 4d 4f 56 45 41 42 4c 45 20 3d   GMEM_MOVEABLE =
34a0: 20 30 78 30 30 30 32 20 7d 0d 0a 65 6e 75 6d 20   0x0002 }..enum 
34b0: 3a 20 75 69 6e 74 20 7b 20 47 4d 45 4d 5f 4e 4f  : uint { GMEM_NO
34c0: 43 4f 4d 50 41 43 54 20 3d 20 30 78 30 30 31 30  COMPACT = 0x0010
34d0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
34e0: 7b 20 47 4d 45 4d 5f 4e 4f 44 49 53 43 41 52 44  { GMEM_NODISCARD
34f0: 20 3d 20 30 78 30 30 32 30 20 7d 0d 0a 65 6e 75   = 0x0020 }..enu
3500: 6d 20 3a 20 75 69 6e 74 20 7b 20 47 4d 45 4d 5f  m : uint { GMEM_
3510: 5a 45 52 4f 49 4e 49 54 20 3d 20 30 78 30 30 34  ZEROINIT = 0x004
3520: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
3530: 20 7b 20 47 4d 45 4d 5f 4d 4f 44 49 46 59 20 3d   { GMEM_MODIFY =
3540: 20 30 78 30 30 38 30 20 7d 0d 0a 65 6e 75 6d 20   0x0080 }..enum 
3550: 3a 20 75 69 6e 74 20 7b 20 47 4d 45 4d 5f 44 49  : uint { GMEM_DI
3560: 53 43 41 52 44 41 42 4c 45 20 3d 20 30 78 30 31  SCARDABLE = 0x01
3570: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  00 }..enum : uin
3580: 74 20 7b 20 47 4d 45 4d 5f 4e 4f 54 5f 42 41 4e  t { GMEM_NOT_BAN
3590: 4b 45 44 20 3d 20 30 78 31 30 30 30 20 7d 0d 0a  KED = 0x1000 }..
35a0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 47 4d  enum : uint { GM
35b0: 45 4d 5f 53 48 41 52 45 20 3d 20 30 78 32 30 30  EM_SHARE = 0x200
35c0: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
35d0: 20 7b 20 47 4d 45 4d 5f 44 44 45 53 48 41 52 45   { GMEM_DDESHARE
35e0: 20 3d 20 30 78 32 30 30 30 20 7d 0d 0a 65 6e 75   = 0x2000 }..enu
35f0: 6d 20 3a 20 75 69 6e 74 20 7b 20 47 4d 45 4d 5f  m : uint { GMEM_
3600: 4e 4f 54 49 46 59 20 3d 20 30 78 34 30 30 30 20  NOTIFY = 0x4000 
3610: 7d 0d 0a 61 6c 69 61 73 20 47 4d 45 4d 5f 4e 4f  }..alias GMEM_NO
3620: 54 5f 42 41 4e 4b 45 44 20 47 4d 45 4d 5f 4c 4f  T_BANKED GMEM_LO
3630: 57 45 52 3b 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  WER;..enum : uin
3640: 74 20 7b 20 47 4d 45 4d 5f 56 41 4c 49 44 5f 46  t { GMEM_VALID_F
3650: 4c 41 47 53 20 3d 20 30 78 37 46 37 32 20 7d 0d  LAGS = 0x7F72 }.
3660: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 47  .enum : uint { G
3670: 4d 45 4d 5f 49 4e 56 41 4c 49 44 5f 48 41 4e 44  MEM_INVALID_HAND
3680: 4c 45 20 3d 20 30 78 38 30 30 30 20 7d 0d 0a 0d  LE = 0x8000 }...
3690: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 47  .enum : uint { G
36a0: 48 4e 44 20 3d 20 47 4d 45 4d 5f 4d 4f 56 45 41  HND = GMEM_MOVEA
36b0: 42 4c 45 20 7c 20 47 4d 45 4d 5f 5a 45 52 4f 49  BLE | GMEM_ZEROI
36c0: 4e 49 54 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  NIT }..enum : ui
36d0: 6e 74 20 7b 20 47 50 54 52 20 3d 20 47 4d 45 4d  nt { GPTR = GMEM
36e0: 5f 46 49 58 45 44 20 7c 20 47 4d 45 4d 5f 5a 45  _FIXED | GMEM_ZE
36f0: 52 4f 49 4e 49 54 20 7d 0d 0a 0d 0a 2f 2f 20 23  ROINIT }....// #
3700: 64 65 66 69 6e 65 20 47 6c 6f 62 61 6c 4c 52 55  define GlobalLRU
3710: 4e 65 77 65 73 74 28 20 68 20 29 20 28 28 48 41  Newest( h ) ((HA
3720: 4e 44 4c 45 29 28 68 29 29 0d 0a 2f 2f 20 23 64  NDLE)(h))..// #d
3730: 65 66 69 6e 65 20 47 6c 6f 62 61 6c 4c 52 55 4f  efine GlobalLRUO
3740: 6c 64 65 73 74 28 20 68 20 29 20 28 28 48 41 4e  ldest( h ) ((HAN
3750: 44 4c 45 29 28 68 29 29 0d 0a 2f 2f 20 23 64 65  DLE)(h))..// #de
3760: 66 69 6e 65 20 47 6c 6f 62 61 6c 44 69 73 63 61  fine GlobalDisca
3770: 72 64 28 20 68 20 29 20 47 6c 6f 62 61 6c 52 65  rd( h ) GlobalRe
3780: 41 6c 6c 6f 63 28 20 28 68 29 2c 20 30 2c 20 47  Alloc( (h), 0, G
3790: 4d 45 4d 5f 4d 4f 56 45 41 42 4c 45 20 29 0d 0a  MEM_MOVEABLE )..
37a0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
37b0: 47 4d 45 4d 5f 44 49 53 43 41 52 44 45 44 20 3d  GMEM_DISCARDED =
37c0: 20 30 78 34 30 30 30 20 7d 0d 0a 65 6e 75 6d 20   0x4000 }..enum 
37d0: 3a 20 75 69 6e 74 20 7b 20 47 4d 45 4d 5f 4c 4f  : uint { GMEM_LO
37e0: 43 4b 43 4f 55 4e 54 20 3d 20 30 78 30 30 46 46  CKCOUNT = 0x00FF
37f0: 20 7d 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 4d 45   }....struct _ME
3800: 4d 4f 52 59 53 54 41 54 55 53 20 7b 0d 0a 20 20  MORYSTATUS {..  
3810: 44 57 4f 52 44 20 64 77 4c 65 6e 67 74 68 3b 0d  DWORD dwLength;.
3820: 0a 20 20 44 57 4f 52 44 20 64 77 4d 65 6d 6f 72  .  DWORD dwMemor
3830: 79 4c 6f 61 64 3b 0d 0a 20 20 53 49 5a 45 5f 54  yLoad;..  SIZE_T
3840: 20 64 77 54 6f 74 61 6c 50 68 79 73 3b 0d 0a 20   dwTotalPhys;.. 
3850: 20 53 49 5a 45 5f 54 20 64 77 41 76 61 69 6c 50   SIZE_T dwAvailP
3860: 68 79 73 3b 0d 0a 20 20 53 49 5a 45 5f 54 20 64  hys;..  SIZE_T d
3870: 77 54 6f 74 61 6c 50 61 67 65 46 69 6c 65 3b 0d  wTotalPageFile;.
3880: 0a 20 20 53 49 5a 45 5f 54 20 64 77 41 76 61 69  .  SIZE_T dwAvai
3890: 6c 50 61 67 65 46 69 6c 65 3b 0d 0a 20 20 53 49  lPageFile;..  SI
38a0: 5a 45 5f 54 20 64 77 54 6f 74 61 6c 56 69 72 74  ZE_T dwTotalVirt
38b0: 75 61 6c 3b 0d 0a 20 20 53 49 5a 45 5f 54 20 64  ual;..  SIZE_T d
38c0: 77 41 76 61 69 6c 56 69 72 74 75 61 6c 3b 0d 0a  wAvailVirtual;..
38d0: 7d 0d 0a 61 6c 69 61 73 20 5f 4d 45 4d 4f 52 59  }..alias _MEMORY
38e0: 53 54 41 54 55 53 20 4d 45 4d 4f 52 59 53 54 41  STATUS MEMORYSTA
38f0: 54 55 53 3b 0d 0a 61 6c 69 61 73 20 5f 4d 45 4d  TUS;..alias _MEM
3900: 4f 52 59 53 54 41 54 55 53 2a 20 4c 50 4d 45 4d  ORYSTATUS* LPMEM
3910: 4f 52 59 53 54 41 54 55 53 3b 0d 0a 0d 0a 65 6e  ORYSTATUS;....en
3920: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4d 45 4d  um : uint { LMEM
3930: 5f 46 49 58 45 44 20 3d 20 30 78 30 30 30 30 20  _FIXED = 0x0000 
3940: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
3950: 20 4c 4d 45 4d 5f 4d 4f 56 45 41 42 4c 45 20 3d   LMEM_MOVEABLE =
3960: 20 30 78 30 30 30 32 20 7d 0d 0a 65 6e 75 6d 20   0x0002 }..enum 
3970: 3a 20 75 69 6e 74 20 7b 20 4c 4d 45 4d 5f 4e 4f  : uint { LMEM_NO
3980: 43 4f 4d 50 41 43 54 20 3d 20 30 78 30 30 31 30  COMPACT = 0x0010
3990: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
39a0: 7b 20 4c 4d 45 4d 5f 4e 4f 44 49 53 43 41 52 44  { LMEM_NODISCARD
39b0: 20 3d 20 30 78 30 30 32 30 20 7d 0d 0a 65 6e 75   = 0x0020 }..enu
39c0: 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4d 45 4d 5f  m : uint { LMEM_
39d0: 5a 45 52 4f 49 4e 49 54 20 3d 20 30 78 30 30 34  ZEROINIT = 0x004
39e0: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
39f0: 20 7b 20 4c 4d 45 4d 5f 4d 4f 44 49 46 59 20 3d   { LMEM_MODIFY =
3a00: 20 30 78 30 30 38 30 20 7d 0d 0a 65 6e 75 6d 20   0x0080 }..enum 
3a10: 3a 20 75 69 6e 74 20 7b 20 4c 4d 45 4d 5f 44 49  : uint { LMEM_DI
3a20: 53 43 41 52 44 41 42 4c 45 20 3d 20 30 78 30 46  SCARDABLE = 0x0F
3a30: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  00 }..enum : uin
3a40: 74 20 7b 20 4c 4d 45 4d 5f 56 41 4c 49 44 5f 46  t { LMEM_VALID_F
3a50: 4c 41 47 53 20 3d 20 30 78 30 46 37 32 20 7d 0d  LAGS = 0x0F72 }.
3a60: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c  .enum : uint { L
3a70: 4d 45 4d 5f 49 4e 56 41 4c 49 44 5f 48 41 4e 44  MEM_INVALID_HAND
3a80: 4c 45 20 3d 20 30 78 38 30 30 30 20 7d 0d 0a 0d  LE = 0x8000 }...
3a90: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c  .enum : uint { L
3aa0: 48 4e 44 20 3d 20 4c 4d 45 4d 5f 4d 4f 56 45 41  HND = LMEM_MOVEA
3ab0: 42 4c 45 20 7c 20 4c 4d 45 4d 5f 5a 45 52 4f 49  BLE | LMEM_ZEROI
3ac0: 4e 49 54 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  NIT }..enum : ui
3ad0: 6e 74 20 7b 20 4c 50 54 52 20 3d 20 4c 4d 45 4d  nt { LPTR = LMEM
3ae0: 5f 46 49 58 45 44 20 7c 20 4c 4d 45 4d 5f 5a 45  _FIXED | LMEM_ZE
3af0: 52 4f 49 4e 49 54 20 7d 0d 0a 0d 0a 65 6e 75 6d  ROINIT }....enum
3b00: 20 3a 20 75 69 6e 74 20 7b 20 4e 4f 4e 5a 45 52   : uint { NONZER
3b10: 4f 4c 48 4e 44 20 3d 20 4c 4d 45 4d 5f 4d 4f 56  OLHND = LMEM_MOV
3b20: 45 41 42 4c 45 20 7d 0d 0a 65 6e 75 6d 20 3a 20  EABLE }..enum : 
3b30: 75 69 6e 74 20 7b 20 4e 4f 4e 5a 45 52 4f 4c 50  uint { NONZEROLP
3b40: 54 52 20 3d 20 4c 4d 45 4d 5f 46 49 58 45 44 20  TR = LMEM_FIXED 
3b50: 7d 0d 0a 0d 0a 2f 2f 20 23 64 65 66 69 6e 65 20  }....// #define 
3b60: 4c 6f 63 61 6c 44 69 73 63 61 72 64 28 20 68 20  LocalDiscard( h 
3b70: 29 20 4c 6f 63 61 6c 52 65 41 6c 6c 6f 63 28 20  ) LocalReAlloc( 
3b80: 28 68 29 2c 20 30 2c 20 4c 4d 45 4d 5f 4d 4f 56  (h), 0, LMEM_MOV
3b90: 45 41 42 4c 45 20 29 0d 0a 0d 0a 65 6e 75 6d 20  EABLE )....enum 
3ba0: 3a 20 75 69 6e 74 20 7b 20 4c 4d 45 4d 5f 44 49  : uint { LMEM_DI
3bb0: 53 43 41 52 44 45 44 20 3d 20 30 78 34 30 30 30  SCARDED = 0x4000
3bc0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
3bd0: 7b 20 4c 4d 45 4d 5f 4c 4f 43 4b 43 4f 55 4e 54  { LMEM_LOCKCOUNT
3be0: 20 3d 20 30 78 30 30 46 46 20 7d 0d 0a 0d 0a 65   = 0x00FF }....e
3bf0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 44 45 42  num : uint { DEB
3c00: 55 47 5f 50 52 4f 43 45 53 53 20 3d 20 30 78 30  UG_PROCESS = 0x0
3c10: 30 30 30 30 30 30 31 20 7d 0d 0a 65 6e 75 6d 20  0000001 }..enum 
3c20: 3a 20 75 69 6e 74 20 7b 20 44 45 42 55 47 5f 4f  : uint { DEBUG_O
3c30: 4e 4c 59 5f 54 48 49 53 5f 50 52 4f 43 45 53 53  NLY_THIS_PROCESS
3c40: 20 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d 0d   = 0x00000002 }.
3c50: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
3c60: 20 43 52 45 41 54 45 5f 53 55 53 50 45 4e 44 45   CREATE_SUSPENDE
3c70: 44 20 3d 20 30 78 30 30 30 30 30 30 30 34 20 7d  D = 0x00000004 }
3c80: 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20  ....enum : uint 
3c90: 7b 20 44 45 54 41 43 48 45 44 5f 50 52 4f 43 45  { DETACHED_PROCE
3ca0: 53 53 20 3d 20 30 78 30 30 30 30 30 30 30 38 20  SS = 0x00000008 
3cb0: 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  }....enum : uint
3cc0: 20 7b 20 43 52 45 41 54 45 5f 4e 45 57 5f 43 4f   { CREATE_NEW_CO
3cd0: 4e 53 4f 4c 45 20 3d 20 30 78 30 30 30 30 30 30  NSOLE = 0x000000
3ce0: 31 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75  10 }....enum : u
3cf0: 69 6e 74 20 7b 20 4e 4f 52 4d 41 4c 5f 50 52 49  int { NORMAL_PRI
3d00: 4f 52 49 54 59 5f 43 4c 41 53 53 20 3d 20 30 78  ORITY_CLASS = 0x
3d10: 30 30 30 30 30 30 32 30 20 7d 0d 0a 65 6e 75 6d  00000020 }..enum
3d20: 20 3a 20 75 69 6e 74 20 7b 20 49 44 4c 45 5f 50   : uint { IDLE_P
3d30: 52 49 4f 52 49 54 59 5f 43 4c 41 53 53 20 3d 20  RIORITY_CLASS = 
3d40: 30 78 30 30 30 30 30 30 34 30 20 7d 0d 0a 65 6e  0x00000040 }..en
3d50: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 48 49 47 48  um : uint { HIGH
3d60: 5f 50 52 49 4f 52 49 54 59 5f 43 4c 41 53 53 20  _PRIORITY_CLASS 
3d70: 3d 20 30 78 30 30 30 30 30 30 38 30 20 7d 0d 0a  = 0x00000080 }..
3d80: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 52 45  enum : uint { RE
3d90: 41 4c 54 49 4d 45 5f 50 52 49 4f 52 49 54 59 5f  ALTIME_PRIORITY_
3da0: 43 4c 41 53 53 20 3d 20 30 78 30 30 30 30 30 31  CLASS = 0x000001
3db0: 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75  00 }....enum : u
3dc0: 69 6e 74 20 7b 20 43 52 45 41 54 45 5f 4e 45 57  int { CREATE_NEW
3dd0: 5f 50 52 4f 43 45 53 53 5f 47 52 4f 55 50 20 3d  _PROCESS_GROUP =
3de0: 20 30 78 30 30 30 30 30 32 30 30 20 7d 0d 0a 65   0x00000200 }..e
3df0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 52 45  num : uint { CRE
3e00: 41 54 45 5f 55 4e 49 43 4f 44 45 5f 45 4e 56 49  ATE_UNICODE_ENVI
3e10: 52 4f 4e 4d 45 4e 54 20 3d 20 30 78 30 30 30 30  RONMENT = 0x0000
3e20: 30 34 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a  0400 }....enum :
3e30: 20 75 69 6e 74 20 7b 20 43 52 45 41 54 45 5f 53   uint { CREATE_S
3e40: 45 50 41 52 41 54 45 5f 57 4f 57 5f 56 44 4d 20  EPARATE_WOW_VDM 
3e50: 3d 20 30 78 30 30 30 30 30 38 30 30 20 7d 0d 0a  = 0x00000800 }..
3e60: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 52  enum : uint { CR
3e70: 45 41 54 45 5f 53 48 41 52 45 44 5f 57 4f 57 5f  EATE_SHARED_WOW_
3e80: 56 44 4d 20 3d 20 30 78 30 30 30 30 31 30 30 30  VDM = 0x00001000
3e90: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
3ea0: 7b 20 43 52 45 41 54 45 5f 46 4f 52 43 45 44 4f  { CREATE_FORCEDO
3eb0: 53 20 3d 20 30 78 30 30 30 30 32 30 30 30 20 7d  S = 0x00002000 }
3ec0: 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20  ....enum : uint 
3ed0: 7b 20 42 45 4c 4f 57 5f 4e 4f 52 4d 41 4c 5f 50  { BELOW_NORMAL_P
3ee0: 52 49 4f 52 49 54 59 5f 43 4c 41 53 53 20 3d 20  RIORITY_CLASS = 
3ef0: 30 78 30 30 30 30 34 30 30 30 20 7d 0d 0a 65 6e  0x00004000 }..en
3f00: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41 42 4f 56  um : uint { ABOV
3f10: 45 5f 4e 4f 52 4d 41 4c 5f 50 52 49 4f 52 49 54  E_NORMAL_PRIORIT
3f20: 59 5f 43 4c 41 53 53 20 3d 20 30 78 30 30 30 30  Y_CLASS = 0x0000
3f30: 38 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  8000 }..enum : u
3f40: 69 6e 74 20 7b 20 53 54 41 43 4b 5f 53 49 5a 45  int { STACK_SIZE
3f50: 5f 50 41 52 41 4d 5f 49 53 5f 41 5f 52 45 53 45  _PARAM_IS_A_RESE
3f60: 52 56 41 54 49 4f 4e 20 3d 20 30 78 30 30 30 31  RVATION = 0x0001
3f70: 30 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a  0000 }....enum :
3f80: 20 75 69 6e 74 20 7b 20 43 52 45 41 54 45 5f 42   uint { CREATE_B
3f90: 52 45 41 4b 41 57 41 59 5f 46 52 4f 4d 5f 4a 4f  REAKAWAY_FROM_JO
3fa0: 42 20 3d 20 30 78 30 31 30 30 30 30 30 30 20 7d  B = 0x01000000 }
3fb0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
3fc0: 43 52 45 41 54 45 5f 50 52 45 53 45 52 56 45 5f  CREATE_PRESERVE_
3fd0: 43 4f 44 45 5f 41 55 54 48 5a 5f 4c 45 56 45 4c  CODE_AUTHZ_LEVEL
3fe0: 20 3d 20 30 78 30 32 30 30 30 30 30 30 20 7d 0d   = 0x02000000 }.
3ff0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
4000: 20 43 52 45 41 54 45 5f 44 45 46 41 55 4c 54 5f   CREATE_DEFAULT_
4010: 45 52 52 4f 52 5f 4d 4f 44 45 20 3d 20 30 78 30  ERROR_MODE = 0x0
4020: 34 30 30 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20  4000000 }..enum 
4030: 3a 20 75 69 6e 74 20 7b 20 43 52 45 41 54 45 5f  : uint { CREATE_
4040: 4e 4f 5f 57 49 4e 44 4f 57 20 3d 20 30 78 30 38  NO_WINDOW = 0x08
4050: 30 30 30 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d  000000 }....enum
4060: 20 3a 20 75 69 6e 74 20 7b 20 50 52 4f 46 49 4c   : uint { PROFIL
4070: 45 5f 55 53 45 52 20 3d 20 30 78 31 30 30 30 30  E_USER = 0x10000
4080: 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  000 }..enum : ui
4090: 6e 74 20 7b 20 50 52 4f 46 49 4c 45 5f 4b 45 52  nt { PROFILE_KER
40a0: 4e 45 4c 20 3d 20 30 78 32 30 30 30 30 30 30 30  NEL = 0x20000000
40b0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
40c0: 7b 20 50 52 4f 46 49 4c 45 5f 53 45 52 56 45 52  { PROFILE_SERVER
40d0: 20 3d 20 30 78 34 30 30 30 30 30 30 30 20 7d 0d   = 0x40000000 }.
40e0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
40f0: 20 43 52 45 41 54 45 5f 49 47 4e 4f 52 45 5f 53   CREATE_IGNORE_S
4100: 59 53 54 45 4d 5f 44 45 46 41 55 4c 54 20 3d 20  YSTEM_DEFAULT = 
4110: 30 78 38 30 30 30 30 30 30 30 20 7d 0d 0a 0d 0a  0x80000000 }....
4120: 61 6c 69 61 73 20 54 48 52 45 41 44 5f 42 41 53  alias THREAD_BAS
4130: 45 5f 50 52 49 4f 52 49 54 59 5f 4d 49 4e 20 54  E_PRIORITY_MIN T
4140: 48 52 45 41 44 5f 50 52 49 4f 52 49 54 59 5f 4c  HREAD_PRIORITY_L
4150: 4f 57 45 53 54 3b 0d 0a 65 6e 75 6d 20 3a 20 75  OWEST;..enum : u
4160: 69 6e 74 20 7b 20 54 48 52 45 41 44 5f 50 52 49  int { THREAD_PRI
4170: 4f 52 49 54 59 5f 42 45 4c 4f 57 5f 4e 4f 52 4d  ORITY_BELOW_NORM
4180: 41 4c 20 3d 20 54 48 52 45 41 44 5f 50 52 49 4f  AL = THREAD_PRIO
4190: 52 49 54 59 5f 4c 4f 57 45 53 54 2b 31 20 7d 0d  RITY_LOWEST+1 }.
41a0: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 54  .enum : uint { T
41b0: 48 52 45 41 44 5f 50 52 49 4f 52 49 54 59 5f 4e  HREAD_PRIORITY_N
41c0: 4f 52 4d 41 4c 20 3d 20 30 20 7d 0d 0a 61 6c 69  ORMAL = 0 }..ali
41d0: 61 73 20 54 48 52 45 41 44 5f 42 41 53 45 5f 50  as THREAD_BASE_P
41e0: 52 49 4f 52 49 54 59 5f 4d 41 58 20 54 48 52 45  RIORITY_MAX THRE
41f0: 41 44 5f 50 52 49 4f 52 49 54 59 5f 48 49 47 48  AD_PRIORITY_HIGH
4200: 45 53 54 3b 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  EST;..enum : uin
4210: 74 20 7b 20 54 48 52 45 41 44 5f 50 52 49 4f 52  t { THREAD_PRIOR
4220: 49 54 59 5f 41 42 4f 56 45 5f 4e 4f 52 4d 41 4c  ITY_ABOVE_NORMAL
4230: 20 3d 20 54 48 52 45 41 44 5f 50 52 49 4f 52 49   = THREAD_PRIORI
4240: 54 59 5f 48 49 47 48 45 53 54 2d 31 20 7d 0d 0a  TY_HIGHEST-1 }..
4250: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 54 48  enum : uint { TH
4260: 52 45 41 44 5f 50 52 49 4f 52 49 54 59 5f 45 52  READ_PRIORITY_ER
4270: 52 4f 52 5f 52 45 54 55 52 4e 20 3d 20 4d 41 58  ROR_RETURN = MAX
4280: 4c 4f 4e 47 20 7d 0d 0a 0d 0a 61 6c 69 61 73 20  LONG }....alias 
4290: 54 48 52 45 41 44 5f 42 41 53 45 5f 50 52 49 4f  THREAD_BASE_PRIO
42a0: 52 49 54 59 5f 4c 4f 57 52 54 20 54 48 52 45 41  RITY_LOWRT THREA
42b0: 44 5f 50 52 49 4f 52 49 54 59 5f 54 49 4d 45 5f  D_PRIORITY_TIME_
42c0: 43 52 49 54 49 43 41 4c 3b 0d 0a 61 6c 69 61 73  CRITICAL;..alias
42d0: 20 54 48 52 45 41 44 5f 42 41 53 45 5f 50 52 49   THREAD_BASE_PRI
42e0: 4f 52 49 54 59 5f 49 44 4c 45 20 54 48 52 45 41  ORITY_IDLE THREA
42f0: 44 5f 50 52 49 4f 52 49 54 59 5f 49 44 4c 45 3b  D_PRIORITY_IDLE;
4300: 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20  ....enum : uint 
4310: 7b 20 45 58 43 45 50 54 49 4f 4e 5f 44 45 42 55  { EXCEPTION_DEBU
4320: 47 5f 45 56 45 4e 54 20 3d 20 31 20 7d 0d 0a 65  G_EVENT = 1 }..e
4330: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 52 45  num : uint { CRE
4340: 41 54 45 5f 54 48 52 45 41 44 5f 44 45 42 55 47  ATE_THREAD_DEBUG
4350: 5f 45 56 45 4e 54 20 3d 20 32 20 7d 0d 0a 65 6e  _EVENT = 2 }..en
4360: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 52 45 41  um : uint { CREA
4370: 54 45 5f 50 52 4f 43 45 53 53 5f 44 45 42 55 47  TE_PROCESS_DEBUG
4380: 5f 45 56 45 4e 54 20 3d 20 33 20 7d 0d 0a 65 6e  _EVENT = 3 }..en
4390: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 45 58 49 54  um : uint { EXIT
43a0: 5f 54 48 52 45 41 44 5f 44 45 42 55 47 5f 45 56  _THREAD_DEBUG_EV
43b0: 45 4e 54 20 3d 20 34 20 7d 0d 0a 65 6e 75 6d 20  ENT = 4 }..enum 
43c0: 3a 20 75 69 6e 74 20 7b 20 45 58 49 54 5f 50 52  : uint { EXIT_PR
43d0: 4f 43 45 53 53 5f 44 45 42 55 47 5f 45 56 45 4e  OCESS_DEBUG_EVEN
43e0: 54 20 3d 20 35 20 7d 0d 0a 65 6e 75 6d 20 3a 20  T = 5 }..enum : 
43f0: 75 69 6e 74 20 7b 20 4c 4f 41 44 5f 44 4c 4c 5f  uint { LOAD_DLL_
4400: 44 45 42 55 47 5f 45 56 45 4e 54 20 3d 20 36 20  DEBUG_EVENT = 6 
4410: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
4420: 20 55 4e 4c 4f 41 44 5f 44 4c 4c 5f 44 45 42 55   UNLOAD_DLL_DEBU
4430: 47 5f 45 56 45 4e 54 20 3d 20 37 20 7d 0d 0a 65  G_EVENT = 7 }..e
4440: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4f 55 54  num : uint { OUT
4450: 50 55 54 5f 44 45 42 55 47 5f 53 54 52 49 4e 47  PUT_DEBUG_STRING
4460: 5f 45 56 45 4e 54 20 3d 20 38 20 7d 0d 0a 65 6e  _EVENT = 8 }..en
4470: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 52 49 50 5f  um : uint { RIP_
4480: 45 56 45 4e 54 20 3d 20 39 20 7d 0d 0a 0d 0a 73  EVENT = 9 }....s
4490: 74 72 75 63 74 20 5f 45 58 43 45 50 54 49 4f 4e  truct _EXCEPTION
44a0: 5f 44 45 42 55 47 5f 49 4e 46 4f 20 7b 0d 0a 20  _DEBUG_INFO {.. 
44b0: 20 45 58 43 45 50 54 49 4f 4e 5f 52 45 43 4f 52   EXCEPTION_RECOR
44c0: 44 20 45 78 63 65 70 74 69 6f 6e 52 65 63 6f 72  D ExceptionRecor
44d0: 64 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 69  d;..  DWORD dwFi
44e0: 72 73 74 43 68 61 6e 63 65 3b 0d 0a 7d 0d 0a 61  rstChance;..}..a
44f0: 6c 69 61 73 20 5f 45 58 43 45 50 54 49 4f 4e 5f  lias _EXCEPTION_
4500: 44 45 42 55 47 5f 49 4e 46 4f 20 45 58 43 45 50  DEBUG_INFO EXCEP
4510: 54 49 4f 4e 5f 44 45 42 55 47 5f 49 4e 46 4f 3b  TION_DEBUG_INFO;
4520: 0d 0a 61 6c 69 61 73 20 5f 45 58 43 45 50 54 49  ..alias _EXCEPTI
4530: 4f 4e 5f 44 45 42 55 47 5f 49 4e 46 4f 2a 20 4c  ON_DEBUG_INFO* L
4540: 50 45 58 43 45 50 54 49 4f 4e 5f 44 45 42 55 47  PEXCEPTION_DEBUG
4550: 5f 49 4e 46 4f 3b 0d 0a 0d 0a 73 74 72 75 63 74  _INFO;....struct
4560: 20 5f 43 52 45 41 54 45 5f 54 48 52 45 41 44 5f   _CREATE_THREAD_
4570: 44 45 42 55 47 5f 49 4e 46 4f 20 7b 0d 0a 20 20  DEBUG_INFO {..  
4580: 48 41 4e 44 4c 45 20 68 54 68 72 65 61 64 3b 0d  HANDLE hThread;.
4590: 0a 20 20 4c 50 56 4f 49 44 20 6c 70 54 68 72 65  .  LPVOID lpThre
45a0: 61 64 4c 6f 63 61 6c 42 61 73 65 3b 0d 0a 20 20  adLocalBase;..  
45b0: 4c 50 54 48 52 45 41 44 5f 53 54 41 52 54 5f 52  LPTHREAD_START_R
45c0: 4f 55 54 49 4e 45 20 6c 70 53 74 61 72 74 41 64  OUTINE lpStartAd
45d0: 64 72 65 73 73 3b 0d 0a 7d 0d 0a 61 6c 69 61 73  dress;..}..alias
45e0: 20 5f 43 52 45 41 54 45 5f 54 48 52 45 41 44 5f   _CREATE_THREAD_
45f0: 44 45 42 55 47 5f 49 4e 46 4f 20 43 52 45 41 54  DEBUG_INFO CREAT
4600: 45 5f 54 48 52 45 41 44 5f 44 45 42 55 47 5f 49  E_THREAD_DEBUG_I
4610: 4e 46 4f 3b 0d 0a 61 6c 69 61 73 20 5f 43 52 45  NFO;..alias _CRE
4620: 41 54 45 5f 54 48 52 45 41 44 5f 44 45 42 55 47  ATE_THREAD_DEBUG
4630: 5f 49 4e 46 4f 2a 20 4c 50 43 52 45 41 54 45 5f  _INFO* LPCREATE_
4640: 54 48 52 45 41 44 5f 44 45 42 55 47 5f 49 4e 46  THREAD_DEBUG_INF
4650: 4f 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 43 52  O;....struct _CR
4660: 45 41 54 45 5f 50 52 4f 43 45 53 53 5f 44 45 42  EATE_PROCESS_DEB
4670: 55 47 5f 49 4e 46 4f 20 7b 0d 0a 20 20 48 41 4e  UG_INFO {..  HAN
4680: 44 4c 45 20 68 46 69 6c 65 3b 0d 0a 20 20 48 41  DLE hFile;..  HA
4690: 4e 44 4c 45 20 68 50 72 6f 63 65 73 73 3b 0d 0a  NDLE hProcess;..
46a0: 20 20 48 41 4e 44 4c 45 20 68 54 68 72 65 61 64    HANDLE hThread
46b0: 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 42 61  ;..  LPVOID lpBa
46c0: 73 65 4f 66 49 6d 61 67 65 3b 0d 0a 20 20 44 57  seOfImage;..  DW
46d0: 4f 52 44 20 64 77 44 65 62 75 67 49 6e 66 6f 46  ORD dwDebugInfoF
46e0: 69 6c 65 4f 66 66 73 65 74 3b 0d 0a 20 20 44 57  ileOffset;..  DW
46f0: 4f 52 44 20 6e 44 65 62 75 67 49 6e 66 6f 53 69  ORD nDebugInfoSi
4700: 7a 65 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70  ze;..  LPVOID lp
4710: 54 68 72 65 61 64 4c 6f 63 61 6c 42 61 73 65 3b  ThreadLocalBase;
4720: 0d 0a 20 20 4c 50 54 48 52 45 41 44 5f 53 54 41  ..  LPTHREAD_STA
4730: 52 54 5f 52 4f 55 54 49 4e 45 20 6c 70 53 74 61  RT_ROUTINE lpSta
4740: 72 74 41 64 64 72 65 73 73 3b 0d 0a 20 20 4c 50  rtAddress;..  LP
4750: 56 4f 49 44 20 6c 70 49 6d 61 67 65 4e 61 6d 65  VOID lpImageName
4760: 3b 0d 0a 20 20 57 4f 52 44 20 66 55 6e 69 63 6f  ;..  WORD fUnico
4770: 64 65 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 43  de;..}..alias _C
4780: 52 45 41 54 45 5f 50 52 4f 43 45 53 53 5f 44 45  REATE_PROCESS_DE
4790: 42 55 47 5f 49 4e 46 4f 20 43 52 45 41 54 45 5f  BUG_INFO CREATE_
47a0: 50 52 4f 43 45 53 53 5f 44 45 42 55 47 5f 49 4e  PROCESS_DEBUG_IN
47b0: 46 4f 3b 0d 0a 61 6c 69 61 73 20 5f 43 52 45 41  FO;..alias _CREA
47c0: 54 45 5f 50 52 4f 43 45 53 53 5f 44 45 42 55 47  TE_PROCESS_DEBUG
47d0: 5f 49 4e 46 4f 2a 20 4c 50 43 52 45 41 54 45 5f  _INFO* LPCREATE_
47e0: 50 52 4f 43 45 53 53 5f 44 45 42 55 47 5f 49 4e  PROCESS_DEBUG_IN
47f0: 46 4f 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 45  FO;....struct _E
4800: 58 49 54 5f 54 48 52 45 41 44 5f 44 45 42 55 47  XIT_THREAD_DEBUG
4810: 5f 49 4e 46 4f 20 7b 0d 0a 20 20 44 57 4f 52 44  _INFO {..  DWORD
4820: 20 64 77 45 78 69 74 43 6f 64 65 3b 0d 0a 7d 0d   dwExitCode;..}.
4830: 0a 61 6c 69 61 73 20 5f 45 58 49 54 5f 54 48 52  .alias _EXIT_THR
4840: 45 41 44 5f 44 45 42 55 47 5f 49 4e 46 4f 20 45  EAD_DEBUG_INFO E
4850: 58 49 54 5f 54 48 52 45 41 44 5f 44 45 42 55 47  XIT_THREAD_DEBUG
4860: 5f 49 4e 46 4f 3b 0d 0a 61 6c 69 61 73 20 5f 45  _INFO;..alias _E
4870: 58 49 54 5f 54 48 52 45 41 44 5f 44 45 42 55 47  XIT_THREAD_DEBUG
4880: 5f 49 4e 46 4f 2a 20 4c 50 45 58 49 54 5f 54 48  _INFO* LPEXIT_TH
4890: 52 45 41 44 5f 44 45 42 55 47 5f 49 4e 46 4f 3b  READ_DEBUG_INFO;
48a0: 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 45 58 49 54  ....struct _EXIT
48b0: 5f 50 52 4f 43 45 53 53 5f 44 45 42 55 47 5f 49  _PROCESS_DEBUG_I
48c0: 4e 46 4f 20 7b 0d 0a 20 20 44 57 4f 52 44 20 64  NFO {..  DWORD d
48d0: 77 45 78 69 74 43 6f 64 65 3b 0d 0a 7d 0d 0a 61  wExitCode;..}..a
48e0: 6c 69 61 73 20 5f 45 58 49 54 5f 50 52 4f 43 45  lias _EXIT_PROCE
48f0: 53 53 5f 44 45 42 55 47 5f 49 4e 46 4f 20 45 58  SS_DEBUG_INFO EX
4900: 49 54 5f 50 52 4f 43 45 53 53 5f 44 45 42 55 47  IT_PROCESS_DEBUG
4910: 5f 49 4e 46 4f 3b 0d 0a 61 6c 69 61 73 20 5f 45  _INFO;..alias _E
4920: 58 49 54 5f 50 52 4f 43 45 53 53 5f 44 45 42 55  XIT_PROCESS_DEBU
4930: 47 5f 49 4e 46 4f 2a 20 4c 50 45 58 49 54 5f 50  G_INFO* LPEXIT_P
4940: 52 4f 43 45 53 53 5f 44 45 42 55 47 5f 49 4e 46  ROCESS_DEBUG_INF
4950: 4f 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 4c 4f  O;....struct _LO
4960: 41 44 5f 44 4c 4c 5f 44 45 42 55 47 5f 49 4e 46  AD_DLL_DEBUG_INF
4970: 4f 20 7b 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46  O {..  HANDLE hF
4980: 69 6c 65 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 6c  ile;..  LPVOID l
4990: 70 42 61 73 65 4f 66 44 6c 6c 3b 0d 0a 20 20 44  pBaseOfDll;..  D
49a0: 57 4f 52 44 20 64 77 44 65 62 75 67 49 6e 66 6f  WORD dwDebugInfo
49b0: 46 69 6c 65 4f 66 66 73 65 74 3b 0d 0a 20 20 44  FileOffset;..  D
49c0: 57 4f 52 44 20 6e 44 65 62 75 67 49 6e 66 6f 53  WORD nDebugInfoS
49d0: 69 7a 65 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 6c  ize;..  LPVOID l
49e0: 70 49 6d 61 67 65 4e 61 6d 65 3b 0d 0a 20 20 57  pImageName;..  W
49f0: 4f 52 44 20 66 55 6e 69 63 6f 64 65 3b 0d 0a 7d  ORD fUnicode;..}
4a00: 0d 0a 61 6c 69 61 73 20 5f 4c 4f 41 44 5f 44 4c  ..alias _LOAD_DL
4a10: 4c 5f 44 45 42 55 47 5f 49 4e 46 4f 20 4c 4f 41  L_DEBUG_INFO LOA
4a20: 44 5f 44 4c 4c 5f 44 45 42 55 47 5f 49 4e 46 4f  D_DLL_DEBUG_INFO
4a30: 3b 0d 0a 61 6c 69 61 73 20 5f 4c 4f 41 44 5f 44  ;..alias _LOAD_D
4a40: 4c 4c 5f 44 45 42 55 47 5f 49 4e 46 4f 2a 20 4c  LL_DEBUG_INFO* L
4a50: 50 4c 4f 41 44 5f 44 4c 4c 5f 44 45 42 55 47 5f  PLOAD_DLL_DEBUG_
4a60: 49 4e 46 4f 3b 0d 0a 0d 0a 73 74 72 75 63 74 20  INFO;....struct 
4a70: 5f 55 4e 4c 4f 41 44 5f 44 4c 4c 5f 44 45 42 55  _UNLOAD_DLL_DEBU
4a80: 47 5f 49 4e 46 4f 20 7b 0d 0a 20 20 4c 50 56 4f  G_INFO {..  LPVO
4a90: 49 44 20 6c 70 42 61 73 65 4f 66 44 6c 6c 3b 0d  ID lpBaseOfDll;.
4aa0: 0a 7d 0d 0a 61 6c 69 61 73 20 5f 55 4e 4c 4f 41  .}..alias _UNLOA
4ab0: 44 5f 44 4c 4c 5f 44 45 42 55 47 5f 49 4e 46 4f  D_DLL_DEBUG_INFO
4ac0: 20 55 4e 4c 4f 41 44 5f 44 4c 4c 5f 44 45 42 55   UNLOAD_DLL_DEBU
4ad0: 47 5f 49 4e 46 4f 3b 0d 0a 61 6c 69 61 73 20 5f  G_INFO;..alias _
4ae0: 55 4e 4c 4f 41 44 5f 44 4c 4c 5f 44 45 42 55 47  UNLOAD_DLL_DEBUG
4af0: 5f 49 4e 46 4f 2a 20 4c 50 55 4e 4c 4f 41 44 5f  _INFO* LPUNLOAD_
4b00: 44 4c 4c 5f 44 45 42 55 47 5f 49 4e 46 4f 3b 0d  DLL_DEBUG_INFO;.
4b10: 0a 0d 0a 73 74 72 75 63 74 20 5f 4f 55 54 50 55  ...struct _OUTPU
4b20: 54 5f 44 45 42 55 47 5f 53 54 52 49 4e 47 5f 49  T_DEBUG_STRING_I
4b30: 4e 46 4f 20 7b 0d 0a 20 20 4c 50 53 54 52 20 6c  NFO {..  LPSTR l
4b40: 70 44 65 62 75 67 53 74 72 69 6e 67 44 61 74 61  pDebugStringData
4b50: 3b 0d 0a 20 20 57 4f 52 44 20 66 55 6e 69 63 6f  ;..  WORD fUnico
4b60: 64 65 3b 0d 0a 20 20 57 4f 52 44 20 6e 44 65 62  de;..  WORD nDeb
4b70: 75 67 53 74 72 69 6e 67 4c 65 6e 67 74 68 3b 0d  ugStringLength;.
4b80: 0a 7d 0d 0a 61 6c 69 61 73 20 5f 4f 55 54 50 55  .}..alias _OUTPU
4b90: 54 5f 44 45 42 55 47 5f 53 54 52 49 4e 47 5f 49  T_DEBUG_STRING_I
4ba0: 4e 46 4f 20 4f 55 54 50 55 54 5f 44 45 42 55 47  NFO OUTPUT_DEBUG
4bb0: 5f 53 54 52 49 4e 47 5f 49 4e 46 4f 3b 0d 0a 61  _STRING_INFO;..a
4bc0: 6c 69 61 73 20 5f 4f 55 54 50 55 54 5f 44 45 42  lias _OUTPUT_DEB
4bd0: 55 47 5f 53 54 52 49 4e 47 5f 49 4e 46 4f 2a 20  UG_STRING_INFO* 
4be0: 4c 50 4f 55 54 50 55 54 5f 44 45 42 55 47 5f 53  LPOUTPUT_DEBUG_S
4bf0: 54 52 49 4e 47 5f 49 4e 46 4f 3b 0d 0a 0d 0a 73  TRING_INFO;....s
4c00: 74 72 75 63 74 20 5f 52 49 50 5f 49 4e 46 4f 20  truct _RIP_INFO 
4c10: 7b 0d 0a 20 20 44 57 4f 52 44 20 64 77 45 72 72  {..  DWORD dwErr
4c20: 6f 72 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77 54  or;..  DWORD dwT
4c30: 79 70 65 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f  ype;..}..alias _
4c40: 52 49 50 5f 49 4e 46 4f 20 52 49 50 5f 49 4e 46  RIP_INFO RIP_INF
4c50: 4f 3b 0d 0a 61 6c 69 61 73 20 5f 52 49 50 5f 49  O;..alias _RIP_I
4c60: 4e 46 4f 2a 20 4c 50 52 49 50 5f 49 4e 46 4f 3b  NFO* LPRIP_INFO;
4c70: 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 44 45 42 55  ....struct _DEBU
4c80: 47 5f 45 56 45 4e 54 20 7b 0d 0a 20 20 44 57 4f  G_EVENT {..  DWO
4c90: 52 44 20 64 77 44 65 62 75 67 45 76 65 6e 74 43  RD dwDebugEventC
4ca0: 6f 64 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ode;..  DWORD dw
4cb0: 50 72 6f 63 65 73 73 49 64 3b 0d 0a 20 20 44 57  ProcessId;..  DW
4cc0: 4f 52 44 20 64 77 54 68 72 65 61 64 49 64 3b 0d  ORD dwThreadId;.
4cd0: 0a 75 6e 69 6f 6e 20 7b 0d 0a 20 20 45 58 43 45  .union {..  EXCE
4ce0: 50 54 49 4f 4e 5f 44 45 42 55 47 5f 49 4e 46 4f  PTION_DEBUG_INFO
4cf0: 20 45 78 63 65 70 74 69 6f 6e 3b 0d 0a 20 20 43   Exception;..  C
4d00: 52 45 41 54 45 5f 54 48 52 45 41 44 5f 44 45 42  REATE_THREAD_DEB
4d10: 55 47 5f 49 4e 46 4f 20 43 72 65 61 74 65 54 68  UG_INFO CreateTh
4d20: 72 65 61 64 3b 0d 0a 20 20 43 52 45 41 54 45 5f  read;..  CREATE_
4d30: 50 52 4f 43 45 53 53 5f 44 45 42 55 47 5f 49 4e  PROCESS_DEBUG_IN
4d40: 46 4f 20 43 72 65 61 74 65 50 72 6f 63 65 73 73  FO CreateProcess
4d50: 49 6e 66 6f 3b 0d 0a 20 20 45 58 49 54 5f 54 48  Info;..  EXIT_TH
4d60: 52 45 41 44 5f 44 45 42 55 47 5f 49 4e 46 4f 20  READ_DEBUG_INFO 
4d70: 45 78 69 74 54 68 72 65 61 64 3b 0d 0a 20 20 45  ExitThread;..  E
4d80: 58 49 54 5f 50 52 4f 43 45 53 53 5f 44 45 42 55  XIT_PROCESS_DEBU
4d90: 47 5f 49 4e 46 4f 20 45 78 69 74 50 72 6f 63 65  G_INFO ExitProce
4da0: 73 73 3b 0d 0a 20 20 4c 4f 41 44 5f 44 4c 4c 5f  ss;..  LOAD_DLL_
4db0: 44 45 42 55 47 5f 49 4e 46 4f 20 4c 6f 61 64 44  DEBUG_INFO LoadD
4dc0: 6c 6c 3b 0d 0a 20 20 55 4e 4c 4f 41 44 5f 44 4c  ll;..  UNLOAD_DL
4dd0: 4c 5f 44 45 42 55 47 5f 49 4e 46 4f 20 55 6e 6c  L_DEBUG_INFO Unl
4de0: 6f 61 64 44 6c 6c 3b 0d 0a 20 20 4f 55 54 50 55  oadDll;..  OUTPU
4df0: 54 5f 44 45 42 55 47 5f 53 54 52 49 4e 47 5f 49  T_DEBUG_STRING_I
4e00: 4e 46 4f 20 44 65 62 75 67 53 74 72 69 6e 67 3b  NFO DebugString;
4e10: 0d 0a 20 20 52 49 50 5f 49 4e 46 4f 20 52 69 70  ..  RIP_INFO Rip
4e20: 49 6e 66 6f 3b 0d 0a 7d 0d 0a 0d 0a 7d 0d 0a 61  Info;..}....}..a
4e30: 6c 69 61 73 20 5f 44 45 42 55 47 5f 45 56 45 4e  lias _DEBUG_EVEN
4e40: 54 20 44 45 42 55 47 5f 45 56 45 4e 54 3b 0d 0a  T DEBUG_EVENT;..
4e50: 61 6c 69 61 73 20 5f 44 45 42 55 47 5f 45 56 45  alias _DEBUG_EVE
4e60: 4e 54 2a 20 4c 50 44 45 42 55 47 5f 45 56 45 4e  NT* LPDEBUG_EVEN
4e70: 54 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 20 21 64 65  T;....// #if !de
4e80: 66 69 6e 65 64 28 4d 49 44 4c 5f 50 41 53 53 29  fined(MIDL_PASS)
4e90: 0d 0a 61 6c 69 61 73 20 50 43 4f 4e 54 45 58 54  ..alias PCONTEXT
4ea0: 20 4c 50 43 4f 4e 54 45 58 54 3b 0d 0a 61 6c 69   LPCONTEXT;..ali
4eb0: 61 73 20 50 45 58 43 45 50 54 49 4f 4e 5f 52 45  as PEXCEPTION_RE
4ec0: 43 4f 52 44 20 4c 50 45 58 43 45 50 54 49 4f 4e  CORD LPEXCEPTION
4ed0: 5f 52 45 43 4f 52 44 3b 0d 0a 61 6c 69 61 73 20  _RECORD;..alias 
4ee0: 50 45 58 43 45 50 54 49 4f 4e 5f 50 4f 49 4e 54  PEXCEPTION_POINT
4ef0: 45 52 53 20 4c 50 45 58 43 45 50 54 49 4f 4e 5f  ERS LPEXCEPTION_
4f00: 50 4f 49 4e 54 45 52 53 3b 0d 0a 2f 2f 20 23 65  POINTERS;..// #e
4f10: 6e 64 69 66 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75  ndif....enum : u
4f20: 69 6e 74 20 7b 20 44 52 49 56 45 5f 55 4e 4b 4e  int { DRIVE_UNKN
4f30: 4f 57 4e 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d 20  OWN = 0 }..enum 
4f40: 3a 20 75 69 6e 74 20 7b 20 44 52 49 56 45 5f 4e  : uint { DRIVE_N
4f50: 4f 5f 52 4f 4f 54 5f 44 49 52 20 3d 20 31 20 7d  O_ROOT_DIR = 1 }
4f60: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
4f70: 44 52 49 56 45 5f 52 45 4d 4f 56 41 42 4c 45 20  DRIVE_REMOVABLE 
4f80: 3d 20 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  = 2 }..enum : ui
4f90: 6e 74 20 7b 20 44 52 49 56 45 5f 46 49 58 45 44  nt { DRIVE_FIXED
4fa0: 20 3d 20 33 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75   = 3 }..enum : u
4fb0: 69 6e 74 20 7b 20 44 52 49 56 45 5f 52 45 4d 4f  int { DRIVE_REMO
4fc0: 54 45 20 3d 20 34 20 7d 0d 0a 65 6e 75 6d 20 3a  TE = 4 }..enum :
4fd0: 20 75 69 6e 74 20 7b 20 44 52 49 56 45 5f 43 44   uint { DRIVE_CD
4fe0: 52 4f 4d 20 3d 20 35 20 7d 0d 0a 65 6e 75 6d 20  ROM = 5 }..enum 
4ff0: 3a 20 75 69 6e 74 20 7b 20 44 52 49 56 45 5f 52  : uint { DRIVE_R
5000: 41 4d 44 49 53 4b 20 3d 20 36 20 7d 0d 0a 0d 0a  AMDISK = 6 }....
5010: 2f 2f 20 23 69 66 6e 64 65 66 20 5f 4d 41 43 0d  // #ifndef _MAC.
5020: 0a 2f 2f 20 23 64 65 66 69 6e 65 20 47 65 74 46  .// #define GetF
5030: 72 65 65 53 70 61 63 65 28 77 29 20 28 30 78 31  reeSpace(w) (0x1
5040: 30 30 30 30 30 4c 29 0d 0a 2f 2f 20 23 65 6c 73  00000L)..// #els
5050: 65 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23 65  e..// .....// #e
5060: 6e 64 69 66 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75  ndif....enum : u
5070: 69 6e 74 20 7b 20 46 49 4c 45 5f 54 59 50 45 5f  int { FILE_TYPE_
5080: 55 4e 4b 4e 4f 57 4e 20 3d 20 30 78 30 30 30 30  UNKNOWN = 0x0000
5090: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
50a0: 7b 20 46 49 4c 45 5f 54 59 50 45 5f 44 49 53 4b  { FILE_TYPE_DISK
50b0: 20 3d 20 30 78 30 30 30 31 20 7d 0d 0a 65 6e 75   = 0x0001 }..enu
50c0: 6d 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f  m : uint { FILE_
50d0: 54 59 50 45 5f 43 48 41 52 20 3d 20 30 78 30 30  TYPE_CHAR = 0x00
50e0: 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  02 }..enum : uin
50f0: 74 20 7b 20 46 49 4c 45 5f 54 59 50 45 5f 50 49  t { FILE_TYPE_PI
5100: 50 45 20 3d 20 30 78 30 30 30 33 20 7d 0d 0a 65  PE = 0x0003 }..e
5110: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c  num : uint { FIL
5120: 45 5f 54 59 50 45 5f 52 45 4d 4f 54 45 20 3d 20  E_TYPE_REMOTE = 
5130: 30 78 38 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d  0x8000 }....enum
5140: 20 3a 20 44 57 4f 52 44 20 7b 20 53 54 44 5f 49   : DWORD { STD_I
5150: 4e 50 55 54 5f 48 41 4e 44 4c 45 20 3d 20 63 61  NPUT_HANDLE = ca
5160: 73 74 28 44 57 4f 52 44 29 2d 31 30 20 7d 0d 0a  st(DWORD)-10 }..
5170: 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 53  enum : DWORD { S
5180: 54 44 5f 4f 55 54 50 55 54 5f 48 41 4e 44 4c 45  TD_OUTPUT_HANDLE
5190: 20 3d 20 63 61 73 74 28 44 57 4f 52 44 29 2d 31   = cast(DWORD)-1
51a0: 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f 52  1 }..enum : DWOR
51b0: 44 20 7b 20 53 54 44 5f 45 52 52 4f 52 5f 48 41  D { STD_ERROR_HA
51c0: 4e 44 4c 45 20 3d 20 63 61 73 74 28 44 57 4f 52  NDLE = cast(DWOR
51d0: 44 29 2d 31 32 20 7d 0d 0a 0d 0a 65 6e 75 6d 20  D)-12 }....enum 
51e0: 3a 20 75 69 6e 74 20 7b 20 4e 4f 50 41 52 49 54  : uint { NOPARIT
51f0: 59 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  Y = 0 }..enum : 
5200: 75 69 6e 74 20 7b 20 4f 44 44 50 41 52 49 54 59  uint { ODDPARITY
5210: 20 3d 20 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75   = 1 }..enum : u
5220: 69 6e 74 20 7b 20 45 56 45 4e 50 41 52 49 54 59  int { EVENPARITY
5230: 20 3d 20 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75   = 2 }..enum : u
5240: 69 6e 74 20 7b 20 4d 41 52 4b 50 41 52 49 54 59  int { MARKPARITY
5250: 20 3d 20 33 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75   = 3 }..enum : u
5260: 69 6e 74 20 7b 20 53 50 41 43 45 50 41 52 49 54  int { SPACEPARIT
5270: 59 20 3d 20 34 20 7d 0d 0a 0d 0a 65 6e 75 6d 20  Y = 4 }....enum 
5280: 3a 20 75 69 6e 74 20 7b 20 4f 4e 45 53 54 4f 50  : uint { ONESTOP
5290: 42 49 54 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d 20  BIT = 0 }..enum 
52a0: 3a 20 75 69 6e 74 20 7b 20 4f 4e 45 35 53 54 4f  : uint { ONE5STO
52b0: 50 42 49 54 53 20 3d 20 31 20 7d 0d 0a 65 6e 75  PBITS = 1 }..enu
52c0: 6d 20 3a 20 75 69 6e 74 20 7b 20 54 57 4f 53 54  m : uint { TWOST
52d0: 4f 50 42 49 54 53 20 3d 20 32 20 7d 0d 0a 0d 0a  OPBITS = 2 }....
52e0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 49 47  enum : uint { IG
52f0: 4e 4f 52 45 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d  NORE = 0 }..enum
5300: 20 3a 20 75 69 6e 74 20 7b 20 49 4e 46 49 4e 49   : uint { INFINI
5310: 54 45 20 3d 20 30 78 46 46 46 46 46 46 46 46 20  TE = 0xFFFFFFFF 
5320: 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  }....enum : uint
5330: 20 7b 20 43 42 52 5f 31 31 30 20 3d 20 31 31 30   { CBR_110 = 110
5340: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
5350: 7b 20 43 42 52 5f 33 30 30 20 3d 20 33 30 30 20  { CBR_300 = 300 
5360: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
5370: 20 43 42 52 5f 36 30 30 20 3d 20 36 30 30 20 7d   CBR_600 = 600 }
5380: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
5390: 43 42 52 5f 31 32 30 30 20 3d 20 31 32 30 30 20  CBR_1200 = 1200 
53a0: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
53b0: 20 43 42 52 5f 32 34 30 30 20 3d 20 32 34 30 30   CBR_2400 = 2400
53c0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
53d0: 7b 20 43 42 52 5f 34 38 30 30 20 3d 20 34 38 30  { CBR_4800 = 480
53e0: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
53f0: 20 7b 20 43 42 52 5f 39 36 30 30 20 3d 20 39 36   { CBR_9600 = 96
5400: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  00 }..enum : uin
5410: 74 20 7b 20 43 42 52 5f 31 34 34 30 30 20 3d 20  t { CBR_14400 = 
5420: 31 34 34 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  14400 }..enum : 
5430: 75 69 6e 74 20 7b 20 43 42 52 5f 31 39 32 30 30  uint { CBR_19200
5440: 20 3d 20 31 39 32 30 30 20 7d 0d 0a 65 6e 75 6d   = 19200 }..enum
5450: 20 3a 20 75 69 6e 74 20 7b 20 43 42 52 5f 33 38   : uint { CBR_38
5460: 34 30 30 20 3d 20 33 38 34 30 30 20 7d 0d 0a 65  400 = 38400 }..e
5470: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 42 52  num : uint { CBR
5480: 5f 35 36 30 30 30 20 3d 20 35 36 30 30 30 20 7d  _56000 = 56000 }
5490: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
54a0: 43 42 52 5f 35 37 36 30 30 20 3d 20 35 37 36 30  CBR_57600 = 5760
54b0: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
54c0: 20 7b 20 43 42 52 5f 31 31 35 32 30 30 20 3d 20   { CBR_115200 = 
54d0: 31 31 35 32 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a  115200 }..enum :
54e0: 20 75 69 6e 74 20 7b 20 43 42 52 5f 31 32 38 30   uint { CBR_1280
54f0: 30 30 20 3d 20 31 32 38 30 30 30 20 7d 0d 0a 65  00 = 128000 }..e
5500: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 42 52  num : uint { CBR
5510: 5f 32 35 36 30 30 30 20 3d 20 32 35 36 30 30 30  _256000 = 256000
5520: 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e   }....enum : uin
5530: 74 20 7b 20 43 45 5f 52 58 4f 56 45 52 20 3d 20  t { CE_RXOVER = 
5540: 30 78 30 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a  0x0001 }..enum :
5550: 20 75 69 6e 74 20 7b 20 43 45 5f 4f 56 45 52 52   uint { CE_OVERR
5560: 55 4e 20 3d 20 30 78 30 30 30 32 20 7d 0d 0a 65  UN = 0x0002 }..e
5570: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 45 5f  num : uint { CE_
5580: 52 58 50 41 52 49 54 59 20 3d 20 30 78 30 30 30  RXPARITY = 0x000
5590: 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  4 }..enum : uint
55a0: 20 7b 20 43 45 5f 46 52 41 4d 45 20 3d 20 30 78   { CE_FRAME = 0x
55b0: 30 30 30 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0008 }..enum : u
55c0: 69 6e 74 20 7b 20 43 45 5f 42 52 45 41 4b 20 3d  int { CE_BREAK =
55d0: 20 30 78 30 30 31 30 20 7d 0d 0a 65 6e 75 6d 20   0x0010 }..enum 
55e0: 3a 20 75 69 6e 74 20 7b 20 43 45 5f 54 58 46 55  : uint { CE_TXFU
55f0: 4c 4c 20 3d 20 30 78 30 31 30 30 20 7d 0d 0a 65  LL = 0x0100 }..e
5600: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 45 5f  num : uint { CE_
5610: 50 54 4f 20 3d 20 30 78 30 32 30 30 20 7d 0d 0a  PTO = 0x0200 }..
5620: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 45  enum : uint { CE
5630: 5f 49 4f 45 20 3d 20 30 78 30 34 30 30 20 7d 0d  _IOE = 0x0400 }.
5640: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43  .enum : uint { C
5650: 45 5f 44 4e 53 20 3d 20 30 78 30 38 30 30 20 7d  E_DNS = 0x0800 }
5660: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
5670: 43 45 5f 4f 4f 50 20 3d 20 30 78 31 30 30 30 20  CE_OOP = 0x1000 
5680: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
5690: 20 43 45 5f 4d 4f 44 45 20 3d 20 30 78 38 30 30   CE_MODE = 0x800
56a0: 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 7b 20 49 45  0 }....enum { IE
56b0: 5f 42 41 44 49 44 20 3d 20 2d 31 20 7d 0d 0a 65  _BADID = -1 }..e
56c0: 6e 75 6d 20 7b 20 49 45 5f 4f 50 45 4e 20 3d 20  num { IE_OPEN = 
56d0: 2d 32 20 7d 0d 0a 65 6e 75 6d 20 7b 20 49 45 5f  -2 }..enum { IE_
56e0: 4e 4f 50 45 4e 20 3d 20 2d 33 20 7d 0d 0a 65 6e  NOPEN = -3 }..en
56f0: 75 6d 20 7b 20 49 45 5f 4d 45 4d 4f 52 59 20 3d  um { IE_MEMORY =
5700: 20 2d 34 20 7d 0d 0a 65 6e 75 6d 20 7b 20 49 45   -4 }..enum { IE
5710: 5f 44 45 46 41 55 4c 54 20 3d 20 2d 35 20 7d 0d  _DEFAULT = -5 }.
5720: 0a 65 6e 75 6d 20 7b 20 49 45 5f 48 41 52 44 57  .enum { IE_HARDW
5730: 41 52 45 20 3d 20 2d 31 30 20 7d 0d 0a 65 6e 75  ARE = -10 }..enu
5740: 6d 20 7b 20 49 45 5f 42 59 54 45 53 49 5a 45 20  m { IE_BYTESIZE 
5750: 3d 20 2d 31 31 20 7d 0d 0a 65 6e 75 6d 20 7b 20  = -11 }..enum { 
5760: 49 45 5f 42 41 55 44 52 41 54 45 20 3d 20 2d 31  IE_BAUDRATE = -1
5770: 32 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69  2 }....enum : ui
5780: 6e 74 20 7b 20 45 56 5f 52 58 43 48 41 52 20 3d  nt { EV_RXCHAR =
5790: 20 30 78 30 30 30 31 20 7d 0d 0a 65 6e 75 6d 20   0x0001 }..enum 
57a0: 3a 20 75 69 6e 74 20 7b 20 45 56 5f 52 58 46 4c  : uint { EV_RXFL
57b0: 41 47 20 3d 20 30 78 30 30 30 32 20 7d 0d 0a 65  AG = 0x0002 }..e
57c0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 45 56 5f  num : uint { EV_
57d0: 54 58 45 4d 50 54 59 20 3d 20 30 78 30 30 30 34  TXEMPTY = 0x0004
57e0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
57f0: 7b 20 45 56 5f 43 54 53 20 3d 20 30 78 30 30 30  { EV_CTS = 0x000
5800: 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  8 }..enum : uint
5810: 20 7b 20 45 56 5f 44 53 52 20 3d 20 30 78 30 30   { EV_DSR = 0x00
5820: 31 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  10 }..enum : uin
5830: 74 20 7b 20 45 56 5f 52 4c 53 44 20 3d 20 30 78  t { EV_RLSD = 0x
5840: 30 30 32 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0020 }..enum : u
5850: 69 6e 74 20 7b 20 45 56 5f 42 52 45 41 4b 20 3d  int { EV_BREAK =
5860: 20 30 78 30 30 34 30 20 7d 0d 0a 65 6e 75 6d 20   0x0040 }..enum 
5870: 3a 20 75 69 6e 74 20 7b 20 45 56 5f 45 52 52 20  : uint { EV_ERR 
5880: 3d 20 30 78 30 30 38 30 20 7d 0d 0a 65 6e 75 6d  = 0x0080 }..enum
5890: 20 3a 20 75 69 6e 74 20 7b 20 45 56 5f 52 49 4e   : uint { EV_RIN
58a0: 47 20 3d 20 30 78 30 31 30 30 20 7d 0d 0a 65 6e  G = 0x0100 }..en
58b0: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 45 56 5f 50  um : uint { EV_P
58c0: 45 52 52 20 3d 20 30 78 30 32 30 30 20 7d 0d 0a  ERR = 0x0200 }..
58d0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 45 56  enum : uint { EV
58e0: 5f 52 58 38 30 46 55 4c 4c 20 3d 20 30 78 30 34  _RX80FULL = 0x04
58f0: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  00 }..enum : uin
5900: 74 20 7b 20 45 56 5f 45 56 45 4e 54 31 20 3d 20  t { EV_EVENT1 = 
5910: 30 78 30 38 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a  0x0800 }..enum :
5920: 20 75 69 6e 74 20 7b 20 45 56 5f 45 56 45 4e 54   uint { EV_EVENT
5930: 32 20 3d 20 30 78 31 30 30 30 20 7d 0d 0a 0d 0a  2 = 0x1000 }....
5940: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 45  enum : uint { SE
5950: 54 58 4f 46 46 20 3d 20 31 20 7d 0d 0a 65 6e 75  TXOFF = 1 }..enu
5960: 6d 20 3a 20 75 69 6e 74 20 7b 20 53 45 54 58 4f  m : uint { SETXO
5970: 4e 20 3d 20 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20  N = 2 }..enum : 
5980: 75 69 6e 74 20 7b 20 53 45 54 52 54 53 20 3d 20  uint { SETRTS = 
5990: 33 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  3 }..enum : uint
59a0: 20 7b 20 43 4c 52 52 54 53 20 3d 20 34 20 7d 0d   { CLRRTS = 4 }.
59b0: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53  .enum : uint { S
59c0: 45 54 44 54 52 20 3d 20 35 20 7d 0d 0a 65 6e 75  ETDTR = 5 }..enu
59d0: 6d 20 3a 20 75 69 6e 74 20 7b 20 43 4c 52 44 54  m : uint { CLRDT
59e0: 52 20 3d 20 36 20 7d 0d 0a 65 6e 75 6d 20 3a 20  R = 6 }..enum : 
59f0: 75 69 6e 74 20 7b 20 52 45 53 45 54 44 45 56 20  uint { RESETDEV 
5a00: 3d 20 37 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  = 7 }..enum : ui
5a10: 6e 74 20 7b 20 53 45 54 42 52 45 41 4b 20 3d 20  nt { SETBREAK = 
5a20: 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  8 }..enum : uint
5a30: 20 7b 20 43 4c 52 42 52 45 41 4b 20 3d 20 39 20   { CLRBREAK = 9 
5a40: 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  }....enum : uint
5a50: 20 7b 20 50 55 52 47 45 5f 54 58 41 42 4f 52 54   { PURGE_TXABORT
5a60: 20 3d 20 30 78 30 30 30 31 20 7d 0d 0a 65 6e 75   = 0x0001 }..enu
5a70: 6d 20 3a 20 75 69 6e 74 20 7b 20 50 55 52 47 45  m : uint { PURGE
5a80: 5f 52 58 41 42 4f 52 54 20 3d 20 30 78 30 30 30  _RXABORT = 0x000
5a90: 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  2 }..enum : uint
5aa0: 20 7b 20 50 55 52 47 45 5f 54 58 43 4c 45 41 52   { PURGE_TXCLEAR
5ab0: 20 3d 20 30 78 30 30 30 34 20 7d 0d 0a 65 6e 75   = 0x0004 }..enu
5ac0: 6d 20 3a 20 75 69 6e 74 20 7b 20 50 55 52 47 45  m : uint { PURGE
5ad0: 5f 52 58 43 4c 45 41 52 20 3d 20 30 78 30 30 30  _RXCLEAR = 0x000
5ae0: 38 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69  8 }....enum : ui
5af0: 6e 74 20 7b 20 4c 50 54 78 20 3d 20 30 78 38 30  nt { LPTx = 0x80
5b00: 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f   }....enum : DWO
5b10: 52 44 20 7b 20 4d 53 5f 43 54 53 5f 4f 4e 20 3d  RD { MS_CTS_ON =
5b20: 20 30 78 30 30 31 30 20 7d 0d 0a 65 6e 75 6d 20   0x0010 }..enum 
5b30: 3a 20 44 57 4f 52 44 20 7b 20 4d 53 5f 44 53 52  : DWORD { MS_DSR
5b40: 5f 4f 4e 20 3d 20 30 78 30 30 32 30 20 7d 0d 0a  _ON = 0x0020 }..
5b50: 65 6e 75 6d 20 3a 20 44 57 4f 52 44 20 7b 20 4d  enum : DWORD { M
5b60: 53 5f 52 49 4e 47 5f 4f 4e 20 3d 20 30 78 30 30  S_RING_ON = 0x00
5b70: 34 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 44 57 4f  40 }..enum : DWO
5b80: 52 44 20 7b 20 4d 53 5f 52 4c 53 44 5f 4f 4e 20  RD { MS_RLSD_ON 
5b90: 3d 20 30 78 30 30 38 30 20 7d 0d 0a 0d 0a 65 6e  = 0x0080 }....en
5ba0: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 5f 51 55  um : uint { S_QU
5bb0: 45 55 45 45 4d 50 54 59 20 3d 20 30 20 7d 0d 0a  EUEEMPTY = 0 }..
5bc0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 5f  enum : uint { S_
5bd0: 54 48 52 45 53 48 4f 4c 44 20 3d 20 31 20 7d 0d  THRESHOLD = 1 }.
5be0: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53  .enum : uint { S
5bf0: 5f 41 4c 4c 54 48 52 45 53 48 4f 4c 44 20 3d 20  _ALLTHRESHOLD = 
5c00: 32 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69  2 }....enum : ui
5c10: 6e 74 20 7b 20 53 5f 4e 4f 52 4d 41 4c 20 3d 20  nt { S_NORMAL = 
5c20: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
5c30: 20 7b 20 53 5f 4c 45 47 41 54 4f 20 3d 20 31 20   { S_LEGATO = 1 
5c40: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
5c50: 20 53 5f 53 54 41 43 43 41 54 4f 20 3d 20 32 20   S_STACCATO = 2 
5c60: 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  }....enum : uint
5c70: 20 7b 20 53 5f 50 45 52 49 4f 44 35 31 32 20 3d   { S_PERIOD512 =
5c80: 20 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e   0 }..enum : uin
5c90: 74 20 7b 20 53 5f 50 45 52 49 4f 44 31 30 32 34  t { S_PERIOD1024
5ca0: 20 3d 20 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75   = 1 }..enum : u
5cb0: 69 6e 74 20 7b 20 53 5f 50 45 52 49 4f 44 32 30  int { S_PERIOD20
5cc0: 34 38 20 3d 20 32 20 7d 0d 0a 65 6e 75 6d 20 3a  48 = 2 }..enum :
5cd0: 20 75 69 6e 74 20 7b 20 53 5f 50 45 52 49 4f 44   uint { S_PERIOD
5ce0: 56 4f 49 43 45 20 3d 20 33 20 7d 0d 0a 65 6e 75  VOICE = 3 }..enu
5cf0: 6d 20 3a 20 75 69 6e 74 20 7b 20 53 5f 57 48 49  m : uint { S_WHI
5d00: 54 45 35 31 32 20 3d 20 34 20 7d 0d 0a 65 6e 75  TE512 = 4 }..enu
5d10: 6d 20 3a 20 75 69 6e 74 20 7b 20 53 5f 57 48 49  m : uint { S_WHI
5d20: 54 45 31 30 32 34 20 3d 20 35 20 7d 0d 0a 65 6e  TE1024 = 5 }..en
5d30: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 5f 57 48  um : uint { S_WH
5d40: 49 54 45 32 30 34 38 20 3d 20 36 20 7d 0d 0a 65  ITE2048 = 6 }..e
5d50: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 5f 57  num : uint { S_W
5d60: 48 49 54 45 56 4f 49 43 45 20 3d 20 37 20 7d 0d  HITEVOICE = 7 }.
5d70: 0a 0d 0a 65 6e 75 6d 20 7b 20 53 5f 53 45 52 44  ...enum { S_SERD
5d80: 56 4e 41 20 3d 20 2d 31 20 7d 0d 0a 65 6e 75 6d  VNA = -1 }..enum
5d90: 20 7b 20 53 5f 53 45 52 4f 46 4d 20 3d 20 2d 32   { S_SEROFM = -2
5da0: 20 7d 0d 0a 65 6e 75 6d 20 7b 20 53 5f 53 45 52   }..enum { S_SER
5db0: 4d 41 43 54 20 3d 20 2d 33 20 7d 0d 0a 65 6e 75  MACT = -3 }..enu
5dc0: 6d 20 7b 20 53 5f 53 45 52 51 46 55 4c 20 3d 20  m { S_SERQFUL = 
5dd0: 2d 34 20 7d 0d 0a 65 6e 75 6d 20 7b 20 53 5f 53  -4 }..enum { S_S
5de0: 45 52 42 44 4e 54 20 3d 20 2d 35 20 7d 0d 0a 65  ERBDNT = -5 }..e
5df0: 6e 75 6d 20 7b 20 53 5f 53 45 52 44 4c 4e 20 3d  num { S_SERDLN =
5e00: 20 2d 36 20 7d 0d 0a 65 6e 75 6d 20 7b 20 53 5f   -6 }..enum { S_
5e10: 53 45 52 44 43 43 20 3d 20 2d 37 20 7d 0d 0a 65  SERDCC = -7 }..e
5e20: 6e 75 6d 20 7b 20 53 5f 53 45 52 44 54 50 20 3d  num { S_SERDTP =
5e30: 20 2d 38 20 7d 0d 0a 65 6e 75 6d 20 7b 20 53 5f   -8 }..enum { S_
5e40: 53 45 52 44 56 4c 20 3d 20 2d 39 20 7d 0d 0a 65  SERDVL = -9 }..e
5e50: 6e 75 6d 20 7b 20 53 5f 53 45 52 44 4d 44 20 3d  num { S_SERDMD =
5e60: 20 2d 31 30 20 7d 0d 0a 65 6e 75 6d 20 7b 20 53   -10 }..enum { S
5e70: 5f 53 45 52 44 53 48 20 3d 20 2d 31 31 20 7d 0d  _SERDSH = -11 }.
5e80: 0a 65 6e 75 6d 20 7b 20 53 5f 53 45 52 44 50 54  .enum { S_SERDPT
5e90: 20 3d 20 2d 31 32 20 7d 0d 0a 65 6e 75 6d 20 7b   = -12 }..enum {
5ea0: 20 53 5f 53 45 52 44 46 51 20 3d 20 2d 31 33 20   S_SERDFQ = -13 
5eb0: 7d 0d 0a 65 6e 75 6d 20 7b 20 53 5f 53 45 52 44  }..enum { S_SERD
5ec0: 44 52 20 3d 20 2d 31 34 20 7d 0d 0a 65 6e 75 6d  DR = -14 }..enum
5ed0: 20 7b 20 53 5f 53 45 52 44 53 52 20 3d 20 2d 31   { S_SERDSR = -1
5ee0: 35 20 7d 0d 0a 65 6e 75 6d 20 7b 20 53 5f 53 45  5 }..enum { S_SE
5ef0: 52 44 53 54 20 3d 20 2d 31 36 20 7d 0d 0a 0d 0a  RDST = -16 }....
5f00: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4e 4d  enum : uint { NM
5f10: 50 57 41 49 54 5f 57 41 49 54 5f 46 4f 52 45 56  PWAIT_WAIT_FOREV
5f20: 45 52 20 3d 20 30 78 66 66 66 66 66 66 66 66 20  ER = 0xffffffff 
5f30: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
5f40: 20 4e 4d 50 57 41 49 54 5f 4e 4f 57 41 49 54 20   NMPWAIT_NOWAIT 
5f50: 3d 20 30 78 30 30 30 30 30 30 30 31 20 7d 0d 0a  = 0x00000001 }..
5f60: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4e 4d  enum : uint { NM
5f70: 50 57 41 49 54 5f 55 53 45 5f 44 45 46 41 55 4c  PWAIT_USE_DEFAUL
5f80: 54 5f 57 41 49 54 20 3d 20 30 78 30 30 30 30 30  T_WAIT = 0x00000
5f90: 30 30 30 20 7d 0d 0a 0d 0a 61 6c 69 61 73 20 46  000 }....alias F
5fa0: 49 4c 45 5f 43 41 53 45 5f 50 52 45 53 45 52 56  ILE_CASE_PRESERV
5fb0: 45 44 5f 4e 41 4d 45 53 20 46 53 5f 43 41 53 45  ED_NAMES FS_CASE
5fc0: 5f 49 53 5f 50 52 45 53 45 52 56 45 44 3b 0d 0a  _IS_PRESERVED;..
5fd0: 61 6c 69 61 73 20 46 49 4c 45 5f 43 41 53 45 5f  alias FILE_CASE_
5fe0: 53 45 4e 53 49 54 49 56 45 5f 53 45 41 52 43 48  SENSITIVE_SEARCH
5ff0: 20 46 53 5f 43 41 53 45 5f 53 45 4e 53 49 54 49   FS_CASE_SENSITI
6000: 56 45 3b 0d 0a 61 6c 69 61 73 20 46 49 4c 45 5f  VE;..alias FILE_
6010: 55 4e 49 43 4f 44 45 5f 4f 4e 5f 44 49 53 4b 20  UNICODE_ON_DISK 
6020: 46 53 5f 55 4e 49 43 4f 44 45 5f 53 54 4f 52 45  FS_UNICODE_STORE
6030: 44 5f 4f 4e 5f 44 49 53 4b 3b 0d 0a 61 6c 69 61  D_ON_DISK;..alia
6040: 73 20 46 49 4c 45 5f 50 45 52 53 49 53 54 45 4e  s FILE_PERSISTEN
6050: 54 5f 41 43 4c 53 20 46 53 5f 50 45 52 53 49 53  T_ACLS FS_PERSIS
6060: 54 45 4e 54 5f 41 43 4c 53 3b 0d 0a 61 6c 69 61  TENT_ACLS;..alia
6070: 73 20 46 49 4c 45 5f 56 4f 4c 55 4d 45 5f 49 53  s FILE_VOLUME_IS
6080: 5f 43 4f 4d 50 52 45 53 53 45 44 20 46 53 5f 56  _COMPRESSED FS_V
6090: 4f 4c 5f 49 53 5f 43 4f 4d 50 52 45 53 53 45 44  OL_IS_COMPRESSED
60a0: 3b 0d 0a 61 6c 69 61 73 20 46 49 4c 45 5f 46 49  ;..alias FILE_FI
60b0: 4c 45 5f 43 4f 4d 50 52 45 53 53 49 4f 4e 20 46  LE_COMPRESSION F
60c0: 53 5f 46 49 4c 45 5f 43 4f 4d 50 52 45 53 53 49  S_FILE_COMPRESSI
60d0: 4f 4e 3b 0d 0a 61 6c 69 61 73 20 46 49 4c 45 5f  ON;..alias FILE_
60e0: 53 55 50 50 4f 52 54 53 5f 45 4e 43 52 59 50 54  SUPPORTS_ENCRYPT
60f0: 49 4f 4e 20 46 53 5f 46 49 4c 45 5f 45 4e 43 52  ION FS_FILE_ENCR
6100: 59 50 54 49 4f 4e 3b 0d 0a 0d 0a 61 6c 69 61 73  YPTION;....alias
6110: 20 53 45 43 54 49 4f 4e 5f 51 55 45 52 59 20 46   SECTION_QUERY F
6120: 49 4c 45 5f 4d 41 50 5f 43 4f 50 59 3b 0d 0a 61  ILE_MAP_COPY;..a
6130: 6c 69 61 73 20 53 45 43 54 49 4f 4e 5f 4d 41 50  lias SECTION_MAP
6140: 5f 57 52 49 54 45 20 46 49 4c 45 5f 4d 41 50 5f  _WRITE FILE_MAP_
6150: 57 52 49 54 45 3b 0d 0a 61 6c 69 61 73 20 53 45  WRITE;..alias SE
6160: 43 54 49 4f 4e 5f 4d 41 50 5f 52 45 41 44 20 46  CTION_MAP_READ F
6170: 49 4c 45 5f 4d 41 50 5f 52 45 41 44 3b 0d 0a 61  ILE_MAP_READ;..a
6180: 6c 69 61 73 20 53 45 43 54 49 4f 4e 5f 41 4c 4c  lias SECTION_ALL
6190: 5f 41 43 43 45 53 53 20 46 49 4c 45 5f 4d 41 50  _ACCESS FILE_MAP
61a0: 5f 41 4c 4c 5f 41 43 43 45 53 53 3b 0d 0a 0d 0a  _ALL_ACCESS;....
61b0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4f 46  enum : uint { OF
61c0: 5f 52 45 41 44 20 3d 20 30 78 30 30 30 30 30 30  _READ = 0x000000
61d0: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  00 }..enum : uin
61e0: 74 20 7b 20 4f 46 5f 57 52 49 54 45 20 3d 20 30  t { OF_WRITE = 0
61f0: 78 30 30 30 30 30 30 30 31 20 7d 0d 0a 65 6e 75  x00000001 }..enu
6200: 6d 20 3a 20 75 69 6e 74 20 7b 20 4f 46 5f 52 45  m : uint { OF_RE
6210: 41 44 57 52 49 54 45 20 3d 20 30 78 30 30 30 30  ADWRITE = 0x0000
6220: 30 30 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0002 }..enum : u
6230: 69 6e 74 20 7b 20 4f 46 5f 53 48 41 52 45 5f 43  int { OF_SHARE_C
6240: 4f 4d 50 41 54 20 3d 20 30 78 30 30 30 30 30 30  OMPAT = 0x000000
6250: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  00 }..enum : uin
6260: 74 20 7b 20 4f 46 5f 53 48 41 52 45 5f 45 58 43  t { OF_SHARE_EXC
6270: 4c 55 53 49 56 45 20 3d 20 30 78 30 30 30 30 30  LUSIVE = 0x00000
6280: 30 31 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  010 }..enum : ui
6290: 6e 74 20 7b 20 4f 46 5f 53 48 41 52 45 5f 44 45  nt { OF_SHARE_DE
62a0: 4e 59 5f 57 52 49 54 45 20 3d 20 30 78 30 30 30  NY_WRITE = 0x000
62b0: 30 30 30 32 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  00020 }..enum : 
62c0: 75 69 6e 74 20 7b 20 4f 46 5f 53 48 41 52 45 5f  uint { OF_SHARE_
62d0: 44 45 4e 59 5f 52 45 41 44 20 3d 20 30 78 30 30  DENY_READ = 0x00
62e0: 30 30 30 30 33 30 20 7d 0d 0a 65 6e 75 6d 20 3a  000030 }..enum :
62f0: 20 75 69 6e 74 20 7b 20 4f 46 5f 53 48 41 52 45   uint { OF_SHARE
6300: 5f 44 45 4e 59 5f 4e 4f 4e 45 20 3d 20 30 78 30  _DENY_NONE = 0x0
6310: 30 30 30 30 30 34 30 20 7d 0d 0a 65 6e 75 6d 20  0000040 }..enum 
6320: 3a 20 75 69 6e 74 20 7b 20 4f 46 5f 50 41 52 53  : uint { OF_PARS
6330: 45 20 3d 20 30 78 30 30 30 30 30 31 30 30 20 7d  E = 0x00000100 }
6340: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
6350: 4f 46 5f 44 45 4c 45 54 45 20 3d 20 30 78 30 30  OF_DELETE = 0x00
6360: 30 30 30 32 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a  000200 }..enum :
6370: 20 75 69 6e 74 20 7b 20 4f 46 5f 56 45 52 49 46   uint { OF_VERIF
6380: 59 20 3d 20 30 78 30 30 30 30 30 34 30 30 20 7d  Y = 0x00000400 }
6390: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
63a0: 4f 46 5f 43 41 4e 43 45 4c 20 3d 20 30 78 30 30  OF_CANCEL = 0x00
63b0: 30 30 30 38 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a  000800 }..enum :
63c0: 20 75 69 6e 74 20 7b 20 4f 46 5f 43 52 45 41 54   uint { OF_CREAT
63d0: 45 20 3d 20 30 78 30 30 30 30 31 30 30 30 20 7d  E = 0x00001000 }
63e0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
63f0: 4f 46 5f 50 52 4f 4d 50 54 20 3d 20 30 78 30 30  OF_PROMPT = 0x00
6400: 30 30 32 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a  002000 }..enum :
6410: 20 75 69 6e 74 20 7b 20 4f 46 5f 45 58 49 53 54   uint { OF_EXIST
6420: 20 3d 20 30 78 30 30 30 30 34 30 30 30 20 7d 0d   = 0x00004000 }.
6430: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4f  .enum : uint { O
6440: 46 5f 52 45 4f 50 45 4e 20 3d 20 30 78 30 30 30  F_REOPEN = 0x000
6450: 30 38 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20  08000 }....enum 
6460: 3a 20 75 69 6e 74 20 7b 20 4f 46 53 5f 4d 41 58  : uint { OFS_MAX
6470: 50 41 54 48 4e 41 4d 45 20 3d 20 31 32 38 20 7d  PATHNAME = 128 }
6480: 0d 0a 73 74 72 75 63 74 20 5f 4f 46 53 54 52 55  ..struct _OFSTRU
6490: 43 54 20 7b 0d 0a 20 20 42 59 54 45 20 63 42 79  CT {..  BYTE cBy
64a0: 74 65 73 3b 0d 0a 20 20 42 59 54 45 20 66 46 69  tes;..  BYTE fFi
64b0: 78 65 64 44 69 73 6b 3b 0d 0a 20 20 57 4f 52 44  xedDisk;..  WORD
64c0: 20 6e 45 72 72 43 6f 64 65 3b 0d 0a 20 20 57 4f   nErrCode;..  WO
64d0: 52 44 20 52 65 73 65 72 76 65 64 31 3b 0d 0a 20  RD Reserved1;.. 
64e0: 20 57 4f 52 44 20 52 65 73 65 72 76 65 64 32 3b   WORD Reserved2;
64f0: 0d 0a 20 20 43 48 41 52 20 73 7a 50 61 74 68 4e  ..  CHAR szPathN
6500: 61 6d 65 5b 4f 46 53 5f 4d 41 58 50 41 54 48 4e  ame[OFS_MAXPATHN
6510: 41 4d 45 5d 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20  AME];..}..alias 
6520: 5f 4f 46 53 54 52 55 43 54 20 4f 46 53 54 52 55  _OFSTRUCT OFSTRU
6530: 43 54 3b 0d 0a 61 6c 69 61 73 20 5f 4f 46 53 54  CT;..alias _OFST
6540: 52 55 43 54 2a 20 4c 50 4f 46 53 54 52 55 43 54  RUCT* LPOFSTRUCT
6550: 3b 0d 0a 61 6c 69 61 73 20 5f 4f 46 53 54 52 55  ;..alias _OFSTRU
6560: 43 54 2a 20 50 4f 46 53 54 52 55 43 54 3b 0d 0a  CT* POFSTRUCT;..
6570: 0d 0a 2f 2f 20 23 69 66 6e 64 65 66 20 4e 4f 57  ..// #ifndef NOW
6580: 49 4e 42 41 53 45 49 4e 54 45 52 4c 4f 43 4b 0d  INBASEINTERLOCK.
6590: 0a 0d 0a 2f 2f 20 23 69 66 6e 64 65 66 20 5f 4e  ...// #ifndef _N
65a0: 54 4f 53 5f 0d 0a 0d 0a 2f 2f 20 23 69 66 20 64  TOS_....// #if d
65b0: 65 66 69 6e 65 64 28 5f 4d 5f 49 41 36 34 29 20  efined(_M_IA64) 
65c0: 26 26 20 21 64 65 66 69 6e 65 64 28 52 43 5f 49  && !defined(RC_I
65d0: 4e 56 4f 4b 45 44 29 0d 0a 0d 0a 2f 2f 20 23 2e  NVOKED)....// #.
65e0: 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  ....// #.....// 
65f0: 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  #.....// #...../
6600: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d  / #.....// #....
6610: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e  .// #.......// .
6620: 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a  ......// .......
6630: 2f 2f 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e  // .......// ...
6640: 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a 2f 2f  ....// .......//
6650: 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a   .......// .....
6660: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e  ..// #.....// #.
6670: 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  ....// #.....// 
6680: 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  #.....// #...../
6690: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d  / #.....// #....
66a0: 0a 0d 0a 2f 2f 20 23 65 6c 69 66 20 64 65 66 69  ...// #elif defi
66b0: 6e 65 64 28 5f 4d 5f 41 4d 44 36 34 29 20 26 26  ned(_M_AMD64) &&
66c0: 20 21 64 65 66 69 6e 65 64 28 52 43 5f 49 4e 56   !defined(RC_INV
66d0: 4f 4b 45 44 29 0d 0a 0d 0a 2f 2f 20 23 2e 2e 2e  OKED)....// #...
66e0: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e  ..// #.....// #.
66f0: 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  ....// #.....// 
6700: 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  #.....// #...../
6710: 2f 20 23 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e  / #.......// ...
6720: 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a 2f 2f  ....// .......//
6730: 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a   .......// .....
6740: 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e  ..// .......// .
6750: 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a  ......// .......
6760: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e  // #.....// #...
6770: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e  ..// #.....// #.
6780: 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  ....// #.....// 
6790: 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 0d  #.....// #......
67a0: 0a 2f 2f 20 23 65 6c 73 65 20 20 20 20 20 20 20  .// #else       
67b0: 20 20 20 20 2f 2f 20 58 38 36 20 69 6e 74 65 72      // X86 inter
67c0: 6c 6f 63 6b 65 64 20 64 65 66 69 6e 69 74 69 6f  locked definitio
67d0: 6e 73 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  ns....extern(Win
67e0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e  dows) export LON
67f0: 47 20 49 6e 74 65 72 6c 6f 63 6b 65 64 49 6e 63  G InterlockedInc
6800: 72 65 6d 65 6e 74 28 0d 0a 20 20 4c 4f 4e 47 20  rement(..  LONG 
6810: 2a 6c 70 41 64 64 65 6e 64 29 3b 0d 0a 0d 0a 65  *lpAddend);....e
6820: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
6830: 78 70 6f 72 74 20 4c 4f 4e 47 20 49 6e 74 65 72  xport LONG Inter
6840: 6c 6f 63 6b 65 64 44 65 63 72 65 6d 65 6e 74 28  lockedDecrement(
6850: 0d 0a 20 20 4c 4f 4e 47 20 2a 6c 70 41 64 64 65  ..  LONG *lpAdde
6860: 6e 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  nd);....extern(W
6870: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c  indows) export L
6880: 4f 4e 47 20 49 6e 74 65 72 6c 6f 63 6b 65 64 45  ONG InterlockedE
6890: 78 63 68 61 6e 67 65 28 0d 0a 20 20 4c 4f 4e 47  xchange(..  LONG
68a0: 20 2a 54 61 72 67 65 74 2c 0d 0a 20 20 4c 4f 4e   *Target,..  LON
68b0: 47 20 56 61 6c 75 65 29 3b 0d 0a 0d 0a 76 6f 69  G Value);....voi
68c0: 64 2a 20 49 6e 74 65 72 6c 6f 63 6b 65 64 45 78  d* InterlockedEx
68d0: 63 68 61 6e 67 65 50 6f 69 6e 74 65 72 28 76 6f  changePointer(vo
68e0: 69 64 2a 2a 20 74 2c 20 76 6f 69 64 2a 20 76 29  id** t, void* v)
68f0: 7b 20 72 65 74 75 72 6e 20 63 61 73 74 28 76 6f  { return cast(vo
6900: 69 64 2a 29 49 6e 74 65 72 6c 6f 63 6b 65 64 45  id*)InterlockedE
6910: 78 63 68 61 6e 67 65 28 63 61 73 74 28 50 4c 4f  xchange(cast(PLO
6920: 4e 47 29 74 2c 20 63 61 73 74 28 4c 4f 4e 47 29  NG)t, cast(LONG)
6930: 76 29 3b 20 7d 0d 0a 0d 0a 65 78 74 65 72 6e 28  v); }....extern(
6940: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
6950: 4c 4f 4e 47 20 49 6e 74 65 72 6c 6f 63 6b 65 64  LONG Interlocked
6960: 45 78 63 68 61 6e 67 65 41 64 64 28 0d 0a 20 20  ExchangeAdd(..  
6970: 4c 4f 4e 47 20 2a 41 64 64 65 6e 64 2c 0d 0a 20  LONG *Addend,.. 
6980: 20 4c 4f 4e 47 20 56 61 6c 75 65 29 3b 0d 0a 0d   LONG Value);...
6990: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
69a0: 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 49 6e 74   export LONG Int
69b0: 65 72 6c 6f 63 6b 65 64 43 6f 6d 70 61 72 65 45  erlockedCompareE
69c0: 78 63 68 61 6e 67 65 28 0d 0a 20 20 4c 4f 4e 47  xchange(..  LONG
69d0: 20 2a 44 65 73 74 69 6e 61 74 69 6f 6e 2c 0d 0a   *Destination,..
69e0: 20 20 4c 4f 4e 47 20 45 78 63 68 61 6e 67 65 2c    LONG Exchange,
69f0: 0d 0a 20 20 4c 4f 4e 47 20 43 6f 6d 70 65 72 61  ..  LONG Compera
6a00: 6e 64 29 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65  nd);....// #ifde
6a10: 66 20 5f 5f 63 70 6c 75 73 70 6c 75 73 0d 0a 0d  f __cplusplus...
6a20: 0a 50 56 4f 49 44 20 5f 5f 49 6e 6c 69 6e 65 49  .PVOID __InlineI
6a30: 6e 74 65 72 6c 6f 63 6b 65 64 43 6f 6d 70 61 72  nterlockedCompar
6a40: 65 45 78 63 68 61 6e 67 65 50 6f 69 6e 74 65 72  eExchangePointer
6a50: 28 50 56 4f 49 44 2a 20 44 65 73 74 69 6e 61 74  (PVOID* Destinat
6a60: 69 6f 6e 2c 20 50 56 4f 49 44 20 45 78 43 68 61  ion, PVOID ExCha
6a70: 6e 67 65 2c 20 50 56 4f 49 44 20 43 6f 6d 70 65  nge, PVOID Compe
6a80: 72 61 6e 64 29 7b 20 72 65 74 75 72 6e 28 63 61  rand){ return(ca
6a90: 73 74 28 50 56 4f 49 44 29 63 61 73 74 28 4c 4f  st(PVOID)cast(LO
6aa0: 4e 47 5f 50 54 52 29 49 6e 74 65 72 6c 6f 63 6b  NG_PTR)Interlock
6ab0: 65 64 43 6f 6d 70 61 72 65 45 78 63 68 61 6e 67  edCompareExchang
6ac0: 65 28 63 61 73 74 28 4c 4f 4e 47 2a 29 44 65 73  e(cast(LONG*)Des
6ad0: 74 69 6e 61 74 69 6f 6e 2c 20 63 61 73 74 28 4c  tination, cast(L
6ae0: 4f 4e 47 29 63 61 73 74 28 4c 4f 4e 47 5f 50 54  ONG)cast(LONG_PT
6af0: 52 29 45 78 43 68 61 6e 67 65 2c 20 63 61 73 74  R)ExChange, cast
6b00: 28 4c 4f 4e 47 29 63 61 73 74 28 4c 4f 4e 47 5f  (LONG)cast(LONG_
6b10: 50 54 52 29 43 6f 6d 70 65 72 61 6e 64 29 29 3b  PTR)Comperand));
6b20: 20 7d 0d 0a 61 6c 69 61 73 20 5f 5f 49 6e 6c 69   }..alias __Inli
6b30: 6e 65 49 6e 74 65 72 6c 6f 63 6b 65 64 43 6f 6d  neInterlockedCom
6b40: 70 61 72 65 45 78 63 68 61 6e 67 65 50 6f 69 6e  pareExchangePoin
6b50: 74 65 72 20 49 6e 74 65 72 6c 6f 63 6b 65 64 43  ter InterlockedC
6b60: 6f 6d 70 61 72 65 45 78 63 68 61 6e 67 65 50 6f  ompareExchangePo
6b70: 69 6e 74 65 72 3b 0d 0a 0d 0a 2f 2f 20 23 65 6c  inter;....// #el
6b80: 73 65 0d 0a 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  se....// #...../
6b90: 2f 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 23 65 6e 64  / .......// #end
6ba0: 69 66 20 2f 2a 20 5f 5f 63 70 6c 75 73 70 6c 75  if /* __cplusplu
6bb0: 73 20 2a 2f 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69  s */....// #endi
6bc0: 66 20 2f 2a 20 58 38 36 20 7c 20 49 41 36 34 20  f /* X86 | IA64 
6bd0: 2a 2f 0d 0a 0d 0a 2f 2f 20 23 69 66 20 64 65 66  */....// #if def
6be0: 69 6e 65 64 28 5f 53 4c 49 53 54 5f 48 45 41 44  ined(_SLIST_HEAD
6bf0: 45 52 5f 29 20 26 26 20 21 64 65 66 69 6e 65 64  ER_) && !defined
6c00: 28 5f 4e 54 4f 53 50 5f 29 0d 0a 0d 0a 2f 2f 20  (_NTOSP_)....// 
6c10: 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d  .......// ......
6c20: 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e  .// .......// ..
6c30: 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a 2f  .....// ......./
6c40: 2f 20 23 65 6e 64 69 66 20 2f 2a 20 5f 53 4c 49  / #endif /* _SLI
6c50: 53 54 5f 48 45 41 44 45 52 5f 20 2a 2f 0d 0a 2f  ST_HEADER_ */../
6c60: 2f 20 23 65 6e 64 69 66 20 2f 2a 20 5f 4e 54 4f  / #endif /* _NTO
6c70: 53 5f 20 2a 2f 0d 0a 0d 0a 2f 2f 20 23 65 6e 64  S_ */....// #end
6c80: 69 66 20 2f 2a 20 4e 4f 57 49 4e 42 41 53 45 49  if /* NOWINBASEI
6c90: 4e 54 45 52 4c 4f 43 4b 20 2a 2f 0d 0a 0d 0a 65  NTERLOCK */....e
6ca0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
6cb0: 78 70 6f 72 74 20 42 4f 4f 4c 20 46 72 65 65 52  xport BOOL FreeR
6cc0: 65 73 6f 75 72 63 65 28 0d 0a 20 20 48 47 4c 4f  esource(..  HGLO
6cd0: 42 41 4c 20 68 52 65 73 44 61 74 61 29 3b 0d 0a  BAL hResData);..
6ce0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
6cf0: 29 20 65 78 70 6f 72 74 20 4c 50 56 4f 49 44 20  ) export LPVOID 
6d00: 4c 6f 63 6b 52 65 73 6f 75 72 63 65 28 0d 0a 20  LockResource(.. 
6d10: 20 48 47 4c 4f 42 41 4c 20 68 52 65 73 44 61 74   HGLOBAL hResDat
6d20: 61 29 3b 0d 0a 0d 0a 2f 2f 20 23 64 65 66 69 6e  a);....// #defin
6d30: 65 20 55 6e 6c 6f 63 6b 52 65 73 6f 75 72 63 65  e UnlockResource
6d40: 28 68 52 65 73 44 61 74 61 29 20 28 28 68 52 65  (hResData) ((hRe
6d50: 73 44 61 74 61 29 2c 20 30 29 0d 0a 65 6e 75 6d  sData), 0)..enum
6d60: 20 3a 20 75 69 6e 74 20 7b 20 4d 41 58 49 4e 54   : uint { MAXINT
6d70: 41 54 4f 4d 20 3d 20 30 78 43 30 30 30 20 7d 0d  ATOM = 0xC000 }.
6d80: 0a 2f 2f 20 23 64 65 66 69 6e 65 20 4d 41 4b 45  .// #define MAKE
6d90: 49 4e 54 41 54 4f 4d 28 69 29 20 28 4c 50 54 53  INTATOM(i) (LPTS
6da0: 54 52 29 28 28 55 4c 4f 4e 47 5f 50 54 52 29 28  TR)((ULONG_PTR)(
6db0: 28 57 4f 52 44 29 28 69 29 29 29 0d 0a 65 6e 75  (WORD)(i)))..enu
6dc0: 6d 20 3a 20 41 54 4f 4d 20 7b 20 49 4e 56 41 4c  m : ATOM { INVAL
6dd0: 49 44 5f 41 54 4f 4d 20 3d 20 30 20 7d 0d 0a 0d  ID_ATOM = 0 }...
6de0: 0a 2f 2f 20 23 69 66 6e 64 65 66 20 5f 4d 41 43  .// #ifndef _MAC
6df0: 0d 0a 2f 2f 20 3f 3f 3f 0d 0a 2f 2f 20 3f 3f 3f  ..// ???..// ???
6e00: 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20 2e  ..// #else..// .
6e10: 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 2f  ....// #endif../
6e20: 2f 20 57 69 6e 4d 61 69 6e 0d 0a 0d 0a 65 78 74  / WinMain....ext
6e30: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
6e40: 6f 72 74 20 42 4f 4f 4c 20 46 72 65 65 4c 69 62  ort BOOL FreeLib
6e50: 72 61 72 79 28 0d 0a 20 20 48 4d 4f 44 55 4c 45  rary(..  HMODULE
6e60: 20 68 4c 69 62 4d 6f 64 75 6c 65 29 3b 0d 0a 0d   hLibModule);...
6e70: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
6e80: 20 65 78 70 6f 72 74 20 56 4f 49 44 20 46 72 65   export VOID Fre
6e90: 65 4c 69 62 72 61 72 79 41 6e 64 45 78 69 74 54  eLibraryAndExitT
6ea0: 68 72 65 61 64 28 0d 0a 20 20 48 4d 4f 44 55 4c  hread(..  HMODUL
6eb0: 45 20 68 4c 69 62 4d 6f 64 75 6c 65 2c 0d 0a 20  E hLibModule,.. 
6ec0: 20 44 57 4f 52 44 20 64 77 45 78 69 74 43 6f 64   DWORD dwExitCod
6ed0: 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
6ee0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
6ef0: 4f 4c 20 44 69 73 61 62 6c 65 54 68 72 65 61 64  OL DisableThread
6f00: 4c 69 62 72 61 72 79 43 61 6c 6c 73 28 0d 0a 20  LibraryCalls(.. 
6f10: 20 48 4d 4f 44 55 4c 45 20 68 4c 69 62 4d 6f 64   HMODULE hLibMod
6f20: 75 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ule);....extern(
6f30: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
6f40: 46 41 52 50 52 4f 43 20 47 65 74 50 72 6f 63 41  FARPROC GetProcA
6f50: 64 64 72 65 73 73 28 0d 0a 20 20 48 4d 4f 44 55  ddress(..  HMODU
6f60: 4c 45 20 68 4d 6f 64 75 6c 65 2c 0d 0a 20 20 4c  LE hModule,..  L
6f70: 50 43 53 54 52 20 6c 70 50 72 6f 63 4e 61 6d 65  PCSTR lpProcName
6f80: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
6f90: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f  dows) export DWO
6fa0: 52 44 20 47 65 74 56 65 72 73 69 6f 6e 28 29 3b  RD GetVersion();
6fb0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
6fc0: 77 73 29 20 65 78 70 6f 72 74 20 48 47 4c 4f 42  ws) export HGLOB
6fd0: 41 4c 20 47 6c 6f 62 61 6c 41 6c 6c 6f 63 28 0d  AL GlobalAlloc(.
6fe0: 0a 20 20 55 49 4e 54 20 75 46 6c 61 67 73 2c 0d  .  UINT uFlags,.
6ff0: 0a 20 20 53 49 5a 45 5f 54 20 64 77 42 79 74 65  .  SIZE_T dwByte
7000: 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  s);....extern(Wi
7010: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 47  ndows) export HG
7020: 4c 4f 42 41 4c 20 47 6c 6f 62 61 6c 52 65 41 6c  LOBAL GlobalReAl
7030: 6c 6f 63 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20  loc(..  HGLOBAL 
7040: 68 4d 65 6d 2c 0d 0a 20 20 53 49 5a 45 5f 54 20  hMem,..  SIZE_T 
7050: 64 77 42 79 74 65 73 2c 0d 0a 20 20 55 49 4e 54  dwBytes,..  UINT
7060: 20 75 46 6c 61 67 73 29 3b 0d 0a 0d 0a 65 78 74   uFlags);....ext
7070: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
7080: 6f 72 74 20 53 49 5a 45 5f 54 20 47 6c 6f 62 61  ort SIZE_T Globa
7090: 6c 53 69 7a 65 28 0d 0a 20 20 48 47 4c 4f 42 41  lSize(..  HGLOBA
70a0: 4c 20 68 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65  L hMem);....exte
70b0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
70c0: 72 74 20 55 49 4e 54 20 47 6c 6f 62 61 6c 46 6c  rt UINT GlobalFl
70d0: 61 67 73 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20  ags(..  HGLOBAL 
70e0: 68 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  hMem);....extern
70f0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
7100: 20 4c 50 56 4f 49 44 20 47 6c 6f 62 61 6c 4c 6f   LPVOID GlobalLo
7110: 63 6b 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20 68  ck(..  HGLOBAL h
7120: 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  Mem);....extern(
7130: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
7140: 48 47 4c 4f 42 41 4c 20 47 6c 6f 62 61 6c 48 61  HGLOBAL GlobalHa
7150: 6e 64 6c 65 28 0d 0a 20 20 4c 50 43 56 4f 49 44  ndle(..  LPCVOID
7160: 20 70 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72   pMem);....exter
7170: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
7180: 74 20 42 4f 4f 4c 20 47 6c 6f 62 61 6c 55 6e 6c  t BOOL GlobalUnl
7190: 6f 63 6b 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20  ock(..  HGLOBAL 
71a0: 68 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  hMem);....extern
71b0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
71c0: 20 48 47 4c 4f 42 41 4c 20 47 6c 6f 62 61 6c 46   HGLOBAL GlobalF
71d0: 72 65 65 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20  ree(..  HGLOBAL 
71e0: 68 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  hMem);....extern
71f0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
7200: 20 53 49 5a 45 5f 54 20 47 6c 6f 62 61 6c 43 6f   SIZE_T GlobalCo
7210: 6d 70 61 63 74 28 0d 0a 20 20 44 57 4f 52 44 20  mpact(..  DWORD 
7220: 64 77 4d 69 6e 46 72 65 65 29 3b 0d 0a 0d 0a 65  dwMinFree);....e
7230: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
7240: 78 70 6f 72 74 20 56 4f 49 44 20 47 6c 6f 62 61  xport VOID Globa
7250: 6c 46 69 78 28 0d 0a 20 20 48 47 4c 4f 42 41 4c  lFix(..  HGLOBAL
7260: 20 68 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72   hMem);....exter
7270: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
7280: 74 20 56 4f 49 44 20 47 6c 6f 62 61 6c 55 6e 66  t VOID GlobalUnf
7290: 69 78 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20 68  ix(..  HGLOBAL h
72a0: 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  Mem);....extern(
72b0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
72c0: 4c 50 56 4f 49 44 20 47 6c 6f 62 61 6c 57 69 72  LPVOID GlobalWir
72d0: 65 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20 68 4d  e(..  HGLOBAL hM
72e0: 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  em);....extern(W
72f0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
7300: 4f 4f 4c 20 47 6c 6f 62 61 6c 55 6e 57 69 72 65  OOL GlobalUnWire
7310: 28 0d 0a 20 20 48 47 4c 4f 42 41 4c 20 68 4d 65  (..  HGLOBAL hMe
7320: 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  m);....extern(Wi
7330: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f  ndows) export VO
7340: 49 44 20 47 6c 6f 62 61 6c 4d 65 6d 6f 72 79 53  ID GlobalMemoryS
7350: 74 61 74 75 73 28 0d 0a 20 20 4c 50 4d 45 4d 4f  tatus(..  LPMEMO
7360: 52 59 53 54 41 54 55 53 20 6c 70 42 75 66 66 65  RYSTATUS lpBuffe
7370: 72 29 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 4d  r);....struct _M
7380: 45 4d 4f 52 59 53 54 41 54 55 53 45 58 20 7b 0d  EMORYSTATUSEX {.
7390: 0a 20 20 44 57 4f 52 44 20 64 77 4c 65 6e 67 74  .  DWORD dwLengt
73a0: 68 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77 4d 65  h;..  DWORD dwMe
73b0: 6d 6f 72 79 4c 6f 61 64 3b 0d 0a 20 20 44 57 4f  moryLoad;..  DWO
73c0: 52 44 4c 4f 4e 47 20 75 6c 6c 54 6f 74 61 6c 50  RDLONG ullTotalP
73d0: 68 79 73 3b 0d 0a 20 20 44 57 4f 52 44 4c 4f 4e  hys;..  DWORDLON
73e0: 47 20 75 6c 6c 41 76 61 69 6c 50 68 79 73 3b 0d  G ullAvailPhys;.
73f0: 0a 20 20 44 57 4f 52 44 4c 4f 4e 47 20 75 6c 6c  .  DWORDLONG ull
7400: 54 6f 74 61 6c 50 61 67 65 46 69 6c 65 3b 0d 0a  TotalPageFile;..
7410: 20 20 44 57 4f 52 44 4c 4f 4e 47 20 75 6c 6c 41    DWORDLONG ullA
7420: 76 61 69 6c 50 61 67 65 46 69 6c 65 3b 0d 0a 20  vailPageFile;.. 
7430: 20 44 57 4f 52 44 4c 4f 4e 47 20 75 6c 6c 54 6f   DWORDLONG ullTo
7440: 74 61 6c 56 69 72 74 75 61 6c 3b 0d 0a 20 20 44  talVirtual;..  D
7450: 57 4f 52 44 4c 4f 4e 47 20 75 6c 6c 41 76 61 69  WORDLONG ullAvai
7460: 6c 56 69 72 74 75 61 6c 3b 0d 0a 20 20 44 57 4f  lVirtual;..  DWO
7470: 52 44 4c 4f 4e 47 20 75 6c 6c 41 76 61 69 6c 45  RDLONG ullAvailE
7480: 78 74 65 6e 64 65 64 56 69 72 74 75 61 6c 3b 0d  xtendedVirtual;.
7490: 0a 7d 0d 0a 61 6c 69 61 73 20 5f 4d 45 4d 4f 52  .}..alias _MEMOR
74a0: 59 53 54 41 54 55 53 45 58 20 4d 45 4d 4f 52 59  YSTATUSEX MEMORY
74b0: 53 54 41 54 55 53 45 58 3b 0d 0a 61 6c 69 61 73  STATUSEX;..alias
74c0: 20 5f 4d 45 4d 4f 52 59 53 54 41 54 55 53 45 58   _MEMORYSTATUSEX
74d0: 2a 20 4c 50 4d 45 4d 4f 52 59 53 54 41 54 55 53  * LPMEMORYSTATUS
74e0: 45 58 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  EX;....extern(Wi
74f0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
7500: 4f 4c 20 47 6c 6f 62 61 6c 4d 65 6d 6f 72 79 53  OL GlobalMemoryS
7510: 74 61 74 75 73 45 78 28 0d 0a 20 20 4c 50 4d 45  tatusEx(..  LPME
7520: 4d 4f 52 59 53 54 41 54 55 53 45 58 20 6c 70 42  MORYSTATUSEX lpB
7530: 75 66 66 65 72 29 3b 0d 0a 0d 0a 65 78 74 65 72  uffer);....exter
7540: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
7550: 74 20 48 4c 4f 43 41 4c 20 4c 6f 63 61 6c 41 6c  t HLOCAL LocalAl
7560: 6c 6f 63 28 0d 0a 20 20 55 49 4e 54 20 75 46 6c  loc(..  UINT uFl
7570: 61 67 73 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 75  ags,..  SIZE_T u
7580: 42 79 74 65 73 29 3b 0d 0a 0d 0a 65 78 74 65 72  Bytes);....exter
7590: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
75a0: 74 20 48 4c 4f 43 41 4c 20 4c 6f 63 61 6c 52 65  t HLOCAL LocalRe
75b0: 41 6c 6c 6f 63 28 0d 0a 20 20 48 4c 4f 43 41 4c  Alloc(..  HLOCAL
75c0: 20 68 4d 65 6d 2c 0d 0a 20 20 53 49 5a 45 5f 54   hMem,..  SIZE_T
75d0: 20 75 42 79 74 65 73 2c 0d 0a 20 20 55 49 4e 54   uBytes,..  UINT
75e0: 20 75 46 6c 61 67 73 29 3b 0d 0a 0d 0a 65 78 74   uFlags);....ext
75f0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
7600: 6f 72 74 20 4c 50 56 4f 49 44 20 4c 6f 63 61 6c  ort LPVOID Local
7610: 4c 6f 63 6b 28 0d 0a 20 20 48 4c 4f 43 41 4c 20  Lock(..  HLOCAL 
7620: 68 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  hMem);....extern
7630: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
7640: 20 48 4c 4f 43 41 4c 20 4c 6f 63 61 6c 48 61 6e   HLOCAL LocalHan
7650: 64 6c 65 28 0d 0a 20 20 4c 50 43 56 4f 49 44 20  dle(..  LPCVOID 
7660: 70 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  pMem);....extern
7670: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
7680: 20 42 4f 4f 4c 20 4c 6f 63 61 6c 55 6e 6c 6f 63   BOOL LocalUnloc
7690: 6b 28 0d 0a 20 20 48 4c 4f 43 41 4c 20 68 4d 65  k(..  HLOCAL hMe
76a0: 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  m);....extern(Wi
76b0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 53 49  ndows) export SI
76c0: 5a 45 5f 54 20 4c 6f 63 61 6c 53 69 7a 65 28 0d  ZE_T LocalSize(.
76d0: 0a 20 20 48 4c 4f 43 41 4c 20 68 4d 65 6d 29 3b  .  HLOCAL hMem);
76e0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
76f0: 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e 54 20  ws) export UINT 
7700: 4c 6f 63 61 6c 46 6c 61 67 73 28 0d 0a 20 20 48  LocalFlags(..  H
7710: 4c 4f 43 41 4c 20 68 4d 65 6d 29 3b 0d 0a 0d 0a  LOCAL hMem);....
7720: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
7730: 65 78 70 6f 72 74 20 48 4c 4f 43 41 4c 20 4c 6f  export HLOCAL Lo
7740: 63 61 6c 46 72 65 65 28 0d 0a 20 20 48 4c 4f 43  calFree(..  HLOC
7750: 41 4c 20 68 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74  AL hMem);....ext
7760: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
7770: 6f 72 74 20 53 49 5a 45 5f 54 20 4c 6f 63 61 6c  ort SIZE_T Local
7780: 53 68 72 69 6e 6b 28 0d 0a 20 20 48 4c 4f 43 41  Shrink(..  HLOCA
7790: 4c 20 68 4d 65 6d 2c 0d 0a 20 20 55 49 4e 54 20  L hMem,..  UINT 
77a0: 63 62 4e 65 77 53 69 7a 65 29 3b 0d 0a 0d 0a 65  cbNewSize);....e
77b0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
77c0: 78 70 6f 72 74 20 53 49 5a 45 5f 54 20 4c 6f 63  xport SIZE_T Loc
77d0: 61 6c 43 6f 6d 70 61 63 74 28 0d 0a 20 20 55 49  alCompact(..  UI
77e0: 4e 54 20 75 4d 69 6e 46 72 65 65 29 3b 0d 0a 0d  NT uMinFree);...
77f0: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
7800: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 46 6c 75   export BOOL Flu
7810: 73 68 49 6e 73 74 72 75 63 74 69 6f 6e 43 61 63  shInstructionCac
7820: 68 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 50  he(..  HANDLE hP
7830: 72 6f 63 65 73 73 2c 0d 0a 20 20 4c 50 43 56 4f  rocess,..  LPCVO
7840: 49 44 20 6c 70 42 61 73 65 41 64 64 72 65 73 73  ID lpBaseAddress
7850: 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 64 77 53 69  ,..  SIZE_T dwSi
7860: 7a 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ze);....extern(W
7870: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c  indows) export L
7880: 50 56 4f 49 44 20 56 69 72 74 75 61 6c 41 6c 6c  PVOID VirtualAll
7890: 6f 63 28 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70  oc(..  LPVOID lp
78a0: 41 64 64 72 65 73 73 2c 0d 0a 20 20 53 49 5a 45  Address,..  SIZE
78b0: 5f 54 20 64 77 53 69 7a 65 2c 0d 0a 20 20 44 57  _T dwSize,..  DW
78c0: 4f 52 44 20 66 6c 41 6c 6c 6f 63 61 74 69 6f 6e  ORD flAllocation
78d0: 54 79 70 65 2c 0d 0a 20 20 44 57 4f 52 44 20 66  Type,..  DWORD f
78e0: 6c 50 72 6f 74 65 63 74 29 3b 0d 0a 0d 0a 65 78  lProtect);....ex
78f0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
7900: 70 6f 72 74 20 42 4f 4f 4c 20 56 69 72 74 75 61  port BOOL Virtua
7910: 6c 46 72 65 65 28 0d 0a 20 20 4c 50 56 4f 49 44  lFree(..  LPVOID
7920: 20 6c 70 41 64 64 72 65 73 73 2c 0d 0a 20 20 53   lpAddress,..  S
7930: 49 5a 45 5f 54 20 64 77 53 69 7a 65 2c 0d 0a 20  IZE_T dwSize,.. 
7940: 20 44 57 4f 52 44 20 64 77 46 72 65 65 54 79 70   DWORD dwFreeTyp
7950: 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
7960: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
7970: 4f 4c 20 56 69 72 74 75 61 6c 50 72 6f 74 65 63  OL VirtualProtec
7980: 74 28 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 41  t(..  LPVOID lpA
7990: 64 64 72 65 73 73 2c 0d 0a 20 20 53 49 5a 45 5f  ddress,..  SIZE_
79a0: 54 20 64 77 53 69 7a 65 2c 0d 0a 20 20 44 57 4f  T dwSize,..  DWO
79b0: 52 44 20 66 6c 4e 65 77 50 72 6f 74 65 63 74 2c  RD flNewProtect,
79c0: 0d 0a 20 20 50 44 57 4f 52 44 20 6c 70 66 6c 4f  ..  PDWORD lpflO
79d0: 6c 64 50 72 6f 74 65 63 74 29 3b 0d 0a 0d 0a 65  ldProtect);....e
79e0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
79f0: 78 70 6f 72 74 20 53 49 5a 45 5f 54 20 56 69 72  xport SIZE_T Vir
7a00: 74 75 61 6c 51 75 65 72 79 28 0d 0a 20 20 4c 50  tualQuery(..  LP
7a10: 43 56 4f 49 44 20 6c 70 41 64 64 72 65 73 73 2c  CVOID lpAddress,
7a20: 0d 0a 20 20 50 4d 45 4d 4f 52 59 5f 42 41 53 49  ..  PMEMORY_BASI
7a30: 43 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 6c 70  C_INFORMATION lp
7a40: 42 75 66 66 65 72 2c 0d 0a 20 20 53 49 5a 45 5f  Buffer,..  SIZE_
7a50: 54 20 64 77 4c 65 6e 67 74 68 29 3b 0d 0a 0d 0a  T dwLength);....
7a60: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
7a70: 65 78 70 6f 72 74 20 4c 50 56 4f 49 44 20 56 69  export LPVOID Vi
7a80: 72 74 75 61 6c 41 6c 6c 6f 63 45 78 28 0d 0a 20  rtualAllocEx(.. 
7a90: 20 48 41 4e 44 4c 45 20 68 50 72 6f 63 65 73 73   HANDLE hProcess
7aa0: 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 41 64  ,..  LPVOID lpAd
7ab0: 64 72 65 73 73 2c 0d 0a 20 20 53 49 5a 45 5f 54  dress,..  SIZE_T
7ac0: 20 64 77 53 69 7a 65 2c 0d 0a 20 20 44 57 4f 52   dwSize,..  DWOR
7ad0: 44 20 66 6c 41 6c 6c 6f 63 61 74 69 6f 6e 54 79  D flAllocationTy
7ae0: 70 65 2c 0d 0a 20 20 44 57 4f 52 44 20 66 6c 50  pe,..  DWORD flP
7af0: 72 6f 74 65 63 74 29 3b 0d 0a 0d 0a 65 78 74 65  rotect);....exte
7b00: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
7b10: 72 74 20 55 49 4e 54 20 47 65 74 57 72 69 74 65  rt UINT GetWrite
7b20: 57 61 74 63 68 28 0d 0a 20 20 44 57 4f 52 44 20  Watch(..  DWORD 
7b30: 64 77 46 6c 61 67 73 2c 0d 0a 20 20 50 56 4f 49  dwFlags,..  PVOI
7b40: 44 20 6c 70 42 61 73 65 41 64 64 72 65 73 73 2c  D lpBaseAddress,
7b50: 0d 0a 20 20 53 49 5a 45 5f 54 20 64 77 52 65 67  ..  SIZE_T dwReg
7b60: 69 6f 6e 53 69 7a 65 2c 0d 0a 20 20 50 56 4f 49  ionSize,..  PVOI
7b70: 44 20 2a 6c 70 41 64 64 72 65 73 73 65 73 2c 0d  D *lpAddresses,.
7b80: 0a 20 20 50 55 4c 4f 4e 47 5f 50 54 52 20 6c 70  .  PULONG_PTR lp
7b90: 64 77 43 6f 75 6e 74 2c 0d 0a 20 20 50 55 4c 4f  dwCount,..  PULO
7ba0: 4e 47 20 6c 70 64 77 47 72 61 6e 75 6c 61 72 69  NG lpdwGranulari
7bb0: 74 79 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ty);....extern(W
7bc0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55  indows) export U
7bd0: 49 4e 54 20 52 65 73 65 74 57 72 69 74 65 57 61  INT ResetWriteWa
7be0: 74 63 68 28 0d 0a 20 20 4c 50 56 4f 49 44 20 6c  tch(..  LPVOID l
7bf0: 70 42 61 73 65 41 64 64 72 65 73 73 2c 0d 0a 20  pBaseAddress,.. 
7c00: 20 53 49 5a 45 5f 54 20 64 77 52 65 67 69 6f 6e   SIZE_T dwRegion
7c10: 53 69 7a 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  Size);....extern
7c20: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
7c30: 20 42 4f 4f 4c 20 56 69 72 74 75 61 6c 46 72 65   BOOL VirtualFre
7c40: 65 45 78 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  eEx(..  HANDLE h
7c50: 50 72 6f 63 65 73 73 2c 0d 0a 20 20 4c 50 56 4f  Process,..  LPVO
7c60: 49 44 20 6c 70 41 64 64 72 65 73 73 2c 0d 0a 20  ID lpAddress,.. 
7c70: 20 53 49 5a 45 5f 54 20 64 77 53 69 7a 65 2c 0d   SIZE_T dwSize,.
7c80: 0a 20 20 44 57 4f 52 44 20 64 77 46 72 65 65 54  .  DWORD dwFreeT
7c90: 79 70 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ype);....extern(
7ca0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
7cb0: 42 4f 4f 4c 20 56 69 72 74 75 61 6c 50 72 6f 74  BOOL VirtualProt
7cc0: 65 63 74 45 78 28 0d 0a 20 20 48 41 4e 44 4c 45  ectEx(..  HANDLE
7cd0: 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20 4c 50   hProcess,..  LP
7ce0: 56 4f 49 44 20 6c 70 41 64 64 72 65 73 73 2c 0d  VOID lpAddress,.
7cf0: 0a 20 20 53 49 5a 45 5f 54 20 64 77 53 69 7a 65  .  SIZE_T dwSize
7d00: 2c 0d 0a 20 20 44 57 4f 52 44 20 66 6c 4e 65 77  ,..  DWORD flNew
7d10: 50 72 6f 74 65 63 74 2c 0d 0a 20 20 50 44 57 4f  Protect,..  PDWO
7d20: 52 44 20 6c 70 66 6c 4f 6c 64 50 72 6f 74 65 63  RD lpflOldProtec
7d30: 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  t);....extern(Wi
7d40: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 53 49  ndows) export SI
7d50: 5a 45 5f 54 20 56 69 72 74 75 61 6c 51 75 65 72  ZE_T VirtualQuer
7d60: 79 45 78 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  yEx(..  HANDLE h
7d70: 50 72 6f 63 65 73 73 2c 0d 0a 20 20 4c 50 43 56  Process,..  LPCV
7d80: 4f 49 44 20 6c 70 41 64 64 72 65 73 73 2c 0d 0a  OID lpAddress,..
7d90: 20 20 50 4d 45 4d 4f 52 59 5f 42 41 53 49 43 5f    PMEMORY_BASIC_
7da0: 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 6c 70 42 75  INFORMATION lpBu
7db0: 66 66 65 72 2c 0d 0a 20 20 53 49 5a 45 5f 54 20  ffer,..  SIZE_T 
7dc0: 64 77 4c 65 6e 67 74 68 29 3b 0d 0a 0d 0a 65 78  dwLength);....ex
7dd0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
7de0: 70 6f 72 74 20 48 41 4e 44 4c 45 20 48 65 61 70  port HANDLE Heap
7df0: 43 72 65 61 74 65 28 0d 0a 20 20 44 57 4f 52 44  Create(..  DWORD
7e00: 20 66 6c 4f 70 74 69 6f 6e 73 2c 0d 0a 20 20 53   flOptions,..  S
7e10: 49 5a 45 5f 54 20 64 77 49 6e 69 74 69 61 6c 53  IZE_T dwInitialS
7e20: 69 7a 65 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 64  ize,..  SIZE_T d
7e30: 77 4d 61 78 69 6d 75 6d 53 69 7a 65 29 3b 0d 0a  wMaximumSize);..
7e40: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
7e50: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 48 65  ) export BOOL He
7e60: 61 70 44 65 73 74 72 6f 79 28 0d 0a 20 20 48 41  apDestroy(..  HA
7e70: 4e 44 4c 45 20 68 48 65 61 70 29 3b 0d 0a 0d 0a  NDLE hHeap);....
7e80: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
7e90: 65 78 70 6f 72 74 20 4c 50 56 4f 49 44 20 48 65  export LPVOID He
7ea0: 61 70 41 6c 6c 6f 63 28 0d 0a 20 20 48 41 4e 44  apAlloc(..  HAND
7eb0: 4c 45 20 68 48 65 61 70 2c 0d 0a 20 20 44 57 4f  LE hHeap,..  DWO
7ec0: 52 44 20 64 77 46 6c 61 67 73 2c 0d 0a 20 20 53  RD dwFlags,..  S
7ed0: 49 5a 45 5f 54 20 64 77 42 79 74 65 73 29 3b 0d  IZE_T dwBytes);.
7ee0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
7ef0: 73 29 20 65 78 70 6f 72 74 20 4c 50 56 4f 49 44  s) export LPVOID
7f00: 20 48 65 61 70 52 65 41 6c 6c 6f 63 28 0d 0a 20   HeapReAlloc(.. 
7f10: 20 48 41 4e 44 4c 45 20 68 48 65 61 70 2c 0d 0a   HANDLE hHeap,..
7f20: 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73 2c    DWORD dwFlags,
7f30: 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 4d 65 6d  ..  LPVOID lpMem
7f40: 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 64 77 42 79  ,..  SIZE_T dwBy
7f50: 74 65 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  tes);....extern(
7f60: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
7f70: 42 4f 4f 4c 20 48 65 61 70 46 72 65 65 28 0d 0a  BOOL HeapFree(..
7f80: 20 20 48 41 4e 44 4c 45 20 68 48 65 61 70 2c 0d    HANDLE hHeap,.
7f90: 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73  .  DWORD dwFlags
7fa0: 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 4d 65  ,..  LPVOID lpMe
7fb0: 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  m);....extern(Wi
7fc0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 53 49  ndows) export SI
7fd0: 5a 45 5f 54 20 48 65 61 70 53 69 7a 65 28 0d 0a  ZE_T HeapSize(..
7fe0: 20 20 48 41 4e 44 4c 45 20 68 48 65 61 70 2c 0d    HANDLE hHeap,.
7ff0: 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73  .  DWORD dwFlags
8000: 2c 0d 0a 20 20 4c 50 43 56 4f 49 44 20 6c 70 4d  ,..  LPCVOID lpM
8010: 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  em);....extern(W
8020: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
8030: 4f 4f 4c 20 48 65 61 70 56 61 6c 69 64 61 74 65  OOL HeapValidate
8040: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 48 65 61  (..  HANDLE hHea
8050: 70 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 6c  p,..  DWORD dwFl
8060: 61 67 73 2c 0d 0a 20 20 4c 50 43 56 4f 49 44 20  ags,..  LPCVOID 
8070: 6c 70 4d 65 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72  lpMem);....exter
8080: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
8090: 74 20 53 49 5a 45 5f 54 20 48 65 61 70 43 6f 6d  t SIZE_T HeapCom
80a0: 70 61 63 74 28 0d 0a 20 20 48 41 4e 44 4c 45 20  pact(..  HANDLE 
80b0: 68 48 65 61 70 2c 0d 0a 20 20 44 57 4f 52 44 20  hHeap,..  DWORD 
80c0: 64 77 46 6c 61 67 73 29 3b 0d 0a 0d 0a 65 78 74  dwFlags);....ext
80d0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
80e0: 6f 72 74 20 48 41 4e 44 4c 45 20 47 65 74 50 72  ort HANDLE GetPr
80f0: 6f 63 65 73 73 48 65 61 70 28 29 3b 0d 0a 0d 0a  ocessHeap();....
8100: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
8110: 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74  export DWORD Get
8120: 50 72 6f 63 65 73 73 48 65 61 70 73 28 0d 0a 20  ProcessHeaps(.. 
8130: 20 44 57 4f 52 44 20 4e 75 6d 62 65 72 4f 66 48   DWORD NumberOfH
8140: 65 61 70 73 2c 0d 0a 20 20 50 48 41 4e 44 4c 45  eaps,..  PHANDLE
8150: 20 50 72 6f 63 65 73 73 48 65 61 70 73 29 3b 0d   ProcessHeaps);.
8160: 0a 0d 0a 73 74 72 75 63 74 20 5f 50 52 4f 43 45  ...struct _PROCE
8170: 53 53 5f 48 45 41 50 5f 45 4e 54 52 59 20 7b 0d  SS_HEAP_ENTRY {.
8180: 0a 20 20 50 56 4f 49 44 20 6c 70 44 61 74 61 3b  .  PVOID lpData;
8190: 0d 0a 20 20 44 57 4f 52 44 20 63 62 44 61 74 61  ..  DWORD cbData
81a0: 3b 0d 0a 20 20 42 59 54 45 20 63 62 4f 76 65 72  ;..  BYTE cbOver
81b0: 68 65 61 64 3b 0d 0a 20 20 42 59 54 45 20 69 52  head;..  BYTE iR
81c0: 65 67 69 6f 6e 49 6e 64 65 78 3b 0d 0a 20 20 57  egionIndex;..  W
81d0: 4f 52 44 20 77 46 6c 61 67 73 3b 0d 0a 75 6e 69  ORD wFlags;..uni
81e0: 6f 6e 20 7b 0d 0a 73 74 72 75 63 74 20 7b 0d 0a  on {..struct {..
81f0: 20 20 48 41 4e 44 4c 45 20 68 4d 65 6d 3b 0d 0a    HANDLE hMem;..
8200: 20 20 44 57 4f 52 44 20 64 77 52 65 73 65 72 76    DWORD dwReserv
8210: 65 64 5b 20 33 20 5d 3b 0d 0a 7d 0d 0a 0d 0a 73  ed[ 3 ];..}....s
8220: 74 72 75 63 74 20 7b 0d 0a 20 20 44 57 4f 52 44  truct {..  DWORD
8230: 20 64 77 43 6f 6d 6d 69 74 74 65 64 53 69 7a 65   dwCommittedSize
8240: 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77 55 6e 43  ;..  DWORD dwUnC
8250: 6f 6d 6d 69 74 74 65 64 53 69 7a 65 3b 0d 0a 20  ommittedSize;.. 
8260: 20 4c 50 56 4f 49 44 20 6c 70 46 69 72 73 74 42   LPVOID lpFirstB
8270: 6c 6f 63 6b 3b 0d 0a 20 20 4c 50 56 4f 49 44 20  lock;..  LPVOID 
8280: 6c 70 4c 61 73 74 42 6c 6f 63 6b 3b 0d 0a 7d 0d  lpLastBlock;..}.
8290: 0a 0d 0a 7d 0d 0a 0d 0a 7d 0d 0a 61 6c 69 61 73  ...}....}..alias
82a0: 20 5f 50 52 4f 43 45 53 53 5f 48 45 41 50 5f 45   _PROCESS_HEAP_E
82b0: 4e 54 52 59 20 50 52 4f 43 45 53 53 5f 48 45 41  NTRY PROCESS_HEA
82c0: 50 5f 45 4e 54 52 59 3b 0d 0a 61 6c 69 61 73 20  P_ENTRY;..alias 
82d0: 5f 50 52 4f 43 45 53 53 5f 48 45 41 50 5f 45 4e  _PROCESS_HEAP_EN
82e0: 54 52 59 2a 20 4c 50 50 52 4f 43 45 53 53 5f 48  TRY* LPPROCESS_H
82f0: 45 41 50 5f 45 4e 54 52 59 3b 0d 0a 61 6c 69 61  EAP_ENTRY;..alia
8300: 73 20 5f 50 52 4f 43 45 53 53 5f 48 45 41 50 5f  s _PROCESS_HEAP_
8310: 45 4e 54 52 59 2a 20 50 50 52 4f 43 45 53 53 5f  ENTRY* PPROCESS_
8320: 48 45 41 50 5f 45 4e 54 52 59 3b 0d 0a 0d 0a 65  HEAP_ENTRY;....e
8330: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 50 52 4f  num : uint { PRO
8340: 43 45 53 53 5f 48 45 41 50 5f 52 45 47 49 4f 4e  CESS_HEAP_REGION
8350: 20 3d 20 30 78 30 30 30 31 20 7d 0d 0a 65 6e 75   = 0x0001 }..enu
8360: 6d 20 3a 20 75 69 6e 74 20 7b 20 50 52 4f 43 45  m : uint { PROCE
8370: 53 53 5f 48 45 41 50 5f 55 4e 43 4f 4d 4d 49 54  SS_HEAP_UNCOMMIT
8380: 54 45 44 5f 52 41 4e 47 45 20 3d 20 30 78 30 30  TED_RANGE = 0x00
8390: 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  02 }..enum : uin
83a0: 74 20 7b 20 50 52 4f 43 45 53 53 5f 48 45 41 50  t { PROCESS_HEAP
83b0: 5f 45 4e 54 52 59 5f 42 55 53 59 20 3d 20 30 78  _ENTRY_BUSY = 0x
83c0: 30 30 30 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0004 }..enum : u
83d0: 69 6e 74 20 7b 20 50 52 4f 43 45 53 53 5f 48 45  int { PROCESS_HE
83e0: 41 50 5f 45 4e 54 52 59 5f 4d 4f 56 45 41 42 4c  AP_ENTRY_MOVEABL
83f0: 45 20 3d 20 30 78 30 30 31 30 20 7d 0d 0a 65 6e  E = 0x0010 }..en
8400: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 50 52 4f 43  um : uint { PROC
8410: 45 53 53 5f 48 45 41 50 5f 45 4e 54 52 59 5f 44  ESS_HEAP_ENTRY_D
8420: 44 45 53 48 41 52 45 20 3d 20 30 78 30 30 32 30  DESHARE = 0x0020
8430: 20 7d 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e   }....extern(Win
8440: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
8450: 4c 20 48 65 61 70 4c 6f 63 6b 28 0d 0a 20 20 48  L HeapLock(..  H
8460: 41 4e 44 4c 45 20 68 48 65 61 70 29 3b 0d 0a 0d  ANDLE hHeap);...
8470: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
8480: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 48 65 61   export BOOL Hea
8490: 70 55 6e 6c 6f 63 6b 28 0d 0a 20 20 48 41 4e 44  pUnlock(..  HAND
84a0: 4c 45 20 68 48 65 61 70 29 3b 0d 0a 0d 0a 65 78  LE hHeap);....ex
84b0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
84c0: 70 6f 72 74 20 42 4f 4f 4c 20 48 65 61 70 57 61  port BOOL HeapWa
84d0: 6c 6b 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 48  lk(..  HANDLE hH
84e0: 65 61 70 2c 0d 0a 20 20 4c 50 50 52 4f 43 45 53  eap,..  LPPROCES
84f0: 53 5f 48 45 41 50 5f 45 4e 54 52 59 20 6c 70 45  S_HEAP_ENTRY lpE
8500: 6e 74 72 79 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  ntry);....extern
8510: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
8520: 20 42 4f 4f 4c 20 48 65 61 70 53 65 74 49 6e 66   BOOL HeapSetInf
8530: 6f 72 6d 61 74 69 6f 6e 28 0d 0a 20 20 50 56 4f  ormation(..  PVO
8540: 49 44 20 48 65 61 70 48 61 6e 64 6c 65 2c 20 0d  ID HeapHandle, .
8550: 0a 20 20 48 45 41 50 5f 49 4e 46 4f 52 4d 41 54  .  HEAP_INFORMAT
8560: 49 4f 4e 5f 43 4c 41 53 53 20 48 65 61 70 49 6e  ION_CLASS HeapIn
8570: 66 6f 72 6d 61 74 69 6f 6e 43 6c 61 73 73 2c 0d  formationClass,.
8580: 0a 20 20 50 56 4f 49 44 20 48 65 61 70 49 6e 66  .  PVOID HeapInf
8590: 6f 72 6d 61 74 69 6f 6e 20 2c 0d 0a 20 20 53 49  ormation ,..  SI
85a0: 5a 45 5f 54 20 48 65 61 70 49 6e 66 6f 72 6d 61  ZE_T HeapInforma
85b0: 74 69 6f 6e 4c 65 6e 67 74 68 20 29 3b 0d 0a 0d  tionLength );...
85c0: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
85d0: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 48 65 61   export BOOL Hea
85e0: 70 51 75 65 72 79 49 6e 66 6f 72 6d 61 74 69 6f  pQueryInformatio
85f0: 6e 28 0d 0a 20 20 50 56 4f 49 44 20 48 65 61 70  n(..  PVOID Heap
8600: 48 61 6e 64 6c 65 2c 20 0d 0a 20 20 48 45 41 50  Handle, ..  HEAP
8610: 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 5f 43 4c 41  _INFORMATION_CLA
8620: 53 53 20 48 65 61 70 49 6e 66 6f 72 6d 61 74 69  SS HeapInformati
8630: 6f 6e 43 6c 61 73 73 2c 0d 0a 20 20 50 56 4f 49  onClass,..  PVOI
8640: 44 20 48 65 61 70 49 6e 66 6f 72 6d 61 74 69 6f  D HeapInformatio
8650: 6e 20 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 48 65  n ,..  SIZE_T He
8660: 61 70 49 6e 66 6f 72 6d 61 74 69 6f 6e 4c 65 6e  apInformationLen
8670: 67 74 68 20 2c 0d 0a 20 20 50 53 49 5a 45 5f 54  gth ,..  PSIZE_T
8680: 20 52 65 74 75 72 6e 4c 65 6e 67 74 68 20 29 3b   ReturnLength );
8690: 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20  ....enum : uint 
86a0: 7b 20 53 43 53 5f 33 32 42 49 54 5f 42 49 4e 41  { SCS_32BIT_BINA
86b0: 52 59 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d 20 3a  RY = 0 }..enum :
86c0: 20 75 69 6e 74 20 7b 20 53 43 53 5f 44 4f 53 5f   uint { SCS_DOS_
86d0: 42 49 4e 41 52 59 20 3d 20 31 20 7d 0d 0a 65 6e  BINARY = 1 }..en
86e0: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 43 53 5f  um : uint { SCS_
86f0: 57 4f 57 5f 42 49 4e 41 52 59 20 3d 20 32 20 7d  WOW_BINARY = 2 }
8700: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
8710: 53 43 53 5f 50 49 46 5f 42 49 4e 41 52 59 20 3d  SCS_PIF_BINARY =
8720: 20 33 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e   3 }..enum : uin
8730: 74 20 7b 20 53 43 53 5f 50 4f 53 49 58 5f 42 49  t { SCS_POSIX_BI
8740: 4e 41 52 59 20 3d 20 34 20 7d 0d 0a 65 6e 75 6d  NARY = 4 }..enum
8750: 20 3a 20 75 69 6e 74 20 7b 20 53 43 53 5f 4f 53   : uint { SCS_OS
8760: 32 31 36 5f 42 49 4e 41 52 59 20 3d 20 35 20 7d  216_BINARY = 5 }
8770: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
8780: 53 43 53 5f 36 34 42 49 54 5f 42 49 4e 41 52 59  SCS_64BIT_BINARY
8790: 20 3d 20 36 20 7d 0d 0a 0d 0a 2f 2f 20 23 69 66   = 6 }....// #if
87a0: 20 64 65 66 69 6e 65 64 28 5f 57 49 4e 36 34 29   defined(_WIN64)
87b0: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
87c0: 6c 73 65 0d 0a 61 6c 69 61 73 20 53 43 53 5f 33  lse..alias SCS_3
87d0: 32 42 49 54 5f 42 49 4e 41 52 59 20 53 43 53 5f  2BIT_BINARY SCS_
87e0: 54 48 49 53 5f 50 4c 41 54 46 4f 52 4d 5f 42 49  THIS_PLATFORM_BI
87f0: 4e 41 52 59 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  NARY;..// #endif
8800: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
8810: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
8820: 47 65 74 42 69 6e 61 72 79 54 79 70 65 41 28 0d  GetBinaryTypeA(.
8830: 0a 20 20 4c 50 43 53 54 52 20 6c 70 41 70 70 6c  .  LPCSTR lpAppl
8840: 69 63 61 74 69 6f 6e 4e 61 6d 65 2c 0d 0a 20 20  icationName,..  
8850: 4c 50 44 57 4f 52 44 20 6c 70 42 69 6e 61 72 79  LPDWORD lpBinary
8860: 54 79 70 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57  Type);..extern(W
8870: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
8880: 4f 4f 4c 20 47 65 74 42 69 6e 61 72 79 54 79 70  OOL GetBinaryTyp
8890: 65 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  eW(..  LPCWSTR l
88a0: 70 41 70 70 6c 69 63 61 74 69 6f 6e 4e 61 6d 65  pApplicationName
88b0: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 42  ,..  LPDWORD lpB
88c0: 69 6e 61 72 79 54 79 70 65 29 3b 0d 0a 2f 2f 20  inaryType);..// 
88d0: 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
88e0: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
88f0: 65 0d 0a 61 6c 69 61 73 20 47 65 74 42 69 6e 61  e..alias GetBina
8900: 72 79 54 79 70 65 41 20 47 65 74 42 69 6e 61 72  ryTypeA GetBinar
8910: 79 54 79 70 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69  yType;..// #endi
8920: 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
8930: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
8940: 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65   export DWORD Ge
8950: 74 53 68 6f 72 74 50 61 74 68 4e 61 6d 65 41 28  tShortPathNameA(
8960: 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 73 7a 4c  ..  LPCSTR lpszL
8970: 6f 6e 67 50 61 74 68 2c 0d 0a 20 20 4c 50 53 54  ongPath,..  LPST
8980: 52 20 6c 70 73 7a 53 68 6f 72 74 50 61 74 68 2c  R lpszShortPath,
8990: 0d 0a 20 20 44 57 4f 52 44 20 63 63 68 42 75 66  ..  DWORD cchBuf
89a0: 66 65 72 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  fer);..extern(Wi
89b0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57  ndows) export DW
89c0: 4f 52 44 20 47 65 74 53 68 6f 72 74 50 61 74 68  ORD GetShortPath
89d0: 4e 61 6d 65 57 28 0d 0a 20 20 4c 50 43 57 53 54  NameW(..  LPCWST
89e0: 52 20 6c 70 73 7a 4c 6f 6e 67 50 61 74 68 2c 0d  R lpszLongPath,.
89f0: 0a 20 20 4c 50 57 53 54 52 20 6c 70 73 7a 53 68  .  LPWSTR lpszSh
8a00: 6f 72 74 50 61 74 68 2c 0d 0a 20 20 44 57 4f 52  ortPath,..  DWOR
8a10: 44 20 63 63 68 42 75 66 66 65 72 29 3b 0d 0a 2f  D cchBuffer);../
8a20: 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
8a30: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
8a40: 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 53 68  lse..alias GetSh
8a50: 6f 72 74 50 61 74 68 4e 61 6d 65 41 20 47 65 74  ortPathNameA Get
8a60: 53 68 6f 72 74 50 61 74 68 4e 61 6d 65 3b 0d 0a  ShortPathName;..
8a70: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
8a80: 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
8a90: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
8aa0: 44 57 4f 52 44 20 47 65 74 4c 6f 6e 67 50 61 74  DWORD GetLongPat
8ab0: 68 4e 61 6d 65 41 28 0d 0a 20 20 4c 50 43 53 54  hNameA(..  LPCST
8ac0: 52 20 6c 70 73 7a 53 68 6f 72 74 50 61 74 68 2c  R lpszShortPath,
8ad0: 0d 0a 20 20 4c 50 53 54 52 20 6c 70 73 7a 4c 6f  ..  LPSTR lpszLo
8ae0: 6e 67 50 61 74 68 2c 0d 0a 20 20 44 57 4f 52 44  ngPath,..  DWORD
8af0: 20 63 63 68 42 75 66 66 65 72 29 3b 0d 0a 65 78   cchBuffer);..ex
8b00: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
8b10: 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74 4c 6f  port DWORD GetLo
8b20: 6e 67 50 61 74 68 4e 61 6d 65 57 28 0d 0a 20 20  ngPathNameW(..  
8b30: 4c 50 43 57 53 54 52 20 6c 70 73 7a 53 68 6f 72  LPCWSTR lpszShor
8b40: 74 50 61 74 68 2c 0d 0a 20 20 4c 50 57 53 54 52  tPath,..  LPWSTR
8b50: 20 6c 70 73 7a 4c 6f 6e 67 50 61 74 68 2c 0d 0a   lpszLongPath,..
8b60: 20 20 44 57 4f 52 44 20 63 63 68 42 75 66 66 65    DWORD cchBuffe
8b70: 72 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  r);..// #ifdef U
8b80: 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
8b90: 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
8ba0: 20 47 65 74 4c 6f 6e 67 50 61 74 68 4e 61 6d 65   GetLongPathName
8bb0: 41 20 47 65 74 4c 6f 6e 67 50 61 74 68 4e 61 6d  A GetLongPathNam
8bc0: 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  e;..// #endif //
8bd0: 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
8be0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
8bf0: 6f 72 74 20 42 4f 4f 4c 20 47 65 74 50 72 6f 63  ort BOOL GetProc
8c00: 65 73 73 41 66 66 69 6e 69 74 79 4d 61 73 6b 28  essAffinityMask(
8c10: 0d 0a 20 20 48 41 4e 44 4c 45 20 68 50 72 6f 63  ..  HANDLE hProc
8c20: 65 73 73 2c 0d 0a 20 20 50 44 57 4f 52 44 5f 50  ess,..  PDWORD_P
8c30: 54 52 20 6c 70 50 72 6f 63 65 73 73 41 66 66 69  TR lpProcessAffi
8c40: 6e 69 74 79 4d 61 73 6b 2c 0d 0a 20 20 50 44 57  nityMask,..  PDW
8c50: 4f 52 44 5f 50 54 52 20 6c 70 53 79 73 74 65 6d  ORD_PTR lpSystem
8c60: 41 66 66 69 6e 69 74 79 4d 61 73 6b 29 3b 0d 0a  AffinityMask);..
8c70: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
8c80: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
8c90: 74 50 72 6f 63 65 73 73 41 66 66 69 6e 69 74 79  tProcessAffinity
8ca0: 4d 61 73 6b 28 0d 0a 20 20 48 41 4e 44 4c 45 20  Mask(..  HANDLE 
8cb0: 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20 44 57 4f  hProcess,..  DWO
8cc0: 52 44 5f 50 54 52 20 64 77 50 72 6f 63 65 73 73  RD_PTR dwProcess
8cd0: 41 66 66 69 6e 69 74 79 4d 61 73 6b 29 3b 0d 0a  AffinityMask);..
8ce0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
8cf0: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65  ) export BOOL Ge
8d00: 74 50 72 6f 63 65 73 73 54 69 6d 65 73 28 0d 0a  tProcessTimes(..
8d10: 20 20 48 41 4e 44 4c 45 20 68 50 72 6f 63 65 73    HANDLE hProces
8d20: 73 2c 0d 0a 20 20 4c 50 46 49 4c 45 54 49 4d 45  s,..  LPFILETIME
8d30: 20 6c 70 43 72 65 61 74 69 6f 6e 54 69 6d 65 2c   lpCreationTime,
8d40: 0d 0a 20 20 4c 50 46 49 4c 45 54 49 4d 45 20 6c  ..  LPFILETIME l
8d50: 70 45 78 69 74 54 69 6d 65 2c 0d 0a 20 20 4c 50  pExitTime,..  LP
8d60: 46 49 4c 45 54 49 4d 45 20 6c 70 4b 65 72 6e 65  FILETIME lpKerne
8d70: 6c 54 69 6d 65 2c 0d 0a 20 20 4c 50 46 49 4c 45  lTime,..  LPFILE
8d80: 54 49 4d 45 20 6c 70 55 73 65 72 54 69 6d 65 29  TIME lpUserTime)
8d90: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
8da0: 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
8db0: 20 47 65 74 50 72 6f 63 65 73 73 49 6f 43 6f 75   GetProcessIoCou
8dc0: 6e 74 65 72 73 28 0d 0a 20 20 48 41 4e 44 4c 45  nters(..  HANDLE
8dd0: 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20 50 49   hProcess,..  PI
8de0: 4f 5f 43 4f 55 4e 54 45 52 53 20 6c 70 49 6f 43  O_COUNTERS lpIoC
8df0: 6f 75 6e 74 65 72 73 29 3b 0d 0a 0d 0a 65 78 74  ounters);....ext
8e00: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
8e10: 6f 72 74 20 42 4f 4f 4c 20 47 65 74 50 72 6f 63  ort BOOL GetProc
8e20: 65 73 73 57 6f 72 6b 69 6e 67 53 65 74 53 69 7a  essWorkingSetSiz
8e30: 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 50 72  e(..  HANDLE hPr
8e40: 6f 63 65 73 73 2c 0d 0a 20 20 50 53 49 5a 45 5f  ocess,..  PSIZE_
8e50: 54 20 6c 70 4d 69 6e 69 6d 75 6d 57 6f 72 6b 69  T lpMinimumWorki
8e60: 6e 67 53 65 74 53 69 7a 65 2c 0d 0a 20 20 50 53  ngSetSize,..  PS
8e70: 49 5a 45 5f 54 20 6c 70 4d 61 78 69 6d 75 6d 57  IZE_T lpMaximumW
8e80: 6f 72 6b 69 6e 67 53 65 74 53 69 7a 65 29 3b 0d  orkingSetSize);.
8e90: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
8ea0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
8eb0: 65 74 50 72 6f 63 65 73 73 57 6f 72 6b 69 6e 67  etProcessWorking
8ec0: 53 65 74 53 69 7a 65 28 0d 0a 20 20 48 41 4e 44  SetSize(..  HAND
8ed0: 4c 45 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20  LE hProcess,..  
8ee0: 53 49 5a 45 5f 54 20 64 77 4d 69 6e 69 6d 75 6d  SIZE_T dwMinimum
8ef0: 57 6f 72 6b 69 6e 67 53 65 74 53 69 7a 65 2c 0d  WorkingSetSize,.
8f00: 0a 20 20 53 49 5a 45 5f 54 20 64 77 4d 61 78 69  .  SIZE_T dwMaxi
8f10: 6d 75 6d 57 6f 72 6b 69 6e 67 53 65 74 53 69 7a  mumWorkingSetSiz
8f20: 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
8f30: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41  ndows) export HA
8f40: 4e 44 4c 45 20 4f 70 65 6e 50 72 6f 63 65 73 73  NDLE OpenProcess
8f50: 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44 65 73  (..  DWORD dwDes
8f60: 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 42  iredAccess,..  B
8f70: 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61 6e 64  OOL bInheritHand
8f80: 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 50  le,..  DWORD dwP
8f90: 72 6f 63 65 73 73 49 64 29 3b 0d 0a 0d 0a 65 78  rocessId);....ex
8fa0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
8fb0: 70 6f 72 74 20 48 41 4e 44 4c 45 20 47 65 74 43  port HANDLE GetC
8fc0: 75 72 72 65 6e 74 50 72 6f 63 65 73 73 28 29 3b  urrentProcess();
8fd0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
8fe0: 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44  ws) export DWORD
8ff0: 20 47 65 74 43 75 72 72 65 6e 74 50 72 6f 63 65   GetCurrentProce
9000: 73 73 49 64 28 29 3b 0d 0a 0d 0a 65 78 74 65 72  ssId();....exter
9010: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
9020: 74 20 56 4f 49 44 20 45 78 69 74 50 72 6f 63 65  t VOID ExitProce
9030: 73 73 28 0d 0a 20 20 55 49 4e 54 20 75 45 78 69  ss(..  UINT uExi
9040: 74 43 6f 64 65 29 3b 0d 0a 0d 0a 65 78 74 65 72  tCode);....exter
9050: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
9060: 74 20 42 4f 4f 4c 20 54 65 72 6d 69 6e 61 74 65  t BOOL Terminate
9070: 50 72 6f 63 65 73 73 28 0d 0a 20 20 48 41 4e 44  Process(..  HAND
9080: 4c 45 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20  LE hProcess,..  
9090: 55 49 4e 54 20 75 45 78 69 74 43 6f 64 65 29 3b  UINT uExitCode);
90a0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
90b0: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
90c0: 47 65 74 45 78 69 74 43 6f 64 65 50 72 6f 63 65  GetExitCodeProce
90d0: 73 73 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 50  ss(..  HANDLE hP
90e0: 72 6f 63 65 73 73 2c 0d 0a 20 20 4c 50 44 57 4f  rocess,..  LPDWO
90f0: 52 44 20 6c 70 45 78 69 74 43 6f 64 65 29 3b 0d  RD lpExitCode);.
9100: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
9110: 73 29 20 65 78 70 6f 72 74 20 56 4f 49 44 20 46  s) export VOID F
9120: 61 74 61 6c 45 78 69 74 28 0d 0a 20 20 69 6e 74  atalExit(..  int
9130: 20 45 78 69 74 43 6f 64 65 29 3b 0d 0a 0d 0a 65   ExitCode);....e
9140: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
9150: 78 70 6f 72 74 20 4c 50 53 54 52 20 47 65 74 45  xport LPSTR GetE
9160: 6e 76 69 72 6f 6e 6d 65 6e 74 53 74 72 69 6e 67  nvironmentString
9170: 73 28 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  s();....extern(W
9180: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c  indows) export L
9190: 50 57 53 54 52 20 47 65 74 45 6e 76 69 72 6f 6e  PWSTR GetEnviron
91a0: 6d 65 6e 74 53 74 72 69 6e 67 73 57 28 29 3b 0d  mentStringsW();.
91b0: 0a 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ...// #ifdef UNI
91c0: 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
91d0: 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47  / #else..alias G
91e0: 65 74 45 6e 76 69 72 6f 6e 6d 65 6e 74 53 74 72  etEnvironmentStr
91f0: 69 6e 67 73 20 47 65 74 45 6e 76 69 72 6f 6e 6d  ings GetEnvironm
9200: 65 6e 74 53 74 72 69 6e 67 73 41 3b 0d 0a 2f 2f  entStringsA;..//
9210: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
9220: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
9230: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
9240: 4f 4c 20 46 72 65 65 45 6e 76 69 72 6f 6e 6d 65  OL FreeEnvironme
9250: 6e 74 53 74 72 69 6e 67 73 41 28 0d 0a 20 20 4c  ntStringsA(..  L
9260: 50 53 54 52 29 3b 0d 0a 65 78 74 65 72 6e 28 57  PSTR);..extern(W
9270: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
9280: 4f 4f 4c 20 46 72 65 65 45 6e 76 69 72 6f 6e 6d  OOL FreeEnvironm
9290: 65 6e 74 53 74 72 69 6e 67 73 57 28 0d 0a 20 20  entStringsW(..  
92a0: 4c 50 57 53 54 52 29 3b 0d 0a 2f 2f 20 23 69 66  LPWSTR);..// #if
92b0: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
92c0: 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
92d0: 61 6c 69 61 73 20 46 72 65 65 45 6e 76 69 72 6f  alias FreeEnviro
92e0: 6e 6d 65 6e 74 53 74 72 69 6e 67 73 41 20 46 72  nmentStringsA Fr
92f0: 65 65 45 6e 76 69 72 6f 6e 6d 65 6e 74 53 74 72  eeEnvironmentStr
9300: 69 6e 67 73 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  ings;..// #endif
9310: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
9320: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
9330: 65 78 70 6f 72 74 20 56 4f 49 44 20 52 61 69 73  export VOID Rais
9340: 65 45 78 63 65 70 74 69 6f 6e 28 0d 0a 20 20 44  eException(..  D
9350: 57 4f 52 44 20 64 77 45 78 63 65 70 74 69 6f 6e  WORD dwException
9360: 43 6f 64 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64  Code,..  DWORD d
9370: 77 45 78 63 65 70 74 69 6f 6e 46 6c 61 67 73 2c  wExceptionFlags,
9380: 0d 0a 20 20 44 57 4f 52 44 20 6e 4e 75 6d 62 65  ..  DWORD nNumbe
9390: 72 4f 66 41 72 67 75 6d 65 6e 74 73 2c 0d 0a 20  rOfArguments,.. 
93a0: 20 55 4c 4f 4e 47 5f 50 54 52 20 2a 6c 70 41 72   ULONG_PTR *lpAr
93b0: 67 75 6d 65 6e 74 73 29 3b 0d 0a 0d 0a 65 78 74  guments);....ext
93c0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
93d0: 6f 72 74 20 4c 4f 4e 47 20 55 6e 68 61 6e 64 6c  ort LONG Unhandl
93e0: 65 64 45 78 63 65 70 74 69 6f 6e 46 69 6c 74 65  edExceptionFilte
93f0: 72 28 0d 0a 20 20 5f 45 58 43 45 50 54 49 4f 4e  r(..  _EXCEPTION
9400: 5f 50 4f 49 4e 54 45 52 53 20 2a 45 78 63 65 70  _POINTERS *Excep
9410: 74 69 6f 6e 49 6e 66 6f 29 3b 0d 0a 0d 0a 65 78  tionInfo);....ex
9420: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 61 6c  tern(Windows) al
9430: 69 61 73 20 4c 4f 4e 47 20 66 75 6e 63 74 69 6f  ias LONG functio
9440: 6e 28 20 20 5f 45 58 43 45 50 54 49 4f 4e 5f 50  n(  _EXCEPTION_P
9450: 4f 49 4e 54 45 52 53 20 2a 45 78 63 65 70 74 69  OINTERS *Excepti
9460: 6f 6e 49 6e 66 6f 20 29 20 50 54 4f 50 5f 4c 45  onInfo ) PTOP_LE
9470: 56 45 4c 5f 45 58 43 45 50 54 49 4f 4e 5f 46 49  VEL_EXCEPTION_FI
9480: 4c 54 45 52 3b 0d 0a 61 6c 69 61 73 20 50 54 4f  LTER;..alias PTO
9490: 50 5f 4c 45 56 45 4c 5f 45 58 43 45 50 54 49 4f  P_LEVEL_EXCEPTIO
94a0: 4e 5f 46 49 4c 54 45 52 20 4c 50 54 4f 50 5f 4c  N_FILTER LPTOP_L
94b0: 45 56 45 4c 5f 45 58 43 45 50 54 49 4f 4e 5f 46  EVEL_EXCEPTION_F
94c0: 49 4c 54 45 52 3b 0d 0a 0d 0a 65 78 74 65 72 6e  ILTER;....extern
94d0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
94e0: 20 4c 50 54 4f 50 5f 4c 45 56 45 4c 5f 45 58 43   LPTOP_LEVEL_EXC
94f0: 45 50 54 49 4f 4e 5f 46 49 4c 54 45 52 20 53 65  EPTION_FILTER Se
9500: 74 55 6e 68 61 6e 64 6c 65 64 45 78 63 65 70 74  tUnhandledExcept
9510: 69 6f 6e 46 69 6c 74 65 72 28 0d 0a 20 20 4c 50  ionFilter(..  LP
9520: 54 4f 50 5f 4c 45 56 45 4c 5f 45 58 43 45 50 54  TOP_LEVEL_EXCEPT
9530: 49 4f 4e 5f 46 49 4c 54 45 52 20 6c 70 54 6f 70  ION_FILTER lpTop
9540: 4c 65 76 65 6c 45 78 63 65 70 74 69 6f 6e 46 69  LevelExceptionFi
9550: 6c 74 65 72 29 3b 0d 0a 0d 0a 2f 2f 20 23 69 66  lter);....// #if
9560: 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d  (_WIN32_WINNT >=
9570: 20 30 78 30 34 30 30 29 0d 0a 0d 0a 65 78 74 65   0x0400)....exte
9580: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
9590: 72 74 20 4c 50 56 4f 49 44 20 43 72 65 61 74 65  rt LPVOID Create
95a0: 46 69 62 65 72 28 0d 0a 20 20 53 49 5a 45 5f 54  Fiber(..  SIZE_T
95b0: 20 64 77 53 74 61 63 6b 53 69 7a 65 2c 0d 0a 20   dwStackSize,.. 
95c0: 20 4c 50 46 49 42 45 52 5f 53 54 41 52 54 5f 52   LPFIBER_START_R
95d0: 4f 55 54 49 4e 45 20 6c 70 53 74 61 72 74 41 64  OUTINE lpStartAd
95e0: 64 72 65 73 73 2c 0d 0a 20 20 4c 50 56 4f 49 44  dress,..  LPVOID
95f0: 20 6c 70 50 61 72 61 6d 65 74 65 72 29 3b 0d 0a   lpParameter);..
9600: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
9610: 29 20 65 78 70 6f 72 74 20 4c 50 56 4f 49 44 20  ) export LPVOID 
9620: 43 72 65 61 74 65 46 69 62 65 72 45 78 28 0d 0a  CreateFiberEx(..
9630: 20 20 53 49 5a 45 5f 54 20 64 77 53 74 61 63 6b    SIZE_T dwStack
9640: 43 6f 6d 6d 69 74 53 69 7a 65 2c 0d 0a 20 20 53  CommitSize,..  S
9650: 49 5a 45 5f 54 20 64 77 53 74 61 63 6b 52 65 73  IZE_T dwStackRes
9660: 65 72 76 65 53 69 7a 65 2c 0d 0a 20 20 44 57 4f  erveSize,..  DWO
9670: 52 44 20 64 77 46 6c 61 67 73 2c 0d 0a 20 20 4c  RD dwFlags,..  L
9680: 50 46 49 42 45 52 5f 53 54 41 52 54 5f 52 4f 55  PFIBER_START_ROU
9690: 54 49 4e 45 20 6c 70 53 74 61 72 74 41 64 64 72  TINE lpStartAddr
96a0: 65 73 73 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c  ess,..  LPVOID l
96b0: 70 50 61 72 61 6d 65 74 65 72 29 3b 0d 0a 0d 0a  pParameter);....
96c0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
96d0: 65 78 70 6f 72 74 20 56 4f 49 44 20 44 65 6c 65  export VOID Dele
96e0: 74 65 46 69 62 65 72 28 0d 0a 20 20 4c 50 56 4f  teFiber(..  LPVO
96f0: 49 44 20 6c 70 46 69 62 65 72 29 3b 0d 0a 0d 0a  ID lpFiber);....
9700: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
9710: 65 78 70 6f 72 74 20 4c 50 56 4f 49 44 20 43 6f  export LPVOID Co
9720: 6e 76 65 72 74 54 68 72 65 61 64 54 6f 46 69 62  nvertThreadToFib
9730: 65 72 28 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70  er(..  LPVOID lp
9740: 50 61 72 61 6d 65 74 65 72 29 3b 0d 0a 0d 0a 65  Parameter);....e
9750: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
9760: 78 70 6f 72 74 20 42 4f 4f 4c 20 43 6f 6e 76 65  xport BOOL Conve
9770: 72 74 46 69 62 65 72 54 6f 54 68 72 65 61 64 28  rtFiberToThread(
9780: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
9790: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f 49  dows) export VOI
97a0: 44 20 53 77 69 74 63 68 54 6f 46 69 62 65 72 28  D SwitchToFiber(
97b0: 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 46 69 62  ..  LPVOID lpFib
97c0: 65 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  er);....extern(W
97d0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
97e0: 4f 4f 4c 20 53 77 69 74 63 68 54 6f 54 68 72 65  OOL SwitchToThre
97f0: 61 64 28 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  ad();..// #endif
9800: 20 2f 2a 20 5f 57 49 4e 33 32 5f 57 49 4e 4e 54   /* _WIN32_WINNT
9810: 20 3e 3d 20 30 78 30 34 30 30 20 2a 2f 0d 0a 0d   >= 0x0400 */...
9820: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
9830: 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 43   export HANDLE C
9840: 72 65 61 74 65 54 68 72 65 61 64 28 0d 0a 20 20  reateThread(..  
9850: 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49  LPSECURITY_ATTRI
9860: 42 55 54 45 53 20 6c 70 54 68 72 65 61 64 41 74  BUTES lpThreadAt
9870: 74 72 69 62 75 74 65 73 2c 0d 0a 20 20 53 49 5a  tributes,..  SIZ
9880: 45 5f 54 20 64 77 53 74 61 63 6b 53 69 7a 65 2c  E_T dwStackSize,
9890: 0d 0a 20 20 4c 50 54 48 52 45 41 44 5f 53 54 41  ..  LPTHREAD_STA
98a0: 52 54 5f 52 4f 55 54 49 4e 45 20 6c 70 53 74 61  RT_ROUTINE lpSta
98b0: 72 74 41 64 64 72 65 73 73 2c 0d 0a 20 20 4c 50  rtAddress,..  LP
98c0: 56 4f 49 44 20 6c 70 50 61 72 61 6d 65 74 65 72  VOID lpParameter
98d0: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 43 72 65  ,..  DWORD dwCre
98e0: 61 74 69 6f 6e 46 6c 61 67 73 2c 0d 0a 20 20 4c  ationFlags,..  L
98f0: 50 44 57 4f 52 44 20 6c 70 54 68 72 65 61 64 49  PDWORD lpThreadI
9900: 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  d);....extern(Wi
9910: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41  ndows) export HA
9920: 4e 44 4c 45 20 43 72 65 61 74 65 52 65 6d 6f 74  NDLE CreateRemot
9930: 65 54 68 72 65 61 64 28 0d 0a 20 20 48 41 4e 44  eThread(..  HAND
9940: 4c 45 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20  LE hProcess,..  
9950: 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49  LPSECURITY_ATTRI
9960: 42 55 54 45 53 20 6c 70 54 68 72 65 61 64 41 74  BUTES lpThreadAt
9970: 74 72 69 62 75 74 65 73 2c 0d 0a 20 20 53 49 5a  tributes,..  SIZ
9980: 45 5f 54 20 64 77 53 74 61 63 6b 53 69 7a 65 2c  E_T dwStackSize,
9990: 0d 0a 20 20 4c 50 54 48 52 45 41 44 5f 53 54 41  ..  LPTHREAD_STA
99a0: 52 54 5f 52 4f 55 54 49 4e 45 20 6c 70 53 74 61  RT_ROUTINE lpSta
99b0: 72 74 41 64 64 72 65 73 73 2c 0d 0a 20 20 4c 50  rtAddress,..  LP
99c0: 56 4f 49 44 20 6c 70 50 61 72 61 6d 65 74 65 72  VOID lpParameter
99d0: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 43 72 65  ,..  DWORD dwCre
99e0: 61 74 69 6f 6e 46 6c 61 67 73 2c 0d 0a 20 20 4c  ationFlags,..  L
99f0: 50 44 57 4f 52 44 20 6c 70 54 68 72 65 61 64 49  PDWORD lpThreadI
9a00: 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  d);....extern(Wi
9a10: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41  ndows) export HA
9a20: 4e 44 4c 45 20 47 65 74 43 75 72 72 65 6e 74 54  NDLE GetCurrentT
9a30: 68 72 65 61 64 28 29 3b 0d 0a 0d 0a 65 78 74 65  hread();....exte
9a40: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
9a50: 72 74 20 44 57 4f 52 44 20 47 65 74 43 75 72 72  rt DWORD GetCurr
9a60: 65 6e 74 54 68 72 65 61 64 49 64 28 29 3b 0d 0a  entThreadId();..
9a70: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
9a80: 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 5f 50  ) export DWORD_P
9a90: 54 52 20 53 65 74 54 68 72 65 61 64 41 66 66 69  TR SetThreadAffi
9aa0: 6e 69 74 79 4d 61 73 6b 28 0d 0a 20 20 48 41 4e  nityMask(..  HAN
9ab0: 44 4c 45 20 68 54 68 72 65 61 64 2c 0d 0a 20 20  DLE hThread,..  
9ac0: 44 57 4f 52 44 5f 50 54 52 20 64 77 54 68 72 65  DWORD_PTR dwThre
9ad0: 61 64 41 66 66 69 6e 69 74 79 4d 61 73 6b 29 3b  adAffinityMask);
9ae0: 0d 0a 0d 0a 2f 2f 20 23 69 66 28 5f 57 49 4e 33  ....// #if(_WIN3
9af0: 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 34 30  2_WINNT >= 0x040
9b00: 30 29 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  0)..extern(Windo
9b10: 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44  ws) export DWORD
9b20: 20 53 65 74 54 68 72 65 61 64 49 64 65 61 6c 50   SetThreadIdealP
9b30: 72 6f 63 65 73 73 6f 72 28 0d 0a 20 20 48 41 4e  rocessor(..  HAN
9b40: 44 4c 45 20 68 54 68 72 65 61 64 2c 0d 0a 20 20  DLE hThread,..  
9b50: 44 57 4f 52 44 20 64 77 49 64 65 61 6c 50 72 6f  DWORD dwIdealPro
9b60: 63 65 73 73 6f 72 29 3b 0d 0a 2f 2f 20 23 65 6e  cessor);..// #en
9b70: 64 69 66 20 2f 2a 20 5f 57 49 4e 33 32 5f 57 49  dif /* _WIN32_WI
9b80: 4e 4e 54 20 3e 3d 20 30 78 30 34 30 30 20 2a 2f  NNT >= 0x0400 */
9b90: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
9ba0: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
9bb0: 53 65 74 50 72 6f 63 65 73 73 50 72 69 6f 72 69  SetProcessPriori
9bc0: 74 79 42 6f 6f 73 74 28 0d 0a 20 20 48 41 4e 44  tyBoost(..  HAND
9bd0: 4c 45 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20  LE hProcess,..  
9be0: 42 4f 4f 4c 20 62 44 69 73 61 62 6c 65 50 72 69  BOOL bDisablePri
9bf0: 6f 72 69 74 79 42 6f 6f 73 74 29 3b 0d 0a 0d 0a  orityBoost);....
9c00: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
9c10: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 50  export BOOL GetP
9c20: 72 6f 63 65 73 73 50 72 69 6f 72 69 74 79 42 6f  rocessPriorityBo
9c30: 6f 73 74 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  ost(..  HANDLE h
9c40: 50 72 6f 63 65 73 73 2c 0d 0a 20 20 50 42 4f 4f  Process,..  PBOO
9c50: 4c 20 70 44 69 73 61 62 6c 65 50 72 69 6f 72 69  L pDisablePriori
9c60: 74 79 42 6f 6f 73 74 29 3b 0d 0a 0d 0a 65 78 74  tyBoost);....ext
9c70: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
9c80: 6f 72 74 20 42 4f 4f 4c 20 52 65 71 75 65 73 74  ort BOOL Request
9c90: 57 61 6b 65 75 70 4c 61 74 65 6e 63 79 28 0d 0a  WakeupLatency(..
9ca0: 20 20 4c 41 54 45 4e 43 59 5f 54 49 4d 45 20 6c    LATENCY_TIME l
9cb0: 61 74 65 6e 63 79 29 3b 0d 0a 0d 0a 65 78 74 65  atency);....exte
9cc0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
9cd0: 72 74 20 42 4f 4f 4c 20 49 73 53 79 73 74 65 6d  rt BOOL IsSystem
9ce0: 52 65 73 75 6d 65 41 75 74 6f 6d 61 74 69 63 28  ResumeAutomatic(
9cf0: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
9d00: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
9d10: 44 4c 45 20 4f 70 65 6e 54 68 72 65 61 64 28 0d  DLE OpenThread(.
9d20: 0a 20 20 44 57 4f 52 44 20 64 77 44 65 73 69 72  .  DWORD dwDesir
9d30: 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 42 4f 4f  edAccess,..  BOO
9d40: 4c 20 62 49 6e 68 65 72 69 74 48 61 6e 64 6c 65  L bInheritHandle
9d50: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 54 68 72  ,..  DWORD dwThr
9d60: 65 61 64 49 64 29 3b 0d 0a 0d 0a 65 78 74 65 72  eadId);....exter
9d70: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
9d80: 74 20 42 4f 4f 4c 20 53 65 74 54 68 72 65 61 64  t BOOL SetThread
9d90: 50 72 69 6f 72 69 74 79 28 0d 0a 20 20 48 41 4e  Priority(..  HAN
9da0: 44 4c 45 20 68 54 68 72 65 61 64 2c 0d 0a 20 20  DLE hThread,..  
9db0: 69 6e 74 20 6e 50 72 69 6f 72 69 74 79 29 3b 0d  int nPriority);.
9dc0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
9dd0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
9de0: 65 74 54 68 72 65 61 64 50 72 69 6f 72 69 74 79  etThreadPriority
9df0: 42 6f 6f 73 74 28 0d 0a 20 20 48 41 4e 44 4c 45  Boost(..  HANDLE
9e00: 20 68 54 68 72 65 61 64 2c 0d 0a 20 20 42 4f 4f   hThread,..  BOO
9e10: 4c 20 62 44 69 73 61 62 6c 65 50 72 69 6f 72 69  L bDisablePriori
9e20: 74 79 42 6f 6f 73 74 29 3b 0d 0a 0d 0a 65 78 74  tyBoost);....ext
9e30: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
9e40: 6f 72 74 20 42 4f 4f 4c 20 47 65 74 54 68 72 65  ort BOOL GetThre
9e50: 61 64 50 72 69 6f 72 69 74 79 42 6f 6f 73 74 28  adPriorityBoost(
9e60: 0d 0a 20 20 48 41 4e 44 4c 45 20 68 54 68 72 65  ..  HANDLE hThre
9e70: 61 64 2c 0d 0a 20 20 50 42 4f 4f 4c 20 70 44 69  ad,..  PBOOL pDi
9e80: 73 61 62 6c 65 50 72 69 6f 72 69 74 79 42 6f 6f  sablePriorityBoo
9e90: 73 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  st);....extern(W
9ea0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 69  indows) export i
9eb0: 6e 74 20 47 65 74 54 68 72 65 61 64 50 72 69 6f  nt GetThreadPrio
9ec0: 72 69 74 79 28 0d 0a 20 20 48 41 4e 44 4c 45 20  rity(..  HANDLE 
9ed0: 68 54 68 72 65 61 64 29 3b 0d 0a 0d 0a 65 78 74  hThread);....ext
9ee0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
9ef0: 6f 72 74 20 42 4f 4f 4c 20 47 65 74 54 68 72 65  ort BOOL GetThre
9f00: 61 64 54 69 6d 65 73 28 0d 0a 20 20 48 41 4e 44  adTimes(..  HAND
9f10: 4c 45 20 68 54 68 72 65 61 64 2c 0d 0a 20 20 4c  LE hThread,..  L
9f20: 50 46 49 4c 45 54 49 4d 45 20 6c 70 43 72 65 61  PFILETIME lpCrea
9f30: 74 69 6f 6e 54 69 6d 65 2c 0d 0a 20 20 4c 50 46  tionTime,..  LPF
9f40: 49 4c 45 54 49 4d 45 20 6c 70 45 78 69 74 54 69  ILETIME lpExitTi
9f50: 6d 65 2c 0d 0a 20 20 4c 50 46 49 4c 45 54 49 4d  me,..  LPFILETIM
9f60: 45 20 6c 70 4b 65 72 6e 65 6c 54 69 6d 65 2c 0d  E lpKernelTime,.
9f70: 0a 20 20 4c 50 46 49 4c 45 54 49 4d 45 20 6c 70  .  LPFILETIME lp
9f80: 55 73 65 72 54 69 6d 65 29 3b 0d 0a 0d 0a 65 78  UserTime);....ex
9f90: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
9fa0: 70 6f 72 74 20 56 4f 49 44 20 45 78 69 74 54 68  port VOID ExitTh
9fb0: 72 65 61 64 28 0d 0a 20 20 44 57 4f 52 44 20 64  read(..  DWORD d
9fc0: 77 45 78 69 74 43 6f 64 65 29 3b 0d 0a 0d 0a 65  wExitCode);....e
9fd0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
9fe0: 78 70 6f 72 74 20 42 4f 4f 4c 20 54 65 72 6d 69  xport BOOL Termi
9ff0: 6e 61 74 65 54 68 72 65 61 64 28 0d 0a 20 20 48  nateThread(..  H
a000: 41 4e 44 4c 45 20 68 54 68 72 65 61 64 2c 0d 0a  ANDLE hThread,..
a010: 20 20 44 57 4f 52 44 20 64 77 45 78 69 74 43 6f    DWORD dwExitCo
a020: 64 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  de);....extern(W
a030: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
a040: 4f 4f 4c 20 47 65 74 45 78 69 74 43 6f 64 65 54  OOL GetExitCodeT
a050: 68 72 65 61 64 28 0d 0a 20 20 48 41 4e 44 4c 45  hread(..  HANDLE
a060: 20 68 54 68 72 65 61 64 2c 0d 0a 20 20 4c 50 44   hThread,..  LPD
a070: 57 4f 52 44 20 6c 70 45 78 69 74 43 6f 64 65 29  WORD lpExitCode)
a080: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
a090: 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
a0a0: 20 47 65 74 54 68 72 65 61 64 53 65 6c 65 63 74   GetThreadSelect
a0b0: 6f 72 45 6e 74 72 79 28 0d 0a 20 20 48 41 4e 44  orEntry(..  HAND
a0c0: 4c 45 20 68 54 68 72 65 61 64 2c 0d 0a 20 20 44  LE hThread,..  D
a0d0: 57 4f 52 44 20 64 77 53 65 6c 65 63 74 6f 72 2c  WORD dwSelector,
a0e0: 0d 0a 20 20 4c 50 4c 44 54 5f 45 4e 54 52 59 20  ..  LPLDT_ENTRY 
a0f0: 6c 70 53 65 6c 65 63 74 6f 72 45 6e 74 72 79 29  lpSelectorEntry)
a100: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
a110: 6f 77 73 29 20 65 78 70 6f 72 74 20 45 58 45 43  ows) export EXEC
a120: 55 54 49 4f 4e 5f 53 54 41 54 45 20 53 65 74 54  UTION_STATE SetT
a130: 68 72 65 61 64 45 78 65 63 75 74 69 6f 6e 53 74  hreadExecutionSt
a140: 61 74 65 28 0d 0a 20 20 45 58 45 43 55 54 49 4f  ate(..  EXECUTIO
a150: 4e 5f 53 54 41 54 45 20 65 73 46 6c 61 67 73 29  N_STATE esFlags)
a160: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
a170: 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
a180: 44 20 47 65 74 4c 61 73 74 45 72 72 6f 72 28 29  D GetLastError()
a190: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
a1a0: 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f 49 44  ows) export VOID
a1b0: 20 53 65 74 4c 61 73 74 45 72 72 6f 72 28 0d 0a   SetLastError(..
a1c0: 20 20 44 57 4f 52 44 20 64 77 45 72 72 43 6f 64    DWORD dwErrCod
a1d0: 65 29 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 20 21 64  e);....// #if !d
a1e0: 65 66 69 6e 65 64 28 52 43 5f 49 4e 56 4f 4b 45  efined(RC_INVOKE
a1f0: 44 29 20 2f 2f 20 52 43 20 77 61 72 6e 73 20 62  D) // RC warns b
a200: 65 63 61 75 73 65 20 22 57 49 4e 42 41 53 45 5f  ecause "WINBASE_
a210: 44 45 43 4c 41 52 45 5f 52 45 53 54 4f 52 45 5f  DECLARE_RESTORE_
a220: 4c 41 53 54 5f 45 52 52 4f 52 22 20 69 73 20 61  LAST_ERROR" is a
a230: 20 62 69 74 20 6c 6f 6e 67 2e 0d 0a 0d 0a 2f 2f   bit long.....//
a240: 20 23 69 66 20 64 65 66 69 6e 65 64 28 57 49 4e   #if defined(WIN
a250: 42 41 53 45 5f 44 45 43 4c 41 52 45 5f 52 45 53  BASE_DECLARE_RES
a260: 54 4f 52 45 5f 4c 41 53 54 5f 45 52 52 4f 52 29  TORE_LAST_ERROR)
a270: 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 0d 0a 2f 2f  ....// .......//
a280: 20 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f   .....// #...../
a290: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e 0d  / #.....// #....
a2a0: 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 2f 2f  ...// #endif..//
a2b0: 20 23 65 6e 64 69 66 0d 0a 0d 0a 62 69 74 20 48   #endif....bit H
a2c0: 61 73 4f 76 65 72 6c 61 70 70 65 64 49 6f 43 6f  asOverlappedIoCo
a2d0: 6d 70 6c 65 74 65 64 28 4c 50 4f 56 45 52 4c 41  mpleted(LPOVERLA
a2e0: 50 50 45 44 20 6c 70 4f 76 65 72 6c 61 70 70 65  PPED lpOverlappe
a2f0: 64 29 7b 20 72 65 74 75 72 6e 20 28 2a 6c 70 4f  d){ return (*lpO
a300: 76 65 72 6c 61 70 70 65 64 29 2e 49 6e 74 65 72  verlapped).Inter
a310: 6e 61 6c 20 21 3d 20 53 54 41 54 55 53 5f 50 45  nal != STATUS_PE
a320: 4e 44 49 4e 47 3b 20 7d 0d 0a 0d 0a 65 78 74 65  NDING; }....exte
a330: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
a340: 72 74 20 42 4f 4f 4c 20 47 65 74 4f 76 65 72 6c  rt BOOL GetOverl
a350: 61 70 70 65 64 52 65 73 75 6c 74 28 0d 0a 20 20  appedResult(..  
a360: 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d 0a 20  HANDLE hFile,.. 
a370: 20 4c 50 4f 56 45 52 4c 41 50 50 45 44 20 6c 70   LPOVERLAPPED lp
a380: 4f 76 65 72 6c 61 70 70 65 64 2c 0d 0a 20 20 4c  Overlapped,..  L
a390: 50 44 57 4f 52 44 20 6c 70 4e 75 6d 62 65 72 4f  PDWORD lpNumberO
a3a0: 66 42 79 74 65 73 54 72 61 6e 73 66 65 72 72 65  fBytesTransferre
a3b0: 64 2c 0d 0a 20 20 42 4f 4f 4c 20 62 57 61 69 74  d,..  BOOL bWait
a3c0: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
a3d0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
a3e0: 44 4c 45 20 43 72 65 61 74 65 49 6f 43 6f 6d 70  DLE CreateIoComp
a3f0: 6c 65 74 69 6f 6e 50 6f 72 74 28 0d 0a 20 20 48  letionPort(..  H
a400: 41 4e 44 4c 45 20 46 69 6c 65 48 61 6e 64 6c 65  ANDLE FileHandle
a410: 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 45 78 69 73  ,..  HANDLE Exis
a420: 74 69 6e 67 43 6f 6d 70 6c 65 74 69 6f 6e 50 6f  tingCompletionPo
a430: 72 74 2c 0d 0a 20 20 55 4c 4f 4e 47 5f 50 54 52  rt,..  ULONG_PTR
a440: 20 43 6f 6d 70 6c 65 74 69 6f 6e 4b 65 79 2c 0d   CompletionKey,.
a450: 0a 20 20 44 57 4f 52 44 20 4e 75 6d 62 65 72 4f  .  DWORD NumberO
a460: 66 43 6f 6e 63 75 72 72 65 6e 74 54 68 72 65 61  fConcurrentThrea
a470: 64 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ds);....extern(W
a480: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
a490: 4f 4f 4c 20 47 65 74 51 75 65 75 65 64 43 6f 6d  OOL GetQueuedCom
a4a0: 70 6c 65 74 69 6f 6e 53 74 61 74 75 73 28 0d 0a  pletionStatus(..
a4b0: 20 20 48 41 4e 44 4c 45 20 43 6f 6d 70 6c 65 74    HANDLE Complet
a4c0: 69 6f 6e 50 6f 72 74 2c 0d 0a 20 20 4c 50 44 57  ionPort,..  LPDW
a4d0: 4f 52 44 20 6c 70 4e 75 6d 62 65 72 4f 66 42 79  ORD lpNumberOfBy
a4e0: 74 65 73 54 72 61 6e 73 66 65 72 72 65 64 2c 0d  tesTransferred,.
a4f0: 0a 20 20 50 55 4c 4f 4e 47 5f 50 54 52 20 6c 70  .  PULONG_PTR lp
a500: 43 6f 6d 70 6c 65 74 69 6f 6e 4b 65 79 2c 0d 0a  CompletionKey,..
a510: 20 20 4c 50 4f 56 45 52 4c 41 50 50 45 44 20 2a    LPOVERLAPPED *
a520: 6c 70 4f 76 65 72 6c 61 70 70 65 64 2c 0d 0a 20  lpOverlapped,.. 
a530: 20 44 57 4f 52 44 20 64 77 4d 69 6c 6c 69 73 65   DWORD dwMillise
a540: 63 6f 6e 64 73 29 3b 0d 0a 0d 0a 65 78 74 65 72  conds);....exter
a550: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
a560: 74 20 42 4f 4f 4c 20 50 6f 73 74 51 75 65 75 65  t BOOL PostQueue
a570: 64 43 6f 6d 70 6c 65 74 69 6f 6e 53 74 61 74 75  dCompletionStatu
a580: 73 28 0d 0a 20 20 48 41 4e 44 4c 45 20 43 6f 6d  s(..  HANDLE Com
a590: 70 6c 65 74 69 6f 6e 50 6f 72 74 2c 0d 0a 20 20  pletionPort,..  
a5a0: 44 57 4f 52 44 20 64 77 4e 75 6d 62 65 72 4f 66  DWORD dwNumberOf
a5b0: 42 79 74 65 73 54 72 61 6e 73 66 65 72 72 65 64  BytesTransferred
a5c0: 2c 0d 0a 20 20 55 4c 4f 4e 47 5f 50 54 52 20 64  ,..  ULONG_PTR d
a5d0: 77 43 6f 6d 70 6c 65 74 69 6f 6e 4b 65 79 2c 0d  wCompletionKey,.
a5e0: 0a 20 20 4c 50 4f 56 45 52 4c 41 50 50 45 44 20  .  LPOVERLAPPED 
a5f0: 6c 70 4f 76 65 72 6c 61 70 70 65 64 29 3b 0d 0a  lpOverlapped);..
a600: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
a610: 53 45 4d 5f 46 41 49 4c 43 52 49 54 49 43 41 4c  SEM_FAILCRITICAL
a620: 45 52 52 4f 52 53 20 3d 20 30 78 30 30 30 31 20  ERRORS = 0x0001 
a630: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
a640: 20 53 45 4d 5f 4e 4f 47 50 46 41 55 4c 54 45 52   SEM_NOGPFAULTER
a650: 52 4f 52 42 4f 58 20 3d 20 30 78 30 30 30 32 20  RORBOX = 0x0002 
a660: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
a670: 20 53 45 4d 5f 4e 4f 41 4c 49 47 4e 4d 45 4e 54   SEM_NOALIGNMENT
a680: 46 41 55 4c 54 45 58 43 45 50 54 20 3d 20 30 78  FAULTEXCEPT = 0x
a690: 30 30 30 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0004 }..enum : u
a6a0: 69 6e 74 20 7b 20 53 45 4d 5f 4e 4f 4f 50 45 4e  int { SEM_NOOPEN
a6b0: 46 49 4c 45 45 52 52 4f 52 42 4f 58 20 3d 20 30  FILEERRORBOX = 0
a6c0: 78 38 30 30 30 20 7d 0d 0a 0d 0a 65 78 74 65 72  x8000 }....exter
a6d0: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
a6e0: 74 20 55 49 4e 54 20 53 65 74 45 72 72 6f 72 4d  t UINT SetErrorM
a6f0: 6f 64 65 28 0d 0a 20 20 55 49 4e 54 20 75 4d 6f  ode(..  UINT uMo
a700: 64 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  de);....extern(W
a710: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
a720: 4f 4f 4c 20 52 65 61 64 50 72 6f 63 65 73 73 4d  OOL ReadProcessM
a730: 65 6d 6f 72 79 28 0d 0a 20 20 48 41 4e 44 4c 45  emory(..  HANDLE
a740: 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20 4c 50   hProcess,..  LP
a750: 43 56 4f 49 44 20 6c 70 42 61 73 65 41 64 64 72  CVOID lpBaseAddr
a760: 65 73 73 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c  ess,..  LPVOID l
a770: 70 42 75 66 66 65 72 2c 0d 0a 20 20 53 49 5a 45  pBuffer,..  SIZE
a780: 5f 54 20 6e 53 69 7a 65 2c 0d 0a 20 20 53 49 5a  _T nSize,..  SIZ
a790: 45 5f 54 20 2a 20 6c 70 4e 75 6d 62 65 72 4f 66  E_T * lpNumberOf
a7a0: 42 79 74 65 73 52 65 61 64 29 3b 0d 0a 0d 0a 65  BytesRead);....e
a7b0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
a7c0: 78 70 6f 72 74 20 42 4f 4f 4c 20 57 72 69 74 65  xport BOOL Write
a7d0: 50 72 6f 63 65 73 73 4d 65 6d 6f 72 79 28 0d 0a  ProcessMemory(..
a7e0: 20 20 48 41 4e 44 4c 45 20 68 50 72 6f 63 65 73    HANDLE hProces
a7f0: 73 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 42  s,..  LPVOID lpB
a800: 61 73 65 41 64 64 72 65 73 73 2c 0d 0a 20 20 4c  aseAddress,..  L
a810: 50 43 56 4f 49 44 20 6c 70 42 75 66 66 65 72 2c  PCVOID lpBuffer,
a820: 0d 0a 20 20 53 49 5a 45 5f 54 20 6e 53 69 7a 65  ..  SIZE_T nSize
a830: 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 2a 20 6c 70  ,..  SIZE_T * lp
a840: 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 57 72 69  NumberOfBytesWri
a850: 74 74 65 6e 29 3b 0d 0a 0d 0a 2f 2f 20 23 69 66  tten);....// #if
a860: 20 21 64 65 66 69 6e 65 64 28 4d 49 44 4c 5f 50   !defined(MIDL_P
a870: 41 53 53 29 0d 0a 65 78 74 65 72 6e 28 57 69 6e  ASS)..extern(Win
a880: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
a890: 4c 20 47 65 74 54 68 72 65 61 64 43 6f 6e 74 65  L GetThreadConte
a8a0: 78 74 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 54  xt(..  HANDLE hT
a8b0: 68 72 65 61 64 2c 0d 0a 20 20 4c 50 43 4f 4e 54  hread,..  LPCONT
a8c0: 45 58 54 20 6c 70 43 6f 6e 74 65 78 74 29 3b 0d  EXT lpContext);.
a8d0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
a8e0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
a8f0: 65 74 54 68 72 65 61 64 43 6f 6e 74 65 78 74 28  etThreadContext(
a900: 0d 0a 20 20 48 41 4e 44 4c 45 20 68 54 68 72 65  ..  HANDLE hThre
a910: 61 64 2c 0d 0a 20 20 43 4f 4e 54 45 58 54 20 2a  ad,..  CONTEXT *
a920: 6c 70 43 6f 6e 74 65 78 74 29 3b 0d 0a 2f 2f 20  lpContext);..// 
a930: 23 65 6e 64 69 66 0d 0a 0d 0a 65 78 74 65 72 6e  #endif....extern
a940: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
a950: 20 44 57 4f 52 44 20 53 75 73 70 65 6e 64 54 68   DWORD SuspendTh
a960: 72 65 61 64 28 0d 0a 20 20 48 41 4e 44 4c 45 20  read(..  HANDLE 
a970: 68 54 68 72 65 61 64 29 3b 0d 0a 0d 0a 65 78 74  hThread);....ext
a980: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
a990: 6f 72 74 20 44 57 4f 52 44 20 52 65 73 75 6d 65  ort DWORD Resume
a9a0: 54 68 72 65 61 64 28 0d 0a 20 20 48 41 4e 44 4c  Thread(..  HANDL
a9b0: 45 20 68 54 68 72 65 61 64 29 3b 0d 0a 0d 0a 2f  E hThread);..../
a9c0: 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e  / #if(_WIN32_WIN
a9d0: 4e 54 20 3e 3d 20 30 78 30 34 30 30 29 20 7c 7c  NT >= 0x0400) ||
a9e0: 20 28 5f 57 49 4e 33 32 5f 57 49 4e 44 4f 57 53   (_WIN32_WINDOWS
a9f0: 20 3e 20 30 78 30 34 30 30 29 0d 0a 0d 0a 2f 2f   > 0x0400)....//
aa00: 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a   .......// .....
aa10: 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a 20 5f  ..// #endif /* _
aa20: 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30  WIN32_WINNT >= 0
aa30: 78 30 34 30 30 20 7c 7c 20 5f 57 49 4e 33 32 5f  x0400 || _WIN32_
aa40: 57 49 4e 44 4f 57 53 20 3e 20 30 78 30 34 30 30  WINDOWS > 0x0400
aa50: 20 2a 2f 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f   */....// #if (_
aa60: 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30  WIN32_WINNT >= 0
aa70: 78 30 34 30 30 29 20 7c 7c 20 28 5f 57 49 4e 33  x0400) || (_WIN3
aa80: 32 5f 57 49 4e 44 4f 57 53 20 3e 20 30 78 30 34  2_WINDOWS > 0x04
aa90: 30 30 29 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  00)..extern(Wind
aaa0: 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
aab0: 20 49 73 44 65 62 75 67 67 65 72 50 72 65 73 65   IsDebuggerPrese
aac0: 6e 74 28 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  nt();..// #endif
aad0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
aae0: 77 73 29 20 65 78 70 6f 72 74 20 56 4f 49 44 20  ws) export VOID 
aaf0: 44 65 62 75 67 42 72 65 61 6b 28 29 3b 0d 0a 0d  DebugBreak();...
ab00: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
ab10: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 57 61 69   export BOOL Wai
ab20: 74 46 6f 72 44 65 62 75 67 45 76 65 6e 74 28 0d  tForDebugEvent(.
ab30: 0a 20 20 4c 50 44 45 42 55 47 5f 45 56 45 4e 54  .  LPDEBUG_EVENT
ab40: 20 6c 70 44 65 62 75 67 45 76 65 6e 74 2c 0d 0a   lpDebugEvent,..
ab50: 20 20 44 57 4f 52 44 20 64 77 4d 69 6c 6c 69 73    DWORD dwMillis
ab60: 65 63 6f 6e 64 73 29 3b 0d 0a 0d 0a 65 78 74 65  econds);....exte
ab70: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
ab80: 72 74 20 42 4f 4f 4c 20 43 6f 6e 74 69 6e 75 65  rt BOOL Continue
ab90: 44 65 62 75 67 45 76 65 6e 74 28 0d 0a 20 20 44  DebugEvent(..  D
aba0: 57 4f 52 44 20 64 77 50 72 6f 63 65 73 73 49 64  WORD dwProcessId
abb0: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 54 68 72  ,..  DWORD dwThr
abc0: 65 61 64 49 64 2c 0d 0a 20 20 44 57 4f 52 44 20  eadId,..  DWORD 
abd0: 64 77 43 6f 6e 74 69 6e 75 65 53 74 61 74 75 73  dwContinueStatus
abe0: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
abf0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
ac00: 4c 20 44 65 62 75 67 41 63 74 69 76 65 50 72 6f  L DebugActivePro
ac10: 63 65 73 73 28 0d 0a 20 20 44 57 4f 52 44 20 64  cess(..  DWORD d
ac20: 77 50 72 6f 63 65 73 73 49 64 29 3b 0d 0a 0d 0a  wProcessId);....
ac30: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
ac40: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 44 65 62 75  export BOOL Debu
ac50: 67 41 63 74 69 76 65 50 72 6f 63 65 73 73 53 74  gActiveProcessSt
ac60: 6f 70 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 50  op(..  DWORD dwP
ac70: 72 6f 63 65 73 73 49 64 29 3b 0d 0a 0d 0a 65 78  rocessId);....ex
ac80: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
ac90: 70 6f 72 74 20 42 4f 4f 4c 20 44 65 62 75 67 53  port BOOL DebugS
aca0: 65 74 50 72 6f 63 65 73 73 4b 69 6c 6c 4f 6e 45  etProcessKillOnE
acb0: 78 69 74 28 0d 0a 20 20 42 4f 4f 4c 20 4b 69 6c  xit(..  BOOL Kil
acc0: 6c 4f 6e 45 78 69 74 29 3b 0d 0a 0d 0a 65 78 74  lOnExit);....ext
acd0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
ace0: 6f 72 74 20 42 4f 4f 4c 20 44 65 62 75 67 42 72  ort BOOL DebugBr
acf0: 65 61 6b 50 72 6f 63 65 73 73 28 0d 0a 20 20 48  eakProcess(..  H
ad00: 41 4e 44 4c 45 20 50 72 6f 63 65 73 73 29 3b 0d  ANDLE Process);.
ad10: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
ad20: 73 29 20 65 78 70 6f 72 74 20 56 4f 49 44 20 49  s) export VOID I
ad30: 6e 69 74 69 61 6c 69 7a 65 43 72 69 74 69 63 61  nitializeCritica
ad40: 6c 53 65 63 74 69 6f 6e 28 0d 0a 20 20 4c 50 43  lSection(..  LPC
ad50: 52 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20  RITICAL_SECTION 
ad60: 6c 70 43 72 69 74 69 63 61 6c 53 65 63 74 69 6f  lpCriticalSectio
ad70: 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  n);....extern(Wi
ad80: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f  ndows) export VO
ad90: 49 44 20 45 6e 74 65 72 43 72 69 74 69 63 61 6c  ID EnterCritical
ada0: 53 65 63 74 69 6f 6e 28 0d 0a 20 20 4c 50 43 52  Section(..  LPCR
adb0: 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20 6c  ITICAL_SECTION l
adc0: 70 43 72 69 74 69 63 61 6c 53 65 63 74 69 6f 6e  pCriticalSection
add0: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
ade0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f 49  dows) export VOI
adf0: 44 20 4c 65 61 76 65 43 72 69 74 69 63 61 6c 53  D LeaveCriticalS
ae00: 65 63 74 69 6f 6e 28 0d 0a 20 20 4c 50 43 52 49  ection(..  LPCRI
ae10: 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20 6c 70  TICAL_SECTION lp
ae20: 43 72 69 74 69 63 61 6c 53 65 63 74 69 6f 6e 29  CriticalSection)
ae30: 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f 57 49  ;....// #if (_WI
ae40: 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30  N32_WINNT >= 0x0
ae50: 34 30 33 29 0d 0a 65 78 74 65 72 6e 28 57 69 6e  403)..extern(Win
ae60: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
ae70: 4c 20 49 6e 69 74 69 61 6c 69 7a 65 43 72 69 74  L InitializeCrit
ae80: 69 63 61 6c 53 65 63 74 69 6f 6e 41 6e 64 53 70  icalSectionAndSp
ae90: 69 6e 43 6f 75 6e 74 28 0d 0a 20 20 4c 50 43 52  inCount(..  LPCR
aea0: 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20 6c  ITICAL_SECTION l
aeb0: 70 43 72 69 74 69 63 61 6c 53 65 63 74 69 6f 6e  pCriticalSection
aec0: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 53 70 69  ,..  DWORD dwSpi
aed0: 6e 43 6f 75 6e 74 29 3b 0d 0a 0d 0a 65 78 74 65  nCount);....exte
aee0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
aef0: 72 74 20 44 57 4f 52 44 20 53 65 74 43 72 69 74  rt DWORD SetCrit
af00: 69 63 61 6c 53 65 63 74 69 6f 6e 53 70 69 6e 43  icalSectionSpinC
af10: 6f 75 6e 74 28 0d 0a 20 20 4c 50 43 52 49 54 49  ount(..  LPCRITI
af20: 43 41 4c 5f 53 45 43 54 49 4f 4e 20 6c 70 43 72  CAL_SECTION lpCr
af30: 69 74 69 63 61 6c 53 65 63 74 69 6f 6e 2c 0d 0a  iticalSection,..
af40: 20 20 44 57 4f 52 44 20 64 77 53 70 69 6e 43 6f    DWORD dwSpinCo
af50: 75 6e 74 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  unt);..// #endif
af60: 0d 0a 0d 0a 2f 2f 20 23 69 66 28 5f 57 49 4e 33  ....// #if(_WIN3
af70: 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 34 30  2_WINNT >= 0x040
af80: 30 29 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  0)..extern(Windo
af90: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
afa0: 54 72 79 45 6e 74 65 72 43 72 69 74 69 63 61 6c  TryEnterCritical
afb0: 53 65 63 74 69 6f 6e 28 0d 0a 20 20 4c 50 43 52  Section(..  LPCR
afc0: 49 54 49 43 41 4c 5f 53 45 43 54 49 4f 4e 20 6c  ITICAL_SECTION l
afd0: 70 43 72 69 74 69 63 61 6c 53 65 63 74 69 6f 6e  pCriticalSection
afe0: 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a  );..// #endif /*
aff0: 20 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d   _WIN32_WINNT >=
b000: 20 30 78 30 34 30 30 20 2a 2f 0d 0a 0d 0a 65 78   0x0400 */....ex
b010: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
b020: 70 6f 72 74 20 56 4f 49 44 20 44 65 6c 65 74 65  port VOID Delete
b030: 43 72 69 74 69 63 61 6c 53 65 63 74 69 6f 6e 28  CriticalSection(
b040: 0d 0a 20 20 4c 50 43 52 49 54 49 43 41 4c 5f 53  ..  LPCRITICAL_S
b050: 45 43 54 49 4f 4e 20 6c 70 43 72 69 74 69 63 61  ECTION lpCritica
b060: 6c 53 65 63 74 69 6f 6e 29 3b 0d 0a 0d 0a 65 78  lSection);....ex
b070: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
b080: 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 45 76 65  port BOOL SetEve
b090: 6e 74 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45  nt(..  HANDLE hE
b0a0: 76 65 6e 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  vent);....extern
b0b0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
b0c0: 20 42 4f 4f 4c 20 52 65 73 65 74 45 76 65 6e 74   BOOL ResetEvent
b0d0: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45 76 65  (..  HANDLE hEve
b0e0: 6e 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  nt);....extern(W
b0f0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
b100: 4f 4f 4c 20 50 75 6c 73 65 45 76 65 6e 74 28 0d  OOL PulseEvent(.
b110: 0a 20 20 48 41 4e 44 4c 45 20 68 45 76 65 6e 74  .  HANDLE hEvent
b120: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
b130: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
b140: 4c 20 52 65 6c 65 61 73 65 53 65 6d 61 70 68 6f  L ReleaseSemapho
b150: 72 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 53  re(..  HANDLE hS
b160: 65 6d 61 70 68 6f 72 65 2c 0d 0a 20 20 4c 4f 4e  emaphore,..  LON
b170: 47 20 6c 52 65 6c 65 61 73 65 43 6f 75 6e 74 2c  G lReleaseCount,
b180: 0d 0a 20 20 4c 50 4c 4f 4e 47 20 6c 70 50 72 65  ..  LPLONG lpPre
b190: 76 69 6f 75 73 43 6f 75 6e 74 29 3b 0d 0a 0d 0a  viousCount);....
b1a0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
b1b0: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 52 65 6c 65  export BOOL Rele
b1c0: 61 73 65 4d 75 74 65 78 28 0d 0a 20 20 48 41 4e  aseMutex(..  HAN
b1d0: 44 4c 45 20 68 4d 75 74 65 78 29 3b 0d 0a 0d 0a  DLE hMutex);....
b1e0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
b1f0: 65 78 70 6f 72 74 20 44 57 4f 52 44 20 57 61 69  export DWORD Wai
b200: 74 46 6f 72 53 69 6e 67 6c 65 4f 62 6a 65 63 74  tForSingleObject
b210: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 48 61 6e  (..  HANDLE hHan
b220: 64 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77  dle,..  DWORD dw
b230: 4d 69 6c 6c 69 73 65 63 6f 6e 64 73 29 3b 0d 0a  Milliseconds);..
b240: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
b250: 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20 57  ) export DWORD W
b260: 61 69 74 46 6f 72 4d 75 6c 74 69 70 6c 65 4f 62  aitForMultipleOb
b270: 6a 65 63 74 73 28 0d 0a 20 20 44 57 4f 52 44 20  jects(..  DWORD 
b280: 6e 43 6f 75 6e 74 2c 0d 0a 20 20 48 41 4e 44 4c  nCount,..  HANDL
b290: 45 20 2a 6c 70 48 61 6e 64 6c 65 73 2c 0d 0a 20  E *lpHandles,.. 
b2a0: 20 42 4f 4f 4c 20 62 57 61 69 74 41 6c 6c 2c 0d   BOOL bWaitAll,.
b2b0: 0a 20 20 44 57 4f 52 44 20 64 77 4d 69 6c 6c 69  .  DWORD dwMilli
b2c0: 73 65 63 6f 6e 64 73 29 3b 0d 0a 0d 0a 65 78 74  seconds);....ext
b2d0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
b2e0: 6f 72 74 20 56 4f 49 44 20 53 6c 65 65 70 28 0d  ort VOID Sleep(.
b2f0: 0a 20 20 44 57 4f 52 44 20 64 77 4d 69 6c 6c 69  .  DWORD dwMilli
b300: 73 65 63 6f 6e 64 73 29 3b 0d 0a 0d 0a 65 78 74  seconds);....ext
b310: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
b320: 6f 72 74 20 48 47 4c 4f 42 41 4c 20 4c 6f 61 64  ort HGLOBAL Load
b330: 52 65 73 6f 75 72 63 65 28 0d 0a 20 20 48 4d 4f  Resource(..  HMO
b340: 44 55 4c 45 20 68 4d 6f 64 75 6c 65 2c 0d 0a 20  DULE hModule,.. 
b350: 20 48 52 53 52 43 20 68 52 65 73 49 6e 66 6f 29   HRSRC hResInfo)
b360: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
b370: 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
b380: 44 20 53 69 7a 65 6f 66 52 65 73 6f 75 72 63 65  D SizeofResource
b390: 28 0d 0a 20 20 48 4d 4f 44 55 4c 45 20 68 4d 6f  (..  HMODULE hMo
b3a0: 64 75 6c 65 2c 0d 0a 20 20 48 52 53 52 43 20 68  dule,..  HRSRC h
b3b0: 52 65 73 49 6e 66 6f 29 3b 0d 0a 0d 0a 65 78 74  ResInfo);....ext
b3c0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
b3d0: 6f 72 74 20 41 54 4f 4d 20 47 6c 6f 62 61 6c 44  ort ATOM GlobalD
b3e0: 65 6c 65 74 65 41 74 6f 6d 28 0d 0a 20 20 41 54  eleteAtom(..  AT
b3f0: 4f 4d 20 6e 41 74 6f 6d 29 3b 0d 0a 0d 0a 65 78  OM nAtom);....ex
b400: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
b410: 70 6f 72 74 20 42 4f 4f 4c 20 49 6e 69 74 41 74  port BOOL InitAt
b420: 6f 6d 54 61 62 6c 65 28 0d 0a 20 20 44 57 4f 52  omTable(..  DWOR
b430: 44 20 6e 53 69 7a 65 29 3b 0d 0a 0d 0a 65 78 74  D nSize);....ext
b440: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
b450: 6f 72 74 20 41 54 4f 4d 20 44 65 6c 65 74 65 41  ort ATOM DeleteA
b460: 74 6f 6d 28 0d 0a 20 20 41 54 4f 4d 20 6e 41 74  tom(..  ATOM nAt
b470: 6f 6d 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  om);....extern(W
b480: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55  indows) export U
b490: 49 4e 54 20 53 65 74 48 61 6e 64 6c 65 43 6f 75  INT SetHandleCou
b4a0: 6e 74 28 0d 0a 20 20 55 49 4e 54 20 75 4e 75 6d  nt(..  UINT uNum
b4b0: 62 65 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ber);....extern(
b4c0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
b4d0: 44 57 4f 52 44 20 47 65 74 4c 6f 67 69 63 61 6c  DWORD GetLogical
b4e0: 44 72 69 76 65 73 28 29 3b 0d 0a 0d 0a 65 78 74  Drives();....ext
b4f0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
b500: 6f 72 74 20 42 4f 4f 4c 20 4c 6f 63 6b 46 69 6c  ort BOOL LockFil
b510: 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69  e(..  HANDLE hFi
b520: 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 46  le,..  DWORD dwF
b530: 69 6c 65 4f 66 66 73 65 74 4c 6f 77 2c 0d 0a 20  ileOffsetLow,.. 
b540: 20 44 57 4f 52 44 20 64 77 46 69 6c 65 4f 66 66   DWORD dwFileOff
b550: 73 65 74 48 69 67 68 2c 0d 0a 20 20 44 57 4f 52  setHigh,..  DWOR
b560: 44 20 6e 4e 75 6d 62 65 72 4f 66 42 79 74 65 73  D nNumberOfBytes
b570: 54 6f 4c 6f 63 6b 4c 6f 77 2c 0d 0a 20 20 44 57  ToLockLow,..  DW
b580: 4f 52 44 20 6e 4e 75 6d 62 65 72 4f 66 42 79 74  ORD nNumberOfByt
b590: 65 73 54 6f 4c 6f 63 6b 48 69 67 68 29 3b 0d 0a  esToLockHigh);..
b5a0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
b5b0: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 55 6e  ) export BOOL Un
b5c0: 6c 6f 63 6b 46 69 6c 65 28 0d 0a 20 20 48 41 4e  lockFile(..  HAN
b5d0: 44 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 44 57  DLE hFile,..  DW
b5e0: 4f 52 44 20 64 77 46 69 6c 65 4f 66 66 73 65 74  ORD dwFileOffset
b5f0: 4c 6f 77 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77  Low,..  DWORD dw
b600: 46 69 6c 65 4f 66 66 73 65 74 48 69 67 68 2c 0d  FileOffsetHigh,.
b610: 0a 20 20 44 57 4f 52 44 20 6e 4e 75 6d 62 65 72  .  DWORD nNumber
b620: 4f 66 42 79 74 65 73 54 6f 55 6e 6c 6f 63 6b 4c  OfBytesToUnlockL
b630: 6f 77 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 4e 75  ow,..  DWORD nNu
b640: 6d 62 65 72 4f 66 42 79 74 65 73 54 6f 55 6e 6c  mberOfBytesToUnl
b650: 6f 63 6b 48 69 67 68 29 3b 0d 0a 0d 0a 65 78 74  ockHigh);....ext
b660: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
b670: 6f 72 74 20 42 4f 4f 4c 20 4c 6f 63 6b 46 69 6c  ort BOOL LockFil
b680: 65 45 78 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  eEx(..  HANDLE h
b690: 46 69 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64  File,..  DWORD d
b6a0: 77 46 6c 61 67 73 2c 0d 0a 20 20 44 57 4f 52 44  wFlags,..  DWORD
b6b0: 20 64 77 52 65 73 65 72 76 65 64 2c 0d 0a 20 20   dwReserved,..  
b6c0: 44 57 4f 52 44 20 6e 4e 75 6d 62 65 72 4f 66 42  DWORD nNumberOfB
b6d0: 79 74 65 73 54 6f 4c 6f 63 6b 4c 6f 77 2c 0d 0a  ytesToLockLow,..
b6e0: 20 20 44 57 4f 52 44 20 6e 4e 75 6d 62 65 72 4f    DWORD nNumberO
b6f0: 66 42 79 74 65 73 54 6f 4c 6f 63 6b 48 69 67 68  fBytesToLockHigh
b700: 2c 0d 0a 20 20 4c 50 4f 56 45 52 4c 41 50 50 45  ,..  LPOVERLAPPE
b710: 44 20 6c 70 4f 76 65 72 6c 61 70 70 65 64 29 3b  D lpOverlapped);
b720: 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20  ....enum : uint 
b730: 7b 20 4c 4f 43 4b 46 49 4c 45 5f 46 41 49 4c 5f  { LOCKFILE_FAIL_
b740: 49 4d 4d 45 44 49 41 54 45 4c 59 20 3d 20 30 78  IMMEDIATELY = 0x
b750: 30 30 30 30 30 30 30 31 20 7d 0d 0a 65 6e 75 6d  00000001 }..enum
b760: 20 3a 20 75 69 6e 74 20 7b 20 4c 4f 43 4b 46 49   : uint { LOCKFI
b770: 4c 45 5f 45 58 43 4c 55 53 49 56 45 5f 4c 4f 43  LE_EXCLUSIVE_LOC
b780: 4b 20 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d  K = 0x00000002 }
b790: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
b7a0: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
b7b0: 55 6e 6c 6f 63 6b 46 69 6c 65 45 78 28 0d 0a 20  UnlockFileEx(.. 
b7c0: 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d 0a   HANDLE hFile,..
b7d0: 20 20 44 57 4f 52 44 20 64 77 52 65 73 65 72 76    DWORD dwReserv
b7e0: 65 64 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 4e 75  ed,..  DWORD nNu
b7f0: 6d 62 65 72 4f 66 42 79 74 65 73 54 6f 55 6e 6c  mberOfBytesToUnl
b800: 6f 63 6b 4c 6f 77 2c 0d 0a 20 20 44 57 4f 52 44  ockLow,..  DWORD
b810: 20 6e 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 54   nNumberOfBytesT
b820: 6f 55 6e 6c 6f 63 6b 48 69 67 68 2c 0d 0a 20 20  oUnlockHigh,..  
b830: 4c 50 4f 56 45 52 4c 41 50 50 45 44 20 6c 70 4f  LPOVERLAPPED lpO
b840: 76 65 72 6c 61 70 70 65 64 29 3b 0d 0a 0d 0a 73  verlapped);....s
b850: 74 72 75 63 74 20 5f 42 59 5f 48 41 4e 44 4c 45  truct _BY_HANDLE
b860: 5f 46 49 4c 45 5f 49 4e 46 4f 52 4d 41 54 49 4f  _FILE_INFORMATIO
b870: 4e 20 7b 0d 0a 20 20 44 57 4f 52 44 20 64 77 46  N {..  DWORD dwF
b880: 69 6c 65 41 74 74 72 69 62 75 74 65 73 3b 0d 0a  ileAttributes;..
b890: 20 20 46 49 4c 45 54 49 4d 45 20 66 74 43 72 65    FILETIME ftCre
b8a0: 61 74 69 6f 6e 54 69 6d 65 3b 0d 0a 20 20 46 49  ationTime;..  FI
b8b0: 4c 45 54 49 4d 45 20 66 74 4c 61 73 74 41 63 63  LETIME ftLastAcc
b8c0: 65 73 73 54 69 6d 65 3b 0d 0a 20 20 46 49 4c 45  essTime;..  FILE
b8d0: 54 49 4d 45 20 66 74 4c 61 73 74 57 72 69 74 65  TIME ftLastWrite
b8e0: 54 69 6d 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64  Time;..  DWORD d
b8f0: 77 56 6f 6c 75 6d 65 53 65 72 69 61 6c 4e 75 6d  wVolumeSerialNum
b900: 62 65 72 3b 0d 0a 20 20 44 57 4f 52 44 20 6e 46  ber;..  DWORD nF
b910: 69 6c 65 53 69 7a 65 48 69 67 68 3b 0d 0a 20 20  ileSizeHigh;..  
b920: 44 57 4f 52 44 20 6e 46 69 6c 65 53 69 7a 65 4c  DWORD nFileSizeL
b930: 6f 77 3b 0d 0a 20 20 44 57 4f 52 44 20 6e 4e 75  ow;..  DWORD nNu
b940: 6d 62 65 72 4f 66 4c 69 6e 6b 73 3b 0d 0a 20 20  mberOfLinks;..  
b950: 44 57 4f 52 44 20 6e 46 69 6c 65 49 6e 64 65 78  DWORD nFileIndex
b960: 48 69 67 68 3b 0d 0a 20 20 44 57 4f 52 44 20 6e  High;..  DWORD n
b970: 46 69 6c 65 49 6e 64 65 78 4c 6f 77 3b 0d 0a 7d  FileIndexLow;..}
b980: 0d 0a 61 6c 69 61 73 20 5f 42 59 5f 48 41 4e 44  ..alias _BY_HAND
b990: 4c 45 5f 46 49 4c 45 5f 49 4e 46 4f 52 4d 41 54  LE_FILE_INFORMAT
b9a0: 49 4f 4e 20 42 59 5f 48 41 4e 44 4c 45 5f 46 49  ION BY_HANDLE_FI
b9b0: 4c 45 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 3b 0d  LE_INFORMATION;.
b9c0: 0a 61 6c 69 61 73 20 5f 42 59 5f 48 41 4e 44 4c  .alias _BY_HANDL
b9d0: 45 5f 46 49 4c 45 5f 49 4e 46 4f 52 4d 41 54 49  E_FILE_INFORMATI
b9e0: 4f 4e 2a 20 50 42 59 5f 48 41 4e 44 4c 45 5f 46  ON* PBY_HANDLE_F
b9f0: 49 4c 45 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 3b  ILE_INFORMATION;
ba00: 0d 0a 61 6c 69 61 73 20 5f 42 59 5f 48 41 4e 44  ..alias _BY_HAND
ba10: 4c 45 5f 46 49 4c 45 5f 49 4e 46 4f 52 4d 41 54  LE_FILE_INFORMAT
ba20: 49 4f 4e 2a 20 4c 50 42 59 5f 48 41 4e 44 4c 45  ION* LPBY_HANDLE
ba30: 5f 46 49 4c 45 5f 49 4e 46 4f 52 4d 41 54 49 4f  _FILE_INFORMATIO
ba40: 4e 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  N;....extern(Win
ba50: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
ba60: 4c 20 47 65 74 46 69 6c 65 49 6e 66 6f 72 6d 61  L GetFileInforma
ba70: 74 69 6f 6e 42 79 48 61 6e 64 6c 65 28 0d 0a 20  tionByHandle(.. 
ba80: 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d 0a   HANDLE hFile,..
ba90: 20 20 4c 50 42 59 5f 48 41 4e 44 4c 45 5f 46 49    LPBY_HANDLE_FI
baa0: 4c 45 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 6c  LE_INFORMATION l
bab0: 70 46 69 6c 65 49 6e 66 6f 72 6d 61 74 69 6f 6e  pFileInformation
bac0: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
bad0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f  dows) export DWO
bae0: 52 44 20 47 65 74 46 69 6c 65 54 79 70 65 28 0d  RD GetFileType(.
baf0: 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 29  .  HANDLE hFile)
bb00: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
bb10: 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
bb20: 44 20 47 65 74 46 69 6c 65 53 69 7a 65 28 0d 0a  D GetFileSize(..
bb30: 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
bb40: 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 46 69 6c  .  LPDWORD lpFil
bb50: 65 53 69 7a 65 48 69 67 68 29 3b 0d 0a 0d 0a 65  eSizeHigh);....e
bb60: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
bb70: 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 46 69  xport BOOL GetFi
bb80: 6c 65 53 69 7a 65 45 78 28 0d 0a 20 20 48 41 4e  leSizeEx(..  HAN
bb90: 44 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 50 4c  DLE hFile,..  PL
bba0: 41 52 47 45 5f 49 4e 54 45 47 45 52 20 6c 70 46  ARGE_INTEGER lpF
bbb0: 69 6c 65 53 69 7a 65 29 3b 0d 0a 0d 0a 65 78 74  ileSize);....ext
bbc0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
bbd0: 6f 72 74 20 48 41 4e 44 4c 45 20 47 65 74 53 74  ort HANDLE GetSt
bbe0: 64 48 61 6e 64 6c 65 28 0d 0a 20 20 44 57 4f 52  dHandle(..  DWOR
bbf0: 44 20 6e 53 74 64 48 61 6e 64 6c 65 29 3b 0d 0a  D nStdHandle);..
bc00: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
bc10: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
bc20: 74 53 74 64 48 61 6e 64 6c 65 28 0d 0a 20 20 44  tStdHandle(..  D
bc30: 57 4f 52 44 20 6e 53 74 64 48 61 6e 64 6c 65 2c  WORD nStdHandle,
bc40: 0d 0a 20 20 48 41 4e 44 4c 45 20 68 48 61 6e 64  ..  HANDLE hHand
bc50: 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  le);....extern(W
bc60: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
bc70: 4f 4f 4c 20 57 72 69 74 65 46 69 6c 65 28 0d 0a  OOL WriteFile(..
bc80: 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
bc90: 0a 20 20 4c 50 43 56 4f 49 44 20 6c 70 42 75 66  .  LPCVOID lpBuf
bca0: 66 65 72 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 4e  fer,..  DWORD nN
bcb0: 75 6d 62 65 72 4f 66 42 79 74 65 73 54 6f 57 72  umberOfBytesToWr
bcc0: 69 74 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  ite,..  LPDWORD 
bcd0: 6c 70 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 57  lpNumberOfBytesW
bce0: 72 69 74 74 65 6e 2c 0d 0a 20 20 4c 50 4f 56 45  ritten,..  LPOVE
bcf0: 52 4c 41 50 50 45 44 20 6c 70 4f 76 65 72 6c 61  RLAPPED lpOverla
bd00: 70 70 65 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  pped);....extern
bd10: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
bd20: 20 42 4f 4f 4c 20 52 65 61 64 46 69 6c 65 28 0d   BOOL ReadFile(.
bd30: 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c  .  HANDLE hFile,
bd40: 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 42 75 66  ..  LPVOID lpBuf
bd50: 66 65 72 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 4e  fer,..  DWORD nN
bd60: 75 6d 62 65 72 4f 66 42 79 74 65 73 54 6f 52 65  umberOfBytesToRe
bd70: 61 64 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  ad,..  LPDWORD l
bd80: 70 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 52 65  pNumberOfBytesRe
bd90: 61 64 2c 0d 0a 20 20 4c 50 4f 56 45 52 4c 41 50  ad,..  LPOVERLAP
bda0: 50 45 44 20 6c 70 4f 76 65 72 6c 61 70 70 65 64  PED lpOverlapped
bdb0: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
bdc0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
bdd0: 4c 20 46 6c 75 73 68 46 69 6c 65 42 75 66 66 65  L FlushFileBuffe
bde0: 72 73 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46  rs(..  HANDLE hF
bdf0: 69 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ile);....extern(
be00: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
be10: 42 4f 4f 4c 20 44 65 76 69 63 65 49 6f 43 6f 6e  BOOL DeviceIoCon
be20: 74 72 6f 6c 28 0d 0a 20 20 48 41 4e 44 4c 45 20  trol(..  HANDLE 
be30: 68 44 65 76 69 63 65 2c 0d 0a 20 20 44 57 4f 52  hDevice,..  DWOR
be40: 44 20 64 77 49 6f 43 6f 6e 74 72 6f 6c 43 6f 64  D dwIoControlCod
be50: 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 49  e,..  LPVOID lpI
be60: 6e 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f 52  nBuffer,..  DWOR
be70: 44 20 6e 49 6e 42 75 66 66 65 72 53 69 7a 65 2c  D nInBufferSize,
be80: 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 4f 75 74  ..  LPVOID lpOut
be90: 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f 52 44  Buffer,..  DWORD
bea0: 20 6e 4f 75 74 42 75 66 66 65 72 53 69 7a 65 2c   nOutBufferSize,
beb0: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 42 79  ..  LPDWORD lpBy
bec0: 74 65 73 52 65 74 75 72 6e 65 64 2c 0d 0a 20 20  tesReturned,..  
bed0: 4c 50 4f 56 45 52 4c 41 50 50 45 44 20 6c 70 4f  LPOVERLAPPED lpO
bee0: 76 65 72 6c 61 70 70 65 64 29 3b 0d 0a 0d 0a 65  verlapped);....e
bef0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
bf00: 78 70 6f 72 74 20 42 4f 4f 4c 20 52 65 71 75 65  xport BOOL Reque
bf10: 73 74 44 65 76 69 63 65 57 61 6b 65 75 70 28 0d  stDeviceWakeup(.
bf20: 0a 20 20 48 41 4e 44 4c 45 20 68 44 65 76 69 63  .  HANDLE hDevic
bf30: 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
bf40: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
bf50: 4f 4c 20 43 61 6e 63 65 6c 44 65 76 69 63 65 57  OL CancelDeviceW
bf60: 61 6b 65 75 70 52 65 71 75 65 73 74 28 0d 0a 20  akeupRequest(.. 
bf70: 20 48 41 4e 44 4c 45 20 68 44 65 76 69 63 65 29   HANDLE hDevice)
bf80: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
bf90: 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
bfa0: 20 47 65 74 44 65 76 69 63 65 50 6f 77 65 72 53   GetDevicePowerS
bfb0: 74 61 74 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20  tate(..  HANDLE 
bfc0: 68 44 65 76 69 63 65 2c 0d 0a 20 20 42 4f 4f 4c  hDevice,..  BOOL
bfd0: 20 2a 70 66 4f 6e 29 3b 0d 0a 0d 0a 65 78 74 65   *pfOn);....exte
bfe0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
bff0: 72 74 20 42 4f 4f 4c 20 53 65 74 4d 65 73 73 61  rt BOOL SetMessa
c000: 67 65 57 61 69 74 69 6e 67 49 6e 64 69 63 61 74  geWaitingIndicat
c010: 6f 72 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 4d  or(..  HANDLE hM
c020: 73 67 49 6e 64 69 63 61 74 6f 72 2c 0d 0a 20 20  sgIndicator,..  
c030: 55 4c 4f 4e 47 20 75 6c 4d 73 67 43 6f 75 6e 74  ULONG ulMsgCount
c040: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
c050: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
c060: 4c 20 53 65 74 45 6e 64 4f 66 46 69 6c 65 28 0d  L SetEndOfFile(.
c070: 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 29  .  HANDLE hFile)
c080: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
c090: 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
c0a0: 44 20 53 65 74 46 69 6c 65 50 6f 69 6e 74 65 72  D SetFilePointer
c0b0: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c  (..  HANDLE hFil
c0c0: 65 2c 0d 0a 20 20 4c 4f 4e 47 20 6c 44 69 73 74  e,..  LONG lDist
c0d0: 61 6e 63 65 54 6f 4d 6f 76 65 2c 0d 0a 20 20 50  anceToMove,..  P
c0e0: 4c 4f 4e 47 20 6c 70 44 69 73 74 61 6e 63 65 54  LONG lpDistanceT
c0f0: 6f 4d 6f 76 65 48 69 67 68 2c 0d 0a 20 20 44 57  oMoveHigh,..  DW
c100: 4f 52 44 20 64 77 4d 6f 76 65 4d 65 74 68 6f 64  ORD dwMoveMethod
c110: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
c120: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
c130: 4c 20 53 65 74 46 69 6c 65 50 6f 69 6e 74 65 72  L SetFilePointer
c140: 45 78 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46  Ex(..  HANDLE hF
c150: 69 6c 65 2c 0d 0a 20 20 4c 41 52 47 45 5f 49 4e  ile,..  LARGE_IN
c160: 54 45 47 45 52 20 6c 69 44 69 73 74 61 6e 63 65  TEGER liDistance
c170: 54 6f 4d 6f 76 65 2c 0d 0a 20 20 50 4c 41 52 47  ToMove,..  PLARG
c180: 45 5f 49 4e 54 45 47 45 52 20 6c 70 4e 65 77 46  E_INTEGER lpNewF
c190: 69 6c 65 50 6f 69 6e 74 65 72 2c 0d 0a 20 20 44  ilePointer,..  D
c1a0: 57 4f 52 44 20 64 77 4d 6f 76 65 4d 65 74 68 6f  WORD dwMoveMetho
c1b0: 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  d);....extern(Wi
c1c0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
c1d0: 4f 4c 20 46 69 6e 64 43 6c 6f 73 65 28 0d 0a 20  OL FindClose(.. 
c1e0: 20 48 41 4e 44 4c 45 20 68 46 69 6e 64 46 69 6c   HANDLE hFindFil
c1f0: 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
c200: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
c210: 4f 4c 20 47 65 74 46 69 6c 65 54 69 6d 65 28 0d  OL GetFileTime(.
c220: 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c  .  HANDLE hFile,
c230: 0d 0a 20 20 4c 50 46 49 4c 45 54 49 4d 45 20 6c  ..  LPFILETIME l
c240: 70 43 72 65 61 74 69 6f 6e 54 69 6d 65 2c 0d 0a  pCreationTime,..
c250: 20 20 4c 50 46 49 4c 45 54 49 4d 45 20 6c 70 4c    LPFILETIME lpL
c260: 61 73 74 41 63 63 65 73 73 54 69 6d 65 2c 0d 0a  astAccessTime,..
c270: 20 20 4c 50 46 49 4c 45 54 49 4d 45 20 6c 70 4c    LPFILETIME lpL
c280: 61 73 74 57 72 69 74 65 54 69 6d 65 29 3b 0d 0a  astWriteTime);..
c290: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
c2a0: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
c2b0: 74 46 69 6c 65 54 69 6d 65 28 0d 0a 20 20 48 41  tFileTime(..  HA
c2c0: 4e 44 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 46  NDLE hFile,..  F
c2d0: 49 4c 45 54 49 4d 45 20 2a 6c 70 43 72 65 61 74  ILETIME *lpCreat
c2e0: 69 6f 6e 54 69 6d 65 2c 0d 0a 20 20 46 49 4c 45  ionTime,..  FILE
c2f0: 54 49 4d 45 20 2a 6c 70 4c 61 73 74 41 63 63 65  TIME *lpLastAcce
c300: 73 73 54 69 6d 65 2c 0d 0a 20 20 46 49 4c 45 54  ssTime,..  FILET
c310: 49 4d 45 20 2a 6c 70 4c 61 73 74 57 72 69 74 65  IME *lpLastWrite
c320: 54 69 6d 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  Time);....extern
c330: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
c340: 20 42 4f 4f 4c 20 53 65 74 46 69 6c 65 56 61 6c   BOOL SetFileVal
c350: 69 64 44 61 74 61 28 0d 0a 20 20 48 41 4e 44 4c  idData(..  HANDL
c360: 45 20 68 46 69 6c 65 2c 0d 0a 20 20 4c 4f 4e 47  E hFile,..  LONG
c370: 4c 4f 4e 47 20 56 61 6c 69 64 44 61 74 61 4c 65  LONG ValidDataLe
c380: 6e 67 74 68 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  ngth);....extern
c390: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
c3a0: 20 42 4f 4f 4c 20 53 65 74 46 69 6c 65 53 68 6f   BOOL SetFileSho
c3b0: 72 74 4e 61 6d 65 41 28 0d 0a 20 20 48 41 4e 44  rtNameA(..  HAND
c3c0: 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 4c 50 43  LE hFile,..  LPC
c3d0: 53 54 52 20 6c 70 53 68 6f 72 74 4e 61 6d 65 29  STR lpShortName)
c3e0: 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
c3f0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
c400: 65 74 46 69 6c 65 53 68 6f 72 74 4e 61 6d 65 57  etFileShortNameW
c410: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c  (..  HANDLE hFil
c420: 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  e,..  LPCWSTR lp
c430: 53 68 6f 72 74 4e 61 6d 65 29 3b 0d 0a 2f 2f 20  ShortName);..// 
c440: 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
c450: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
c460: 65 0d 0a 61 6c 69 61 73 20 53 65 74 46 69 6c 65  e..alias SetFile
c470: 53 68 6f 72 74 4e 61 6d 65 41 20 53 65 74 46 69  ShortNameA SetFi
c480: 6c 65 53 68 6f 72 74 4e 61 6d 65 3b 0d 0a 2f 2f  leShortName;..//
c490: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
c4a0: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
c4b0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
c4c0: 4f 4c 20 43 6c 6f 73 65 48 61 6e 64 6c 65 28 0d  OL CloseHandle(.
c4d0: 0a 20 20 48 41 4e 44 4c 45 20 68 4f 62 6a 65 63  .  HANDLE hObjec
c4e0: 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  t);....extern(Wi
c4f0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
c500: 4f 4c 20 44 75 70 6c 69 63 61 74 65 48 61 6e 64  OL DuplicateHand
c510: 6c 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 53  le(..  HANDLE hS
c520: 6f 75 72 63 65 50 72 6f 63 65 73 73 48 61 6e 64  ourceProcessHand
c530: 6c 65 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 68 53  le,..  HANDLE hS
c540: 6f 75 72 63 65 48 61 6e 64 6c 65 2c 0d 0a 20 20  ourceHandle,..  
c550: 48 41 4e 44 4c 45 20 68 54 61 72 67 65 74 50 72  HANDLE hTargetPr
c560: 6f 63 65 73 73 48 61 6e 64 6c 65 2c 0d 0a 20 20  ocessHandle,..  
c570: 4c 50 48 41 4e 44 4c 45 20 6c 70 54 61 72 67 65  LPHANDLE lpTarge
c580: 74 48 61 6e 64 6c 65 2c 0d 0a 20 20 44 57 4f 52  tHandle,..  DWOR
c590: 44 20 64 77 44 65 73 69 72 65 64 41 63 63 65 73  D dwDesiredAcces
c5a0: 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62 49 6e 68 65  s,..  BOOL bInhe
c5b0: 72 69 74 48 61 6e 64 6c 65 2c 0d 0a 20 20 44 57  ritHandle,..  DW
c5c0: 4f 52 44 20 64 77 4f 70 74 69 6f 6e 73 29 3b 0d  ORD dwOptions);.
c5d0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
c5e0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47  s) export BOOL G
c5f0: 65 74 48 61 6e 64 6c 65 49 6e 66 6f 72 6d 61 74  etHandleInformat
c600: 69 6f 6e 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  ion(..  HANDLE h
c610: 4f 62 6a 65 63 74 2c 0d 0a 20 20 4c 50 44 57 4f  Object,..  LPDWO
c620: 52 44 20 6c 70 64 77 46 6c 61 67 73 29 3b 0d 0a  RD lpdwFlags);..
c630: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
c640: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
c650: 74 48 61 6e 64 6c 65 49 6e 66 6f 72 6d 61 74 69  tHandleInformati
c660: 6f 6e 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 4f  on(..  HANDLE hO
c670: 62 6a 65 63 74 2c 0d 0a 20 20 44 57 4f 52 44 20  bject,..  DWORD 
c680: 64 77 4d 61 73 6b 2c 0d 0a 20 20 44 57 4f 52 44  dwMask,..  DWORD
c690: 20 64 77 46 6c 61 67 73 29 3b 0d 0a 0d 0a 65 6e   dwFlags);....en
c6a0: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 48 41 4e 44  um : uint { HAND
c6b0: 4c 45 5f 46 4c 41 47 5f 49 4e 48 45 52 49 54 20  LE_FLAG_INHERIT 
c6c0: 3d 20 30 78 30 30 30 30 30 30 30 31 20 7d 0d 0a  = 0x00000001 }..
c6d0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 48 41  enum : uint { HA
c6e0: 4e 44 4c 45 5f 46 4c 41 47 5f 50 52 4f 54 45 43  NDLE_FLAG_PROTEC
c6f0: 54 5f 46 52 4f 4d 5f 43 4c 4f 53 45 20 3d 20 30  T_FROM_CLOSE = 0
c700: 78 30 30 30 30 30 30 30 32 20 7d 0d 0a 0d 0a 65  x00000002 }....e
c710: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 48 49 4e  num : uint { HIN
c720: 53 54 41 4e 43 45 5f 45 52 52 4f 52 20 3d 20 33  STANCE_ERROR = 3
c730: 32 20 7d 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  2 }....extern(Wi
c740: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57  ndows) export DW
c750: 4f 52 44 20 4c 6f 61 64 4d 6f 64 75 6c 65 28 0d  ORD LoadModule(.
c760: 0a 20 20 4c 50 43 53 54 52 20 6c 70 4d 6f 64 75  .  LPCSTR lpModu
c770: 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49  leName,..  LPVOI
c780: 44 20 6c 70 50 61 72 61 6d 65 74 65 72 42 6c 6f  D lpParameterBlo
c790: 63 6b 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ck);....extern(W
c7a0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55  indows) export U
c7b0: 49 4e 54 20 57 69 6e 45 78 65 63 28 0d 0a 20 20  INT WinExec(..  
c7c0: 4c 50 43 53 54 52 20 6c 70 43 6d 64 4c 69 6e 65  LPCSTR lpCmdLine
c7d0: 2c 0d 0a 20 20 55 49 4e 54 20 75 43 6d 64 53 68  ,..  UINT uCmdSh
c7e0: 6f 77 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ow);....extern(W
c7f0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
c800: 4f 4f 4c 20 43 6c 65 61 72 43 6f 6d 6d 42 72 65  OOL ClearCommBre
c810: 61 6b 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46  ak(..  HANDLE hF
c820: 69 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ile);....extern(
c830: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
c840: 42 4f 4f 4c 20 43 6c 65 61 72 43 6f 6d 6d 45 72  BOOL ClearCommEr
c850: 72 6f 72 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  ror(..  HANDLE h
c860: 46 69 6c 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  File,..  LPDWORD
c870: 20 6c 70 45 72 72 6f 72 73 2c 0d 0a 20 20 4c 50   lpErrors,..  LP
c880: 43 4f 4d 53 54 41 54 20 6c 70 53 74 61 74 29 3b  COMSTAT lpStat);
c890: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
c8a0: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
c8b0: 53 65 74 75 70 43 6f 6d 6d 28 0d 0a 20 20 48 41  SetupComm(..  HA
c8c0: 4e 44 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 44  NDLE hFile,..  D
c8d0: 57 4f 52 44 20 64 77 49 6e 51 75 65 75 65 2c 0d  WORD dwInQueue,.
c8e0: 0a 20 20 44 57 4f 52 44 20 64 77 4f 75 74 51 75  .  DWORD dwOutQu
c8f0: 65 75 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  eue);....extern(
c900: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
c910: 42 4f 4f 4c 20 45 73 63 61 70 65 43 6f 6d 6d 46  BOOL EscapeCommF
c920: 75 6e 63 74 69 6f 6e 28 0d 0a 20 20 48 41 4e 44  unction(..  HAND
c930: 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 44 57 4f  LE hFile,..  DWO
c940: 52 44 20 64 77 46 75 6e 63 29 3b 0d 0a 0d 0a 65  RD dwFunc);....e
c950: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
c960: 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 43 6f  xport BOOL GetCo
c970: 6d 6d 43 6f 6e 66 69 67 28 0d 0a 20 20 48 41 4e  mmConfig(..  HAN
c980: 44 4c 45 20 68 43 6f 6d 6d 44 65 76 2c 0d 0a 20  DLE hCommDev,.. 
c990: 20 4c 50 43 4f 4d 4d 43 4f 4e 46 49 47 20 6c 70   LPCOMMCONFIG lp
c9a0: 43 43 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  CC,..  LPDWORD l
c9b0: 70 64 77 53 69 7a 65 29 3b 0d 0a 0d 0a 65 78 74  pdwSize);....ext
c9c0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
c9d0: 6f 72 74 20 42 4f 4f 4c 20 47 65 74 43 6f 6d 6d  ort BOOL GetComm
c9e0: 4d 61 73 6b 28 0d 0a 20 20 48 41 4e 44 4c 45 20  Mask(..  HANDLE 
c9f0: 68 46 69 6c 65 2c 0d 0a 20 20 4c 50 44 57 4f 52  hFile,..  LPDWOR
ca00: 44 20 6c 70 45 76 74 4d 61 73 6b 29 3b 0d 0a 0d  D lpEvtMask);...
ca10: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
ca20: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74   export BOOL Get
ca30: 43 6f 6d 6d 50 72 6f 70 65 72 74 69 65 73 28 0d  CommProperties(.
ca40: 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c  .  HANDLE hFile,
ca50: 0d 0a 20 20 4c 50 43 4f 4d 4d 50 52 4f 50 20 6c  ..  LPCOMMPROP l
ca60: 70 43 6f 6d 6d 50 72 6f 70 29 3b 0d 0a 0d 0a 65  pCommProp);....e
ca70: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
ca80: 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 43 6f  xport BOOL GetCo
ca90: 6d 6d 4d 6f 64 65 6d 53 74 61 74 75 73 28 0d 0a  mmModemStatus(..
caa0: 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
cab0: 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 4d 6f 64  .  LPDWORD lpMod
cac0: 65 6d 53 74 61 74 29 3b 0d 0a 0d 0a 65 78 74 65  emStat);....exte
cad0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
cae0: 72 74 20 42 4f 4f 4c 20 47 65 74 43 6f 6d 6d 53  rt BOOL GetCommS
caf0: 74 61 74 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20  tate(..  HANDLE 
cb00: 68 46 69 6c 65 2c 0d 0a 20 20 4c 50 44 43 42 20  hFile,..  LPDCB 
cb10: 6c 70 44 43 42 29 3b 0d 0a 0d 0a 65 78 74 65 72  lpDCB);....exter
cb20: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
cb30: 74 20 42 4f 4f 4c 20 47 65 74 43 6f 6d 6d 54 69  t BOOL GetCommTi
cb40: 6d 65 6f 75 74 73 28 0d 0a 20 20 48 41 4e 44 4c  meouts(..  HANDL
cb50: 45 20 68 46 69 6c 65 2c 0d 0a 20 20 4c 50 43 4f  E hFile,..  LPCO
cb60: 4d 4d 54 49 4d 45 4f 55 54 53 20 6c 70 43 6f 6d  MMTIMEOUTS lpCom
cb70: 6d 54 69 6d 65 6f 75 74 73 29 3b 0d 0a 0d 0a 65  mTimeouts);....e
cb80: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
cb90: 78 70 6f 72 74 20 42 4f 4f 4c 20 50 75 72 67 65  xport BOOL Purge
cba0: 43 6f 6d 6d 28 0d 0a 20 20 48 41 4e 44 4c 45 20  Comm(..  HANDLE 
cbb0: 68 46 69 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20  hFile,..  DWORD 
cbc0: 64 77 46 6c 61 67 73 29 3b 0d 0a 0d 0a 65 78 74  dwFlags);....ext
cbd0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
cbe0: 6f 72 74 20 42 4f 4f 4c 20 53 65 74 43 6f 6d 6d  ort BOOL SetComm
cbf0: 42 72 65 61 6b 28 0d 0a 20 20 48 41 4e 44 4c 45  Break(..  HANDLE
cc00: 20 68 46 69 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65   hFile);....exte
cc10: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
cc20: 72 74 20 42 4f 4f 4c 20 53 65 74 43 6f 6d 6d 43  rt BOOL SetCommC
cc30: 6f 6e 66 69 67 28 0d 0a 20 20 48 41 4e 44 4c 45  onfig(..  HANDLE
cc40: 20 68 43 6f 6d 6d 44 65 76 2c 0d 0a 20 20 4c 50   hCommDev,..  LP
cc50: 43 4f 4d 4d 43 4f 4e 46 49 47 20 6c 70 43 43 2c  COMMCONFIG lpCC,
cc60: 0d 0a 20 20 44 57 4f 52 44 20 64 77 53 69 7a 65  ..  DWORD dwSize
cc70: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
cc80: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
cc90: 4c 20 53 65 74 43 6f 6d 6d 4d 61 73 6b 28 0d 0a  L SetCommMask(..
cca0: 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
ccb0: 0a 20 20 44 57 4f 52 44 20 64 77 45 76 74 4d 61  .  DWORD dwEvtMa
ccc0: 73 6b 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  sk);....extern(W
ccd0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
cce0: 4f 4f 4c 20 53 65 74 43 6f 6d 6d 53 74 61 74 65  OOL SetCommState
ccf0: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c  (..  HANDLE hFil
cd00: 65 2c 0d 0a 20 20 4c 50 44 43 42 20 6c 70 44 43  e,..  LPDCB lpDC
cd10: 42 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  B);....extern(Wi
cd20: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
cd30: 4f 4c 20 53 65 74 43 6f 6d 6d 54 69 6d 65 6f 75  OL SetCommTimeou
cd40: 74 73 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46  ts(..  HANDLE hF
cd50: 69 6c 65 2c 0d 0a 20 20 4c 50 43 4f 4d 4d 54 49  ile,..  LPCOMMTI
cd60: 4d 45 4f 55 54 53 20 6c 70 43 6f 6d 6d 54 69 6d  MEOUTS lpCommTim
cd70: 65 6f 75 74 73 29 3b 0d 0a 0d 0a 65 78 74 65 72  eouts);....exter
cd80: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
cd90: 74 20 42 4f 4f 4c 20 54 72 61 6e 73 6d 69 74 43  t BOOL TransmitC
cda0: 6f 6d 6d 43 68 61 72 28 0d 0a 20 20 48 41 4e 44  ommChar(..  HAND
cdb0: 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 63 68 61  LE hFile,..  cha
cdc0: 72 20 63 43 68 61 72 29 3b 0d 0a 0d 0a 65 78 74  r cChar);....ext
cdd0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
cde0: 6f 72 74 20 42 4f 4f 4c 20 57 61 69 74 43 6f 6d  ort BOOL WaitCom
cdf0: 6d 45 76 65 6e 74 28 0d 0a 20 20 48 41 4e 44 4c  mEvent(..  HANDL
ce00: 45 20 68 46 69 6c 65 2c 0d 0a 20 20 4c 50 44 57  E hFile,..  LPDW
ce10: 4f 52 44 20 6c 70 45 76 74 4d 61 73 6b 2c 0d 0a  ORD lpEvtMask,..
ce20: 20 20 4c 50 4f 56 45 52 4c 41 50 50 45 44 20 6c    LPOVERLAPPED l
ce30: 70 4f 76 65 72 6c 61 70 70 65 64 29 3b 0d 0a 0d  pOverlapped);...
ce40: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
ce50: 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20 53 65   export DWORD Se
ce60: 74 54 61 70 65 50 6f 73 69 74 69 6f 6e 28 0d 0a  tTapePosition(..
ce70: 20 20 48 41 4e 44 4c 45 20 68 44 65 76 69 63 65    HANDLE hDevice
ce80: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 50 6f 73  ,..  DWORD dwPos
ce90: 69 74 69 6f 6e 4d 65 74 68 6f 64 2c 0d 0a 20 20  itionMethod,..  
cea0: 44 57 4f 52 44 20 64 77 50 61 72 74 69 74 69 6f  DWORD dwPartitio
ceb0: 6e 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 4f 66  n,..  DWORD dwOf
cec0: 66 73 65 74 4c 6f 77 2c 0d 0a 20 20 44 57 4f 52  fsetLow,..  DWOR
ced0: 44 20 64 77 4f 66 66 73 65 74 48 69 67 68 2c 0d  D dwOffsetHigh,.
cee0: 0a 20 20 42 4f 4f 4c 20 62 49 6d 6d 65 64 69 61  .  BOOL bImmedia
cef0: 74 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  te);....extern(W
cf00: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44  indows) export D
cf10: 57 4f 52 44 20 47 65 74 54 61 70 65 50 6f 73 69  WORD GetTapePosi
cf20: 74 69 6f 6e 28 0d 0a 20 20 48 41 4e 44 4c 45 20  tion(..  HANDLE 
cf30: 68 44 65 76 69 63 65 2c 0d 0a 20 20 44 57 4f 52  hDevice,..  DWOR
cf40: 44 20 64 77 50 6f 73 69 74 69 6f 6e 54 79 70 65  D dwPositionType
cf50: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 64  ,..  LPDWORD lpd
cf60: 77 50 61 72 74 69 74 69 6f 6e 2c 0d 0a 20 20 4c  wPartition,..  L
cf70: 50 44 57 4f 52 44 20 6c 70 64 77 4f 66 66 73 65  PDWORD lpdwOffse
cf80: 74 4c 6f 77 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  tLow,..  LPDWORD
cf90: 20 6c 70 64 77 4f 66 66 73 65 74 48 69 67 68 29   lpdwOffsetHigh)
cfa0: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
cfb0: 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
cfc0: 44 20 50 72 65 70 61 72 65 54 61 70 65 28 0d 0a  D PrepareTape(..
cfd0: 20 20 48 41 4e 44 4c 45 20 68 44 65 76 69 63 65    HANDLE hDevice
cfe0: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 4f 70 65  ,..  DWORD dwOpe
cff0: 72 61 74 69 6f 6e 2c 0d 0a 20 20 42 4f 4f 4c 20  ration,..  BOOL 
d000: 62 49 6d 6d 65 64 69 61 74 65 29 3b 0d 0a 0d 0a  bImmediate);....
d010: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
d020: 65 78 70 6f 72 74 20 44 57 4f 52 44 20 45 72 61  export DWORD Era
d030: 73 65 54 61 70 65 28 0d 0a 20 20 48 41 4e 44 4c  seTape(..  HANDL
d040: 45 20 68 44 65 76 69 63 65 2c 0d 0a 20 20 44 57  E hDevice,..  DW
d050: 4f 52 44 20 64 77 45 72 61 73 65 54 79 70 65 2c  ORD dwEraseType,
d060: 0d 0a 20 20 42 4f 4f 4c 20 62 49 6d 6d 65 64 69  ..  BOOL bImmedi
d070: 61 74 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ate);....extern(
d080: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
d090: 44 57 4f 52 44 20 43 72 65 61 74 65 54 61 70 65  DWORD CreateTape
d0a0: 50 61 72 74 69 74 69 6f 6e 28 0d 0a 20 20 48 41  Partition(..  HA
d0b0: 4e 44 4c 45 20 68 44 65 76 69 63 65 2c 0d 0a 20  NDLE hDevice,.. 
d0c0: 20 44 57 4f 52 44 20 64 77 50 61 72 74 69 74 69   DWORD dwPartiti
d0d0: 6f 6e 4d 65 74 68 6f 64 2c 0d 0a 20 20 44 57 4f  onMethod,..  DWO
d0e0: 52 44 20 64 77 43 6f 75 6e 74 2c 0d 0a 20 20 44  RD dwCount,..  D
d0f0: 57 4f 52 44 20 64 77 53 69 7a 65 29 3b 0d 0a 0d  WORD dwSize);...
d100: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
d110: 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20 57 72   export DWORD Wr
d120: 69 74 65 54 61 70 65 6d 61 72 6b 28 0d 0a 20 20  iteTapemark(..  
d130: 48 41 4e 44 4c 45 20 68 44 65 76 69 63 65 2c 0d  HANDLE hDevice,.
d140: 0a 20 20 44 57 4f 52 44 20 64 77 54 61 70 65 6d  .  DWORD dwTapem
d150: 61 72 6b 54 79 70 65 2c 0d 0a 20 20 44 57 4f 52  arkType,..  DWOR
d160: 44 20 64 77 54 61 70 65 6d 61 72 6b 43 6f 75 6e  D dwTapemarkCoun
d170: 74 2c 0d 0a 20 20 42 4f 4f 4c 20 62 49 6d 6d 65  t,..  BOOL bImme
d180: 64 69 61 74 65 29 3b 0d 0a 0d 0a 65 78 74 65 72  diate);....exter
d190: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
d1a0: 74 20 44 57 4f 52 44 20 47 65 74 54 61 70 65 53  t DWORD GetTapeS
d1b0: 74 61 74 75 73 28 0d 0a 20 20 48 41 4e 44 4c 45  tatus(..  HANDLE
d1c0: 20 68 44 65 76 69 63 65 29 3b 0d 0a 0d 0a 65 78   hDevice);....ex
d1d0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
d1e0: 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74 54 61  port DWORD GetTa
d1f0: 70 65 50 61 72 61 6d 65 74 65 72 73 28 0d 0a 20  peParameters(.. 
d200: 20 48 41 4e 44 4c 45 20 68 44 65 76 69 63 65 2c   HANDLE hDevice,
d210: 0d 0a 20 20 44 57 4f 52 44 20 64 77 4f 70 65 72  ..  DWORD dwOper
d220: 61 74 69 6f 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52  ation,..  LPDWOR
d230: 44 20 6c 70 64 77 53 69 7a 65 2c 0d 0a 20 20 4c  D lpdwSize,..  L
d240: 50 56 4f 49 44 20 6c 70 54 61 70 65 49 6e 66 6f  PVOID lpTapeInfo
d250: 72 6d 61 74 69 6f 6e 29 3b 0d 0a 0d 0a 65 6e 75  rmation);....enu
d260: 6d 20 3a 20 75 69 6e 74 20 7b 20 47 45 54 5f 54  m : uint { GET_T
d270: 41 50 45 5f 4d 45 44 49 41 5f 49 4e 46 4f 52 4d  APE_MEDIA_INFORM
d280: 41 54 49 4f 4e 20 3d 20 30 20 7d 0d 0a 65 6e 75  ATION = 0 }..enu
d290: 6d 20 3a 20 75 69 6e 74 20 7b 20 47 45 54 5f 54  m : uint { GET_T
d2a0: 41 50 45 5f 44 52 49 56 45 5f 49 4e 46 4f 52 4d  APE_DRIVE_INFORM
d2b0: 41 54 49 4f 4e 20 3d 20 31 20 7d 0d 0a 0d 0a 65  ATION = 1 }....e
d2c0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
d2d0: 78 70 6f 72 74 20 44 57 4f 52 44 20 53 65 74 54  xport DWORD SetT
d2e0: 61 70 65 50 61 72 61 6d 65 74 65 72 73 28 0d 0a  apeParameters(..
d2f0: 20 20 48 41 4e 44 4c 45 20 68 44 65 76 69 63 65    HANDLE hDevice
d300: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 4f 70 65  ,..  DWORD dwOpe
d310: 72 61 74 69 6f 6e 2c 0d 0a 20 20 4c 50 56 4f 49  ration,..  LPVOI
d320: 44 20 6c 70 54 61 70 65 49 6e 66 6f 72 6d 61 74  D lpTapeInformat
d330: 69 6f 6e 29 3b 0d 0a 0d 0a 65 6e 75 6d 20 3a 20  ion);....enum : 
d340: 75 69 6e 74 20 7b 20 53 45 54 5f 54 41 50 45 5f  uint { SET_TAPE_
d350: 4d 45 44 49 41 5f 49 4e 46 4f 52 4d 41 54 49 4f  MEDIA_INFORMATIO
d360: 4e 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  N = 0 }..enum : 
d370: 75 69 6e 74 20 7b 20 53 45 54 5f 54 41 50 45 5f  uint { SET_TAPE_
d380: 44 52 49 56 45 5f 49 4e 46 4f 52 4d 41 54 49 4f  DRIVE_INFORMATIO
d390: 4e 20 3d 20 31 20 7d 0d 0a 0d 0a 65 78 74 65 72  N = 1 }....exter
d3a0: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
d3b0: 74 20 42 4f 4f 4c 20 42 65 65 70 28 0d 0a 20 20  t BOOL Beep(..  
d3c0: 44 57 4f 52 44 20 64 77 46 72 65 71 2c 0d 0a 20  DWORD dwFreq,.. 
d3d0: 20 44 57 4f 52 44 20 64 77 44 75 72 61 74 69 6f   DWORD dwDuratio
d3e0: 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  n);....extern(Wi
d3f0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 69 6e  ndows) export in
d400: 74 20 4d 75 6c 44 69 76 28 0d 0a 20 20 69 6e 74  t MulDiv(..  int
d410: 20 6e 4e 75 6d 62 65 72 2c 0d 0a 20 20 69 6e 74   nNumber,..  int
d420: 20 6e 4e 75 6d 65 72 61 74 6f 72 2c 0d 0a 20 20   nNumerator,..  
d430: 69 6e 74 20 6e 44 65 6e 6f 6d 69 6e 61 74 6f 72  int nDenominator
d440: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
d450: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f 49  dows) export VOI
d460: 44 20 47 65 74 53 79 73 74 65 6d 54 69 6d 65 28  D GetSystemTime(
d470: 0d 0a 20 20 4c 50 53 59 53 54 45 4d 54 49 4d 45  ..  LPSYSTEMTIME
d480: 20 6c 70 53 79 73 74 65 6d 54 69 6d 65 29 3b 0d   lpSystemTime);.
d490: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
d4a0: 73 29 20 65 78 70 6f 72 74 20 56 4f 49 44 20 47  s) export VOID G
d4b0: 65 74 53 79 73 74 65 6d 54 69 6d 65 41 73 46 69  etSystemTimeAsFi
d4c0: 6c 65 54 69 6d 65 28 0d 0a 20 20 4c 50 46 49 4c  leTime(..  LPFIL
d4d0: 45 54 49 4d 45 20 6c 70 53 79 73 74 65 6d 54 69  ETIME lpSystemTi
d4e0: 6d 65 41 73 46 69 6c 65 54 69 6d 65 29 3b 0d 0a  meAsFileTime);..
d4f0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
d500: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
d510: 74 53 79 73 74 65 6d 54 69 6d 65 28 0d 0a 20 20  tSystemTime(..  
d520: 53 59 53 54 45 4d 54 49 4d 45 20 2a 6c 70 53 79  SYSTEMTIME *lpSy
d530: 73 74 65 6d 54 69 6d 65 29 3b 0d 0a 0d 0a 65 78  stemTime);....ex
d540: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
d550: 70 6f 72 74 20 56 4f 49 44 20 47 65 74 4c 6f 63  port VOID GetLoc
d560: 61 6c 54 69 6d 65 28 0d 0a 20 20 4c 50 53 59 53  alTime(..  LPSYS
d570: 54 45 4d 54 49 4d 45 20 6c 70 53 79 73 74 65 6d  TEMTIME lpSystem
d580: 54 69 6d 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  Time);....extern
d590: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
d5a0: 20 42 4f 4f 4c 20 53 65 74 4c 6f 63 61 6c 54 69   BOOL SetLocalTi
d5b0: 6d 65 28 0d 0a 20 20 53 59 53 54 45 4d 54 49 4d  me(..  SYSTEMTIM
d5c0: 45 20 2a 6c 70 53 79 73 74 65 6d 54 69 6d 65 29  E *lpSystemTime)
d5d0: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
d5e0: 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f 49 44  ows) export VOID
d5f0: 20 47 65 74 53 79 73 74 65 6d 49 6e 66 6f 28 0d   GetSystemInfo(.
d600: 0a 20 20 4c 50 53 59 53 54 45 4d 5f 49 4e 46 4f  .  LPSYSTEM_INFO
d610: 20 6c 70 53 79 73 74 65 6d 49 6e 66 6f 29 3b 0d   lpSystemInfo);.
d620: 0a 0d 0a 2f 2f 20 23 69 66 20 5f 57 49 4e 33 32  ...// #if _WIN32
d630: 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30 31  _WINNT >= 0x0501
d640: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
d650: 29 20 65 78 70 6f 72 74 20 56 4f 49 44 20 47 65  ) export VOID Ge
d660: 74 4e 61 74 69 76 65 53 79 73 74 65 6d 49 6e 66  tNativeSystemInf
d670: 6f 28 0d 0a 20 20 4c 50 53 59 53 54 45 4d 5f 49  o(..  LPSYSTEM_I
d680: 4e 46 4f 20 6c 70 53 79 73 74 65 6d 49 6e 66 6f  NFO lpSystemInfo
d690: 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 0d  );..// #endif...
d6a0: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
d6b0: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 49 73 50   export BOOL IsP
d6c0: 72 6f 63 65 73 73 6f 72 46 65 61 74 75 72 65 50  rocessorFeatureP
d6d0: 72 65 73 65 6e 74 28 0d 0a 20 20 44 57 4f 52 44  resent(..  DWORD
d6e0: 20 50 72 6f 63 65 73 73 6f 72 46 65 61 74 75 72   ProcessorFeatur
d6f0: 65 29 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 54  e);....struct _T
d700: 49 4d 45 5f 5a 4f 4e 45 5f 49 4e 46 4f 52 4d 41  IME_ZONE_INFORMA
d710: 54 49 4f 4e 20 7b 0d 0a 20 20 4c 4f 4e 47 20 42  TION {..  LONG B
d720: 69 61 73 3b 0d 0a 20 20 57 43 48 41 52 20 53 74  ias;..  WCHAR St
d730: 61 6e 64 61 72 64 4e 61 6d 65 5b 20 33 32 20 5d  andardName[ 32 ]
d740: 3b 0d 0a 20 20 53 59 53 54 45 4d 54 49 4d 45 20  ;..  SYSTEMTIME 
d750: 53 74 61 6e 64 61 72 64 44 61 74 65 3b 0d 0a 20  StandardDate;.. 
d760: 20 4c 4f 4e 47 20 53 74 61 6e 64 61 72 64 42 69   LONG StandardBi
d770: 61 73 3b 0d 0a 20 20 57 43 48 41 52 20 44 61 79  as;..  WCHAR Day
d780: 6c 69 67 68 74 4e 61 6d 65 5b 20 33 32 20 5d 3b  lightName[ 32 ];
d790: 0d 0a 20 20 53 59 53 54 45 4d 54 49 4d 45 20 44  ..  SYSTEMTIME D
d7a0: 61 79 6c 69 67 68 74 44 61 74 65 3b 0d 0a 20 20  aylightDate;..  
d7b0: 4c 4f 4e 47 20 44 61 79 6c 69 67 68 74 42 69 61  LONG DaylightBia
d7c0: 73 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 54 49  s;..}..alias _TI
d7d0: 4d 45 5f 5a 4f 4e 45 5f 49 4e 46 4f 52 4d 41 54  ME_ZONE_INFORMAT
d7e0: 49 4f 4e 20 54 49 4d 45 5f 5a 4f 4e 45 5f 49 4e  ION TIME_ZONE_IN
d7f0: 46 4f 52 4d 41 54 49 4f 4e 3b 0d 0a 61 6c 69 61  FORMATION;..alia
d800: 73 20 5f 54 49 4d 45 5f 5a 4f 4e 45 5f 49 4e 46  s _TIME_ZONE_INF
d810: 4f 52 4d 41 54 49 4f 4e 2a 20 50 54 49 4d 45 5f  ORMATION* PTIME_
d820: 5a 4f 4e 45 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e  ZONE_INFORMATION
d830: 3b 0d 0a 61 6c 69 61 73 20 5f 54 49 4d 45 5f 5a  ;..alias _TIME_Z
d840: 4f 4e 45 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 2a  ONE_INFORMATION*
d850: 20 4c 50 54 49 4d 45 5f 5a 4f 4e 45 5f 49 4e 46   LPTIME_ZONE_INF
d860: 4f 52 4d 41 54 49 4f 4e 3b 0d 0a 0d 0a 65 78 74  ORMATION;....ext
d870: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
d880: 6f 72 74 20 42 4f 4f 4c 20 53 79 73 74 65 6d 54  ort BOOL SystemT
d890: 69 6d 65 54 6f 54 7a 53 70 65 63 69 66 69 63 4c  imeToTzSpecificL
d8a0: 6f 63 61 6c 54 69 6d 65 28 0d 0a 20 20 4c 50 54  ocalTime(..  LPT
d8b0: 49 4d 45 5f 5a 4f 4e 45 5f 49 4e 46 4f 52 4d 41  IME_ZONE_INFORMA
d8c0: 54 49 4f 4e 20 6c 70 54 69 6d 65 5a 6f 6e 65 49  TION lpTimeZoneI
d8d0: 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 4c  nformation,..  L
d8e0: 50 53 59 53 54 45 4d 54 49 4d 45 20 6c 70 55 6e  PSYSTEMTIME lpUn
d8f0: 69 76 65 72 73 61 6c 54 69 6d 65 2c 0d 0a 20 20  iversalTime,..  
d900: 4c 50 53 59 53 54 45 4d 54 49 4d 45 20 6c 70 4c  LPSYSTEMTIME lpL
d910: 6f 63 61 6c 54 69 6d 65 29 3b 0d 0a 0d 0a 65 78  ocalTime);....ex
d920: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
d930: 70 6f 72 74 20 42 4f 4f 4c 20 54 7a 53 70 65 63  port BOOL TzSpec
d940: 69 66 69 63 4c 6f 63 61 6c 54 69 6d 65 54 6f 53  ificLocalTimeToS
d950: 79 73 74 65 6d 54 69 6d 65 28 0d 0a 20 20 4c 50  ystemTime(..  LP
d960: 54 49 4d 45 5f 5a 4f 4e 45 5f 49 4e 46 4f 52 4d  TIME_ZONE_INFORM
d970: 41 54 49 4f 4e 20 6c 70 54 69 6d 65 5a 6f 6e 65  ATION lpTimeZone
d980: 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20  Information,..  
d990: 4c 50 53 59 53 54 45 4d 54 49 4d 45 20 6c 70 4c  LPSYSTEMTIME lpL
d9a0: 6f 63 61 6c 54 69 6d 65 2c 0d 0a 20 20 4c 50 53  ocalTime,..  LPS
d9b0: 59 53 54 45 4d 54 49 4d 45 20 6c 70 55 6e 69 76  YSTEMTIME lpUniv
d9c0: 65 72 73 61 6c 54 69 6d 65 29 3b 0d 0a 0d 0a 65  ersalTime);....e
d9d0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
d9e0: 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74 54  xport DWORD GetT
d9f0: 69 6d 65 5a 6f 6e 65 49 6e 66 6f 72 6d 61 74 69  imeZoneInformati
da00: 6f 6e 28 0d 0a 20 20 4c 50 54 49 4d 45 5f 5a 4f  on(..  LPTIME_ZO
da10: 4e 45 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 6c  NE_INFORMATION l
da20: 70 54 69 6d 65 5a 6f 6e 65 49 6e 66 6f 72 6d 61  pTimeZoneInforma
da30: 74 69 6f 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  tion);....extern
da40: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
da50: 20 42 4f 4f 4c 20 53 65 74 54 69 6d 65 5a 6f 6e   BOOL SetTimeZon
da60: 65 49 6e 66 6f 72 6d 61 74 69 6f 6e 28 0d 0a 20  eInformation(.. 
da70: 20 54 49 4d 45 5f 5a 4f 4e 45 5f 49 4e 46 4f 52   TIME_ZONE_INFOR
da80: 4d 41 54 49 4f 4e 20 2a 6c 70 54 69 6d 65 5a 6f  MATION *lpTimeZo
da90: 6e 65 49 6e 66 6f 72 6d 61 74 69 6f 6e 29 3b 0d  neInformation);.
daa0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
dab0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
dac0: 79 73 74 65 6d 54 69 6d 65 54 6f 46 69 6c 65 54  ystemTimeToFileT
dad0: 69 6d 65 28 0d 0a 20 20 53 59 53 54 45 4d 54 49  ime(..  SYSTEMTI
dae0: 4d 45 20 2a 6c 70 53 79 73 74 65 6d 54 69 6d 65  ME *lpSystemTime
daf0: 2c 0d 0a 20 20 4c 50 46 49 4c 45 54 49 4d 45 20  ,..  LPFILETIME 
db00: 6c 70 46 69 6c 65 54 69 6d 65 29 3b 0d 0a 0d 0a  lpFileTime);....
db10: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
db20: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 46 69 6c 65  export BOOL File
db30: 54 69 6d 65 54 6f 4c 6f 63 61 6c 46 69 6c 65 54  TimeToLocalFileT
db40: 69 6d 65 28 0d 0a 20 20 46 49 4c 45 54 49 4d 45  ime(..  FILETIME
db50: 20 2a 6c 70 46 69 6c 65 54 69 6d 65 2c 0d 0a 20   *lpFileTime,.. 
db60: 20 4c 50 46 49 4c 45 54 49 4d 45 20 6c 70 4c 6f   LPFILETIME lpLo
db70: 63 61 6c 46 69 6c 65 54 69 6d 65 29 3b 0d 0a 0d  calFileTime);...
db80: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
db90: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4c 6f 63   export BOOL Loc
dba0: 61 6c 46 69 6c 65 54 69 6d 65 54 6f 46 69 6c 65  alFileTimeToFile
dbb0: 54 69 6d 65 28 0d 0a 20 20 46 49 4c 45 54 49 4d  Time(..  FILETIM
dbc0: 45 20 2a 6c 70 4c 6f 63 61 6c 46 69 6c 65 54 69  E *lpLocalFileTi
dbd0: 6d 65 2c 0d 0a 20 20 4c 50 46 49 4c 45 54 49 4d  me,..  LPFILETIM
dbe0: 45 20 6c 70 46 69 6c 65 54 69 6d 65 29 3b 0d 0a  E lpFileTime);..
dbf0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
dc00: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 46 69  ) export BOOL Fi
dc10: 6c 65 54 69 6d 65 54 6f 53 79 73 74 65 6d 54 69  leTimeToSystemTi
dc20: 6d 65 28 0d 0a 20 20 46 49 4c 45 54 49 4d 45 20  me(..  FILETIME 
dc30: 2a 6c 70 46 69 6c 65 54 69 6d 65 2c 0d 0a 20 20  *lpFileTime,..  
dc40: 4c 50 53 59 53 54 45 4d 54 49 4d 45 20 6c 70 53  LPSYSTEMTIME lpS
dc50: 79 73 74 65 6d 54 69 6d 65 29 3b 0d 0a 0d 0a 65  ystemTime);....e
dc60: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
dc70: 78 70 6f 72 74 20 4c 4f 4e 47 20 43 6f 6d 70 61  xport LONG Compa
dc80: 72 65 46 69 6c 65 54 69 6d 65 28 0d 0a 20 20 46  reFileTime(..  F
dc90: 49 4c 45 54 49 4d 45 20 2a 6c 70 46 69 6c 65 54  ILETIME *lpFileT
dca0: 69 6d 65 31 2c 0d 0a 20 20 46 49 4c 45 54 49 4d  ime1,..  FILETIM
dcb0: 45 20 2a 6c 70 46 69 6c 65 54 69 6d 65 32 29 3b  E *lpFileTime2);
dcc0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
dcd0: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
dce0: 46 69 6c 65 54 69 6d 65 54 6f 44 6f 73 44 61 74  FileTimeToDosDat
dcf0: 65 54 69 6d 65 28 0d 0a 20 20 46 49 4c 45 54 49  eTime(..  FILETI
dd00: 4d 45 20 2a 6c 70 46 69 6c 65 54 69 6d 65 2c 0d  ME *lpFileTime,.
dd10: 0a 20 20 4c 50 57 4f 52 44 20 6c 70 46 61 74 44  .  LPWORD lpFatD
dd20: 61 74 65 2c 0d 0a 20 20 4c 50 57 4f 52 44 20 6c  ate,..  LPWORD l
dd30: 70 46 61 74 54 69 6d 65 29 3b 0d 0a 0d 0a 65 78  pFatTime);....ex
dd40: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
dd50: 70 6f 72 74 20 42 4f 4f 4c 20 44 6f 73 44 61 74  port BOOL DosDat
dd60: 65 54 69 6d 65 54 6f 46 69 6c 65 54 69 6d 65 28  eTimeToFileTime(
dd70: 0d 0a 20 20 57 4f 52 44 20 77 46 61 74 44 61 74  ..  WORD wFatDat
dd80: 65 2c 0d 0a 20 20 57 4f 52 44 20 77 46 61 74 54  e,..  WORD wFatT
dd90: 69 6d 65 2c 0d 0a 20 20 4c 50 46 49 4c 45 54 49  ime,..  LPFILETI
dda0: 4d 45 20 6c 70 46 69 6c 65 54 69 6d 65 29 3b 0d  ME lpFileTime);.
ddb0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
ddc0: 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
ddd0: 47 65 74 54 69 63 6b 43 6f 75 6e 74 28 29 3b 0d  GetTickCount();.
dde0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
ddf0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
de00: 65 74 53 79 73 74 65 6d 54 69 6d 65 41 64 6a 75  etSystemTimeAdju
de10: 73 74 6d 65 6e 74 28 0d 0a 20 20 44 57 4f 52 44  stment(..  DWORD
de20: 20 64 77 54 69 6d 65 41 64 6a 75 73 74 6d 65 6e   dwTimeAdjustmen
de30: 74 2c 0d 0a 20 20 42 4f 4f 4c 20 62 54 69 6d 65  t,..  BOOL bTime
de40: 41 64 6a 75 73 74 6d 65 6e 74 44 69 73 61 62 6c  AdjustmentDisabl
de50: 65 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ed);....extern(W
de60: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
de70: 4f 4f 4c 20 47 65 74 53 79 73 74 65 6d 54 69 6d  OOL GetSystemTim
de80: 65 41 64 6a 75 73 74 6d 65 6e 74 28 0d 0a 20 20  eAdjustment(..  
de90: 50 44 57 4f 52 44 20 6c 70 54 69 6d 65 41 64 6a  PDWORD lpTimeAdj
dea0: 75 73 74 6d 65 6e 74 2c 0d 0a 20 20 50 44 57 4f  ustment,..  PDWO
deb0: 52 44 20 6c 70 54 69 6d 65 49 6e 63 72 65 6d 65  RD lpTimeIncreme
dec0: 6e 74 2c 0d 0a 20 20 50 42 4f 4f 4c 20 6c 70 54  nt,..  PBOOL lpT
ded0: 69 6d 65 41 64 6a 75 73 74 6d 65 6e 74 44 69 73  imeAdjustmentDis
dee0: 61 62 6c 65 64 29 3b 0d 0a 0d 0a 2f 2f 20 23 69  abled);....// #i
def0: 66 20 21 64 65 66 69 6e 65 64 28 4d 49 44 4c 5f  f !defined(MIDL_
df00: 50 41 53 53 29 0d 0a 65 78 74 65 72 6e 28 57 69  PASS)..extern(Wi
df10: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57  ndows) export DW
df20: 4f 52 44 20 46 6f 72 6d 61 74 4d 65 73 73 61 67  ORD FormatMessag
df30: 65 41 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 46  eA(..  DWORD dwF
df40: 6c 61 67 73 2c 0d 0a 20 20 4c 50 43 56 4f 49 44  lags,..  LPCVOID
df50: 20 6c 70 53 6f 75 72 63 65 2c 0d 0a 20 20 44 57   lpSource,..  DW
df60: 4f 52 44 20 64 77 4d 65 73 73 61 67 65 49 64 2c  ORD dwMessageId,
df70: 0d 0a 20 20 44 57 4f 52 44 20 64 77 4c 61 6e 67  ..  DWORD dwLang
df80: 75 61 67 65 49 64 2c 0d 0a 20 20 4c 50 53 54 52  uageId,..  LPSTR
df90: 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 44 57   lpBuffer,..  DW
dfa0: 4f 52 44 20 6e 53 69 7a 65 2c 0d 0a 20 20 76 61  ORD nSize,..  va
dfb0: 5f 6c 69 73 74 20 2a 41 72 67 75 6d 65 6e 74 73  _list *Arguments
dfc0: 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
dfd0: 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44  ws) export DWORD
dfe0: 20 46 6f 72 6d 61 74 4d 65 73 73 61 67 65 57 28   FormatMessageW(
dff0: 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67  ..  DWORD dwFlag
e000: 73 2c 0d 0a 20 20 4c 50 43 56 4f 49 44 20 6c 70  s,..  LPCVOID lp
e010: 53 6f 75 72 63 65 2c 0d 0a 20 20 44 57 4f 52 44  Source,..  DWORD
e020: 20 64 77 4d 65 73 73 61 67 65 49 64 2c 0d 0a 20   dwMessageId,.. 
e030: 20 44 57 4f 52 44 20 64 77 4c 61 6e 67 75 61 67   DWORD dwLanguag
e040: 65 49 64 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c  eId,..  LPWSTR l
e050: 70 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f 52  pBuffer,..  DWOR
e060: 44 20 6e 53 69 7a 65 2c 0d 0a 20 20 76 61 5f 6c  D nSize,..  va_l
e070: 69 73 74 20 2a 41 72 67 75 6d 65 6e 74 73 29 3b  ist *Arguments);
e080: 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
e090: 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
e0a0: 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46 6f   #else..alias Fo
e0b0: 72 6d 61 74 4d 65 73 73 61 67 65 41 20 46 6f 72  rmatMessageA For
e0c0: 6d 61 74 4d 65 73 73 61 67 65 3b 0d 0a 2f 2f 20  matMessage;..// 
e0d0: 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
e0e0: 44 45 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 0d  DE..// #endif...
e0f0: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46  .enum : uint { F
e100: 4f 52 4d 41 54 5f 4d 45 53 53 41 47 45 5f 41 4c  ORMAT_MESSAGE_AL
e110: 4c 4f 43 41 54 45 5f 42 55 46 46 45 52 20 3d 20  LOCATE_BUFFER = 
e120: 30 78 30 30 30 30 30 31 30 30 20 7d 0d 0a 65 6e  0x00000100 }..en
e130: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46 4f 52 4d  um : uint { FORM
e140: 41 54 5f 4d 45 53 53 41 47 45 5f 49 47 4e 4f 52  AT_MESSAGE_IGNOR
e150: 45 5f 49 4e 53 45 52 54 53 20 3d 20 30 78 30 30  E_INSERTS = 0x00
e160: 30 30 30 32 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a  000200 }..enum :
e170: 20 75 69 6e 74 20 7b 20 46 4f 52 4d 41 54 5f 4d   uint { FORMAT_M
e180: 45 53 53 41 47 45 5f 46 52 4f 4d 5f 53 54 52 49  ESSAGE_FROM_STRI
e190: 4e 47 20 3d 20 30 78 30 30 30 30 30 34 30 30 20  NG = 0x00000400 
e1a0: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
e1b0: 20 46 4f 52 4d 41 54 5f 4d 45 53 53 41 47 45 5f   FORMAT_MESSAGE_
e1c0: 46 52 4f 4d 5f 48 4d 4f 44 55 4c 45 20 3d 20 30  FROM_HMODULE = 0
e1d0: 78 30 30 30 30 30 38 30 30 20 7d 0d 0a 65 6e 75  x00000800 }..enu
e1e0: 6d 20 3a 20 75 69 6e 74 20 7b 20 46 4f 52 4d 41  m : uint { FORMA
e1f0: 54 5f 4d 45 53 53 41 47 45 5f 46 52 4f 4d 5f 53  T_MESSAGE_FROM_S
e200: 59 53 54 45 4d 20 3d 20 30 78 30 30 30 30 31 30  YSTEM = 0x000010
e210: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  00 }..enum : uin
e220: 74 20 7b 20 46 4f 52 4d 41 54 5f 4d 45 53 53 41  t { FORMAT_MESSA
e230: 47 45 5f 41 52 47 55 4d 45 4e 54 5f 41 52 52 41  GE_ARGUMENT_ARRA
e240: 59 20 3d 20 30 78 30 30 30 30 32 30 30 30 20 7d  Y = 0x00002000 }
e250: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
e260: 46 4f 52 4d 41 54 5f 4d 45 53 53 41 47 45 5f 4d  FORMAT_MESSAGE_M
e270: 41 58 5f 57 49 44 54 48 5f 4d 41 53 4b 20 3d 20  AX_WIDTH_MASK = 
e280: 30 78 30 30 30 30 30 30 46 46 20 7d 0d 0a 0d 0a  0x000000FF }....
e290: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
e2a0: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43 72 65 61  export BOOL Crea
e2b0: 74 65 50 69 70 65 28 0d 0a 20 20 50 48 41 4e 44  tePipe(..  PHAND
e2c0: 4c 45 20 68 52 65 61 64 50 69 70 65 2c 0d 0a 20  LE hReadPipe,.. 
e2d0: 20 50 48 41 4e 44 4c 45 20 68 57 72 69 74 65 50   PHANDLE hWriteP
e2e0: 69 70 65 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49  ipe,..  LPSECURI
e2f0: 54 59 5f 41 54 54 52 49 42 55 54 45 53 20 6c 70  TY_ATTRIBUTES lp
e300: 50 69 70 65 41 74 74 72 69 62 75 74 65 73 2c 0d  PipeAttributes,.
e310: 0a 20 20 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b  .  DWORD nSize);
e320: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
e330: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
e340: 43 6f 6e 6e 65 63 74 4e 61 6d 65 64 50 69 70 65  ConnectNamedPipe
e350: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 4e 61 6d  (..  HANDLE hNam
e360: 65 64 50 69 70 65 2c 0d 0a 20 20 4c 50 4f 56 45  edPipe,..  LPOVE
e370: 52 4c 41 50 50 45 44 20 6c 70 4f 76 65 72 6c 61  RLAPPED lpOverla
e380: 70 70 65 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  pped);....extern
e390: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
e3a0: 20 42 4f 4f 4c 20 44 69 73 63 6f 6e 6e 65 63 74   BOOL Disconnect
e3b0: 4e 61 6d 65 64 50 69 70 65 28 0d 0a 20 20 48 41  NamedPipe(..  HA
e3c0: 4e 44 4c 45 20 68 4e 61 6d 65 64 50 69 70 65 29  NDLE hNamedPipe)
e3d0: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
e3e0: 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
e3f0: 20 53 65 74 4e 61 6d 65 64 50 69 70 65 48 61 6e   SetNamedPipeHan
e400: 64 6c 65 53 74 61 74 65 28 0d 0a 20 20 48 41 4e  dleState(..  HAN
e410: 44 4c 45 20 68 4e 61 6d 65 64 50 69 70 65 2c 0d  DLE hNamedPipe,.
e420: 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 4d 6f 64  .  LPDWORD lpMod
e430: 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70  e,..  LPDWORD lp
e440: 4d 61 78 43 6f 6c 6c 65 63 74 69 6f 6e 43 6f 75  MaxCollectionCou
e450: 6e 74 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  nt,..  LPDWORD l
e460: 70 43 6f 6c 6c 65 63 74 44 61 74 61 54 69 6d 65  pCollectDataTime
e470: 6f 75 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  out);....extern(
e480: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
e490: 42 4f 4f 4c 20 47 65 74 4e 61 6d 65 64 50 69 70  BOOL GetNamedPip
e4a0: 65 49 6e 66 6f 28 0d 0a 20 20 48 41 4e 44 4c 45  eInfo(..  HANDLE
e4b0: 20 68 4e 61 6d 65 64 50 69 70 65 2c 0d 0a 20 20   hNamedPipe,..  
e4c0: 4c 50 44 57 4f 52 44 20 6c 70 46 6c 61 67 73 2c  LPDWORD lpFlags,
e4d0: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 4f 75  ..  LPDWORD lpOu
e4e0: 74 42 75 66 66 65 72 53 69 7a 65 2c 0d 0a 20 20  tBufferSize,..  
e4f0: 4c 50 44 57 4f 52 44 20 6c 70 49 6e 42 75 66 66  LPDWORD lpInBuff
e500: 65 72 53 69 7a 65 2c 0d 0a 20 20 4c 50 44 57 4f  erSize,..  LPDWO
e510: 52 44 20 6c 70 4d 61 78 49 6e 73 74 61 6e 63 65  RD lpMaxInstance
e520: 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  s);....extern(Wi
e530: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
e540: 4f 4c 20 50 65 65 6b 4e 61 6d 65 64 50 69 70 65  OL PeekNamedPipe
e550: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 4e 61 6d  (..  HANDLE hNam
e560: 65 64 50 69 70 65 2c 0d 0a 20 20 4c 50 56 4f 49  edPipe,..  LPVOI
e570: 44 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 44  D lpBuffer,..  D
e580: 57 4f 52 44 20 6e 42 75 66 66 65 72 53 69 7a 65  WORD nBufferSize
e590: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 42  ,..  LPDWORD lpB
e5a0: 79 74 65 73 52 65 61 64 2c 0d 0a 20 20 4c 50 44  ytesRead,..  LPD
e5b0: 57 4f 52 44 20 6c 70 54 6f 74 61 6c 42 79 74 65  WORD lpTotalByte
e5c0: 73 41 76 61 69 6c 2c 0d 0a 20 20 4c 50 44 57 4f  sAvail,..  LPDWO
e5d0: 52 44 20 6c 70 42 79 74 65 73 4c 65 66 74 54 68  RD lpBytesLeftTh
e5e0: 69 73 4d 65 73 73 61 67 65 29 3b 0d 0a 0d 0a 65  isMessage);....e
e5f0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
e600: 78 70 6f 72 74 20 42 4f 4f 4c 20 54 72 61 6e 73  xport BOOL Trans
e610: 61 63 74 4e 61 6d 65 64 50 69 70 65 28 0d 0a 20  actNamedPipe(.. 
e620: 20 48 41 4e 44 4c 45 20 68 4e 61 6d 65 64 50 69   HANDLE hNamedPi
e630: 70 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70  pe,..  LPVOID lp
e640: 49 6e 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f  InBuffer,..  DWO
e650: 52 44 20 6e 49 6e 42 75 66 66 65 72 53 69 7a 65  RD nInBufferSize
e660: 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 4f 75  ,..  LPVOID lpOu
e670: 74 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f 52  tBuffer,..  DWOR
e680: 44 20 6e 4f 75 74 42 75 66 66 65 72 53 69 7a 65  D nOutBufferSize
e690: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 42  ,..  LPDWORD lpB
e6a0: 79 74 65 73 52 65 61 64 2c 0d 0a 20 20 4c 50 4f  ytesRead,..  LPO
e6b0: 56 45 52 4c 41 50 50 45 44 20 6c 70 4f 76 65 72  VERLAPPED lpOver
e6c0: 6c 61 70 70 65 64 29 3b 0d 0a 0d 0a 65 78 74 65  lapped);....exte
e6d0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
e6e0: 72 74 20 48 41 4e 44 4c 45 20 43 72 65 61 74 65  rt HANDLE Create
e6f0: 4d 61 69 6c 73 6c 6f 74 41 28 0d 0a 20 20 4c 50  MailslotA(..  LP
e700: 43 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20  CSTR lpName,..  
e710: 44 57 4f 52 44 20 6e 4d 61 78 4d 65 73 73 61 67  DWORD nMaxMessag
e720: 65 53 69 7a 65 2c 0d 0a 20 20 44 57 4f 52 44 20  eSize,..  DWORD 
e730: 6c 52 65 61 64 54 69 6d 65 6f 75 74 2c 0d 0a 20  lReadTimeout,.. 
e740: 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52   LPSECURITY_ATTR
e750: 49 42 55 54 45 53 20 6c 70 53 65 63 75 72 69 74  IBUTES lpSecurit
e760: 79 41 74 74 72 69 62 75 74 65 73 29 3b 0d 0a 65  yAttributes);..e
e770: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
e780: 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 43 72 65  xport HANDLE Cre
e790: 61 74 65 4d 61 69 6c 73 6c 6f 74 57 28 0d 0a 20  ateMailslotW(.. 
e7a0: 20 4c 50 43 57 53 54 52 20 6c 70 4e 61 6d 65 2c   LPCWSTR lpName,
e7b0: 0d 0a 20 20 44 57 4f 52 44 20 6e 4d 61 78 4d 65  ..  DWORD nMaxMe
e7c0: 73 73 61 67 65 53 69 7a 65 2c 0d 0a 20 20 44 57  ssageSize,..  DW
e7d0: 4f 52 44 20 6c 52 65 61 64 54 69 6d 65 6f 75 74  ORD lReadTimeout
e7e0: 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f  ,..  LPSECURITY_
e7f0: 41 54 54 52 49 42 55 54 45 53 20 6c 70 53 65 63  ATTRIBUTES lpSec
e800: 75 72 69 74 79 41 74 74 72 69 62 75 74 65 73 29  urityAttributes)
e810: 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
e820: 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
e830: 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 43  / #else..alias C
e840: 72 65 61 74 65 4d 61 69 6c 73 6c 6f 74 41 20 43  reateMailslotA C
e850: 72 65 61 74 65 4d 61 69 6c 73 6c 6f 74 3b 0d 0a  reateMailslot;..
e860: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
e870: 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
e880: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
e890: 42 4f 4f 4c 20 47 65 74 4d 61 69 6c 73 6c 6f 74  BOOL GetMailslot
e8a0: 49 6e 66 6f 28 0d 0a 20 20 48 41 4e 44 4c 45 20  Info(..  HANDLE 
e8b0: 68 4d 61 69 6c 73 6c 6f 74 2c 0d 0a 20 20 4c 50  hMailslot,..  LP
e8c0: 44 57 4f 52 44 20 6c 70 4d 61 78 4d 65 73 73 61  DWORD lpMaxMessa
e8d0: 67 65 53 69 7a 65 2c 0d 0a 20 20 4c 50 44 57 4f  geSize,..  LPDWO
e8e0: 52 44 20 6c 70 4e 65 78 74 53 69 7a 65 2c 0d 0a  RD lpNextSize,..
e8f0: 20 20 4c 50 44 57 4f 52 44 20 6c 70 4d 65 73 73    LPDWORD lpMess
e900: 61 67 65 43 6f 75 6e 74 2c 0d 0a 20 20 4c 50 44  ageCount,..  LPD
e910: 57 4f 52 44 20 6c 70 52 65 61 64 54 69 6d 65 6f  WORD lpReadTimeo
e920: 75 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ut);....extern(W
e930: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
e940: 4f 4f 4c 20 53 65 74 4d 61 69 6c 73 6c 6f 74 49  OOL SetMailslotI
e950: 6e 66 6f 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  nfo(..  HANDLE h
e960: 4d 61 69 6c 73 6c 6f 74 2c 0d 0a 20 20 44 57 4f  Mailslot,..  DWO
e970: 52 44 20 6c 52 65 61 64 54 69 6d 65 6f 75 74 29  RD lReadTimeout)
e980: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
e990: 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 50 56 4f  ows) export LPVO
e9a0: 49 44 20 4d 61 70 56 69 65 77 4f 66 46 69 6c 65  ID MapViewOfFile
e9b0: 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c  (..  HANDLE hFil
e9c0: 65 4d 61 70 70 69 6e 67 4f 62 6a 65 63 74 2c 0d  eMappingObject,.
e9d0: 0a 20 20 44 57 4f 52 44 20 64 77 44 65 73 69 72  .  DWORD dwDesir
e9e0: 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 44 57 4f  edAccess,..  DWO
e9f0: 52 44 20 64 77 46 69 6c 65 4f 66 66 73 65 74 48  RD dwFileOffsetH
ea00: 69 67 68 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77  igh,..  DWORD dw
ea10: 46 69 6c 65 4f 66 66 73 65 74 4c 6f 77 2c 0d 0a  FileOffsetLow,..
ea20: 20 20 53 49 5a 45 5f 54 20 64 77 4e 75 6d 62 65    SIZE_T dwNumbe
ea30: 72 4f 66 42 79 74 65 73 54 6f 4d 61 70 29 3b 0d  rOfBytesToMap);.
ea40: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
ea50: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 46  s) export BOOL F
ea60: 6c 75 73 68 56 69 65 77 4f 66 46 69 6c 65 28 0d  lushViewOfFile(.
ea70: 0a 20 20 4c 50 43 56 4f 49 44 20 6c 70 42 61 73  .  LPCVOID lpBas
ea80: 65 41 64 64 72 65 73 73 2c 0d 0a 20 20 53 49 5a  eAddress,..  SIZ
ea90: 45 5f 54 20 64 77 4e 75 6d 62 65 72 4f 66 42 79  E_T dwNumberOfBy
eaa0: 74 65 73 54 6f 46 6c 75 73 68 29 3b 0d 0a 0d 0a  tesToFlush);....
eab0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
eac0: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 55 6e 6d 61  export BOOL Unma
ead0: 70 56 69 65 77 4f 66 46 69 6c 65 28 0d 0a 20 20  pViewOfFile(..  
eae0: 4c 50 43 56 4f 49 44 20 6c 70 42 61 73 65 41 64  LPCVOID lpBaseAd
eaf0: 64 72 65 73 73 29 3b 0d 0a 0d 0a 65 78 74 65 72  dress);....exter
eb00: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
eb10: 74 20 42 4f 4f 4c 20 45 6e 63 72 79 70 74 46 69  t BOOL EncryptFi
eb20: 6c 65 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c  leA(..  LPCSTR l
eb30: 70 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a 65 78 74  pFileName);..ext
eb40: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
eb50: 6f 72 74 20 42 4f 4f 4c 20 45 6e 63 72 79 70 74  ort BOOL Encrypt
eb60: 46 69 6c 65 57 28 0d 0a 20 20 4c 50 43 57 53 54  FileW(..  LPCWST
eb70: 52 20 6c 70 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a  R lpFileName);..
eb80: 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
eb90: 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
eba0: 65 6c 73 65 0d 0a 61 6c 69 61 73 20 45 6e 63 72  else..alias Encr
ebb0: 79 70 74 46 69 6c 65 41 20 45 6e 63 72 79 70 74  yptFileA Encrypt
ebc0: 46 69 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  File;..// #endif
ebd0: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
ebe0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
ebf0: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 44 65 63 72  export BOOL Decr
ec00: 79 70 74 46 69 6c 65 41 28 0d 0a 20 20 4c 50 43  yptFileA(..  LPC
ec10: 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65 2c 0d  STR lpFileName,.
ec20: 0a 20 20 44 57 4f 52 44 20 64 77 52 65 73 65 72  .  DWORD dwReser
ec30: 76 65 64 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ved);..extern(Wi
ec40: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
ec50: 4f 4c 20 44 65 63 72 79 70 74 46 69 6c 65 57 28  OL DecryptFileW(
ec60: 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 46 69  ..  LPCWSTR lpFi
ec70: 6c 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  leName,..  DWORD
ec80: 20 64 77 52 65 73 65 72 76 65 64 29 3b 0d 0a 2f   dwReserved);../
ec90: 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
eca0: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
ecb0: 6c 73 65 0d 0a 61 6c 69 61 73 20 44 65 63 72 79  lse..alias Decry
ecc0: 70 74 46 69 6c 65 41 20 44 65 63 72 79 70 74 46  ptFileA DecryptF
ecd0: 69 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  ile;..// #endif 
ece0: 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65  // !UNICODE....e
ecf0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c  num : uint { FIL
ed00: 45 5f 45 4e 43 52 59 50 54 41 42 4c 45 20 3d 20  E_ENCRYPTABLE = 
ed10: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
ed20: 20 7b 20 46 49 4c 45 5f 49 53 5f 45 4e 43 52 59   { FILE_IS_ENCRY
ed30: 50 54 45 44 20 3d 20 31 20 7d 0d 0a 65 6e 75 6d  PTED = 1 }..enum
ed40: 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 53   : uint { FILE_S
ed50: 59 53 54 45 4d 5f 41 54 54 52 20 3d 20 32 20 7d  YSTEM_ATTR = 2 }
ed60: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
ed70: 46 49 4c 45 5f 52 4f 4f 54 5f 44 49 52 20 3d 20  FILE_ROOT_DIR = 
ed80: 33 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  3 }..enum : uint
ed90: 20 7b 20 46 49 4c 45 5f 53 59 53 54 45 4d 5f 44   { FILE_SYSTEM_D
eda0: 49 52 20 3d 20 34 20 7d 0d 0a 65 6e 75 6d 20 3a  IR = 4 }..enum :
edb0: 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 55 4e 4b   uint { FILE_UNK
edc0: 4e 4f 57 4e 20 3d 20 35 20 7d 0d 0a 65 6e 75 6d  NOWN = 5 }..enum
edd0: 20 3a 20 75 69 6e 74 20 7b 20 46 49 4c 45 5f 53   : uint { FILE_S
ede0: 59 53 54 45 4d 5f 4e 4f 54 5f 53 55 50 50 4f 52  YSTEM_NOT_SUPPOR
edf0: 54 20 3d 20 36 20 7d 0d 0a 65 6e 75 6d 20 3a 20  T = 6 }..enum : 
ee00: 75 69 6e 74 20 7b 20 46 49 4c 45 5f 55 53 45 52  uint { FILE_USER
ee10: 5f 44 49 53 41 4c 4c 4f 57 45 44 20 3d 20 37 20  _DISALLOWED = 7 
ee20: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
ee30: 20 46 49 4c 45 5f 52 45 41 44 5f 4f 4e 4c 59 20   FILE_READ_ONLY 
ee40: 3d 20 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  = 8 }..enum : ui
ee50: 6e 74 20 7b 20 46 49 4c 45 5f 44 49 52 5f 44 49  nt { FILE_DIR_DI
ee60: 53 41 4c 4c 4f 57 45 44 20 3d 20 39 20 7d 0d 0a  SALLOWED = 9 }..
ee70: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
ee80: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 46 69  ) export BOOL Fi
ee90: 6c 65 45 6e 63 72 79 70 74 69 6f 6e 53 74 61 74  leEncryptionStat
eea0: 75 73 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c  usA(..  LPCSTR l
eeb0: 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  pFileName,..  LP
eec0: 44 57 4f 52 44 20 6c 70 53 74 61 74 75 73 29 3b  DWORD lpStatus);
eed0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
eee0: 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 46 69  ) export BOOL Fi
eef0: 6c 65 45 6e 63 72 79 70 74 69 6f 6e 53 74 61 74  leEncryptionStat
ef00: 75 73 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20  usW(..  LPCWSTR 
ef10: 6c 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c  lpFileName,..  L
ef20: 50 44 57 4f 52 44 20 6c 70 53 74 61 74 75 73 29  PDWORD lpStatus)
ef30: 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
ef40: 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
ef50: 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46  / #else..alias F
ef60: 69 6c 65 45 6e 63 72 79 70 74 69 6f 6e 53 74 61  ileEncryptionSta
ef70: 74 75 73 41 20 46 69 6c 65 45 6e 63 72 79 70 74  tusA FileEncrypt
ef80: 69 6f 6e 53 74 61 74 75 73 3b 0d 0a 2f 2f 20 23  ionStatus;..// #
ef90: 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
efa0: 45 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  E....enum : uint
efb0: 20 7b 20 45 46 53 5f 55 53 45 5f 52 45 43 4f 56   { EFS_USE_RECOV
efc0: 45 52 59 5f 4b 45 59 53 20 3d 20 30 78 31 20 7d  ERY_KEYS = 0x1 }
efd0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
efe0: 77 73 29 20 61 6c 69 61 73 20 44 57 4f 52 44 20  ws) alias DWORD 
eff0: 66 75 6e 63 74 69 6f 6e 28 20 50 42 59 54 45 20  function( PBYTE 
f000: 70 62 44 61 74 61 2c 20 50 56 4f 49 44 20 70 76  pbData, PVOID pv
f010: 43 61 6c 6c 62 61 63 6b 43 6f 6e 74 65 78 74 2c  CallbackContext,
f020: 20 55 4c 4f 4e 47 20 75 6c 4c 65 6e 67 74 68 20   ULONG ulLength 
f030: 29 20 50 46 45 5f 45 58 50 4f 52 54 5f 46 55 4e  ) PFE_EXPORT_FUN
f040: 43 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  C;....extern(Win
f050: 64 6f 77 73 29 20 61 6c 69 61 73 20 44 57 4f 52  dows) alias DWOR
f060: 44 20 66 75 6e 63 74 69 6f 6e 28 20 50 42 59 54  D function( PBYT
f070: 45 20 70 62 44 61 74 61 2c 20 50 56 4f 49 44 20  E pbData, PVOID 
f080: 70 76 43 61 6c 6c 62 61 63 6b 43 6f 6e 74 65 78  pvCallbackContex
f090: 74 2c 20 50 55 4c 4f 4e 47 20 75 6c 4c 65 6e 67  t, PULONG ulLeng
f0a0: 74 68 20 29 20 50 46 45 5f 49 4d 50 4f 52 54 5f  th ) PFE_IMPORT_
f0b0: 46 55 4e 43 3b 0d 0a 0d 0a 65 6e 75 6d 20 3a 20  FUNC;....enum : 
f0c0: 75 69 6e 74 20 7b 20 43 52 45 41 54 45 5f 46 4f  uint { CREATE_FO
f0d0: 52 5f 49 4d 50 4f 52 54 20 3d 20 31 20 7d 0d 0a  R_IMPORT = 1 }..
f0e0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 43 52  enum : uint { CR
f0f0: 45 41 54 45 5f 46 4f 52 5f 44 49 52 20 3d 20 32  EATE_FOR_DIR = 2
f100: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
f110: 7b 20 4f 56 45 52 57 52 49 54 45 5f 48 49 44 44  { OVERWRITE_HIDD
f120: 45 4e 20 3d 20 34 20 7d 0d 0a 0d 0a 65 78 74 65  EN = 4 }....exte
f130: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
f140: 72 74 20 44 57 4f 52 44 20 4f 70 65 6e 45 6e 63  rt DWORD OpenEnc
f150: 72 79 70 74 65 64 46 69 6c 65 52 61 77 41 28 0d  ryptedFileRawA(.
f160: 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 69 6c 65  .  LPCSTR lpFile
f170: 4e 61 6d 65 2c 0d 0a 20 20 55 4c 4f 4e 47 20 75  Name,..  ULONG u
f180: 6c 46 6c 61 67 73 2c 0d 0a 20 20 50 56 4f 49 44  lFlags,..  PVOID
f190: 20 2a 20 70 76 43 6f 6e 74 65 78 74 29 3b 0d 0a   * pvContext);..
f1a0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
f1b0: 65 78 70 6f 72 74 20 44 57 4f 52 44 20 4f 70 65  export DWORD Ope
f1c0: 6e 45 6e 63 72 79 70 74 65 64 46 69 6c 65 52 61  nEncryptedFileRa
f1d0: 77 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  wW(..  LPCWSTR l
f1e0: 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 55 4c  pFileName,..  UL
f1f0: 4f 4e 47 20 75 6c 46 6c 61 67 73 2c 0d 0a 20 20  ONG ulFlags,..  
f200: 50 56 4f 49 44 20 2a 20 70 76 43 6f 6e 74 65 78  PVOID * pvContex
f210: 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  t);..// #ifdef U
f220: 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
f230: 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
f240: 20 4f 70 65 6e 45 6e 63 72 79 70 74 65 64 46 69   OpenEncryptedFi
f250: 6c 65 52 61 77 41 20 4f 70 65 6e 45 6e 63 72 79  leRawA OpenEncry
f260: 70 74 65 64 46 69 6c 65 52 61 77 3b 0d 0a 2f 2f  ptedFileRaw;..//
f270: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
f280: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
f290: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57  ndows) export DW
f2a0: 4f 52 44 20 52 65 61 64 45 6e 63 72 79 70 74 65  ORD ReadEncrypte
f2b0: 64 46 69 6c 65 52 61 77 28 0d 0a 20 20 50 46 45  dFileRaw(..  PFE
f2c0: 5f 45 58 50 4f 52 54 5f 46 55 4e 43 20 70 66 45  _EXPORT_FUNC pfE
f2d0: 78 70 6f 72 74 43 61 6c 6c 62 61 63 6b 2c 0d 0a  xportCallback,..
f2e0: 20 20 50 56 4f 49 44 20 70 76 43 61 6c 6c 62 61    PVOID pvCallba
f2f0: 63 6b 43 6f 6e 74 65 78 74 2c 0d 0a 20 20 50 56  ckContext,..  PV
f300: 4f 49 44 20 70 76 43 6f 6e 74 65 78 74 29 3b 0d  OID pvContext);.
f310: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
f320: 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
f330: 57 72 69 74 65 45 6e 63 72 79 70 74 65 64 46 69  WriteEncryptedFi
f340: 6c 65 52 61 77 28 0d 0a 20 20 50 46 45 5f 49 4d  leRaw(..  PFE_IM
f350: 50 4f 52 54 5f 46 55 4e 43 20 70 66 49 6d 70 6f  PORT_FUNC pfImpo
f360: 72 74 43 61 6c 6c 62 61 63 6b 2c 0d 0a 20 20 50  rtCallback,..  P
f370: 56 4f 49 44 20 70 76 43 61 6c 6c 62 61 63 6b 43  VOID pvCallbackC
f380: 6f 6e 74 65 78 74 2c 0d 0a 20 20 50 56 4f 49 44  ontext,..  PVOID
f390: 20 70 76 43 6f 6e 74 65 78 74 29 3b 0d 0a 0d 0a   pvContext);....
f3a0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
f3b0: 65 78 70 6f 72 74 20 56 4f 49 44 20 43 6c 6f 73  export VOID Clos
f3c0: 65 45 6e 63 72 79 70 74 65 64 46 69 6c 65 52 61  eEncryptedFileRa
f3d0: 77 28 0d 0a 20 20 50 56 4f 49 44 20 70 76 43 6f  w(..  PVOID pvCo
f3e0: 6e 74 65 78 74 29 3b 0d 0a 0d 0a 65 78 74 65 72  ntext);....exter
f3f0: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
f400: 74 20 69 6e 74 20 6c 73 74 72 63 6d 70 41 28 0d  t int lstrcmpA(.
f410: 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 74 72 69  .  LPCSTR lpStri
f420: 6e 67 31 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ng1,..  LPCSTR l
f430: 70 53 74 72 69 6e 67 32 29 3b 0d 0a 65 78 74 65  pString2);..exte
f440: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
f450: 72 74 20 69 6e 74 20 6c 73 74 72 63 6d 70 57 28  rt int lstrcmpW(
f460: 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53 74  ..  LPCWSTR lpSt
f470: 72 69 6e 67 31 2c 0d 0a 20 20 4c 50 43 57 53 54  ring1,..  LPCWST
f480: 52 20 6c 70 53 74 72 69 6e 67 32 29 3b 0d 0a 2f  R lpString2);../
f490: 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
f4a0: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
f4b0: 6c 73 65 0d 0a 61 6c 69 61 73 20 6c 73 74 72 63  lse..alias lstrc
f4c0: 6d 70 41 20 6c 73 74 72 63 6d 70 3b 0d 0a 2f 2f  mpA lstrcmp;..//
f4d0: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
f4e0: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
f4f0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 69 6e  ndows) export in
f500: 74 20 6c 73 74 72 63 6d 70 69 41 28 0d 0a 20 20  t lstrcmpiA(..  
f510: 4c 50 43 53 54 52 20 6c 70 53 74 72 69 6e 67 31  LPCSTR lpString1
f520: 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 74  ,..  LPCSTR lpSt
f530: 72 69 6e 67 32 29 3b 0d 0a 65 78 74 65 72 6e 28  ring2);..extern(
f540: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
f550: 69 6e 74 20 6c 73 74 72 63 6d 70 69 57 28 0d 0a  int lstrcmpiW(..
f560: 20 20 4c 50 43 57 53 54 52 20 6c 70 53 74 72 69    LPCWSTR lpStri
f570: 6e 67 31 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20  ng1,..  LPCWSTR 
f580: 6c 70 53 74 72 69 6e 67 32 29 3b 0d 0a 2f 2f 20  lpString2);..// 
f590: 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
f5a0: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
f5b0: 65 0d 0a 61 6c 69 61 73 20 6c 73 74 72 63 6d 70  e..alias lstrcmp
f5c0: 69 41 20 6c 73 74 72 63 6d 70 69 3b 0d 0a 2f 2f  iA lstrcmpi;..//
f5d0: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
f5e0: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
f5f0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 50  ndows) export LP
f600: 53 54 52 20 6c 73 74 72 63 70 79 6e 41 28 0d 0a  STR lstrcpynA(..
f610: 20 20 4c 50 53 54 52 20 6c 70 53 74 72 69 6e 67    LPSTR lpString
f620: 31 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 53  1,..  LPCSTR lpS
f630: 74 72 69 6e 67 32 2c 0d 0a 20 20 69 6e 74 20 69  tring2,..  int i
f640: 4d 61 78 4c 65 6e 67 74 68 29 3b 0d 0a 65 78 74  MaxLength);..ext
f650: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
f660: 6f 72 74 20 4c 50 57 53 54 52 20 6c 73 74 72 63  ort LPWSTR lstrc
f670: 70 79 6e 57 28 0d 0a 20 20 4c 50 57 53 54 52 20  pynW(..  LPWSTR 
f680: 6c 70 53 74 72 69 6e 67 31 2c 0d 0a 20 20 4c 50  lpString1,..  LP
f690: 43 57 53 54 52 20 6c 70 53 74 72 69 6e 67 32 2c  CWSTR lpString2,
f6a0: 0d 0a 20 20 69 6e 74 20 69 4d 61 78 4c 65 6e 67  ..  int iMaxLeng
f6b0: 74 68 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  th);..// #ifdef 
f6c0: 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
f6d0: 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
f6e0: 73 20 6c 73 74 72 63 70 79 6e 41 20 6c 73 74 72  s lstrcpynA lstr
f6f0: 63 70 79 6e 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  cpyn;..// #endif
f700: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
f710: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
f720: 65 78 70 6f 72 74 20 4c 50 53 54 52 20 6c 73 74  export LPSTR lst
f730: 72 63 70 79 41 28 0d 0a 20 20 4c 50 53 54 52 20  rcpyA(..  LPSTR 
f740: 6c 70 53 74 72 69 6e 67 31 2c 0d 0a 20 20 4c 50  lpString1,..  LP
f750: 43 53 54 52 20 6c 70 53 74 72 69 6e 67 32 29 3b  CSTR lpString2);
f760: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
f770: 29 20 65 78 70 6f 72 74 20 4c 50 57 53 54 52 20  ) export LPWSTR 
f780: 6c 73 74 72 63 70 79 57 28 0d 0a 20 20 4c 50 57  lstrcpyW(..  LPW
f790: 53 54 52 20 6c 70 53 74 72 69 6e 67 31 2c 0d 0a  STR lpString1,..
f7a0: 20 20 4c 50 43 57 53 54 52 20 6c 70 53 74 72 69    LPCWSTR lpStri
f7b0: 6e 67 32 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ng2);..// #ifdef
f7c0: 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
f7d0: 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
f7e0: 61 73 20 6c 73 74 72 63 70 79 41 20 6c 73 74 72  as lstrcpyA lstr
f7f0: 63 70 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  cpy;..// #endif 
f800: 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65  // !UNICODE....e
f810: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
f820: 78 70 6f 72 74 20 4c 50 53 54 52 20 6c 73 74 72  xport LPSTR lstr
f830: 63 61 74 41 28 0d 0a 20 20 4c 50 53 54 52 20 6c  catA(..  LPSTR l
f840: 70 53 74 72 69 6e 67 31 2c 0d 0a 20 20 4c 50 43  pString1,..  LPC
f850: 53 54 52 20 6c 70 53 74 72 69 6e 67 32 29 3b 0d  STR lpString2);.
f860: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
f870: 20 65 78 70 6f 72 74 20 4c 50 57 53 54 52 20 6c   export LPWSTR l
f880: 73 74 72 63 61 74 57 28 0d 0a 20 20 4c 50 57 53  strcatW(..  LPWS
f890: 54 52 20 6c 70 53 74 72 69 6e 67 31 2c 0d 0a 20  TR lpString1,.. 
f8a0: 20 4c 50 43 57 53 54 52 20 6c 70 53 74 72 69 6e   LPCWSTR lpStrin
f8b0: 67 32 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  g2);..// #ifdef 
f8c0: 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
f8d0: 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
f8e0: 73 20 6c 73 74 72 63 61 74 41 20 6c 73 74 72 63  s lstrcatA lstrc
f8f0: 61 74 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  at;..// #endif /
f900: 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
f910: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
f920: 70 6f 72 74 20 69 6e 74 20 6c 73 74 72 6c 65 6e  port int lstrlen
f930: 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 53  A(..  LPCSTR lpS
f940: 74 72 69 6e 67 29 3b 0d 0a 65 78 74 65 72 6e 28  tring);..extern(
f950: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
f960: 69 6e 74 20 6c 73 74 72 6c 65 6e 57 28 0d 0a 20  int lstrlenW(.. 
f970: 20 4c 50 43 57 53 54 52 20 6c 70 53 74 72 69 6e   LPCWSTR lpStrin
f980: 67 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  g);..// #ifdef U
f990: 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
f9a0: 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
f9b0: 20 6c 73 74 72 6c 65 6e 41 20 6c 73 74 72 6c 65   lstrlenA lstrle
f9c0: 6e 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  n;..// #endif //
f9d0: 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
f9e0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
f9f0: 6f 72 74 20 48 46 49 4c 45 20 4f 70 65 6e 46 69  ort HFILE OpenFi
fa00: 6c 65 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  le(..  LPCSTR lp
fa10: 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 4f  FileName,..  LPO
fa20: 46 53 54 52 55 43 54 20 6c 70 52 65 4f 70 65 6e  FSTRUCT lpReOpen
fa30: 42 75 66 66 2c 0d 0a 20 20 55 49 4e 54 20 75 53  Buff,..  UINT uS
fa40: 74 79 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  tyle);....extern
fa50: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
fa60: 20 48 46 49 4c 45 20 5f 6c 6f 70 65 6e 28 0d 0a   HFILE _lopen(..
fa70: 20 20 4c 50 43 53 54 52 20 6c 70 50 61 74 68 4e    LPCSTR lpPathN
fa80: 61 6d 65 2c 0d 0a 20 20 69 6e 74 20 69 52 65 61  ame,..  int iRea
fa90: 64 57 72 69 74 65 29 3b 0d 0a 0d 0a 65 78 74 65  dWrite);....exte
faa0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
fab0: 72 74 20 48 46 49 4c 45 20 5f 6c 63 72 65 61 74  rt HFILE _lcreat
fac0: 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 50 61  (..  LPCSTR lpPa
fad0: 74 68 4e 61 6d 65 2c 0d 0a 20 20 69 6e 74 20 69  thName,..  int i
fae0: 41 74 74 72 69 62 75 74 65 29 3b 0d 0a 0d 0a 65  Attribute);....e
faf0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
fb00: 78 70 6f 72 74 20 55 49 4e 54 20 5f 6c 72 65 61  xport UINT _lrea
fb10: 64 28 0d 0a 20 20 48 46 49 4c 45 20 68 46 69 6c  d(..  HFILE hFil
fb20: 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 42  e,..  LPVOID lpB
fb30: 75 66 66 65 72 2c 0d 0a 20 20 55 49 4e 54 20 75  uffer,..  UINT u
fb40: 42 79 74 65 73 29 3b 0d 0a 0d 0a 65 78 74 65 72  Bytes);....exter
fb50: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
fb60: 74 20 55 49 4e 54 20 5f 6c 77 72 69 74 65 28 0d  t UINT _lwrite(.
fb70: 0a 20 20 48 46 49 4c 45 20 68 46 69 6c 65 2c 0d  .  HFILE hFile,.
fb80: 0a 20 20 4c 50 43 53 54 52 20 6c 70 42 75 66 66  .  LPCSTR lpBuff
fb90: 65 72 2c 0d 0a 20 20 55 49 4e 54 20 75 42 79 74  er,..  UINT uByt
fba0: 65 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  es);....extern(W
fbb0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 69  indows) export i
fbc0: 6e 74 20 5f 68 72 65 61 64 28 0d 0a 20 20 48 46  nt _hread(..  HF
fbd0: 49 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 4c 50  ILE hFile,..  LP
fbe0: 56 4f 49 44 20 6c 70 42 75 66 66 65 72 2c 0d 0a  VOID lpBuffer,..
fbf0: 20 20 69 6e 74 20 6c 42 79 74 65 73 29 3b 0d 0a    int lBytes);..
fc00: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
fc10: 29 20 65 78 70 6f 72 74 20 69 6e 74 20 5f 68 77  ) export int _hw
fc20: 72 69 74 65 28 0d 0a 20 20 48 46 49 4c 45 20 68  rite(..  HFILE h
fc30: 46 69 6c 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20  File,..  LPCSTR 
fc40: 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 69 6e 74  lpBuffer,..  int
fc50: 20 6c 42 79 74 65 73 29 3b 0d 0a 0d 0a 65 78 74   lBytes);....ext
fc60: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
fc70: 6f 72 74 20 48 46 49 4c 45 20 5f 6c 63 6c 6f 73  ort HFILE _lclos
fc80: 65 28 0d 0a 20 20 48 46 49 4c 45 20 68 46 69 6c  e(..  HFILE hFil
fc90: 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
fca0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f  ndows) export LO
fcb0: 4e 47 20 5f 6c 6c 73 65 65 6b 28 0d 0a 20 20 48  NG _llseek(..  H
fcc0: 46 49 4c 45 20 68 46 69 6c 65 2c 0d 0a 20 20 4c  FILE hFile,..  L
fcd0: 4f 4e 47 20 6c 4f 66 66 73 65 74 2c 0d 0a 20 20  ONG lOffset,..  
fce0: 69 6e 74 20 69 4f 72 69 67 69 6e 29 3b 0d 0a 0d  int iOrigin);...
fcf0: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
fd00: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 49 73 54   export BOOL IsT
fd10: 65 78 74 55 6e 69 63 6f 64 65 28 0d 0a 20 20 56  extUnicode(..  V
fd20: 4f 49 44 2a 20 6c 70 42 75 66 66 65 72 2c 0d 0a  OID* lpBuffer,..
fd30: 20 20 69 6e 74 20 63 62 2c 0d 0a 20 20 4c 50 49    int cb,..  LPI
fd40: 4e 54 20 6c 70 69 29 3b 0d 0a 0d 0a 65 78 74 65  NT lpi);....exte
fd50: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
fd60: 72 74 20 44 57 4f 52 44 20 54 6c 73 41 6c 6c 6f  rt DWORD TlsAllo
fd70: 63 28 29 3b 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 44  c();....enum : D
fd80: 57 4f 52 44 20 7b 20 54 4c 53 5f 4f 55 54 5f 4f  WORD { TLS_OUT_O
fd90: 46 5f 49 4e 44 45 58 45 53 20 3d 20 30 78 46 46  F_INDEXES = 0xFF
fda0: 46 46 46 46 46 46 20 7d 0d 0a 0d 0a 65 78 74 65  FFFFFF }....exte
fdb0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
fdc0: 72 74 20 4c 50 56 4f 49 44 20 54 6c 73 47 65 74  rt LPVOID TlsGet
fdd0: 56 61 6c 75 65 28 0d 0a 20 20 44 57 4f 52 44 20  Value(..  DWORD 
fde0: 64 77 54 6c 73 49 6e 64 65 78 29 3b 0d 0a 0d 0a  dwTlsIndex);....
fdf0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
fe00: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 54 6c 73 53  export BOOL TlsS
fe10: 65 74 56 61 6c 75 65 28 0d 0a 20 20 44 57 4f 52  etValue(..  DWOR
fe20: 44 20 64 77 54 6c 73 49 6e 64 65 78 2c 0d 0a 20  D dwTlsIndex,.. 
fe30: 20 4c 50 56 4f 49 44 20 6c 70 54 6c 73 56 61 6c   LPVOID lpTlsVal
fe40: 75 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ue);....extern(W
fe50: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
fe60: 4f 4f 4c 20 54 6c 73 46 72 65 65 28 0d 0a 20 20  OOL TlsFree(..  
fe70: 44 57 4f 52 44 20 64 77 54 6c 73 49 6e 64 65 78  DWORD dwTlsIndex
fe80: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
fe90: 64 6f 77 73 29 20 61 6c 69 61 73 20 56 4f 49 44  dows) alias VOID
fea0: 20 66 75 6e 63 74 69 6f 6e 28 20 44 57 4f 52 44   function( DWORD
feb0: 20 64 77 45 72 72 6f 72 43 6f 64 65 2c 20 44 57   dwErrorCode, DW
fec0: 4f 52 44 20 64 77 4e 75 6d 62 65 72 4f 66 42 79  ORD dwNumberOfBy
fed0: 74 65 73 54 72 61 6e 73 66 65 72 65 64 2c 20 4c  tesTransfered, L
fee0: 50 4f 56 45 52 4c 41 50 50 45 44 20 6c 70 4f 76  POVERLAPPED lpOv
fef0: 65 72 6c 61 70 70 65 64 20 29 20 4c 50 4f 56 45  erlapped ) LPOVE
ff00: 52 4c 41 50 50 45 44 5f 43 4f 4d 50 4c 45 54 49  RLAPPED_COMPLETI
ff10: 4f 4e 5f 52 4f 55 54 49 4e 45 3b 0d 0a 0d 0a 65  ON_ROUTINE;....e
ff20: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
ff30: 78 70 6f 72 74 20 44 57 4f 52 44 20 53 6c 65 65  xport DWORD Slee
ff40: 70 45 78 28 0d 0a 20 20 44 57 4f 52 44 20 64 77  pEx(..  DWORD dw
ff50: 4d 69 6c 6c 69 73 65 63 6f 6e 64 73 2c 0d 0a 20  Milliseconds,.. 
ff60: 20 42 4f 4f 4c 20 62 41 6c 65 72 74 61 62 6c 65   BOOL bAlertable
ff70: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
ff80: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f  dows) export DWO
ff90: 52 44 20 57 61 69 74 46 6f 72 53 69 6e 67 6c 65  RD WaitForSingle
ffa0: 4f 62 6a 65 63 74 45 78 28 0d 0a 20 20 48 41 4e  ObjectEx(..  HAN
ffb0: 44 4c 45 20 68 48 61 6e 64 6c 65 2c 0d 0a 20 20  DLE hHandle,..  
ffc0: 44 57 4f 52 44 20 64 77 4d 69 6c 6c 69 73 65 63  DWORD dwMillisec
ffd0: 6f 6e 64 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62 41  onds,..  BOOL bA
ffe0: 6c 65 72 74 61 62 6c 65 29 3b 0d 0a 0d 0a 65 78  lertable);....ex
fff0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
10000 70 6f 72 74 20 44 57 4f 52 44 20 57 61 69 74 46  port DWORD WaitF
10010 6f 72 4d 75 6c 74 69 70 6c 65 4f 62 6a 65 63 74  orMultipleObject
10020 73 45 78 28 0d 0a 20 20 44 57 4f 52 44 20 6e 43  sEx(..  DWORD nC
10030 6f 75 6e 74 2c 0d 0a 20 20 48 41 4e 44 4c 45 20  ount,..  HANDLE 
10040 2a 6c 70 48 61 6e 64 6c 65 73 2c 0d 0a 20 20 42  *lpHandles,..  B
10050 4f 4f 4c 20 62 57 61 69 74 41 6c 6c 2c 0d 0a 20  OOL bWaitAll,.. 
10060 20 44 57 4f 52 44 20 64 77 4d 69 6c 6c 69 73 65   DWORD dwMillise
10070 63 6f 6e 64 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62  conds,..  BOOL b
10080 41 6c 65 72 74 61 62 6c 65 29 3b 0d 0a 0d 0a 2f  Alertable);..../
10090 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e  / #if(_WIN32_WIN
100a0 4e 54 20 3e 3d 20 30 78 30 34 30 30 29 0d 0a 65  NT >= 0x0400)..e
100b0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
100c0 78 70 6f 72 74 20 44 57 4f 52 44 20 53 69 67 6e  xport DWORD Sign
100d0 61 6c 4f 62 6a 65 63 74 41 6e 64 57 61 69 74 28  alObjectAndWait(
100e0 0d 0a 20 20 48 41 4e 44 4c 45 20 68 4f 62 6a 65  ..  HANDLE hObje
100f0 63 74 54 6f 53 69 67 6e 61 6c 2c 0d 0a 20 20 48  ctToSignal,..  H
10100 41 4e 44 4c 45 20 68 4f 62 6a 65 63 74 54 6f 57  ANDLE hObjectToW
10110 61 69 74 4f 6e 2c 0d 0a 20 20 44 57 4f 52 44 20  aitOn,..  DWORD 
10120 64 77 4d 69 6c 6c 69 73 65 63 6f 6e 64 73 2c 0d  dwMilliseconds,.
10130 0a 20 20 42 4f 4f 4c 20 62 41 6c 65 72 74 61 62  .  BOOL bAlertab
10140 6c 65 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  le);..// #endif 
10150 2f 2a 20 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  /* _WIN32_WINNT 
10160 3e 3d 20 30 78 30 34 30 30 20 2a 2f 0d 0a 0d 0a  >= 0x0400 */....
10170 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
10180 65 78 70 6f 72 74 20 42 4f 4f 4c 20 52 65 61 64  export BOOL Read
10190 46 69 6c 65 45 78 28 0d 0a 20 20 48 41 4e 44 4c  FileEx(..  HANDL
101a0 45 20 68 46 69 6c 65 2c 0d 0a 20 20 4c 50 56 4f  E hFile,..  LPVO
101b0 49 44 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20  ID lpBuffer,..  
101c0 44 57 4f 52 44 20 6e 4e 75 6d 62 65 72 4f 66 42  DWORD nNumberOfB
101d0 79 74 65 73 54 6f 52 65 61 64 2c 0d 0a 20 20 4c  ytesToRead,..  L
101e0 50 4f 56 45 52 4c 41 50 50 45 44 20 6c 70 4f 76  POVERLAPPED lpOv
101f0 65 72 6c 61 70 70 65 64 2c 0d 0a 20 20 4c 50 4f  erlapped,..  LPO
10200 56 45 52 4c 41 50 50 45 44 5f 43 4f 4d 50 4c 45  VERLAPPED_COMPLE
10210 54 49 4f 4e 5f 52 4f 55 54 49 4e 45 20 6c 70 43  TION_ROUTINE lpC
10220 6f 6d 70 6c 65 74 69 6f 6e 52 6f 75 74 69 6e 65  ompletionRoutine
10230 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
10240 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
10250 4c 20 57 72 69 74 65 46 69 6c 65 45 78 28 0d 0a  L WriteFileEx(..
10260 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
10270 0a 20 20 4c 50 43 56 4f 49 44 20 6c 70 42 75 66  .  LPCVOID lpBuf
10280 66 65 72 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 4e  fer,..  DWORD nN
10290 75 6d 62 65 72 4f 66 42 79 74 65 73 54 6f 57 72  umberOfBytesToWr
102a0 69 74 65 2c 0d 0a 20 20 4c 50 4f 56 45 52 4c 41  ite,..  LPOVERLA
102b0 50 50 45 44 20 6c 70 4f 76 65 72 6c 61 70 70 65  PPED lpOverlappe
102c0 64 2c 0d 0a 20 20 4c 50 4f 56 45 52 4c 41 50 50  d,..  LPOVERLAPP
102d0 45 44 5f 43 4f 4d 50 4c 45 54 49 4f 4e 5f 52 4f  ED_COMPLETION_RO
102e0 55 54 49 4e 45 20 6c 70 43 6f 6d 70 6c 65 74 69  UTINE lpCompleti
102f0 6f 6e 52 6f 75 74 69 6e 65 29 3b 0d 0a 0d 0a 65  onRoutine);....e
10300 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
10310 78 70 6f 72 74 20 42 4f 4f 4c 20 42 61 63 6b 75  xport BOOL Backu
10320 70 52 65 61 64 28 0d 0a 20 20 48 41 4e 44 4c 45  pRead(..  HANDLE
10330 20 68 46 69 6c 65 2c 0d 0a 20 20 4c 50 42 59 54   hFile,..  LPBYT
10340 45 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 44  E lpBuffer,..  D
10350 57 4f 52 44 20 6e 4e 75 6d 62 65 72 4f 66 42 79  WORD nNumberOfBy
10360 74 65 73 54 6f 52 65 61 64 2c 0d 0a 20 20 4c 50  tesToRead,..  LP
10370 44 57 4f 52 44 20 6c 70 4e 75 6d 62 65 72 4f 66  DWORD lpNumberOf
10380 42 79 74 65 73 52 65 61 64 2c 0d 0a 20 20 42 4f  BytesRead,..  BO
10390 4f 4c 20 62 41 62 6f 72 74 2c 0d 0a 20 20 42 4f  OL bAbort,..  BO
103a0 4f 4c 20 62 50 72 6f 63 65 73 73 53 65 63 75 72  OL bProcessSecur
103b0 69 74 79 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 2a  ity,..  LPVOID *
103c0 6c 70 43 6f 6e 74 65 78 74 29 3b 0d 0a 0d 0a 65  lpContext);....e
103d0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
103e0 78 70 6f 72 74 20 42 4f 4f 4c 20 42 61 63 6b 75  xport BOOL Backu
103f0 70 53 65 65 6b 28 0d 0a 20 20 48 41 4e 44 4c 45  pSeek(..  HANDLE
10400 20 68 46 69 6c 65 2c 0d 0a 20 20 44 57 4f 52 44   hFile,..  DWORD
10410 20 64 77 4c 6f 77 42 79 74 65 73 54 6f 53 65 65   dwLowBytesToSee
10420 6b 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 48 69  k,..  DWORD dwHi
10430 67 68 42 79 74 65 73 54 6f 53 65 65 6b 2c 0d 0a  ghBytesToSeek,..
10440 20 20 4c 50 44 57 4f 52 44 20 6c 70 64 77 4c 6f    LPDWORD lpdwLo
10450 77 42 79 74 65 53 65 65 6b 65 64 2c 0d 0a 20 20  wByteSeeked,..  
10460 4c 50 44 57 4f 52 44 20 6c 70 64 77 48 69 67 68  LPDWORD lpdwHigh
10470 42 79 74 65 53 65 65 6b 65 64 2c 0d 0a 20 20 4c  ByteSeeked,..  L
10480 50 56 4f 49 44 20 2a 6c 70 43 6f 6e 74 65 78 74  PVOID *lpContext
10490 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
104a0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
104b0 4c 20 42 61 63 6b 75 70 57 72 69 74 65 28 0d 0a  L BackupWrite(..
104c0 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
104d0 0a 20 20 4c 50 42 59 54 45 20 6c 70 42 75 66 66  .  LPBYTE lpBuff
104e0 65 72 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 4e 75  er,..  DWORD nNu
104f0 6d 62 65 72 4f 66 42 79 74 65 73 54 6f 57 72 69  mberOfBytesToWri
10500 74 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  te,..  LPDWORD l
10510 70 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 57 72  pNumberOfBytesWr
10520 69 74 74 65 6e 2c 0d 0a 20 20 42 4f 4f 4c 20 62  itten,..  BOOL b
10530 41 62 6f 72 74 2c 0d 0a 20 20 42 4f 4f 4c 20 62  Abort,..  BOOL b
10540 50 72 6f 63 65 73 73 53 65 63 75 72 69 74 79 2c  ProcessSecurity,
10550 0d 0a 20 20 4c 50 56 4f 49 44 20 2a 6c 70 43 6f  ..  LPVOID *lpCo
10560 6e 74 65 78 74 29 3b 0d 0a 0d 0a 73 74 72 75 63  ntext);....struc
10570 74 20 5f 57 49 4e 33 32 5f 53 54 52 45 41 4d 5f  t _WIN32_STREAM_
10580 49 44 20 7b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ID {..  DWORD dw
10590 53 74 72 65 61 6d 49 64 20 3b 0d 0a 20 20 44 57  StreamId ;..  DW
105a0 4f 52 44 20 64 77 53 74 72 65 61 6d 41 74 74 72  ORD dwStreamAttr
105b0 69 62 75 74 65 73 20 3b 0d 0a 20 20 4c 41 52 47  ibutes ;..  LARG
105c0 45 5f 49 4e 54 45 47 45 52 20 53 69 7a 65 20 3b  E_INTEGER Size ;
105d0 0d 0a 20 20 44 57 4f 52 44 20 64 77 53 74 72 65  ..  DWORD dwStre
105e0 61 6d 4e 61 6d 65 53 69 7a 65 20 3b 0d 0a 20 20  amNameSize ;..  
105f0 57 43 48 41 52 20 63 53 74 72 65 61 6d 4e 61 6d  WCHAR cStreamNam
10600 65 5b 20 41 4e 59 53 49 5a 45 5f 41 52 52 41 59  e[ ANYSIZE_ARRAY
10610 20 5d 20 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f   ] ;..}..alias _
10620 57 49 4e 33 32 5f 53 54 52 45 41 4d 5f 49 44 20  WIN32_STREAM_ID 
10630 57 49 4e 33 32 5f 53 54 52 45 41 4d 5f 49 44 3b  WIN32_STREAM_ID;
10640 0d 0a 61 6c 69 61 73 20 5f 57 49 4e 33 32 5f 53  ..alias _WIN32_S
10650 54 52 45 41 4d 5f 49 44 2a 20 4c 50 57 49 4e 33  TREAM_ID* LPWIN3
10660 32 5f 53 54 52 45 41 4d 5f 49 44 3b 0d 0a 0d 0a  2_STREAM_ID;....
10670 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 42 41  enum : uint { BA
10680 43 4b 55 50 5f 49 4e 56 41 4c 49 44 20 3d 20 30  CKUP_INVALID = 0
10690 78 30 30 30 30 30 30 30 30 20 7d 0d 0a 65 6e 75  x00000000 }..enu
106a0 6d 20 3a 20 75 69 6e 74 20 7b 20 42 41 43 4b 55  m : uint { BACKU
106b0 50 5f 44 41 54 41 20 3d 20 30 78 30 30 30 30 30  P_DATA = 0x00000
106c0 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  001 }..enum : ui
106d0 6e 74 20 7b 20 42 41 43 4b 55 50 5f 45 41 5f 44  nt { BACKUP_EA_D
106e0 41 54 41 20 3d 20 30 78 30 30 30 30 30 30 30 32  ATA = 0x00000002
106f0 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
10700 7b 20 42 41 43 4b 55 50 5f 53 45 43 55 52 49 54  { BACKUP_SECURIT
10710 59 5f 44 41 54 41 20 3d 20 30 78 30 30 30 30 30  Y_DATA = 0x00000
10720 30 30 33 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  003 }..enum : ui
10730 6e 74 20 7b 20 42 41 43 4b 55 50 5f 41 4c 54 45  nt { BACKUP_ALTE
10740 52 4e 41 54 45 5f 44 41 54 41 20 3d 20 30 78 30  RNATE_DATA = 0x0
10750 30 30 30 30 30 30 34 20 7d 0d 0a 65 6e 75 6d 20  0000004 }..enum 
10760 3a 20 75 69 6e 74 20 7b 20 42 41 43 4b 55 50 5f  : uint { BACKUP_
10770 4c 49 4e 4b 20 3d 20 30 78 30 30 30 30 30 30 30  LINK = 0x0000000
10780 35 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  5 }..enum : uint
10790 20 7b 20 42 41 43 4b 55 50 5f 50 52 4f 50 45 52   { BACKUP_PROPER
107a0 54 59 5f 44 41 54 41 20 3d 20 30 78 30 30 30 30  TY_DATA = 0x0000
107b0 30 30 30 36 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0006 }..enum : u
107c0 69 6e 74 20 7b 20 42 41 43 4b 55 50 5f 4f 42 4a  int { BACKUP_OBJ
107d0 45 43 54 5f 49 44 20 3d 20 30 78 30 30 30 30 30  ECT_ID = 0x00000
107e0 30 30 37 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  007 }..enum : ui
107f0 6e 74 20 7b 20 42 41 43 4b 55 50 5f 52 45 50 41  nt { BACKUP_REPA
10800 52 53 45 5f 44 41 54 41 20 3d 20 30 78 30 30 30  RSE_DATA = 0x000
10810 30 30 30 30 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20  00008 }..enum : 
10820 75 69 6e 74 20 7b 20 42 41 43 4b 55 50 5f 53 50  uint { BACKUP_SP
10830 41 52 53 45 5f 42 4c 4f 43 4b 20 3d 20 30 78 30  ARSE_BLOCK = 0x0
10840 30 30 30 30 30 30 39 20 7d 0d 0a 0d 0a 65 6e 75  0000009 }....enu
10850 6d 20 3a 20 75 69 6e 74 20 7b 20 53 54 52 45 41  m : uint { STREA
10860 4d 5f 4e 4f 52 4d 41 4c 5f 41 54 54 52 49 42 55  M_NORMAL_ATTRIBU
10870 54 45 20 3d 20 30 78 30 30 30 30 30 30 30 30 20  TE = 0x00000000 
10880 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
10890 20 53 54 52 45 41 4d 5f 4d 4f 44 49 46 49 45 44   STREAM_MODIFIED
108a0 5f 57 48 45 4e 5f 52 45 41 44 20 3d 20 30 78 30  _WHEN_READ = 0x0
108b0 30 30 30 30 30 30 31 20 7d 0d 0a 65 6e 75 6d 20  0000001 }..enum 
108c0 3a 20 75 69 6e 74 20 7b 20 53 54 52 45 41 4d 5f  : uint { STREAM_
108d0 43 4f 4e 54 41 49 4e 53 5f 53 45 43 55 52 49 54  CONTAINS_SECURIT
108e0 59 20 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d  Y = 0x00000002 }
108f0 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
10900 53 54 52 45 41 4d 5f 43 4f 4e 54 41 49 4e 53 5f  STREAM_CONTAINS_
10910 50 52 4f 50 45 52 54 49 45 53 20 3d 20 30 78 30  PROPERTIES = 0x0
10920 30 30 30 30 30 30 34 20 7d 0d 0a 65 6e 75 6d 20  0000004 }..enum 
10930 3a 20 75 69 6e 74 20 7b 20 53 54 52 45 41 4d 5f  : uint { STREAM_
10940 53 50 41 52 53 45 5f 41 54 54 52 49 42 55 54 45  SPARSE_ATTRIBUTE
10950 20 3d 20 30 78 30 30 30 30 30 30 30 38 20 7d 0d   = 0x00000008 }.
10960 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
10970 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 52  s) export BOOL R
10980 65 61 64 46 69 6c 65 53 63 61 74 74 65 72 28 0d  eadFileScatter(.
10990 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c  .  HANDLE hFile,
109a0 0d 0a 20 20 46 49 4c 45 5f 53 45 47 4d 45 4e 54  ..  FILE_SEGMENT
109b0 5f 45 4c 45 4d 45 4e 54 20 61 53 65 67 6d 65 6e  _ELEMENT aSegmen
109c0 74 41 72 72 61 79 5b 5d 2c 0d 0a 20 20 44 57 4f  tArray[],..  DWO
109d0 52 44 20 6e 4e 75 6d 62 65 72 4f 66 42 79 74 65  RD nNumberOfByte
109e0 73 54 6f 52 65 61 64 2c 0d 0a 20 20 4c 50 44 57  sToRead,..  LPDW
109f0 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64 2c 0d  ORD lpReserved,.
10a00 0a 20 20 4c 50 4f 56 45 52 4c 41 50 50 45 44 20  .  LPOVERLAPPED 
10a10 6c 70 4f 76 65 72 6c 61 70 70 65 64 29 3b 0d 0a  lpOverlapped);..
10a20 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
10a30 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 57 72  ) export BOOL Wr
10a40 69 74 65 46 69 6c 65 47 61 74 68 65 72 28 0d 0a  iteFileGather(..
10a50 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
10a60 0a 20 20 46 49 4c 45 5f 53 45 47 4d 45 4e 54 5f  .  FILE_SEGMENT_
10a70 45 4c 45 4d 45 4e 54 20 61 53 65 67 6d 65 6e 74  ELEMENT aSegment
10a80 41 72 72 61 79 5b 5d 2c 0d 0a 20 20 44 57 4f 52  Array[],..  DWOR
10a90 44 20 6e 4e 75 6d 62 65 72 4f 66 42 79 74 65 73  D nNumberOfBytes
10aa0 54 6f 57 72 69 74 65 2c 0d 0a 20 20 4c 50 44 57  ToWrite,..  LPDW
10ab0 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64 2c 0d  ORD lpReserved,.
10ac0 0a 20 20 4c 50 4f 56 45 52 4c 41 50 50 45 44 20  .  LPOVERLAPPED 
10ad0 6c 70 4f 76 65 72 6c 61 70 70 65 64 29 3b 0d 0a  lpOverlapped);..
10ae0 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
10af0 53 54 41 52 54 46 5f 55 53 45 53 48 4f 57 57 49  STARTF_USESHOWWI
10b00 4e 44 4f 57 20 3d 20 30 78 30 30 30 30 30 30 30  NDOW = 0x0000000
10b10 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  1 }..enum : uint
10b20 20 7b 20 53 54 41 52 54 46 5f 55 53 45 53 49 5a   { STARTF_USESIZ
10b30 45 20 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d  E = 0x00000002 }
10b40 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
10b50 53 54 41 52 54 46 5f 55 53 45 50 4f 53 49 54 49  STARTF_USEPOSITI
10b60 4f 4e 20 3d 20 30 78 30 30 30 30 30 30 30 34 20  ON = 0x00000004 
10b70 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
10b80 20 53 54 41 52 54 46 5f 55 53 45 43 4f 55 4e 54   STARTF_USECOUNT
10b90 43 48 41 52 53 20 3d 20 30 78 30 30 30 30 30 30  CHARS = 0x000000
10ba0 30 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  08 }..enum : uin
10bb0 74 20 7b 20 53 54 41 52 54 46 5f 55 53 45 46 49  t { STARTF_USEFI
10bc0 4c 4c 41 54 54 52 49 42 55 54 45 20 3d 20 30 78  LLATTRIBUTE = 0x
10bd0 30 30 30 30 30 30 31 30 20 7d 0d 0a 65 6e 75 6d  00000010 }..enum
10be0 20 3a 20 75 69 6e 74 20 7b 20 53 54 41 52 54 46   : uint { STARTF
10bf0 5f 52 55 4e 46 55 4c 4c 53 43 52 45 45 4e 20 3d  _RUNFULLSCREEN =
10c00 20 30 78 30 30 30 30 30 30 32 30 20 7d 0d 0a 65   0x00000020 }..e
10c10 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 54 41  num : uint { STA
10c20 52 54 46 5f 46 4f 52 43 45 4f 4e 46 45 45 44 42  RTF_FORCEONFEEDB
10c30 41 43 4b 20 3d 20 30 78 30 30 30 30 30 30 34 30  ACK = 0x00000040
10c40 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
10c50 7b 20 53 54 41 52 54 46 5f 46 4f 52 43 45 4f 46  { STARTF_FORCEOF
10c60 46 46 45 45 44 42 41 43 4b 20 3d 20 30 78 30 30  FFEEDBACK = 0x00
10c70 30 30 30 30 38 30 20 7d 0d 0a 65 6e 75 6d 20 3a  000080 }..enum :
10c80 20 75 69 6e 74 20 7b 20 53 54 41 52 54 46 5f 55   uint { STARTF_U
10c90 53 45 53 54 44 48 41 4e 44 4c 45 53 20 3d 20 30  SESTDHANDLES = 0
10ca0 78 30 30 30 30 30 31 30 30 20 7d 0d 0a 0d 0a 2f  x00000100 }..../
10cb0 2f 20 23 69 66 28 57 49 4e 56 45 52 20 3e 3d 20  / #if(WINVER >= 
10cc0 30 78 30 34 30 30 29 0d 0a 0d 0a 65 6e 75 6d 20  0x0400)....enum 
10cd0 3a 20 75 69 6e 74 20 7b 20 53 54 41 52 54 46 5f  : uint { STARTF_
10ce0 55 53 45 48 4f 54 4b 45 59 20 3d 20 30 78 30 30  USEHOTKEY = 0x00
10cf0 30 30 30 32 30 30 20 7d 0d 0a 2f 2f 20 23 65 6e  000200 }..// #en
10d00 64 69 66 20 2f 2a 20 57 49 4e 56 45 52 20 3e 3d  dif /* WINVER >=
10d10 20 30 78 30 34 30 30 20 2a 2f 0d 0a 0d 0a 73 74   0x0400 */....st
10d20 72 75 63 74 20 5f 53 54 41 52 54 55 50 49 4e 46  ruct _STARTUPINF
10d30 4f 41 20 7b 0d 0a 20 20 44 57 4f 52 44 20 63 62  OA {..  DWORD cb
10d40 3b 0d 0a 20 20 4c 50 53 54 52 20 6c 70 52 65 73  ;..  LPSTR lpRes
10d50 65 72 76 65 64 3b 0d 0a 20 20 4c 50 53 54 52 20  erved;..  LPSTR 
10d60 6c 70 44 65 73 6b 74 6f 70 3b 0d 0a 20 20 4c 50  lpDesktop;..  LP
10d70 53 54 52 20 6c 70 54 69 74 6c 65 3b 0d 0a 20 20  STR lpTitle;..  
10d80 44 57 4f 52 44 20 64 77 58 3b 0d 0a 20 20 44 57  DWORD dwX;..  DW
10d90 4f 52 44 20 64 77 59 3b 0d 0a 20 20 44 57 4f 52  ORD dwY;..  DWOR
10da0 44 20 64 77 58 53 69 7a 65 3b 0d 0a 20 20 44 57  D dwXSize;..  DW
10db0 4f 52 44 20 64 77 59 53 69 7a 65 3b 0d 0a 20 20  ORD dwYSize;..  
10dc0 44 57 4f 52 44 20 64 77 58 43 6f 75 6e 74 43 68  DWORD dwXCountCh
10dd0 61 72 73 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ars;..  DWORD dw
10de0 59 43 6f 75 6e 74 43 68 61 72 73 3b 0d 0a 20 20  YCountChars;..  
10df0 44 57 4f 52 44 20 64 77 46 69 6c 6c 41 74 74 72  DWORD dwFillAttr
10e00 69 62 75 74 65 3b 0d 0a 20 20 44 57 4f 52 44 20  ibute;..  DWORD 
10e10 64 77 46 6c 61 67 73 3b 0d 0a 20 20 57 4f 52 44  dwFlags;..  WORD
10e20 20 77 53 68 6f 77 57 69 6e 64 6f 77 3b 0d 0a 20   wShowWindow;.. 
10e30 20 57 4f 52 44 20 63 62 52 65 73 65 72 76 65 64   WORD cbReserved
10e40 32 3b 0d 0a 20 20 4c 50 42 59 54 45 20 6c 70 52  2;..  LPBYTE lpR
10e50 65 73 65 72 76 65 64 32 3b 0d 0a 20 20 48 41 4e  eserved2;..  HAN
10e60 44 4c 45 20 68 53 74 64 49 6e 70 75 74 3b 0d 0a  DLE hStdInput;..
10e70 20 20 48 41 4e 44 4c 45 20 68 53 74 64 4f 75 74    HANDLE hStdOut
10e80 70 75 74 3b 0d 0a 20 20 48 41 4e 44 4c 45 20 68  put;..  HANDLE h
10e90 53 74 64 45 72 72 6f 72 3b 0d 0a 7d 0d 0a 61 6c  StdError;..}..al
10ea0 69 61 73 20 5f 53 54 41 52 54 55 50 49 4e 46 4f  ias _STARTUPINFO
10eb0 41 20 53 54 41 52 54 55 50 49 4e 46 4f 41 3b 0d  A STARTUPINFOA;.
10ec0 0a 61 6c 69 61 73 20 5f 53 54 41 52 54 55 50 49  .alias _STARTUPI
10ed0 4e 46 4f 41 2a 20 4c 50 53 54 41 52 54 55 50 49  NFOA* LPSTARTUPI
10ee0 4e 46 4f 41 3b 0d 0a 0d 0a 73 74 72 75 63 74 20  NFOA;....struct 
10ef0 5f 53 54 41 52 54 55 50 49 4e 46 4f 57 20 7b 0d  _STARTUPINFOW {.
10f00 0a 20 20 44 57 4f 52 44 20 63 62 3b 0d 0a 20 20  .  DWORD cb;..  
10f10 4c 50 57 53 54 52 20 6c 70 52 65 73 65 72 76 65  LPWSTR lpReserve
10f20 64 3b 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 44  d;..  LPWSTR lpD
10f30 65 73 6b 74 6f 70 3b 0d 0a 20 20 4c 50 57 53 54  esktop;..  LPWST
10f40 52 20 6c 70 54 69 74 6c 65 3b 0d 0a 20 20 44 57  R lpTitle;..  DW
10f50 4f 52 44 20 64 77 58 3b 0d 0a 20 20 44 57 4f 52  ORD dwX;..  DWOR
10f60 44 20 64 77 59 3b 0d 0a 20 20 44 57 4f 52 44 20  D dwY;..  DWORD 
10f70 64 77 58 53 69 7a 65 3b 0d 0a 20 20 44 57 4f 52  dwXSize;..  DWOR
10f80 44 20 64 77 59 53 69 7a 65 3b 0d 0a 20 20 44 57  D dwYSize;..  DW
10f90 4f 52 44 20 64 77 58 43 6f 75 6e 74 43 68 61 72  ORD dwXCountChar
10fa0 73 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77 59 43  s;..  DWORD dwYC
10fb0 6f 75 6e 74 43 68 61 72 73 3b 0d 0a 20 20 44 57  ountChars;..  DW
10fc0 4f 52 44 20 64 77 46 69 6c 6c 41 74 74 72 69 62  ORD dwFillAttrib
10fd0 75 74 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ute;..  DWORD dw
10fe0 46 6c 61 67 73 3b 0d 0a 20 20 57 4f 52 44 20 77  Flags;..  WORD w
10ff0 53 68 6f 77 57 69 6e 64 6f 77 3b 0d 0a 20 20 57  ShowWindow;..  W
11000 4f 52 44 20 63 62 52 65 73 65 72 76 65 64 32 3b  ORD cbReserved2;
11010 0d 0a 20 20 4c 50 42 59 54 45 20 6c 70 52 65 73  ..  LPBYTE lpRes
11020 65 72 76 65 64 32 3b 0d 0a 20 20 48 41 4e 44 4c  erved2;..  HANDL
11030 45 20 68 53 74 64 49 6e 70 75 74 3b 0d 0a 20 20  E hStdInput;..  
11040 48 41 4e 44 4c 45 20 68 53 74 64 4f 75 74 70 75  HANDLE hStdOutpu
11050 74 3b 0d 0a 20 20 48 41 4e 44 4c 45 20 68 53 74  t;..  HANDLE hSt
11060 64 45 72 72 6f 72 3b 0d 0a 7d 0d 0a 61 6c 69 61  dError;..}..alia
11070 73 20 5f 53 54 41 52 54 55 50 49 4e 46 4f 57 20  s _STARTUPINFOW 
11080 53 54 41 52 54 55 50 49 4e 46 4f 57 3b 0d 0a 61  STARTUPINFOW;..a
11090 6c 69 61 73 20 5f 53 54 41 52 54 55 50 49 4e 46  lias _STARTUPINF
110a0 4f 57 2a 20 4c 50 53 54 41 52 54 55 50 49 4e 46  OW* LPSTARTUPINF
110b0 4f 57 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65 66  OW;....// #ifdef
110c0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 2e 2e 2e   UNICODE..// ...
110d0 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
110e0 73 20 53 54 41 52 54 55 50 49 4e 46 4f 41 20 53  s STARTUPINFOA S
110f0 54 41 52 54 55 50 49 4e 46 4f 3b 0d 0a 61 6c 69  TARTUPINFO;..ali
11100 61 73 20 4c 50 53 54 41 52 54 55 50 49 4e 46 4f  as LPSTARTUPINFO
11110 41 20 4c 50 53 54 41 52 54 55 50 49 4e 46 4f 3b  A LPSTARTUPINFO;
11120 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 55  ..// #endif // U
11130 4e 49 43 4f 44 45 0d 0a 0d 0a 65 6e 75 6d 20 3a  NICODE....enum :
11140 20 75 69 6e 74 20 7b 20 53 48 55 54 44 4f 57 4e   uint { SHUTDOWN
11150 5f 4e 4f 52 45 54 52 59 20 3d 20 30 78 30 30 30  _NORETRY = 0x000
11160 30 30 30 30 31 20 7d 0d 0a 0d 0a 73 74 72 75 63  00001 }....struc
11170 74 20 5f 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41  t _WIN32_FIND_DA
11180 54 41 41 20 7b 0d 0a 20 20 44 57 4f 52 44 20 64  TAA {..  DWORD d
11190 77 46 69 6c 65 41 74 74 72 69 62 75 74 65 73 3b  wFileAttributes;
111a0 0d 0a 20 20 46 49 4c 45 54 49 4d 45 20 66 74 43  ..  FILETIME ftC
111b0 72 65 61 74 69 6f 6e 54 69 6d 65 3b 0d 0a 20 20  reationTime;..  
111c0 46 49 4c 45 54 49 4d 45 20 66 74 4c 61 73 74 41  FILETIME ftLastA
111d0 63 63 65 73 73 54 69 6d 65 3b 0d 0a 20 20 46 49  ccessTime;..  FI
111e0 4c 45 54 49 4d 45 20 66 74 4c 61 73 74 57 72 69  LETIME ftLastWri
111f0 74 65 54 69 6d 65 3b 0d 0a 20 20 44 57 4f 52 44  teTime;..  DWORD
11200 20 6e 46 69 6c 65 53 69 7a 65 48 69 67 68 3b 0d   nFileSizeHigh;.
11210 0a 20 20 44 57 4f 52 44 20 6e 46 69 6c 65 53 69  .  DWORD nFileSi
11220 7a 65 4c 6f 77 3b 0d 0a 20 20 44 57 4f 52 44 20  zeLow;..  DWORD 
11230 64 77 52 65 73 65 72 76 65 64 30 3b 0d 0a 20 20  dwReserved0;..  
11240 44 57 4f 52 44 20 64 77 52 65 73 65 72 76 65 64  DWORD dwReserved
11250 31 3b 0d 0a 20 20 43 48 41 52 20 63 46 69 6c 65  1;..  CHAR cFile
11260 4e 61 6d 65 5b 20 4d 41 58 5f 50 41 54 48 20 5d  Name[ MAX_PATH ]
11270 3b 0d 0a 20 20 43 48 41 52 20 63 41 6c 74 65 72  ;..  CHAR cAlter
11280 6e 61 74 65 46 69 6c 65 4e 61 6d 65 5b 20 31 34  nateFileName[ 14
11290 20 5d 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 5f   ];..// #ifdef _
112a0 4d 41 43 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20  MAC..// .....// 
112b0 23 65 6e 64 69 66 0d 0a 7d 0d 0a 61 6c 69 61 73  #endif..}..alias
112c0 20 5f 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41 54   _WIN32_FIND_DAT
112d0 41 41 20 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41  AA WIN32_FIND_DA
112e0 54 41 41 3b 0d 0a 61 6c 69 61 73 20 5f 57 49 4e  TAA;..alias _WIN
112f0 33 32 5f 46 49 4e 44 5f 44 41 54 41 41 2a 20 50  32_FIND_DATAA* P
11300 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41 54 41 41  WIN32_FIND_DATAA
11310 3b 0d 0a 61 6c 69 61 73 20 5f 57 49 4e 33 32 5f  ;..alias _WIN32_
11320 46 49 4e 44 5f 44 41 54 41 41 2a 20 4c 50 57 49  FIND_DATAA* LPWI
11330 4e 33 32 5f 46 49 4e 44 5f 44 41 54 41 41 3b 0d  N32_FIND_DATAA;.
11340 0a 0d 0a 73 74 72 75 63 74 20 5f 57 49 4e 33 32  ...struct _WIN32
11350 5f 46 49 4e 44 5f 44 41 54 41 57 20 7b 0d 0a 20  _FIND_DATAW {.. 
11360 20 44 57 4f 52 44 20 64 77 46 69 6c 65 41 74 74   DWORD dwFileAtt
11370 72 69 62 75 74 65 73 3b 0d 0a 20 20 46 49 4c 45  ributes;..  FILE
11380 54 49 4d 45 20 66 74 43 72 65 61 74 69 6f 6e 54  TIME ftCreationT
11390 69 6d 65 3b 0d 0a 20 20 46 49 4c 45 54 49 4d 45  ime;..  FILETIME
113a0 20 66 74 4c 61 73 74 41 63 63 65 73 73 54 69 6d   ftLastAccessTim
113b0 65 3b 0d 0a 20 20 46 49 4c 45 54 49 4d 45 20 66  e;..  FILETIME f
113c0 74 4c 61 73 74 57 72 69 74 65 54 69 6d 65 3b 0d  tLastWriteTime;.
113d0 0a 20 20 44 57 4f 52 44 20 6e 46 69 6c 65 53 69  .  DWORD nFileSi
113e0 7a 65 48 69 67 68 3b 0d 0a 20 20 44 57 4f 52 44  zeHigh;..  DWORD
113f0 20 6e 46 69 6c 65 53 69 7a 65 4c 6f 77 3b 0d 0a   nFileSizeLow;..
11400 20 20 44 57 4f 52 44 20 64 77 52 65 73 65 72 76    DWORD dwReserv
11410 65 64 30 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ed0;..  DWORD dw
11420 52 65 73 65 72 76 65 64 31 3b 0d 0a 20 20 57 43  Reserved1;..  WC
11430 48 41 52 20 63 46 69 6c 65 4e 61 6d 65 5b 20 4d  HAR cFileName[ M
11440 41 58 5f 50 41 54 48 20 5d 3b 0d 0a 20 20 57 43  AX_PATH ];..  WC
11450 48 41 52 20 63 41 6c 74 65 72 6e 61 74 65 46 69  HAR cAlternateFi
11460 6c 65 4e 61 6d 65 5b 20 31 34 20 5d 3b 0d 0a 2f  leName[ 14 ];../
11470 2f 20 23 69 66 64 65 66 20 5f 4d 41 43 0d 0a 2f  / #ifdef _MAC../
11480 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66  / .....// #endif
11490 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 57 49 4e 33  ..}..alias _WIN3
114a0 32 5f 46 49 4e 44 5f 44 41 54 41 57 20 57 49 4e  2_FIND_DATAW WIN
114b0 33 32 5f 46 49 4e 44 5f 44 41 54 41 57 3b 0d 0a  32_FIND_DATAW;..
114c0 61 6c 69 61 73 20 5f 57 49 4e 33 32 5f 46 49 4e  alias _WIN32_FIN
114d0 44 5f 44 41 54 41 57 2a 20 50 57 49 4e 33 32 5f  D_DATAW* PWIN32_
114e0 46 49 4e 44 5f 44 41 54 41 57 3b 0d 0a 61 6c 69  FIND_DATAW;..ali
114f0 61 73 20 5f 57 49 4e 33 32 5f 46 49 4e 44 5f 44  as _WIN32_FIND_D
11500 41 54 41 57 2a 20 4c 50 57 49 4e 33 32 5f 46 49  ATAW* LPWIN32_FI
11510 4e 44 5f 44 41 54 41 57 3b 0d 0a 0d 0a 2f 2f 20  ND_DATAW;....// 
11520 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
11530 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  // .....// #else
11540 0d 0a 61 6c 69 61 73 20 57 49 4e 33 32 5f 46 49  ..alias WIN32_FI
11550 4e 44 5f 44 41 54 41 41 20 57 49 4e 33 32 5f 46  ND_DATAA WIN32_F
11560 49 4e 44 5f 44 41 54 41 3b 0d 0a 61 6c 69 61 73  IND_DATA;..alias
11570 20 50 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41 54   PWIN32_FIND_DAT
11580 41 41 20 50 57 49 4e 33 32 5f 46 49 4e 44 5f 44  AA PWIN32_FIND_D
11590 41 54 41 3b 0d 0a 61 6c 69 61 73 20 4c 50 57 49  ATA;..alias LPWI
115a0 4e 33 32 5f 46 49 4e 44 5f 44 41 54 41 41 20 4c  N32_FIND_DATAA L
115b0 50 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41 54 41  PWIN32_FIND_DATA
115c0 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
115d0 55 4e 49 43 4f 44 45 0d 0a 0d 0a 73 74 72 75 63  UNICODE....struc
115e0 74 20 5f 57 49 4e 33 32 5f 46 49 4c 45 5f 41 54  t _WIN32_FILE_AT
115f0 54 52 49 42 55 54 45 5f 44 41 54 41 20 7b 0d 0a  TRIBUTE_DATA {..
11600 20 20 44 57 4f 52 44 20 64 77 46 69 6c 65 41 74    DWORD dwFileAt
11610 74 72 69 62 75 74 65 73 3b 0d 0a 20 20 46 49 4c  tributes;..  FIL
11620 45 54 49 4d 45 20 66 74 43 72 65 61 74 69 6f 6e  ETIME ftCreation
11630 54 69 6d 65 3b 0d 0a 20 20 46 49 4c 45 54 49 4d  Time;..  FILETIM
11640 45 20 66 74 4c 61 73 74 41 63 63 65 73 73 54 69  E ftLastAccessTi
11650 6d 65 3b 0d 0a 20 20 46 49 4c 45 54 49 4d 45 20  me;..  FILETIME 
11660 66 74 4c 61 73 74 57 72 69 74 65 54 69 6d 65 3b  ftLastWriteTime;
11670 0d 0a 20 20 44 57 4f 52 44 20 6e 46 69 6c 65 53  ..  DWORD nFileS
11680 69 7a 65 48 69 67 68 3b 0d 0a 20 20 44 57 4f 52  izeHigh;..  DWOR
11690 44 20 6e 46 69 6c 65 53 69 7a 65 4c 6f 77 3b 0d  D nFileSizeLow;.
116a0 0a 7d 0d 0a 61 6c 69 61 73 20 5f 57 49 4e 33 32  .}..alias _WIN32
116b0 5f 46 49 4c 45 5f 41 54 54 52 49 42 55 54 45 5f  _FILE_ATTRIBUTE_
116c0 44 41 54 41 20 57 49 4e 33 32 5f 46 49 4c 45 5f  DATA WIN32_FILE_
116d0 41 54 54 52 49 42 55 54 45 5f 44 41 54 41 3b 0d  ATTRIBUTE_DATA;.
116e0 0a 61 6c 69 61 73 20 5f 57 49 4e 33 32 5f 46 49  .alias _WIN32_FI
116f0 4c 45 5f 41 54 54 52 49 42 55 54 45 5f 44 41 54  LE_ATTRIBUTE_DAT
11700 41 2a 20 4c 50 57 49 4e 33 32 5f 46 49 4c 45 5f  A* LPWIN32_FILE_
11710 41 54 54 52 49 42 55 54 45 5f 44 41 54 41 3b 0d  ATTRIBUTE_DATA;.
11720 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
11730 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45  s) export HANDLE
11740 20 43 72 65 61 74 65 4d 75 74 65 78 41 28 0d 0a   CreateMutexA(..
11750 20 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54    LPSECURITY_ATT
11760 52 49 42 55 54 45 53 20 6c 70 4d 75 74 65 78 41  RIBUTES lpMutexA
11770 74 74 72 69 62 75 74 65 73 2c 0d 0a 20 20 42 4f  ttributes,..  BO
11780 4f 4c 20 62 49 6e 69 74 69 61 6c 4f 77 6e 65 72  OL bInitialOwner
11790 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4e 61  ,..  LPCSTR lpNa
117a0 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  me);..extern(Win
117b0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
117c0 44 4c 45 20 43 72 65 61 74 65 4d 75 74 65 78 57  DLE CreateMutexW
117d0 28 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f  (..  LPSECURITY_
117e0 41 54 54 52 49 42 55 54 45 53 20 6c 70 4d 75 74  ATTRIBUTES lpMut
117f0 65 78 41 74 74 72 69 62 75 74 65 73 2c 0d 0a 20  exAttributes,.. 
11800 20 42 4f 4f 4c 20 62 49 6e 69 74 69 61 6c 4f 77   BOOL bInitialOw
11810 6e 65 72 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20  ner,..  LPCWSTR 
11820 6c 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66  lpName);..// #if
11830 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
11840 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
11850 61 6c 69 61 73 20 43 72 65 61 74 65 4d 75 74 65  alias CreateMute
11860 78 41 20 43 72 65 61 74 65 4d 75 74 65 78 3b 0d  xA CreateMutex;.
11870 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
11880 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
11890 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
118a0 20 48 41 4e 44 4c 45 20 4f 70 65 6e 4d 75 74 65   HANDLE OpenMute
118b0 78 41 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44  xA(..  DWORD dwD
118c0 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20  esiredAccess,.. 
118d0 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61   BOOL bInheritHa
118e0 6e 64 6c 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20  ndle,..  LPCSTR 
118f0 6c 70 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e  lpName);..extern
11900 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
11910 20 48 41 4e 44 4c 45 20 4f 70 65 6e 4d 75 74 65   HANDLE OpenMute
11920 78 57 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44  xW(..  DWORD dwD
11930 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20  esiredAccess,.. 
11940 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61   BOOL bInheritHa
11950 6e 64 6c 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52  ndle,..  LPCWSTR
11960 20 6c 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69   lpName);..// #i
11970 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
11980 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
11990 0a 61 6c 69 61 73 20 4f 70 65 6e 4d 75 74 65 78  .alias OpenMutex
119a0 41 20 4f 70 65 6e 4d 75 74 65 78 3b 0d 0a 2f 2f  A OpenMutex;..//
119b0 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
119c0 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
119d0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41  ndows) export HA
119e0 4e 44 4c 45 20 43 72 65 61 74 65 45 76 65 6e 74  NDLE CreateEvent
119f0 41 28 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59  A(..  LPSECURITY
11a00 5f 41 54 54 52 49 42 55 54 45 53 20 6c 70 45 76  _ATTRIBUTES lpEv
11a10 65 6e 74 41 74 74 72 69 62 75 74 65 73 2c 0d 0a  entAttributes,..
11a20 20 20 42 4f 4f 4c 20 62 4d 61 6e 75 61 6c 52 65    BOOL bManualRe
11a30 73 65 74 2c 0d 0a 20 20 42 4f 4f 4c 20 62 49 6e  set,..  BOOL bIn
11a40 69 74 69 61 6c 53 74 61 74 65 2c 0d 0a 20 20 4c  itialState,..  L
11a50 50 43 53 54 52 20 6c 70 4e 61 6d 65 29 3b 0d 0a  PCSTR lpName);..
11a60 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
11a70 65 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 43 72  export HANDLE Cr
11a80 65 61 74 65 45 76 65 6e 74 57 28 0d 0a 20 20 4c  eateEventW(..  L
11a90 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49 42  PSECURITY_ATTRIB
11aa0 55 54 45 53 20 6c 70 45 76 65 6e 74 41 74 74 72  UTES lpEventAttr
11ab0 69 62 75 74 65 73 2c 0d 0a 20 20 42 4f 4f 4c 20  ibutes,..  BOOL 
11ac0 62 4d 61 6e 75 61 6c 52 65 73 65 74 2c 0d 0a 20  bManualReset,.. 
11ad0 20 42 4f 4f 4c 20 62 49 6e 69 74 69 61 6c 53 74   BOOL bInitialSt
11ae0 61 74 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20  ate,..  LPCWSTR 
11af0 6c 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66  lpName);..// #if
11b00 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
11b10 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
11b20 61 6c 69 61 73 20 43 72 65 61 74 65 45 76 65 6e  alias CreateEven
11b30 74 41 20 43 72 65 61 74 65 45 76 65 6e 74 3b 0d  tA CreateEvent;.
11b40 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
11b50 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
11b60 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
11b70 20 48 41 4e 44 4c 45 20 4f 70 65 6e 45 76 65 6e   HANDLE OpenEven
11b80 74 41 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44  tA(..  DWORD dwD
11b90 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20  esiredAccess,.. 
11ba0 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61   BOOL bInheritHa
11bb0 6e 64 6c 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20  ndle,..  LPCSTR 
11bc0 6c 70 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e  lpName);..extern
11bd0 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
11be0 20 48 41 4e 44 4c 45 20 4f 70 65 6e 45 76 65 6e   HANDLE OpenEven
11bf0 74 57 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44  tW(..  DWORD dwD
11c00 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20  esiredAccess,.. 
11c10 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61   BOOL bInheritHa
11c20 6e 64 6c 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52  ndle,..  LPCWSTR
11c30 20 6c 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69   lpName);..// #i
11c40 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
11c50 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
11c60 0a 61 6c 69 61 73 20 4f 70 65 6e 45 76 65 6e 74  .alias OpenEvent
11c70 41 20 4f 70 65 6e 45 76 65 6e 74 3b 0d 0a 2f 2f  A OpenEvent;..//
11c80 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
11c90 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
11ca0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41  ndows) export HA
11cb0 4e 44 4c 45 20 43 72 65 61 74 65 53 65 6d 61 70  NDLE CreateSemap
11cc0 68 6f 72 65 41 28 0d 0a 20 20 4c 50 53 45 43 55  horeA(..  LPSECU
11cd0 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53 20  RITY_ATTRIBUTES 
11ce0 6c 70 53 65 6d 61 70 68 6f 72 65 41 74 74 72 69  lpSemaphoreAttri
11cf0 62 75 74 65 73 2c 0d 0a 20 20 4c 4f 4e 47 20 6c  butes,..  LONG l
11d00 49 6e 69 74 69 61 6c 43 6f 75 6e 74 2c 0d 0a 20  InitialCount,.. 
11d10 20 4c 4f 4e 47 20 6c 4d 61 78 69 6d 75 6d 43 6f   LONG lMaximumCo
11d20 75 6e 74 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  unt,..  LPCSTR l
11d30 70 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28  pName);..extern(
11d40 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
11d50 48 41 4e 44 4c 45 20 43 72 65 61 74 65 53 65 6d  HANDLE CreateSem
11d60 61 70 68 6f 72 65 57 28 0d 0a 20 20 4c 50 53 45  aphoreW(..  LPSE
11d70 43 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45  CURITY_ATTRIBUTE
11d80 53 20 6c 70 53 65 6d 61 70 68 6f 72 65 41 74 74  S lpSemaphoreAtt
11d90 72 69 62 75 74 65 73 2c 0d 0a 20 20 4c 4f 4e 47  ributes,..  LONG
11da0 20 6c 49 6e 69 74 69 61 6c 43 6f 75 6e 74 2c 0d   lInitialCount,.
11db0 0a 20 20 4c 4f 4e 47 20 6c 4d 61 78 69 6d 75 6d  .  LONG lMaximum
11dc0 43 6f 75 6e 74 2c 0d 0a 20 20 4c 50 43 57 53 54  Count,..  LPCWST
11dd0 52 20 6c 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23  R lpName);..// #
11de0 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
11df0 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  / #.....// #else
11e00 0d 0a 61 6c 69 61 73 20 43 72 65 61 74 65 53 65  ..alias CreateSe
11e10 6d 61 70 68 6f 72 65 41 20 43 72 65 61 74 65 53  maphoreA CreateS
11e20 65 6d 61 70 68 6f 72 65 3b 0d 0a 2f 2f 20 23 65  emaphore;..// #e
11e30 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
11e40 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
11e50 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c  ws) export HANDL
11e60 45 20 4f 70 65 6e 53 65 6d 61 70 68 6f 72 65 41  E OpenSemaphoreA
11e70 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44 65 73  (..  DWORD dwDes
11e80 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 42  iredAccess,..  B
11e90 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61 6e 64  OOL bInheritHand
11ea0 6c 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  le,..  LPCSTR lp
11eb0 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57  Name);..extern(W
11ec0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48  indows) export H
11ed0 41 4e 44 4c 45 20 4f 70 65 6e 53 65 6d 61 70 68  ANDLE OpenSemaph
11ee0 6f 72 65 57 28 0d 0a 20 20 44 57 4f 52 44 20 64  oreW(..  DWORD d
11ef0 77 44 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d  wDesiredAccess,.
11f00 0a 20 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74  .  BOOL bInherit
11f10 48 61 6e 64 6c 65 2c 0d 0a 20 20 4c 50 43 57 53  Handle,..  LPCWS
11f20 54 52 20 6c 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20  TR lpName);..// 
11f30 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
11f40 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
11f50 65 0d 0a 61 6c 69 61 73 20 4f 70 65 6e 53 65 6d  e..alias OpenSem
11f60 61 70 68 6f 72 65 41 20 4f 70 65 6e 53 65 6d 61  aphoreA OpenSema
11f70 70 68 6f 72 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69  phore;..// #endi
11f80 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
11f90 0a 2f 2f 20 23 69 66 20 28 5f 57 49 4e 33 32 5f  .// #if (_WIN32_
11fa0 57 49 4e 4e 54 20 3e 3d 20 30 78 30 34 30 30 29  WINNT >= 0x0400)
11fb0 20 7c 7c 20 28 5f 57 49 4e 33 32 5f 57 49 4e 44   || (_WIN32_WIND
11fc0 4f 57 53 20 3e 20 30 78 30 34 30 30 29 0d 0a 65  OWS > 0x0400)..e
11fd0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 61  xtern(Windows) a
11fe0 6c 69 61 73 20 56 4f 49 44 20 66 75 6e 63 74 69  lias VOID functi
11ff0 6f 6e 28 20 4c 50 56 4f 49 44 20 6c 70 41 72 67  on( LPVOID lpArg
12000 54 6f 43 6f 6d 70 6c 65 74 69 6f 6e 52 6f 75 74  ToCompletionRout
12010 69 6e 65 2c 20 44 57 4f 52 44 20 64 77 54 69 6d  ine, DWORD dwTim
12020 65 72 4c 6f 77 56 61 6c 75 65 2c 20 44 57 4f 52  erLowValue, DWOR
12030 44 20 64 77 54 69 6d 65 72 48 69 67 68 56 61 6c  D dwTimerHighVal
12040 75 65 20 29 20 50 54 49 4d 45 52 41 50 43 52 4f  ue ) PTIMERAPCRO
12050 55 54 49 4e 45 3b 0d 0a 0d 0a 65 78 74 65 72 6e  UTINE;....extern
12060 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
12070 20 48 41 4e 44 4c 45 20 43 72 65 61 74 65 57 61   HANDLE CreateWa
12080 69 74 61 62 6c 65 54 69 6d 65 72 41 28 0d 0a 20  itableTimerA(.. 
12090 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52   LPSECURITY_ATTR
120a0 49 42 55 54 45 53 20 6c 70 54 69 6d 65 72 41 74  IBUTES lpTimerAt
120b0 74 72 69 62 75 74 65 73 2c 0d 0a 20 20 42 4f 4f  tributes,..  BOO
120c0 4c 20 62 4d 61 6e 75 61 6c 52 65 73 65 74 2c 0d  L bManualReset,.
120d0 0a 20 20 4c 50 43 53 54 52 20 6c 70 54 69 6d 65  .  LPCSTR lpTime
120e0 72 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28  rName);..extern(
120f0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
12100 48 41 4e 44 4c 45 20 43 72 65 61 74 65 57 61 69  HANDLE CreateWai
12110 74 61 62 6c 65 54 69 6d 65 72 57 28 0d 0a 20 20  tableTimerW(..  
12120 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49  LPSECURITY_ATTRI
12130 42 55 54 45 53 20 6c 70 54 69 6d 65 72 41 74 74  BUTES lpTimerAtt
12140 72 69 62 75 74 65 73 2c 0d 0a 20 20 42 4f 4f 4c  ributes,..  BOOL
12150 20 62 4d 61 6e 75 61 6c 52 65 73 65 74 2c 0d 0a   bManualReset,..
12160 20 20 4c 50 43 57 53 54 52 20 6c 70 54 69 6d 65    LPCWSTR lpTime
12170 72 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  rName);..// #ifd
12180 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
12190 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
121a0 6c 69 61 73 20 43 72 65 61 74 65 57 61 69 74 61  lias CreateWaita
121b0 62 6c 65 54 69 6d 65 72 41 20 43 72 65 61 74 65  bleTimerA Create
121c0 57 61 69 74 61 62 6c 65 54 69 6d 65 72 3b 0d 0a  WaitableTimer;..
121d0 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
121e0 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
121f0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
12200 48 41 4e 44 4c 45 20 4f 70 65 6e 57 61 69 74 61  HANDLE OpenWaita
12210 62 6c 65 54 69 6d 65 72 41 28 0d 0a 20 20 44 57  bleTimerA(..  DW
12220 4f 52 44 20 64 77 44 65 73 69 72 65 64 41 63 63  ORD dwDesiredAcc
12230 65 73 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62 49 6e  ess,..  BOOL bIn
12240 68 65 72 69 74 48 61 6e 64 6c 65 2c 0d 0a 20 20  heritHandle,..  
12250 4c 50 43 53 54 52 20 6c 70 54 69 6d 65 72 4e 61  LPCSTR lpTimerNa
12260 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  me);..extern(Win
12270 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
12280 44 4c 45 20 4f 70 65 6e 57 61 69 74 61 62 6c 65  DLE OpenWaitable
12290 54 69 6d 65 72 57 28 0d 0a 20 20 44 57 4f 52 44  TimerW(..  DWORD
122a0 20 64 77 44 65 73 69 72 65 64 41 63 63 65 73 73   dwDesiredAccess
122b0 2c 0d 0a 20 20 42 4f 4f 4c 20 62 49 6e 68 65 72  ,..  BOOL bInher
122c0 69 74 48 61 6e 64 6c 65 2c 0d 0a 20 20 4c 50 43  itHandle,..  LPC
122d0 57 53 54 52 20 6c 70 54 69 6d 65 72 4e 61 6d 65  WSTR lpTimerName
122e0 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
122f0 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
12300 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
12310 4f 70 65 6e 57 61 69 74 61 62 6c 65 54 69 6d 65  OpenWaitableTime
12320 72 41 20 4f 70 65 6e 57 61 69 74 61 62 6c 65 54  rA OpenWaitableT
12330 69 6d 65 72 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  imer;..// #endif
12340 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
12350 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
12360 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 57  export BOOL SetW
12370 61 69 74 61 62 6c 65 54 69 6d 65 72 28 0d 0a 20  aitableTimer(.. 
12380 20 48 41 4e 44 4c 45 20 68 54 69 6d 65 72 2c 0d   HANDLE hTimer,.
12390 0a 20 20 4c 41 52 47 45 5f 49 4e 54 45 47 45 52  .  LARGE_INTEGER
123a0 20 2a 6c 70 44 75 65 54 69 6d 65 2c 0d 0a 20 20   *lpDueTime,..  
123b0 4c 4f 4e 47 20 6c 50 65 72 69 6f 64 2c 0d 0a 20  LONG lPeriod,.. 
123c0 20 50 54 49 4d 45 52 41 50 43 52 4f 55 54 49 4e   PTIMERAPCROUTIN
123d0 45 20 70 66 6e 43 6f 6d 70 6c 65 74 69 6f 6e 52  E pfnCompletionR
123e0 6f 75 74 69 6e 65 2c 0d 0a 20 20 4c 50 56 4f 49  outine,..  LPVOI
123f0 44 20 6c 70 41 72 67 54 6f 43 6f 6d 70 6c 65 74  D lpArgToComplet
12400 69 6f 6e 52 6f 75 74 69 6e 65 2c 0d 0a 20 20 42  ionRoutine,..  B
12410 4f 4f 4c 20 66 52 65 73 75 6d 65 29 3b 0d 0a 0d  OOL fResume);...
12420 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
12430 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43 61 6e   export BOOL Can
12440 63 65 6c 57 61 69 74 61 62 6c 65 54 69 6d 65 72  celWaitableTimer
12450 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 54 69 6d  (..  HANDLE hTim
12460 65 72 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  er);..// #endif 
12470 2f 2a 20 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54  /* (_WIN32_WINNT
12480 20 3e 3d 20 30 78 30 34 30 30 29 20 7c 7c 20 28   >= 0x0400) || (
12490 5f 57 49 4e 33 32 5f 57 49 4e 44 4f 57 53 20 3e  _WIN32_WINDOWS >
124a0 20 30 78 30 34 30 30 29 20 2a 2f 0d 0a 0d 0a 65   0x0400) */....e
124b0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
124c0 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 43 72 65  xport HANDLE Cre
124d0 61 74 65 46 69 6c 65 4d 61 70 70 69 6e 67 41 28  ateFileMappingA(
124e0 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65  ..  HANDLE hFile
124f0 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f  ,..  LPSECURITY_
12500 41 54 54 52 49 42 55 54 45 53 20 6c 70 46 69 6c  ATTRIBUTES lpFil
12510 65 4d 61 70 70 69 6e 67 41 74 74 72 69 62 75 74  eMappingAttribut
12520 65 73 2c 0d 0a 20 20 44 57 4f 52 44 20 66 6c 50  es,..  DWORD flP
12530 72 6f 74 65 63 74 2c 0d 0a 20 20 44 57 4f 52 44  rotect,..  DWORD
12540 20 64 77 4d 61 78 69 6d 75 6d 53 69 7a 65 48 69   dwMaximumSizeHi
12550 67 68 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 4d  gh,..  DWORD dwM
12560 61 78 69 6d 75 6d 53 69 7a 65 4c 6f 77 2c 0d 0a  aximumSizeLow,..
12570 20 20 4c 50 43 53 54 52 20 6c 70 4e 61 6d 65 29    LPCSTR lpName)
12580 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
12590 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45  s) export HANDLE
125a0 20 43 72 65 61 74 65 46 69 6c 65 4d 61 70 70 69   CreateFileMappi
125b0 6e 67 57 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  ngW(..  HANDLE h
125c0 46 69 6c 65 2c 0d 0a 20 20 4c 50 53 45 43 55 52  File,..  LPSECUR
125d0 49 54 59 5f 41 54 54 52 49 42 55 54 45 53 20 6c  ITY_ATTRIBUTES l
125e0 70 46 69 6c 65 4d 61 70 70 69 6e 67 41 74 74 72  pFileMappingAttr
125f0 69 62 75 74 65 73 2c 0d 0a 20 20 44 57 4f 52 44  ibutes,..  DWORD
12600 20 66 6c 50 72 6f 74 65 63 74 2c 0d 0a 20 20 44   flProtect,..  D
12610 57 4f 52 44 20 64 77 4d 61 78 69 6d 75 6d 53 69  WORD dwMaximumSi
12620 7a 65 48 69 67 68 2c 0d 0a 20 20 44 57 4f 52 44  zeHigh,..  DWORD
12630 20 64 77 4d 61 78 69 6d 75 6d 53 69 7a 65 4c 6f   dwMaximumSizeLo
12640 77 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  w,..  LPCWSTR lp
12650 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  Name);..// #ifde
12660 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e  f UNICODE..// #.
12670 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c  ....// #else..al
12680 69 61 73 20 43 72 65 61 74 65 46 69 6c 65 4d 61  ias CreateFileMa
12690 70 70 69 6e 67 41 20 43 72 65 61 74 65 46 69 6c  ppingA CreateFil
126a0 65 4d 61 70 70 69 6e 67 3b 0d 0a 2f 2f 20 23 65  eMapping;..// #e
126b0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
126c0 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
126d0 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c  ws) export HANDL
126e0 45 20 4f 70 65 6e 46 69 6c 65 4d 61 70 70 69 6e  E OpenFileMappin
126f0 67 41 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44  gA(..  DWORD dwD
12700 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20  esiredAccess,.. 
12710 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61   BOOL bInheritHa
12720 6e 64 6c 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20  ndle,..  LPCSTR 
12730 6c 70 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e  lpName);..extern
12740 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
12750 20 48 41 4e 44 4c 45 20 4f 70 65 6e 46 69 6c 65   HANDLE OpenFile
12760 4d 61 70 70 69 6e 67 57 28 0d 0a 20 20 44 57 4f  MappingW(..  DWO
12770 52 44 20 64 77 44 65 73 69 72 65 64 41 63 63 65  RD dwDesiredAcce
12780 73 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62 49 6e 68  ss,..  BOOL bInh
12790 65 72 69 74 48 61 6e 64 6c 65 2c 0d 0a 20 20 4c  eritHandle,..  L
127a0 50 43 57 53 54 52 20 6c 70 4e 61 6d 65 29 3b 0d  PCWSTR lpName);.
127b0 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
127c0 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
127d0 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 4f 70 65  #else..alias Ope
127e0 6e 46 69 6c 65 4d 61 70 70 69 6e 67 41 20 4f 70  nFileMappingA Op
127f0 65 6e 46 69 6c 65 4d 61 70 70 69 6e 67 3b 0d 0a  enFileMapping;..
12800 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
12810 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
12820 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
12830 44 57 4f 52 44 20 47 65 74 4c 6f 67 69 63 61 6c  DWORD GetLogical
12840 44 72 69 76 65 53 74 72 69 6e 67 73 41 28 0d 0a  DriveStringsA(..
12850 20 20 44 57 4f 52 44 20 6e 42 75 66 66 65 72 4c    DWORD nBufferL
12860 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 53 54 52 20  ength,..  LPSTR 
12870 6c 70 42 75 66 66 65 72 29 3b 0d 0a 65 78 74 65  lpBuffer);..exte
12880 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
12890 72 74 20 44 57 4f 52 44 20 47 65 74 4c 6f 67 69  rt DWORD GetLogi
128a0 63 61 6c 44 72 69 76 65 53 74 72 69 6e 67 73 57  calDriveStringsW
128b0 28 0d 0a 20 20 44 57 4f 52 44 20 6e 42 75 66 66  (..  DWORD nBuff
128c0 65 72 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 57  erLength,..  LPW
128d0 53 54 52 20 6c 70 42 75 66 66 65 72 29 3b 0d 0a  STR lpBuffer);..
128e0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
128f0 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
12900 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 4c  else..alias GetL
12910 6f 67 69 63 61 6c 44 72 69 76 65 53 74 72 69 6e  ogicalDriveStrin
12920 67 73 41 20 47 65 74 4c 6f 67 69 63 61 6c 44 72  gsA GetLogicalDr
12930 69 76 65 53 74 72 69 6e 67 73 3b 0d 0a 2f 2f 20  iveStrings;..// 
12940 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
12950 44 45 0d 0a 0d 0a 2f 2f 20 23 69 66 20 5f 57 49  DE....// #if _WI
12960 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30  N32_WINNT >= 0x0
12970 35 30 31 0d 0a 0d 0a 61 6c 69 61 73 20 69 6e 74  501....alias int
12980 20 5f 4d 45 4d 4f 52 59 5f 52 45 53 4f 55 52 43   _MEMORY_RESOURC
12990 45 5f 4e 4f 54 49 46 49 43 41 54 49 4f 4e 5f 54  E_NOTIFICATION_T
129a0 59 50 45 3b 0d 0a 65 6e 75 6d 20 7b 0d 0a 20 20  YPE;..enum {..  
129b0 4c 6f 77 4d 65 6d 6f 72 79 52 65 73 6f 75 72 63  LowMemoryResourc
129c0 65 4e 6f 74 69 66 69 63 61 74 69 6f 6e 2c 0d 0a  eNotification,..
129d0 20 20 48 69 67 68 4d 65 6d 6f 72 79 52 65 73 6f    HighMemoryReso
129e0 75 72 63 65 4e 6f 74 69 66 69 63 61 74 69 6f 6e  urceNotification
129f0 2c 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 4d 45 4d  ,..}..alias _MEM
12a00 4f 52 59 5f 52 45 53 4f 55 52 43 45 5f 4e 4f 54  ORY_RESOURCE_NOT
12a10 49 46 49 43 41 54 49 4f 4e 5f 54 59 50 45 20 4d  IFICATION_TYPE M
12a20 45 4d 4f 52 59 5f 52 45 53 4f 55 52 43 45 5f 4e  EMORY_RESOURCE_N
12a30 4f 54 49 46 49 43 41 54 49 4f 4e 5f 54 59 50 45  OTIFICATION_TYPE
12a40 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
12a50 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44  ows) export HAND
12a60 4c 45 20 43 72 65 61 74 65 4d 65 6d 6f 72 79 52  LE CreateMemoryR
12a70 65 73 6f 75 72 63 65 4e 6f 74 69 66 69 63 61 74  esourceNotificat
12a80 69 6f 6e 28 0d 0a 20 20 4d 45 4d 4f 52 59 5f 52  ion(..  MEMORY_R
12a90 45 53 4f 55 52 43 45 5f 4e 4f 54 49 46 49 43 41  ESOURCE_NOTIFICA
12aa0 54 49 4f 4e 5f 54 59 50 45 20 4e 6f 74 69 66 69  TION_TYPE Notifi
12ab0 63 61 74 69 6f 6e 54 79 70 65 29 3b 0d 0a 0d 0a  cationType);....
12ac0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
12ad0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 51 75 65 72  export BOOL Quer
12ae0 79 4d 65 6d 6f 72 79 52 65 73 6f 75 72 63 65 4e  yMemoryResourceN
12af0 6f 74 69 66 69 63 61 74 69 6f 6e 28 0d 0a 20 20  otification(..  
12b00 48 41 4e 44 4c 45 20 52 65 73 6f 75 72 63 65 4e  HANDLE ResourceN
12b10 6f 74 69 66 69 63 61 74 69 6f 6e 48 61 6e 64 6c  otificationHandl
12b20 65 2c 0d 0a 20 20 50 42 4f 4f 4c 20 52 65 73 6f  e,..  PBOOL Reso
12b30 75 72 63 65 53 74 61 74 65 29 3b 0d 0a 0d 0a 2f  urceState);..../
12b40 2f 20 23 65 6e 64 69 66 20 2f 2f 20 5f 57 49 4e  / #endif // _WIN
12b50 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35  32_WINNT >= 0x05
12b60 30 31 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  01....extern(Win
12b70 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 4d 4f  dows) export HMO
12b80 44 55 4c 45 20 4c 6f 61 64 4c 69 62 72 61 72 79  DULE LoadLibrary
12b90 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4c  A(..  LPCSTR lpL
12ba0 69 62 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a 65 78  ibFileName);..ex
12bb0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
12bc0 70 6f 72 74 20 48 4d 4f 44 55 4c 45 20 4c 6f 61  port HMODULE Loa
12bd0 64 4c 69 62 72 61 72 79 57 28 0d 0a 20 20 4c 50  dLibraryW(..  LP
12be0 43 57 53 54 52 20 6c 70 4c 69 62 46 69 6c 65 4e  CWSTR lpLibFileN
12bf0 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ame);..// #ifdef
12c00 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
12c10 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
12c20 61 73 20 4c 6f 61 64 4c 69 62 72 61 72 79 41 20  as LoadLibraryA 
12c30 4c 6f 61 64 4c 69 62 72 61 72 79 3b 0d 0a 2f 2f  LoadLibrary;..//
12c40 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
12c50 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
12c60 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 4d  ndows) export HM
12c70 4f 44 55 4c 45 20 4c 6f 61 64 4c 69 62 72 61 72  ODULE LoadLibrar
12c80 79 45 78 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  yExA(..  LPCSTR 
12c90 6c 70 4c 69 62 46 69 6c 65 4e 61 6d 65 2c 0d 0a  lpLibFileName,..
12ca0 20 20 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d    HANDLE hFile,.
12cb0 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73  .  DWORD dwFlags
12cc0 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
12cd0 77 73 29 20 65 78 70 6f 72 74 20 48 4d 4f 44 55  ws) export HMODU
12ce0 4c 45 20 4c 6f 61 64 4c 69 62 72 61 72 79 45 78  LE LoadLibraryEx
12cf0 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  W(..  LPCWSTR lp
12d00 4c 69 62 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20  LibFileName,..  
12d10 48 41 4e 44 4c 45 20 68 46 69 6c 65 2c 0d 0a 20  HANDLE hFile,.. 
12d20 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73 29 3b   DWORD dwFlags);
12d30 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
12d40 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
12d50 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 4c 6f   #else..alias Lo
12d60 61 64 4c 69 62 72 61 72 79 45 78 41 20 4c 6f 61  adLibraryExA Loa
12d70 64 4c 69 62 72 61 72 79 45 78 3b 0d 0a 2f 2f 20  dLibraryEx;..// 
12d80 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
12d90 44 45 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  DE....enum : uin
12da0 74 20 7b 20 44 4f 4e 54 5f 52 45 53 4f 4c 56 45  t { DONT_RESOLVE
12db0 5f 44 4c 4c 5f 52 45 46 45 52 45 4e 43 45 53 20  _DLL_REFERENCES 
12dc0 3d 20 30 78 30 30 30 30 30 30 30 31 20 7d 0d 0a  = 0x00000001 }..
12dd0 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4f  enum : uint { LO
12de0 41 44 5f 4c 49 42 52 41 52 59 5f 41 53 5f 44 41  AD_LIBRARY_AS_DA
12df0 54 41 46 49 4c 45 20 3d 20 30 78 30 30 30 30 30  TAFILE = 0x00000
12e00 30 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  002 }..enum : ui
12e10 6e 74 20 7b 20 4c 4f 41 44 5f 57 49 54 48 5f 41  nt { LOAD_WITH_A
12e20 4c 54 45 52 45 44 5f 53 45 41 52 43 48 5f 50 41  LTERED_SEARCH_PA
12e30 54 48 20 3d 20 30 78 30 30 30 30 30 30 30 38 20  TH = 0x00000008 
12e40 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
12e50 20 4c 4f 41 44 5f 49 47 4e 4f 52 45 5f 43 4f 44   LOAD_IGNORE_COD
12e60 45 5f 41 55 54 48 5a 5f 4c 45 56 45 4c 20 3d 20  E_AUTHZ_LEVEL = 
12e70 30 78 30 30 30 30 30 30 31 30 20 7d 0d 0a 0d 0a  0x00000010 }....
12e80 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
12e90 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74  export DWORD Get
12ea0 4d 6f 64 75 6c 65 46 69 6c 65 4e 61 6d 65 41 28  ModuleFileNameA(
12eb0 0d 0a 20 20 48 4d 4f 44 55 4c 45 20 68 4d 6f 64  ..  HMODULE hMod
12ec0 75 6c 65 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70  ule,..  LPSTR lp
12ed0 46 69 6c 65 6e 61 6d 65 2c 0d 0a 20 20 44 57 4f  Filename,..  DWO
12ee0 52 44 20 6e 53 69 7a 65 29 3b 0d 0a 65 78 74 65  RD nSize);..exte
12ef0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
12f00 72 74 20 44 57 4f 52 44 20 47 65 74 4d 6f 64 75  rt DWORD GetModu
12f10 6c 65 46 69 6c 65 4e 61 6d 65 57 28 0d 0a 20 20  leFileNameW(..  
12f20 48 4d 4f 44 55 4c 45 20 68 4d 6f 64 75 6c 65 2c  HMODULE hModule,
12f30 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 46 69 6c  ..  LPWSTR lpFil
12f40 65 6e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20  ename,..  DWORD 
12f50 6e 53 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  nSize);..// #ifd
12f60 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
12f70 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
12f80 6c 69 61 73 20 47 65 74 4d 6f 64 75 6c 65 46 69  lias GetModuleFi
12f90 6c 65 4e 61 6d 65 41 20 47 65 74 4d 6f 64 75 6c  leNameA GetModul
12fa0 65 46 69 6c 65 4e 61 6d 65 3b 0d 0a 2f 2f 20 23  eFileName;..// #
12fb0 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
12fc0 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
12fd0 6f 77 73 29 20 65 78 70 6f 72 74 20 48 4d 4f 44  ows) export HMOD
12fe0 55 4c 45 20 47 65 74 4d 6f 64 75 6c 65 48 61 6e  ULE GetModuleHan
12ff0 64 6c 65 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  dleA(..  LPCSTR 
13000 6c 70 4d 6f 64 75 6c 65 4e 61 6d 65 29 3b 0d 0a  lpModuleName);..
13010 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
13020 65 78 70 6f 72 74 20 48 4d 4f 44 55 4c 45 20 47  export HMODULE G
13030 65 74 4d 6f 64 75 6c 65 48 61 6e 64 6c 65 57 28  etModuleHandleW(
13040 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 4d 6f  ..  LPCWSTR lpMo
13050 64 75 6c 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23  duleName);..// #
13060 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
13070 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  / #.....// #else
13080 0d 0a 61 6c 69 61 73 20 47 65 74 4d 6f 64 75 6c  ..alias GetModul
13090 65 48 61 6e 64 6c 65 41 20 47 65 74 4d 6f 64 75  eHandleA GetModu
130a0 6c 65 48 61 6e 64 6c 65 3b 0d 0a 2f 2f 20 23 65  leHandle;..// #e
130b0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
130c0 0d 0a 0d 0a 2f 2f 20 23 69 66 20 21 64 65 66 69  ....// #if !defi
130d0 6e 65 64 28 52 43 5f 49 4e 56 4f 4b 45 44 29 0d  ned(RC_INVOKED).
130e0 0a 2f 2f 20 23 69 66 20 5f 57 49 4e 33 32 5f 57  .// #if _WIN32_W
130f0 49 4e 4e 54 20 3e 20 30 78 30 35 30 30 20 7c 7c  INNT > 0x0500 ||
13100 20 64 65 66 69 6e 65 64 28 57 49 4e 42 41 53 45   defined(WINBASE
13110 5f 44 45 43 4c 41 52 45 5f 47 45 54 5f 4d 4f 44  _DECLARE_GET_MOD
13120 55 4c 45 5f 48 41 4e 44 4c 45 5f 45 58 29 20 7c  ULE_HANDLE_EX) |
13130 7c 20 49 53 4f 4c 41 54 49 4f 4e 5f 41 57 41 52  | ISOLATION_AWAR
13140 45 5f 45 4e 41 42 4c 45 44 0d 0a 0d 0a 65 6e 75  E_ENABLED....enu
13150 6d 20 3a 20 75 69 6e 74 20 7b 20 47 45 54 5f 4d  m : uint { GET_M
13160 4f 44 55 4c 45 5f 48 41 4e 44 4c 45 5f 45 58 5f  ODULE_HANDLE_EX_
13170 46 4c 41 47 5f 50 49 4e 20 3d 20 30 78 30 30 30  FLAG_PIN = 0x000
13180 30 30 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20  00001 }..enum : 
13190 75 69 6e 74 20 7b 20 47 45 54 5f 4d 4f 44 55 4c  uint { GET_MODUL
131a0 45 5f 48 41 4e 44 4c 45 5f 45 58 5f 46 4c 41 47  E_HANDLE_EX_FLAG
131b0 5f 55 4e 43 48 41 4e 47 45 44 5f 52 45 46 43 4f  _UNCHANGED_REFCO
131c0 55 4e 54 20 3d 20 30 78 30 30 30 30 30 30 30 32  UNT = 0x00000002
131d0 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
131e0 7b 20 47 45 54 5f 4d 4f 44 55 4c 45 5f 48 41 4e  { GET_MODULE_HAN
131f0 44 4c 45 5f 45 58 5f 46 4c 41 47 5f 46 52 4f 4d  DLE_EX_FLAG_FROM
13200 5f 41 44 44 52 45 53 53 20 3d 20 30 78 30 30 30  _ADDRESS = 0x000
13210 30 30 30 30 34 20 7d 0d 0a 0d 0a 65 78 74 65 72  00004 }....exter
13220 6e 28 57 69 6e 64 6f 77 73 29 20 61 6c 69 61 73  n(Windows) alias
13230 20 42 4f 4f 4c 20 66 75 6e 63 74 69 6f 6e 28 20   BOOL function( 
13240 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73 2c 20   DWORD dwFlags, 
13250 20 4c 50 43 53 54 52 20 6c 70 4d 6f 64 75 6c 65   LPCSTR lpModule
13260 4e 61 6d 65 2c 20 20 48 4d 4f 44 55 4c 45 2a 20  Name,  HMODULE* 
13270 70 68 4d 6f 64 75 6c 65 20 29 20 50 47 45 54 5f  phModule ) PGET_
13280 4d 4f 44 55 4c 45 5f 48 41 4e 44 4c 45 5f 45 58  MODULE_HANDLE_EX
13290 41 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  A;..extern(Windo
132a0 77 73 29 20 61 6c 69 61 73 20 42 4f 4f 4c 20 66  ws) alias BOOL f
132b0 75 6e 63 74 69 6f 6e 28 20 20 44 57 4f 52 44 20  unction(  DWORD 
132c0 64 77 46 6c 61 67 73 2c 20 20 4c 50 43 57 53 54  dwFlags,  LPCWST
132d0 52 20 6c 70 4d 6f 64 75 6c 65 4e 61 6d 65 2c 20  R lpModuleName, 
132e0 20 48 4d 4f 44 55 4c 45 2a 20 70 68 4d 6f 64 75   HMODULE* phModu
132f0 6c 65 20 29 20 50 47 45 54 5f 4d 4f 44 55 4c 45  le ) PGET_MODULE
13300 5f 48 41 4e 44 4c 45 5f 45 58 57 3b 0d 0a 2f 2f  _HANDLE_EXW;..//
13310 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
13320 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
13330 73 65 0d 0a 61 6c 69 61 73 20 50 47 45 54 5f 4d  se..alias PGET_M
13340 4f 44 55 4c 45 5f 48 41 4e 44 4c 45 5f 45 58 41  ODULE_HANDLE_EXA
13350 20 50 47 45 54 5f 4d 4f 44 55 4c 45 5f 48 41 4e   PGET_MODULE_HAN
13360 44 4c 45 5f 45 58 3b 0d 0a 2f 2f 20 23 65 6e 64  DLE_EX;..// #end
13370 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
13380 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
13390 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65  ) export BOOL Ge
133a0 74 4d 6f 64 75 6c 65 48 61 6e 64 6c 65 45 78 41  tModuleHandleExA
133b0 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61  (..  DWORD dwFla
133c0 67 73 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  gs,..  LPCSTR lp
133d0 4d 6f 64 75 6c 65 4e 61 6d 65 2c 0d 0a 20 20 48  ModuleName,..  H
133e0 4d 4f 44 55 4c 45 2a 20 70 68 4d 6f 64 75 6c 65  MODULE* phModule
133f0 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
13400 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
13410 47 65 74 4d 6f 64 75 6c 65 48 61 6e 64 6c 65 45  GetModuleHandleE
13420 78 57 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 46  xW(..  DWORD dwF
13430 6c 61 67 73 2c 0d 0a 20 20 4c 50 43 57 53 54 52  lags,..  LPCWSTR
13440 20 6c 70 4d 6f 64 75 6c 65 4e 61 6d 65 2c 0d 0a   lpModuleName,..
13450 20 20 48 4d 4f 44 55 4c 45 2a 20 70 68 4d 6f 64    HMODULE* phMod
13460 75 6c 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ule);..// #ifdef
13470 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
13480 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
13490 61 73 20 47 65 74 4d 6f 64 75 6c 65 48 61 6e 64  as GetModuleHand
134a0 6c 65 45 78 41 20 47 65 74 4d 6f 64 75 6c 65 48  leExA GetModuleH
134b0 61 6e 64 6c 65 45 78 3b 0d 0a 2f 2f 20 23 65 6e  andleEx;..// #en
134c0 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
134d0 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 2f 2f  ...// #endif..//
134e0 20 23 65 6e 64 69 66 0d 0a 0d 0a 65 78 74 65 72   #endif....exter
134f0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
13500 74 20 42 4f 4f 4c 20 43 72 65 61 74 65 50 72 6f  t BOOL CreatePro
13510 63 65 73 73 41 28 0d 0a 20 20 4c 50 43 53 54 52  cessA(..  LPCSTR
13520 20 6c 70 41 70 70 6c 69 63 61 74 69 6f 6e 4e 61   lpApplicationNa
13530 6d 65 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 43  me,..  LPSTR lpC
13540 6f 6d 6d 61 6e 64 4c 69 6e 65 2c 0d 0a 20 20 4c  ommandLine,..  L
13550 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49 42  PSECURITY_ATTRIB
13560 55 54 45 53 20 6c 70 50 72 6f 63 65 73 73 41 74  UTES lpProcessAt
13570 74 72 69 62 75 74 65 73 2c 0d 0a 20 20 4c 50 53  tributes,..  LPS
13580 45 43 55 52 49 54 59 5f 41 54 54 52 49 42 55 54  ECURITY_ATTRIBUT
13590 45 53 20 6c 70 54 68 72 65 61 64 41 74 74 72 69  ES lpThreadAttri
135a0 62 75 74 65 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62  butes,..  BOOL b
135b0 49 6e 68 65 72 69 74 48 61 6e 64 6c 65 73 2c 0d  InheritHandles,.
135c0 0a 20 20 44 57 4f 52 44 20 64 77 43 72 65 61 74  .  DWORD dwCreat
135d0 69 6f 6e 46 6c 61 67 73 2c 0d 0a 20 20 4c 50 56  ionFlags,..  LPV
135e0 4f 49 44 20 6c 70 45 6e 76 69 72 6f 6e 6d 65 6e  OID lpEnvironmen
135f0 74 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 43  t,..  LPCSTR lpC
13600 75 72 72 65 6e 74 44 69 72 65 63 74 6f 72 79 2c  urrentDirectory,
13610 0d 0a 20 20 4c 50 53 54 41 52 54 55 50 49 4e 46  ..  LPSTARTUPINF
13620 4f 41 20 6c 70 53 74 61 72 74 75 70 49 6e 66 6f  OA lpStartupInfo
13630 2c 0d 0a 20 20 4c 50 50 52 4f 43 45 53 53 5f 49  ,..  LPPROCESS_I
13640 4e 46 4f 52 4d 41 54 49 4f 4e 20 6c 70 50 72 6f  NFORMATION lpPro
13650 63 65 73 73 49 6e 66 6f 72 6d 61 74 69 6f 6e 29  cessInformation)
13660 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
13670 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43  s) export BOOL C
13680 72 65 61 74 65 50 72 6f 63 65 73 73 57 28 0d 0a  reateProcessW(..
13690 20 20 4c 50 43 57 53 54 52 20 6c 70 41 70 70 6c    LPCWSTR lpAppl
136a0 69 63 61 74 69 6f 6e 4e 61 6d 65 2c 0d 0a 20 20  icationName,..  
136b0 4c 50 57 53 54 52 20 6c 70 43 6f 6d 6d 61 6e 64  LPWSTR lpCommand
136c0 4c 69 6e 65 2c 0d 0a 20 20 4c 50 53 45 43 55 52  Line,..  LPSECUR
136d0 49 54 59 5f 41 54 54 52 49 42 55 54 45 53 20 6c  ITY_ATTRIBUTES l
136e0 70 50 72 6f 63 65 73 73 41 74 74 72 69 62 75 74  pProcessAttribut
136f0 65 73 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54  es,..  LPSECURIT
13700 59 5f 41 54 54 52 49 42 55 54 45 53 20 6c 70 54  Y_ATTRIBUTES lpT
13710 68 72 65 61 64 41 74 74 72 69 62 75 74 65 73 2c  hreadAttributes,
13720 0d 0a 20 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69  ..  BOOL bInheri
13730 74 48 61 6e 64 6c 65 73 2c 0d 0a 20 20 44 57 4f  tHandles,..  DWO
13740 52 44 20 64 77 43 72 65 61 74 69 6f 6e 46 6c 61  RD dwCreationFla
13750 67 73 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70  gs,..  LPVOID lp
13760 45 6e 76 69 72 6f 6e 6d 65 6e 74 2c 0d 0a 20 20  Environment,..  
13770 4c 50 43 57 53 54 52 20 6c 70 43 75 72 72 65 6e  LPCWSTR lpCurren
13780 74 44 69 72 65 63 74 6f 72 79 2c 0d 0a 20 20 4c  tDirectory,..  L
13790 50 53 54 41 52 54 55 50 49 4e 46 4f 57 20 6c 70  PSTARTUPINFOW lp
137a0 53 74 61 72 74 75 70 49 6e 66 6f 2c 0d 0a 20 20  StartupInfo,..  
137b0 4c 50 50 52 4f 43 45 53 53 5f 49 4e 46 4f 52 4d  LPPROCESS_INFORM
137c0 41 54 49 4f 4e 20 6c 70 50 72 6f 63 65 73 73 49  ATION lpProcessI
137d0 6e 66 6f 72 6d 61 74 69 6f 6e 29 3b 0d 0a 2f 2f  nformation);..//
137e0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
137f0 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
13800 73 65 0d 0a 61 6c 69 61 73 20 43 72 65 61 74 65  se..alias Create
13810 50 72 6f 63 65 73 73 41 20 43 72 65 61 74 65 50  ProcessA CreateP
13820 72 6f 63 65 73 73 3b 0d 0a 2f 2f 20 23 65 6e 64  rocess;..// #end
13830 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
13840 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
13850 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
13860 74 50 72 6f 63 65 73 73 53 68 75 74 64 6f 77 6e  tProcessShutdown
13870 50 61 72 61 6d 65 74 65 72 73 28 0d 0a 20 20 44  Parameters(..  D
13880 57 4f 52 44 20 64 77 4c 65 76 65 6c 2c 0d 0a 20  WORD dwLevel,.. 
13890 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73 29 3b   DWORD dwFlags);
138a0 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
138b0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
138c0 47 65 74 50 72 6f 63 65 73 73 53 68 75 74 64 6f  GetProcessShutdo
138d0 77 6e 50 61 72 61 6d 65 74 65 72 73 28 0d 0a 20  wnParameters(.. 
138e0 20 4c 50 44 57 4f 52 44 20 6c 70 64 77 4c 65 76   LPDWORD lpdwLev
138f0 65 6c 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  el,..  LPDWORD l
13900 70 64 77 46 6c 61 67 73 29 3b 0d 0a 0d 0a 65 78  pdwFlags);....ex
13910 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
13920 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74 50 72  port DWORD GetPr
13930 6f 63 65 73 73 56 65 72 73 69 6f 6e 28 0d 0a 20  ocessVersion(.. 
13940 20 44 57 4f 52 44 20 50 72 6f 63 65 73 73 49 64   DWORD ProcessId
13950 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
13960 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f 49  dows) export VOI
13970 44 20 46 61 74 61 6c 41 70 70 45 78 69 74 41 28  D FatalAppExitA(
13980 0d 0a 20 20 55 49 4e 54 20 75 41 63 74 69 6f 6e  ..  UINT uAction
13990 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4d 65  ,..  LPCSTR lpMe
139a0 73 73 61 67 65 54 65 78 74 29 3b 0d 0a 65 78 74  ssageText);..ext
139b0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
139c0 6f 72 74 20 56 4f 49 44 20 46 61 74 61 6c 41 70  ort VOID FatalAp
139d0 70 45 78 69 74 57 28 0d 0a 20 20 55 49 4e 54 20  pExitW(..  UINT 
139e0 75 41 63 74 69 6f 6e 2c 0d 0a 20 20 4c 50 43 57  uAction,..  LPCW
139f0 53 54 52 20 6c 70 4d 65 73 73 61 67 65 54 65 78  STR lpMessageTex
13a00 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  t);..// #ifdef U
13a10 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
13a20 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
13a30 20 46 61 74 61 6c 41 70 70 45 78 69 74 41 20 46   FatalAppExitA F
13a40 61 74 61 6c 41 70 70 45 78 69 74 3b 0d 0a 2f 2f  atalAppExit;..//
13a50 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
13a60 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
13a70 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f  ndows) export VO
13a80 49 44 20 47 65 74 53 74 61 72 74 75 70 49 6e 66  ID GetStartupInf
13a90 6f 41 28 0d 0a 20 20 4c 50 53 54 41 52 54 55 50  oA(..  LPSTARTUP
13aa0 49 4e 46 4f 41 20 6c 70 53 74 61 72 74 75 70 49  INFOA lpStartupI
13ab0 6e 66 6f 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  nfo);..extern(Wi
13ac0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 56 4f  ndows) export VO
13ad0 49 44 20 47 65 74 53 74 61 72 74 75 70 49 6e 66  ID GetStartupInf
13ae0 6f 57 28 0d 0a 20 20 4c 50 53 54 41 52 54 55 50  oW(..  LPSTARTUP
13af0 49 4e 46 4f 57 20 6c 70 53 74 61 72 74 75 70 49  INFOW lpStartupI
13b00 6e 66 6f 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  nfo);..// #ifdef
13b10 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
13b20 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
13b30 61 73 20 47 65 74 53 74 61 72 74 75 70 49 6e 66  as GetStartupInf
13b40 6f 41 20 47 65 74 53 74 61 72 74 75 70 49 6e 66  oA GetStartupInf
13b50 6f 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  o;..// #endif //
13b60 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
13b70 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
13b80 6f 72 74 20 4c 50 53 54 52 20 47 65 74 43 6f 6d  ort LPSTR GetCom
13b90 6d 61 6e 64 4c 69 6e 65 41 28 29 3b 0d 0a 65 78  mandLineA();..ex
13ba0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
13bb0 70 6f 72 74 20 4c 50 57 53 54 52 20 47 65 74 43  port LPWSTR GetC
13bc0 6f 6d 6d 61 6e 64 4c 69 6e 65 57 28 29 3b 0d 0a  ommandLineW();..
13bd0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
13be0 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
13bf0 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 43  else..alias GetC
13c00 6f 6d 6d 61 6e 64 4c 69 6e 65 41 20 47 65 74 43  ommandLineA GetC
13c10 6f 6d 6d 61 6e 64 4c 69 6e 65 3b 0d 0a 2f 2f 20  ommandLine;..// 
13c20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
13c30 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
13c40 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f  dows) export DWO
13c50 52 44 20 47 65 74 45 6e 76 69 72 6f 6e 6d 65 6e  RD GetEnvironmen
13c60 74 56 61 72 69 61 62 6c 65 41 28 0d 0a 20 20 4c  tVariableA(..  L
13c70 50 43 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20  PCSTR lpName,.. 
13c80 20 4c 50 53 54 52 20 6c 70 42 75 66 66 65 72 2c   LPSTR lpBuffer,
13c90 0d 0a 20 20 44 57 4f 52 44 20 6e 53 69 7a 65 29  ..  DWORD nSize)
13ca0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
13cb0 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
13cc0 47 65 74 45 6e 76 69 72 6f 6e 6d 65 6e 74 56 61  GetEnvironmentVa
13cd0 72 69 61 62 6c 65 57 28 0d 0a 20 20 4c 50 43 57  riableW(..  LPCW
13ce0 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 4c  STR lpName,..  L
13cf0 50 57 53 54 52 20 6c 70 42 75 66 66 65 72 2c 0d  PWSTR lpBuffer,.
13d00 0a 20 20 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b  .  DWORD nSize);
13d10 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
13d20 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
13d30 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65   #else..alias Ge
13d40 74 45 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72 69  tEnvironmentVari
13d50 61 62 6c 65 41 20 47 65 74 45 6e 76 69 72 6f 6e  ableA GetEnviron
13d60 6d 65 6e 74 56 61 72 69 61 62 6c 65 3b 0d 0a 2f  mentVariable;../
13d70 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
13d80 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
13d90 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
13da0 4f 4f 4c 20 53 65 74 45 6e 76 69 72 6f 6e 6d 65  OOL SetEnvironme
13db0 6e 74 56 61 72 69 61 62 6c 65 41 28 0d 0a 20 20  ntVariableA(..  
13dc0 4c 50 43 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a  LPCSTR lpName,..
13dd0 20 20 4c 50 43 53 54 52 20 6c 70 56 61 6c 75 65    LPCSTR lpValue
13de0 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
13df0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
13e00 53 65 74 45 6e 76 69 72 6f 6e 6d 65 6e 74 56 61  SetEnvironmentVa
13e10 72 69 61 62 6c 65 57 28 0d 0a 20 20 4c 50 43 57  riableW(..  LPCW
13e20 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 4c  STR lpName,..  L
13e30 50 43 57 53 54 52 20 6c 70 56 61 6c 75 65 29 3b  PCWSTR lpValue);
13e40 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
13e50 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
13e60 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 53 65   #else..alias Se
13e70 74 45 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72 69  tEnvironmentVari
13e80 61 62 6c 65 41 20 53 65 74 45 6e 76 69 72 6f 6e  ableA SetEnviron
13e90 6d 65 6e 74 56 61 72 69 61 62 6c 65 3b 0d 0a 2f  mentVariable;../
13ea0 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
13eb0 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
13ec0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44  indows) export D
13ed0 57 4f 52 44 20 45 78 70 61 6e 64 45 6e 76 69 72  WORD ExpandEnvir
13ee0 6f 6e 6d 65 6e 74 53 74 72 69 6e 67 73 41 28 0d  onmentStringsA(.
13ef0 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 72 63 2c  .  LPCSTR lpSrc,
13f00 0d 0a 20 20 4c 50 53 54 52 20 6c 70 44 73 74 2c  ..  LPSTR lpDst,
13f10 0d 0a 20 20 44 57 4f 52 44 20 6e 53 69 7a 65 29  ..  DWORD nSize)
13f20 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
13f30 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
13f40 45 78 70 61 6e 64 45 6e 76 69 72 6f 6e 6d 65 6e  ExpandEnvironmen
13f50 74 53 74 72 69 6e 67 73 57 28 0d 0a 20 20 4c 50  tStringsW(..  LP
13f60 43 57 53 54 52 20 6c 70 53 72 63 2c 0d 0a 20 20  CWSTR lpSrc,..  
13f70 4c 50 57 53 54 52 20 6c 70 44 73 74 2c 0d 0a 20  LPWSTR lpDst,.. 
13f80 20 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b 0d 0a   DWORD nSize);..
13f90 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
13fa0 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
13fb0 65 6c 73 65 0d 0a 61 6c 69 61 73 20 45 78 70 61  else..alias Expa
13fc0 6e 64 45 6e 76 69 72 6f 6e 6d 65 6e 74 53 74 72  ndEnvironmentStr
13fd0 69 6e 67 73 41 20 45 78 70 61 6e 64 45 6e 76 69  ingsA ExpandEnvi
13fe0 72 6f 6e 6d 65 6e 74 53 74 72 69 6e 67 73 3b 0d  ronmentStrings;.
13ff0 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
14000 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
14010 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
14020 20 44 57 4f 52 44 20 47 65 74 46 69 72 6d 77 61   DWORD GetFirmwa
14030 72 65 45 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72  reEnvironmentVar
14040 69 61 62 6c 65 41 28 0d 0a 20 20 4c 50 43 53 54  iableA(..  LPCST
14050 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  R lpName,..  LPC
14060 53 54 52 20 6c 70 47 75 69 64 2c 0d 0a 20 20 50  STR lpGuid,..  P
14070 56 4f 49 44 20 70 42 75 66 66 65 72 2c 0d 0a 20  VOID pBuffer,.. 
14080 20 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b 0d 0a   DWORD nSize);..
14090 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
140a0 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74  export DWORD Get
140b0 46 69 72 6d 77 61 72 65 45 6e 76 69 72 6f 6e 6d  FirmwareEnvironm
140c0 65 6e 74 56 61 72 69 61 62 6c 65 57 28 0d 0a 20  entVariableW(.. 
140d0 20 4c 50 43 57 53 54 52 20 6c 70 4e 61 6d 65 2c   LPCWSTR lpName,
140e0 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 47 75  ..  LPCWSTR lpGu
140f0 69 64 2c 0d 0a 20 20 50 56 4f 49 44 20 70 42 75  id,..  PVOID pBu
14100 66 66 65 72 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  ffer,..  DWORD n
14110 53 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  Size);..// #ifde
14120 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e  f UNICODE..// #.
14130 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c  ....// #else..al
14140 69 61 73 20 47 65 74 46 69 72 6d 77 61 72 65 45  ias GetFirmwareE
14150 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72 69 61 62  nvironmentVariab
14160 6c 65 41 20 47 65 74 46 69 72 6d 77 61 72 65 45  leA GetFirmwareE
14170 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72 69 61 62  nvironmentVariab
14180 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  le;..// #endif /
14190 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
141a0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
141b0 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 46 69 72  port BOOL SetFir
141c0 6d 77 61 72 65 45 6e 76 69 72 6f 6e 6d 65 6e 74  mwareEnvironment
141d0 56 61 72 69 61 62 6c 65 41 28 0d 0a 20 20 4c 50  VariableA(..  LP
141e0 43 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20  CSTR lpName,..  
141f0 4c 50 43 53 54 52 20 6c 70 47 75 69 64 2c 0d 0a  LPCSTR lpGuid,..
14200 20 20 50 56 4f 49 44 20 70 56 61 6c 75 65 2c 0d    PVOID pValue,.
14210 0a 20 20 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b  .  DWORD nSize);
14220 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
14230 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
14240 74 46 69 72 6d 77 61 72 65 45 6e 76 69 72 6f 6e  tFirmwareEnviron
14250 6d 65 6e 74 56 61 72 69 61 62 6c 65 57 28 0d 0a  mentVariableW(..
14260 20 20 4c 50 43 57 53 54 52 20 6c 70 4e 61 6d 65    LPCWSTR lpName
14270 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 47  ,..  LPCWSTR lpG
14280 75 69 64 2c 0d 0a 20 20 50 56 4f 49 44 20 70 56  uid,..  PVOID pV
14290 61 6c 75 65 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  alue,..  DWORD n
142a0 53 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  Size);..// #ifde
142b0 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e  f UNICODE..// #.
142c0 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c  ....// #else..al
142d0 69 61 73 20 53 65 74 46 69 72 6d 77 61 72 65 45  ias SetFirmwareE
142e0 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72 69 61 62  nvironmentVariab
142f0 6c 65 41 20 53 65 74 46 69 72 6d 77 61 72 65 45  leA SetFirmwareE
14300 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72 69 61 62  nvironmentVariab
14310 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  le;..// #endif /
14320 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
14330 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
14340 70 6f 72 74 20 56 4f 49 44 20 4f 75 74 70 75 74  port VOID Output
14350 44 65 62 75 67 53 74 72 69 6e 67 41 28 0d 0a 20  DebugStringA(.. 
14360 20 4c 50 43 53 54 52 20 6c 70 4f 75 74 70 75 74   LPCSTR lpOutput
14370 53 74 72 69 6e 67 29 3b 0d 0a 65 78 74 65 72 6e  String);..extern
14380 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
14390 20 56 4f 49 44 20 4f 75 74 70 75 74 44 65 62 75   VOID OutputDebu
143a0 67 53 74 72 69 6e 67 57 28 0d 0a 20 20 4c 50 43  gStringW(..  LPC
143b0 57 53 54 52 20 6c 70 4f 75 74 70 75 74 53 74 72  WSTR lpOutputStr
143c0 69 6e 67 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ing);..// #ifdef
143d0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
143e0 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
143f0 61 73 20 4f 75 74 70 75 74 44 65 62 75 67 53 74  as OutputDebugSt
14400 72 69 6e 67 41 20 4f 75 74 70 75 74 44 65 62 75  ringA OutputDebu
14410 67 53 74 72 69 6e 67 3b 0d 0a 2f 2f 20 23 65 6e  gString;..// #en
14420 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
14430 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
14440 73 29 20 65 78 70 6f 72 74 20 48 52 53 52 43 20  s) export HRSRC 
14450 46 69 6e 64 52 65 73 6f 75 72 63 65 41 28 0d 0a  FindResourceA(..
14460 20 20 48 4d 4f 44 55 4c 45 20 68 4d 6f 64 75 6c    HMODULE hModul
14470 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4e  e,..  LPCSTR lpN
14480 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ame,..  LPCSTR l
14490 70 54 79 70 65 29 3b 0d 0a 65 78 74 65 72 6e 28  pType);..extern(
144a0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
144b0 48 52 53 52 43 20 46 69 6e 64 52 65 73 6f 75 72  HRSRC FindResour
144c0 63 65 57 28 0d 0a 20 20 48 4d 4f 44 55 4c 45 20  ceW(..  HMODULE 
144d0 68 4d 6f 64 75 6c 65 2c 0d 0a 20 20 4c 50 43 57  hModule,..  LPCW
144e0 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 4c  STR lpName,..  L
144f0 50 43 57 53 54 52 20 6c 70 54 79 70 65 29 3b 0d  PCWSTR lpType);.
14500 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
14510 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
14520 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46 69 6e  #else..alias Fin
14530 64 52 65 73 6f 75 72 63 65 41 20 46 69 6e 64 52  dResourceA FindR
14540 65 73 6f 75 72 63 65 3b 0d 0a 2f 2f 20 23 65 6e  esource;..// #en
14550 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
14560 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
14570 73 29 20 65 78 70 6f 72 74 20 48 52 53 52 43 20  s) export HRSRC 
14580 46 69 6e 64 52 65 73 6f 75 72 63 65 45 78 41 28  FindResourceExA(
14590 0d 0a 20 20 48 4d 4f 44 55 4c 45 20 68 4d 6f 64  ..  HMODULE hMod
145a0 75 6c 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ule,..  LPCSTR l
145b0 70 54 79 70 65 2c 0d 0a 20 20 4c 50 43 53 54 52  pType,..  LPCSTR
145c0 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 57 4f 52 44   lpName,..  WORD
145d0 20 77 4c 61 6e 67 75 61 67 65 29 3b 0d 0a 65 78   wLanguage);..ex
145e0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
145f0 70 6f 72 74 20 48 52 53 52 43 20 46 69 6e 64 52  port HRSRC FindR
14600 65 73 6f 75 72 63 65 45 78 57 28 0d 0a 20 20 48  esourceExW(..  H
14610 4d 4f 44 55 4c 45 20 68 4d 6f 64 75 6c 65 2c 0d  MODULE hModule,.
14620 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 54 79 70  .  LPCWSTR lpTyp
14630 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  e,..  LPCWSTR lp
14640 4e 61 6d 65 2c 0d 0a 20 20 57 4f 52 44 20 77 4c  Name,..  WORD wL
14650 61 6e 67 75 61 67 65 29 3b 0d 0a 2f 2f 20 23 69  anguage);..// #i
14660 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
14670 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
14680 0a 61 6c 69 61 73 20 46 69 6e 64 52 65 73 6f 75  .alias FindResou
14690 72 63 65 45 78 41 20 46 69 6e 64 52 65 73 6f 75  rceExA FindResou
146a0 72 63 65 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69  rceEx;..// #endi
146b0 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
146c0 0a 2f 2f 20 23 69 66 64 65 66 20 53 54 52 49 43  .// #ifdef STRIC
146d0 54 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  T..extern(Window
146e0 73 29 20 61 6c 69 61 73 20 42 4f 4f 4c 20 66 75  s) alias BOOL fu
146f0 6e 63 74 69 6f 6e 28 48 4d 4f 44 55 4c 45 20 68  nction(HMODULE h
14700 4d 6f 64 75 6c 65 2c 20 4c 50 53 54 52 20 6c 70  Module, LPSTR lp
14710 54 79 70 65 2c 20 4c 4f 4e 47 5f 50 54 52 20 6c  Type, LONG_PTR l
14720 50 61 72 61 6d 29 20 45 4e 55 4d 52 45 53 54 59  Param) ENUMRESTY
14730 50 45 50 52 4f 43 41 3b 0d 0a 65 78 74 65 72 6e  PEPROCA;..extern
14740 28 57 69 6e 64 6f 77 73 29 20 61 6c 69 61 73 20  (Windows) alias 
14750 42 4f 4f 4c 20 66 75 6e 63 74 69 6f 6e 28 48 4d  BOOL function(HM
14760 4f 44 55 4c 45 20 68 4d 6f 64 75 6c 65 2c 20 4c  ODULE hModule, L
14770 50 57 53 54 52 20 6c 70 54 79 70 65 2c 20 4c 4f  PWSTR lpType, LO
14780 4e 47 5f 50 54 52 20 6c 50 61 72 61 6d 29 20 45  NG_PTR lParam) E
14790 4e 55 4d 52 45 53 54 59 50 45 50 52 4f 43 57 3b  NUMRESTYPEPROCW;
147a0 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
147b0 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
147c0 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 45 4e   #else..alias EN
147d0 55 4d 52 45 53 54 59 50 45 50 52 4f 43 41 20 45  UMRESTYPEPROCA E
147e0 4e 55 4d 52 45 53 54 59 50 45 50 52 4f 43 3b 0d  NUMRESTYPEPROC;.
147f0 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
14800 4e 49 43 4f 44 45 0d 0a 65 78 74 65 72 6e 28 57  NICODE..extern(W
14810 69 6e 64 6f 77 73 29 20 61 6c 69 61 73 20 42 4f  indows) alias BO
14820 4f 4c 20 66 75 6e 63 74 69 6f 6e 28 48 4d 4f 44  OL function(HMOD
14830 55 4c 45 20 68 4d 6f 64 75 6c 65 2c 20 4c 50 43  ULE hModule, LPC
14840 53 54 52 20 6c 70 54 79 70 65 2c 20 4c 50 53 54  STR lpType, LPST
14850 52 20 6c 70 4e 61 6d 65 2c 20 4c 4f 4e 47 5f 50  R lpName, LONG_P
14860 54 52 20 6c 50 61 72 61 6d 29 20 45 4e 55 4d 52  TR lParam) ENUMR
14870 45 53 4e 41 4d 45 50 52 4f 43 41 3b 0d 0a 65 78  ESNAMEPROCA;..ex
14880 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 61 6c  tern(Windows) al
14890 69 61 73 20 42 4f 4f 4c 20 66 75 6e 63 74 69 6f  ias BOOL functio
148a0 6e 28 48 4d 4f 44 55 4c 45 20 68 4d 6f 64 75 6c  n(HMODULE hModul
148b0 65 2c 20 4c 50 43 57 53 54 52 20 6c 70 54 79 70  e, LPCWSTR lpTyp
148c0 65 2c 20 4c 50 57 53 54 52 20 6c 70 4e 61 6d 65  e, LPWSTR lpName
148d0 2c 20 4c 4f 4e 47 5f 50 54 52 20 6c 50 61 72 61  , LONG_PTR lPara
148e0 6d 29 20 45 4e 55 4d 52 45 53 4e 41 4d 45 50 52  m) ENUMRESNAMEPR
148f0 4f 43 57 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  OCW;..// #ifdef 
14900 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
14910 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
14920 73 20 45 4e 55 4d 52 45 53 4e 41 4d 45 50 52 4f  s ENUMRESNAMEPRO
14930 43 41 20 45 4e 55 4d 52 45 53 4e 41 4d 45 50 52  CA ENUMRESNAMEPR
14940 4f 43 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  OC;..// #endif /
14950 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 65 78 74 65  / !UNICODE..exte
14960 72 6e 28 57 69 6e 64 6f 77 73 29 20 61 6c 69 61  rn(Windows) alia
14970 73 20 42 4f 4f 4c 20 66 75 6e 63 74 69 6f 6e 28  s BOOL function(
14980 48 4d 4f 44 55 4c 45 20 68 4d 6f 64 75 6c 65 2c  HMODULE hModule,
14990 20 4c 50 43 53 54 52 20 6c 70 54 79 70 65 2c 20   LPCSTR lpType, 
149a0 4c 50 43 53 54 52 20 6c 70 4e 61 6d 65 2c 20 57  LPCSTR lpName, W
149b0 4f 52 44 20 77 4c 61 6e 67 75 61 67 65 2c 20 4c  ORD wLanguage, L
149c0 4f 4e 47 5f 50 54 52 20 6c 50 61 72 61 6d 29 20  ONG_PTR lParam) 
149d0 45 4e 55 4d 52 45 53 4c 41 4e 47 50 52 4f 43 41  ENUMRESLANGPROCA
149e0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
149f0 73 29 20 61 6c 69 61 73 20 42 4f 4f 4c 20 66 75  s) alias BOOL fu
14a00 6e 63 74 69 6f 6e 28 48 4d 4f 44 55 4c 45 20 68  nction(HMODULE h
14a10 4d 6f 64 75 6c 65 2c 20 4c 50 43 57 53 54 52 20  Module, LPCWSTR 
14a20 6c 70 54 79 70 65 2c 20 4c 50 43 57 53 54 52 20  lpType, LPCWSTR 
14a30 6c 70 4e 61 6d 65 2c 20 57 4f 52 44 20 77 4c 61  lpName, WORD wLa
14a40 6e 67 75 61 67 65 2c 20 4c 4f 4e 47 5f 50 54 52  nguage, LONG_PTR
14a50 20 6c 50 61 72 61 6d 29 20 45 4e 55 4d 52 45 53   lParam) ENUMRES
14a60 4c 41 4e 47 50 52 4f 43 57 3b 0d 0a 2f 2f 20 23  LANGPROCW;..// #
14a70 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
14a80 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  / #.....// #else
14a90 0d 0a 61 6c 69 61 73 20 45 4e 55 4d 52 45 53 4c  ..alias ENUMRESL
14aa0 41 4e 47 50 52 4f 43 41 20 45 4e 55 4d 52 45 53  ANGPROCA ENUMRES
14ab0 4c 41 4e 47 50 52 4f 43 3b 0d 0a 2f 2f 20 23 65  LANGPROC;..// #e
14ac0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
14ad0 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20 2e  ..// #else..// .
14ae0 2e 2e 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  ....// #ifdef UN
14af0 49 43 4f 44 45 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f  ICODE..// ...../
14b00 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20 2e 2e 2e 0d  / #else..// ....
14b10 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 55 4e  .// #endif // UN
14b20 49 43 4f 44 45 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f  ICODE..// ...../
14b30 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
14b40 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  ..// .....// #el
14b50 73 65 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23  se..// .....// #
14b60 65 6e 64 69 66 20 2f 2f 20 55 4e 49 43 4f 44 45  endif // UNICODE
14b70 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23 69 66  ..// .....// #if
14b80 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
14b90 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f  .....// #else../
14ba0 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66  / .....// #endif
14bb0 20 2f 2f 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20   // UNICODE..// 
14bc0 23 65 6e 64 69 66 0d 0a 0d 0a 65 78 74 65 72 6e  #endif....extern
14bd0 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
14be0 20 42 4f 4f 4c 20 45 6e 75 6d 52 65 73 6f 75 72   BOOL EnumResour
14bf0 63 65 54 79 70 65 73 41 28 0d 0a 20 20 48 4d 4f  ceTypesA(..  HMO
14c00 44 55 4c 45 20 68 4d 6f 64 75 6c 65 2c 0d 0a 20  DULE hModule,.. 
14c10 20 45 4e 55 4d 52 45 53 54 59 50 45 50 52 4f 43   ENUMRESTYPEPROC
14c20 41 20 6c 70 45 6e 75 6d 46 75 6e 63 2c 0d 0a 20  A lpEnumFunc,.. 
14c30 20 4c 4f 4e 47 5f 50 54 52 20 6c 50 61 72 61 6d   LONG_PTR lParam
14c40 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
14c50 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
14c60 45 6e 75 6d 52 65 73 6f 75 72 63 65 54 79 70 65  EnumResourceType
14c70 73 57 28 0d 0a 20 20 48 4d 4f 44 55 4c 45 20 68  sW(..  HMODULE h
14c80 4d 6f 64 75 6c 65 2c 0d 0a 20 20 45 4e 55 4d 52  Module,..  ENUMR
14c90 45 53 54 59 50 45 50 52 4f 43 57 20 6c 70 45 6e  ESTYPEPROCW lpEn
14ca0 75 6d 46 75 6e 63 2c 0d 0a 20 20 4c 4f 4e 47 5f  umFunc,..  LONG_
14cb0 50 54 52 20 6c 50 61 72 61 6d 29 3b 0d 0a 2f 2f  PTR lParam);..//
14cc0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
14cd0 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
14ce0 73 65 0d 0a 61 6c 69 61 73 20 45 6e 75 6d 52 65  se..alias EnumRe
14cf0 73 6f 75 72 63 65 54 79 70 65 73 41 20 45 6e 75  sourceTypesA Enu
14d00 6d 52 65 73 6f 75 72 63 65 54 79 70 65 73 3b 0d  mResourceTypes;.
14d10 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
14d20 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
14d30 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
14d40 20 42 4f 4f 4c 20 45 6e 75 6d 52 65 73 6f 75 72   BOOL EnumResour
14d50 63 65 4e 61 6d 65 73 41 28 0d 0a 20 20 48 4d 4f  ceNamesA(..  HMO
14d60 44 55 4c 45 20 68 4d 6f 64 75 6c 65 2c 0d 0a 20  DULE hModule,.. 
14d70 20 4c 50 43 53 54 52 20 6c 70 54 79 70 65 2c 0d   LPCSTR lpType,.
14d80 0a 20 20 45 4e 55 4d 52 45 53 4e 41 4d 45 50 52  .  ENUMRESNAMEPR
14d90 4f 43 41 20 6c 70 45 6e 75 6d 46 75 6e 63 2c 0d  OCA lpEnumFunc,.
14da0 0a 20 20 4c 4f 4e 47 5f 50 54 52 20 6c 50 61 72  .  LONG_PTR lPar
14db0 61 6d 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  am);..extern(Win
14dc0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
14dd0 4c 20 45 6e 75 6d 52 65 73 6f 75 72 63 65 4e 61  L EnumResourceNa
14de0 6d 65 73 57 28 0d 0a 20 20 48 4d 4f 44 55 4c 45  mesW(..  HMODULE
14df0 20 68 4d 6f 64 75 6c 65 2c 0d 0a 20 20 4c 50 43   hModule,..  LPC
14e00 57 53 54 52 20 6c 70 54 79 70 65 2c 0d 0a 20 20  WSTR lpType,..  
14e10 45 4e 55 4d 52 45 53 4e 41 4d 45 50 52 4f 43 57  ENUMRESNAMEPROCW
14e20 20 6c 70 45 6e 75 6d 46 75 6e 63 2c 0d 0a 20 20   lpEnumFunc,..  
14e30 4c 4f 4e 47 5f 50 54 52 20 6c 50 61 72 61 6d 29  LONG_PTR lParam)
14e40 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
14e50 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
14e60 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 45  / #else..alias E
14e70 6e 75 6d 52 65 73 6f 75 72 63 65 4e 61 6d 65 73  numResourceNames
14e80 41 20 45 6e 75 6d 52 65 73 6f 75 72 63 65 4e 61  A EnumResourceNa
14e90 6d 65 73 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  mes;..// #endif 
14ea0 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65  // !UNICODE....e
14eb0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
14ec0 78 70 6f 72 74 20 42 4f 4f 4c 20 45 6e 75 6d 52  xport BOOL EnumR
14ed0 65 73 6f 75 72 63 65 4c 61 6e 67 75 61 67 65 73  esourceLanguages
14ee0 41 28 0d 0a 20 20 48 4d 4f 44 55 4c 45 20 68 4d  A(..  HMODULE hM
14ef0 6f 64 75 6c 65 2c 0d 0a 20 20 4c 50 43 53 54 52  odule,..  LPCSTR
14f00 20 6c 70 54 79 70 65 2c 0d 0a 20 20 4c 50 43 53   lpType,..  LPCS
14f10 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 45 4e  TR lpName,..  EN
14f20 55 4d 52 45 53 4c 41 4e 47 50 52 4f 43 41 20 6c  UMRESLANGPROCA l
14f30 70 45 6e 75 6d 46 75 6e 63 2c 0d 0a 20 20 4c 4f  pEnumFunc,..  LO
14f40 4e 47 5f 50 54 52 20 6c 50 61 72 61 6d 29 3b 0d  NG_PTR lParam);.
14f50 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
14f60 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 45 6e 75   export BOOL Enu
14f70 6d 52 65 73 6f 75 72 63 65 4c 61 6e 67 75 61 67  mResourceLanguag
14f80 65 73 57 28 0d 0a 20 20 48 4d 4f 44 55 4c 45 20  esW(..  HMODULE 
14f90 68 4d 6f 64 75 6c 65 2c 0d 0a 20 20 4c 50 43 57  hModule,..  LPCW
14fa0 53 54 52 20 6c 70 54 79 70 65 2c 0d 0a 20 20 4c  STR lpType,..  L
14fb0 50 43 57 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a  PCWSTR lpName,..
14fc0 20 20 45 4e 55 4d 52 45 53 4c 41 4e 47 50 52 4f    ENUMRESLANGPRO
14fd0 43 57 20 6c 70 45 6e 75 6d 46 75 6e 63 2c 0d 0a  CW lpEnumFunc,..
14fe0 20 20 4c 4f 4e 47 5f 50 54 52 20 6c 50 61 72 61    LONG_PTR lPara
14ff0 6d 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  m);..// #ifdef U
15000 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
15010 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
15020 20 45 6e 75 6d 52 65 73 6f 75 72 63 65 4c 61 6e   EnumResourceLan
15030 67 75 61 67 65 73 41 20 45 6e 75 6d 52 65 73 6f  guagesA EnumReso
15040 75 72 63 65 4c 61 6e 67 75 61 67 65 73 3b 0d 0a  urceLanguages;..
15050 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
15060 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
15070 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
15080 48 41 4e 44 4c 45 20 42 65 67 69 6e 55 70 64 61  HANDLE BeginUpda
15090 74 65 52 65 73 6f 75 72 63 65 41 28 0d 0a 20 20  teResourceA(..  
150a0 4c 50 43 53 54 52 20 70 46 69 6c 65 4e 61 6d 65  LPCSTR pFileName
150b0 2c 0d 0a 20 20 42 4f 4f 4c 20 62 44 65 6c 65 74  ,..  BOOL bDelet
150c0 65 45 78 69 73 74 69 6e 67 52 65 73 6f 75 72 63  eExistingResourc
150d0 65 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  es);..extern(Win
150e0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
150f0 44 4c 45 20 42 65 67 69 6e 55 70 64 61 74 65 52  DLE BeginUpdateR
15100 65 73 6f 75 72 63 65 57 28 0d 0a 20 20 4c 50 43  esourceW(..  LPC
15110 57 53 54 52 20 70 46 69 6c 65 4e 61 6d 65 2c 0d  WSTR pFileName,.
15120 0a 20 20 42 4f 4f 4c 20 62 44 65 6c 65 74 65 45  .  BOOL bDeleteE
15130 78 69 73 74 69 6e 67 52 65 73 6f 75 72 63 65 73  xistingResources
15140 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
15150 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
15160 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
15170 42 65 67 69 6e 55 70 64 61 74 65 52 65 73 6f 75  BeginUpdateResou
15180 72 63 65 41 20 42 65 67 69 6e 55 70 64 61 74 65  rceA BeginUpdate
15190 52 65 73 6f 75 72 63 65 3b 0d 0a 2f 2f 20 23 65  Resource;..// #e
151a0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
151b0 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
151c0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
151d0 55 70 64 61 74 65 52 65 73 6f 75 72 63 65 41 28  UpdateResourceA(
151e0 0d 0a 20 20 48 41 4e 44 4c 45 20 68 55 70 64 61  ..  HANDLE hUpda
151f0 74 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  te,..  LPCSTR lp
15200 54 79 70 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20  Type,..  LPCSTR 
15210 6c 70 4e 61 6d 65 2c 0d 0a 20 20 57 4f 52 44 20  lpName,..  WORD 
15220 77 4c 61 6e 67 75 61 67 65 2c 0d 0a 20 20 4c 50  wLanguage,..  LP
15230 56 4f 49 44 20 6c 70 44 61 74 61 2c 0d 0a 20 20  VOID lpData,..  
15240 44 57 4f 52 44 20 63 62 44 61 74 61 29 3b 0d 0a  DWORD cbData);..
15250 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
15260 65 78 70 6f 72 74 20 42 4f 4f 4c 20 55 70 64 61  export BOOL Upda
15270 74 65 52 65 73 6f 75 72 63 65 57 28 0d 0a 20 20  teResourceW(..  
15280 48 41 4e 44 4c 45 20 68 55 70 64 61 74 65 2c 0d  HANDLE hUpdate,.
15290 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 54 79 70  .  LPCWSTR lpTyp
152a0 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  e,..  LPCWSTR lp
152b0 4e 61 6d 65 2c 0d 0a 20 20 57 4f 52 44 20 77 4c  Name,..  WORD wL
152c0 61 6e 67 75 61 67 65 2c 0d 0a 20 20 4c 50 56 4f  anguage,..  LPVO
152d0 49 44 20 6c 70 44 61 74 61 2c 0d 0a 20 20 44 57  ID lpData,..  DW
152e0 4f 52 44 20 63 62 44 61 74 61 29 3b 0d 0a 2f 2f  ORD cbData);..//
152f0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
15300 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
15310 73 65 0d 0a 61 6c 69 61 73 20 55 70 64 61 74 65  se..alias Update
15320 52 65 73 6f 75 72 63 65 41 20 55 70 64 61 74 65  ResourceA Update
15330 52 65 73 6f 75 72 63 65 3b 0d 0a 2f 2f 20 23 65  Resource;..// #e
15340 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
15350 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
15360 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
15370 45 6e 64 55 70 64 61 74 65 52 65 73 6f 75 72 63  EndUpdateResourc
15380 65 41 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 55  eA(..  HANDLE hU
15390 70 64 61 74 65 2c 0d 0a 20 20 42 4f 4f 4c 20 66  pdate,..  BOOL f
153a0 44 69 73 63 61 72 64 29 3b 0d 0a 65 78 74 65 72  Discard);..exter
153b0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
153c0 74 20 42 4f 4f 4c 20 45 6e 64 55 70 64 61 74 65  t BOOL EndUpdate
153d0 52 65 73 6f 75 72 63 65 57 28 0d 0a 20 20 48 41  ResourceW(..  HA
153e0 4e 44 4c 45 20 68 55 70 64 61 74 65 2c 0d 0a 20  NDLE hUpdate,.. 
153f0 20 42 4f 4f 4c 20 66 44 69 73 63 61 72 64 29 3b   BOOL fDiscard);
15400 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
15410 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
15420 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 45 6e   #else..alias En
15430 64 55 70 64 61 74 65 52 65 73 6f 75 72 63 65 41  dUpdateResourceA
15440 20 45 6e 64 55 70 64 61 74 65 52 65 73 6f 75 72   EndUpdateResour
15450 63 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  ce;..// #endif /
15460 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
15470 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
15480 70 6f 72 74 20 41 54 4f 4d 20 47 6c 6f 62 61 6c  port ATOM Global
15490 41 64 64 41 74 6f 6d 41 28 0d 0a 20 20 4c 50 43  AddAtomA(..  LPC
154a0 53 54 52 20 6c 70 53 74 72 69 6e 67 29 3b 0d 0a  STR lpString);..
154b0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
154c0 65 78 70 6f 72 74 20 41 54 4f 4d 20 47 6c 6f 62  export ATOM Glob
154d0 61 6c 41 64 64 41 74 6f 6d 57 28 0d 0a 20 20 4c  alAddAtomW(..  L
154e0 50 43 57 53 54 52 20 6c 70 53 74 72 69 6e 67 29  PCWSTR lpString)
154f0 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
15500 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
15510 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47  / #else..alias G
15520 6c 6f 62 61 6c 41 64 64 41 74 6f 6d 41 20 47 6c  lobalAddAtomA Gl
15530 6f 62 61 6c 41 64 64 41 74 6f 6d 3b 0d 0a 2f 2f  obalAddAtom;..//
15540 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
15550 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
15560 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 41 54  ndows) export AT
15570 4f 4d 20 47 6c 6f 62 61 6c 46 69 6e 64 41 74 6f  OM GlobalFindAto
15580 6d 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  mA(..  LPCSTR lp
15590 53 74 72 69 6e 67 29 3b 0d 0a 65 78 74 65 72 6e  String);..extern
155a0 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
155b0 20 41 54 4f 4d 20 47 6c 6f 62 61 6c 46 69 6e 64   ATOM GlobalFind
155c0 41 74 6f 6d 57 28 0d 0a 20 20 4c 50 43 57 53 54  AtomW(..  LPCWST
155d0 52 20 6c 70 53 74 72 69 6e 67 29 3b 0d 0a 2f 2f  R lpString);..//
155e0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
155f0 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
15600 73 65 0d 0a 61 6c 69 61 73 20 47 6c 6f 62 61 6c  se..alias Global
15610 46 69 6e 64 41 74 6f 6d 41 20 47 6c 6f 62 61 6c  FindAtomA Global
15620 46 69 6e 64 41 74 6f 6d 3b 0d 0a 2f 2f 20 23 65  FindAtom;..// #e
15630 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
15640 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
15650 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e 54 20  ws) export UINT 
15660 47 6c 6f 62 61 6c 47 65 74 41 74 6f 6d 4e 61 6d  GlobalGetAtomNam
15670 65 41 28 0d 0a 20 20 41 54 4f 4d 20 6e 41 74 6f  eA(..  ATOM nAto
15680 6d 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 42 75  m,..  LPSTR lpBu
15690 66 66 65 72 2c 0d 0a 20 20 69 6e 74 20 6e 53 69  ffer,..  int nSi
156a0 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  ze);..extern(Win
156b0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e  dows) export UIN
156c0 54 20 47 6c 6f 62 61 6c 47 65 74 41 74 6f 6d 4e  T GlobalGetAtomN
156d0 61 6d 65 57 28 0d 0a 20 20 41 54 4f 4d 20 6e 41  ameW(..  ATOM nA
156e0 74 6f 6d 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c  tom,..  LPWSTR l
156f0 70 42 75 66 66 65 72 2c 0d 0a 20 20 69 6e 74 20  pBuffer,..  int 
15700 6e 53 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  nSize);..// #ifd
15710 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
15720 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
15730 6c 69 61 73 20 47 6c 6f 62 61 6c 47 65 74 41 74  lias GlobalGetAt
15740 6f 6d 4e 61 6d 65 41 20 47 6c 6f 62 61 6c 47 65  omNameA GlobalGe
15750 74 41 74 6f 6d 4e 61 6d 65 3b 0d 0a 2f 2f 20 23  tAtomName;..// #
15760 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
15770 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
15780 6f 77 73 29 20 65 78 70 6f 72 74 20 41 54 4f 4d  ows) export ATOM
15790 20 41 64 64 41 74 6f 6d 41 28 0d 0a 20 20 4c 50   AddAtomA(..  LP
157a0 43 53 54 52 20 6c 70 53 74 72 69 6e 67 29 3b 0d  CSTR lpString);.
157b0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
157c0 20 65 78 70 6f 72 74 20 41 54 4f 4d 20 41 64 64   export ATOM Add
157d0 41 74 6f 6d 57 28 0d 0a 20 20 4c 50 43 57 53 54  AtomW(..  LPCWST
157e0 52 20 6c 70 53 74 72 69 6e 67 29 3b 0d 0a 2f 2f  R lpString);..//
157f0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
15800 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
15810 73 65 0d 0a 61 6c 69 61 73 20 41 64 64 41 74 6f  se..alias AddAto
15820 6d 41 20 41 64 64 41 74 6f 6d 3b 0d 0a 2f 2f 20  mA AddAtom;..// 
15830 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
15840 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
15850 64 6f 77 73 29 20 65 78 70 6f 72 74 20 41 54 4f  dows) export ATO
15860 4d 20 46 69 6e 64 41 74 6f 6d 41 28 0d 0a 20 20  M FindAtomA(..  
15870 4c 50 43 53 54 52 20 6c 70 53 74 72 69 6e 67 29  LPCSTR lpString)
15880 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
15890 73 29 20 65 78 70 6f 72 74 20 41 54 4f 4d 20 46  s) export ATOM F
158a0 69 6e 64 41 74 6f 6d 57 28 0d 0a 20 20 4c 50 43  indAtomW(..  LPC
158b0 57 53 54 52 20 6c 70 53 74 72 69 6e 67 29 3b 0d  WSTR lpString);.
158c0 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
158d0 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
158e0 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46 69 6e  #else..alias Fin
158f0 64 41 74 6f 6d 41 20 46 69 6e 64 41 74 6f 6d 3b  dAtomA FindAtom;
15900 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
15910 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
15920 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
15930 74 20 55 49 4e 54 20 47 65 74 41 74 6f 6d 4e 61  t UINT GetAtomNa
15940 6d 65 41 28 0d 0a 20 20 41 54 4f 4d 20 6e 41 74  meA(..  ATOM nAt
15950 6f 6d 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 42  om,..  LPSTR lpB
15960 75 66 66 65 72 2c 0d 0a 20 20 69 6e 74 20 6e 53  uffer,..  int nS
15970 69 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ize);..extern(Wi
15980 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55 49  ndows) export UI
15990 4e 54 20 47 65 74 41 74 6f 6d 4e 61 6d 65 57 28  NT GetAtomNameW(
159a0 0d 0a 20 20 41 54 4f 4d 20 6e 41 74 6f 6d 2c 0d  ..  ATOM nAtom,.
159b0 0a 20 20 4c 50 57 53 54 52 20 6c 70 42 75 66 66  .  LPWSTR lpBuff
159c0 65 72 2c 0d 0a 20 20 69 6e 74 20 6e 53 69 7a 65  er,..  int nSize
159d0 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
159e0 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
159f0 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
15a00 47 65 74 41 74 6f 6d 4e 61 6d 65 41 20 47 65 74  GetAtomNameA Get
15a10 41 74 6f 6d 4e 61 6d 65 3b 0d 0a 2f 2f 20 23 65  AtomName;..// #e
15a20 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
15a30 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
15a40 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e 54 20  ws) export UINT 
15a50 47 65 74 50 72 6f 66 69 6c 65 49 6e 74 41 28 0d  GetProfileIntA(.
15a60 0a 20 20 4c 50 43 53 54 52 20 6c 70 41 70 70 4e  .  LPCSTR lpAppN
15a70 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ame,..  LPCSTR l
15a80 70 4b 65 79 4e 61 6d 65 2c 0d 0a 20 20 49 4e 54  pKeyName,..  INT
15a90 20 6e 44 65 66 61 75 6c 74 29 3b 0d 0a 65 78 74   nDefault);..ext
15aa0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
15ab0 6f 72 74 20 55 49 4e 54 20 47 65 74 50 72 6f 66  ort UINT GetProf
15ac0 69 6c 65 49 6e 74 57 28 0d 0a 20 20 4c 50 43 57  ileIntW(..  LPCW
15ad0 53 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a  STR lpAppName,..
15ae0 20 20 4c 50 43 57 53 54 52 20 6c 70 4b 65 79 4e    LPCWSTR lpKeyN
15af0 61 6d 65 2c 0d 0a 20 20 49 4e 54 20 6e 44 65 66  ame,..  INT nDef
15b00 61 75 6c 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  ault);..// #ifde
15b10 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e  f UNICODE..// #.
15b20 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c  ....// #else..al
15b30 69 61 73 20 47 65 74 50 72 6f 66 69 6c 65 49 6e  ias GetProfileIn
15b40 74 41 20 47 65 74 50 72 6f 66 69 6c 65 49 6e 74  tA GetProfileInt
15b50 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
15b60 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65  !UNICODE....exte
15b70 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
15b80 72 74 20 44 57 4f 52 44 20 47 65 74 50 72 6f 66  rt DWORD GetProf
15b90 69 6c 65 53 74 72 69 6e 67 41 28 0d 0a 20 20 4c  ileStringA(..  L
15ba0 50 43 53 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c  PCSTR lpAppName,
15bb0 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4b 65 79  ..  LPCSTR lpKey
15bc0 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20  Name,..  LPCSTR 
15bd0 6c 70 44 65 66 61 75 6c 74 2c 0d 0a 20 20 4c 50  lpDefault,..  LP
15be0 53 54 52 20 6c 70 52 65 74 75 72 6e 65 64 53 74  STR lpReturnedSt
15bf0 72 69 6e 67 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  ring,..  DWORD n
15c00 53 69 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57  Size);..extern(W
15c10 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44  indows) export D
15c20 57 4f 52 44 20 47 65 74 50 72 6f 66 69 6c 65 53  WORD GetProfileS
15c30 74 72 69 6e 67 57 28 0d 0a 20 20 4c 50 43 57 53  tringW(..  LPCWS
15c40 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a 20  TR lpAppName,.. 
15c50 20 4c 50 43 57 53 54 52 20 6c 70 4b 65 79 4e 61   LPCWSTR lpKeyNa
15c60 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  me,..  LPCWSTR l
15c70 70 44 65 66 61 75 6c 74 2c 0d 0a 20 20 4c 50 57  pDefault,..  LPW
15c80 53 54 52 20 6c 70 52 65 74 75 72 6e 65 64 53 74  STR lpReturnedSt
15c90 72 69 6e 67 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  ring,..  DWORD n
15ca0 53 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  Size);..// #ifde
15cb0 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e  f UNICODE..// #.
15cc0 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c  ....// #else..al
15cd0 69 61 73 20 47 65 74 50 72 6f 66 69 6c 65 53 74  ias GetProfileSt
15ce0 72 69 6e 67 41 20 47 65 74 50 72 6f 66 69 6c 65  ringA GetProfile
15cf0 53 74 72 69 6e 67 3b 0d 0a 2f 2f 20 23 65 6e 64  String;..// #end
15d00 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
15d10 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
15d20 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 57 72  ) export BOOL Wr
15d30 69 74 65 50 72 6f 66 69 6c 65 53 74 72 69 6e 67  iteProfileString
15d40 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 41  A(..  LPCSTR lpA
15d50 70 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54  ppName,..  LPCST
15d60 52 20 6c 70 4b 65 79 4e 61 6d 65 2c 0d 0a 20 20  R lpKeyName,..  
15d70 4c 50 43 53 54 52 20 6c 70 53 74 72 69 6e 67 29  LPCSTR lpString)
15d80 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
15d90 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 57  s) export BOOL W
15da0 72 69 74 65 50 72 6f 66 69 6c 65 53 74 72 69 6e  riteProfileStrin
15db0 67 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  gW(..  LPCWSTR l
15dc0 70 41 70 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  pAppName,..  LPC
15dd0 57 53 54 52 20 6c 70 4b 65 79 4e 61 6d 65 2c 0d  WSTR lpKeyName,.
15de0 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53 74 72  .  LPCWSTR lpStr
15df0 69 6e 67 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ing);..// #ifdef
15e00 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
15e10 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
15e20 61 73 20 57 72 69 74 65 50 72 6f 66 69 6c 65 53  as WriteProfileS
15e30 74 72 69 6e 67 41 20 57 72 69 74 65 50 72 6f 66  tringA WriteProf
15e40 69 6c 65 53 74 72 69 6e 67 3b 0d 0a 2f 2f 20 23  ileString;..// #
15e50 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
15e60 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
15e70 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
15e80 44 20 47 65 74 50 72 6f 66 69 6c 65 53 65 63 74  D GetProfileSect
15e90 69 6f 6e 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  ionA(..  LPCSTR 
15ea0 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50  lpAppName,..  LP
15eb0 53 54 52 20 6c 70 52 65 74 75 72 6e 65 64 53 74  STR lpReturnedSt
15ec0 72 69 6e 67 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  ring,..  DWORD n
15ed0 53 69 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57  Size);..extern(W
15ee0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44  indows) export D
15ef0 57 4f 52 44 20 47 65 74 50 72 6f 66 69 6c 65 53  WORD GetProfileS
15f00 65 63 74 69 6f 6e 57 28 0d 0a 20 20 4c 50 43 57  ectionW(..  LPCW
15f10 53 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a  STR lpAppName,..
15f20 20 20 4c 50 57 53 54 52 20 6c 70 52 65 74 75 72    LPWSTR lpRetur
15f30 6e 65 64 53 74 72 69 6e 67 2c 0d 0a 20 20 44 57  nedString,..  DW
15f40 4f 52 44 20 6e 53 69 7a 65 29 3b 0d 0a 2f 2f 20  ORD nSize);..// 
15f50 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
15f60 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
15f70 65 0d 0a 61 6c 69 61 73 20 47 65 74 50 72 6f 66  e..alias GetProf
15f80 69 6c 65 53 65 63 74 69 6f 6e 41 20 47 65 74 50  ileSectionA GetP
15f90 72 6f 66 69 6c 65 53 65 63 74 69 6f 6e 3b 0d 0a  rofileSection;..
15fa0 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
15fb0 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
15fc0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
15fd0 42 4f 4f 4c 20 57 72 69 74 65 50 72 6f 66 69 6c  BOOL WriteProfil
15fe0 65 53 65 63 74 69 6f 6e 41 28 0d 0a 20 20 4c 50  eSectionA(..  LP
15ff0 43 53 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d  CSTR lpAppName,.
16000 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 74 72 69  .  LPCSTR lpStri
16010 6e 67 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  ng);..extern(Win
16020 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
16030 4c 20 57 72 69 74 65 50 72 6f 66 69 6c 65 53 65  L WriteProfileSe
16040 63 74 69 6f 6e 57 28 0d 0a 20 20 4c 50 43 57 53  ctionW(..  LPCWS
16050 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a 20  TR lpAppName,.. 
16060 20 4c 50 43 57 53 54 52 20 6c 70 53 74 72 69 6e   LPCWSTR lpStrin
16070 67 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  g);..// #ifdef U
16080 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
16090 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
160a0 20 57 72 69 74 65 50 72 6f 66 69 6c 65 53 65 63   WriteProfileSec
160b0 74 69 6f 6e 41 20 57 72 69 74 65 50 72 6f 66 69  tionA WriteProfi
160c0 6c 65 53 65 63 74 69 6f 6e 3b 0d 0a 2f 2f 20 23  leSection;..// #
160d0 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
160e0 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
160f0 6f 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e 54  ows) export UINT
16100 20 47 65 74 50 72 69 76 61 74 65 50 72 6f 66 69   GetPrivateProfi
16110 6c 65 49 6e 74 41 28 0d 0a 20 20 4c 50 43 53 54  leIntA(..  LPCST
16120 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a 20 20  R lpAppName,..  
16130 4c 50 43 53 54 52 20 6c 70 4b 65 79 4e 61 6d 65  LPCSTR lpKeyName
16140 2c 0d 0a 20 20 49 4e 54 20 6e 44 65 66 61 75 6c  ,..  INT nDefaul
16150 74 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46  t,..  LPCSTR lpF
16160 69 6c 65 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72  ileName);..exter
16170 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
16180 74 20 55 49 4e 54 20 47 65 74 50 72 69 76 61 74  t UINT GetPrivat
16190 65 50 72 6f 66 69 6c 65 49 6e 74 57 28 0d 0a 20  eProfileIntW(.. 
161a0 20 4c 50 43 57 53 54 52 20 6c 70 41 70 70 4e 61   LPCWSTR lpAppNa
161b0 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  me,..  LPCWSTR l
161c0 70 4b 65 79 4e 61 6d 65 2c 0d 0a 20 20 49 4e 54  pKeyName,..  INT
161d0 20 6e 44 65 66 61 75 6c 74 2c 0d 0a 20 20 4c 50   nDefault,..  LP
161e0 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65  CWSTR lpFileName
161f0 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
16200 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
16210 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
16220 47 65 74 50 72 69 76 61 74 65 50 72 6f 66 69 6c  GetPrivateProfil
16230 65 49 6e 74 41 20 47 65 74 50 72 69 76 61 74 65  eIntA GetPrivate
16240 50 72 6f 66 69 6c 65 49 6e 74 3b 0d 0a 2f 2f 20  ProfileInt;..// 
16250 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
16260 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
16270 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f  dows) export DWO
16280 52 44 20 47 65 74 50 72 69 76 61 74 65 50 72 6f  RD GetPrivatePro
16290 66 69 6c 65 53 74 72 69 6e 67 41 28 0d 0a 20 20  fileStringA(..  
162a0 4c 50 43 53 54 52 20 6c 70 41 70 70 4e 61 6d 65  LPCSTR lpAppName
162b0 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4b 65  ,..  LPCSTR lpKe
162c0 79 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52  yName,..  LPCSTR
162d0 20 6c 70 44 65 66 61 75 6c 74 2c 0d 0a 20 20 4c   lpDefault,..  L
162e0 50 53 54 52 20 6c 70 52 65 74 75 72 6e 65 64 53  PSTR lpReturnedS
162f0 74 72 69 6e 67 2c 0d 0a 20 20 44 57 4f 52 44 20  tring,..  DWORD 
16300 6e 53 69 7a 65 2c 0d 0a 20 20 4c 50 43 53 54 52  nSize,..  LPCSTR
16310 20 6c 70 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a 65   lpFileName);..e
16320 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
16330 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74 50  xport DWORD GetP
16340 72 69 76 61 74 65 50 72 6f 66 69 6c 65 53 74 72  rivateProfileStr
16350 69 6e 67 57 28 0d 0a 20 20 4c 50 43 57 53 54 52  ingW(..  LPCWSTR
16360 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a 20 20 4c   lpAppName,..  L
16370 50 43 57 53 54 52 20 6c 70 4b 65 79 4e 61 6d 65  PCWSTR lpKeyName
16380 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 44  ,..  LPCWSTR lpD
16390 65 66 61 75 6c 74 2c 0d 0a 20 20 4c 50 57 53 54  efault,..  LPWST
163a0 52 20 6c 70 52 65 74 75 72 6e 65 64 53 74 72 69  R lpReturnedStri
163b0 6e 67 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 53 69  ng,..  DWORD nSi
163c0 7a 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  ze,..  LPCWSTR l
163d0 70 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20  pFileName);..// 
163e0 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
163f0 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
16400 65 0d 0a 61 6c 69 61 73 20 47 65 74 50 72 69 76  e..alias GetPriv
16410 61 74 65 50 72 6f 66 69 6c 65 53 74 72 69 6e 67  ateProfileString
16420 41 20 47 65 74 50 72 69 76 61 74 65 50 72 6f 66  A GetPrivateProf
16430 69 6c 65 53 74 72 69 6e 67 3b 0d 0a 2f 2f 20 23  ileString;..// #
16440 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
16450 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
16460 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
16470 20 57 72 69 74 65 50 72 69 76 61 74 65 50 72 6f   WritePrivatePro
16480 66 69 6c 65 53 74 72 69 6e 67 41 28 0d 0a 20 20  fileStringA(..  
16490 4c 50 43 53 54 52 20 6c 70 41 70 70 4e 61 6d 65  LPCSTR lpAppName
164a0 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4b 65  ,..  LPCSTR lpKe
164b0 79 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52  yName,..  LPCSTR
164c0 20 6c 70 53 74 72 69 6e 67 2c 0d 0a 20 20 4c 50   lpString,..  LP
164d0 43 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65 29  CSTR lpFileName)
164e0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
164f0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 57  s) export BOOL W
16500 72 69 74 65 50 72 69 76 61 74 65 50 72 6f 66 69  ritePrivateProfi
16510 6c 65 53 74 72 69 6e 67 57 28 0d 0a 20 20 4c 50  leStringW(..  LP
16520 43 57 53 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c  CWSTR lpAppName,
16530 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 4b 65  ..  LPCWSTR lpKe
16540 79 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54  yName,..  LPCWST
16550 52 20 6c 70 53 74 72 69 6e 67 2c 0d 0a 20 20 4c  R lpString,..  L
16560 50 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d  PCWSTR lpFileNam
16570 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  e);..// #ifdef U
16580 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
16590 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
165a0 20 57 72 69 74 65 50 72 69 76 61 74 65 50 72 6f   WritePrivatePro
165b0 66 69 6c 65 53 74 72 69 6e 67 41 20 57 72 69 74  fileStringA Writ
165c0 65 50 72 69 76 61 74 65 50 72 6f 66 69 6c 65 53  ePrivateProfileS
165d0 74 72 69 6e 67 3b 0d 0a 2f 2f 20 23 65 6e 64 69  tring;..// #endi
165e0 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
165f0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
16600 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65   export DWORD Ge
16610 74 50 72 69 76 61 74 65 50 72 6f 66 69 6c 65 53  tPrivateProfileS
16620 65 63 74 69 6f 6e 41 28 0d 0a 20 20 4c 50 43 53  ectionA(..  LPCS
16630 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a 20  TR lpAppName,.. 
16640 20 4c 50 53 54 52 20 6c 70 52 65 74 75 72 6e 65   LPSTR lpReturne
16650 64 53 74 72 69 6e 67 2c 0d 0a 20 20 44 57 4f 52  dString,..  DWOR
16660 44 20 6e 53 69 7a 65 2c 0d 0a 20 20 4c 50 43 53  D nSize,..  LPCS
16670 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65 29 3b 0d  TR lpFileName);.
16680 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
16690 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65   export DWORD Ge
166a0 74 50 72 69 76 61 74 65 50 72 6f 66 69 6c 65 53  tPrivateProfileS
166b0 65 63 74 69 6f 6e 57 28 0d 0a 20 20 4c 50 43 57  ectionW(..  LPCW
166c0 53 54 52 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a  STR lpAppName,..
166d0 20 20 4c 50 57 53 54 52 20 6c 70 52 65 74 75 72    LPWSTR lpRetur
166e0 6e 65 64 53 74 72 69 6e 67 2c 0d 0a 20 20 44 57  nedString,..  DW
166f0 4f 52 44 20 6e 53 69 7a 65 2c 0d 0a 20 20 4c 50  ORD nSize,..  LP
16700 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65  CWSTR lpFileName
16710 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
16720 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
16730 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
16740 47 65 74 50 72 69 76 61 74 65 50 72 6f 66 69 6c  GetPrivateProfil
16750 65 53 65 63 74 69 6f 6e 41 20 47 65 74 50 72 69  eSectionA GetPri
16760 76 61 74 65 50 72 6f 66 69 6c 65 53 65 63 74 69  vateProfileSecti
16770 6f 6e 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  on;..// #endif /
16780 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
16790 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
167a0 70 6f 72 74 20 42 4f 4f 4c 20 57 72 69 74 65 50  port BOOL WriteP
167b0 72 69 76 61 74 65 50 72 6f 66 69 6c 65 53 65 63  rivateProfileSec
167c0 74 69 6f 6e 41 28 0d 0a 20 20 4c 50 43 53 54 52  tionA(..  LPCSTR
167d0 20 6c 70 41 70 70 4e 61 6d 65 2c 0d 0a 20 20 4c   lpAppName,..  L
167e0 50 43 53 54 52 20 6c 70 53 74 72 69 6e 67 2c 0d  PCSTR lpString,.
167f0 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 69 6c 65  .  LPCSTR lpFile
16800 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57  Name);..extern(W
16810 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
16820 4f 4f 4c 20 57 72 69 74 65 50 72 69 76 61 74 65  OOL WritePrivate
16830 50 72 6f 66 69 6c 65 53 65 63 74 69 6f 6e 57 28  ProfileSectionW(
16840 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 41 70  ..  LPCWSTR lpAp
16850 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54  pName,..  LPCWST
16860 52 20 6c 70 53 74 72 69 6e 67 2c 0d 0a 20 20 4c  R lpString,..  L
16870 50 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d  PCWSTR lpFileNam
16880 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  e);..// #ifdef U
16890 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
168a0 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
168b0 20 57 72 69 74 65 50 72 69 76 61 74 65 50 72 6f   WritePrivatePro
168c0 66 69 6c 65 53 65 63 74 69 6f 6e 41 20 57 72 69  fileSectionA Wri
168d0 74 65 50 72 69 76 61 74 65 50 72 6f 66 69 6c 65  tePrivateProfile
168e0 53 65 63 74 69 6f 6e 3b 0d 0a 2f 2f 20 23 65 6e  Section;..// #en
168f0 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
16900 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
16910 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
16920 47 65 74 50 72 69 76 61 74 65 50 72 6f 66 69 6c  GetPrivateProfil
16930 65 53 65 63 74 69 6f 6e 4e 61 6d 65 73 41 28 0d  eSectionNamesA(.
16940 0a 20 20 4c 50 53 54 52 20 6c 70 73 7a 52 65 74  .  LPSTR lpszRet
16950 75 72 6e 42 75 66 66 65 72 2c 0d 0a 20 20 44 57  urnBuffer,..  DW
16960 4f 52 44 20 6e 53 69 7a 65 2c 0d 0a 20 20 4c 50  ORD nSize,..  LP
16970 43 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65 29  CSTR lpFileName)
16980 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
16990 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
169a0 47 65 74 50 72 69 76 61 74 65 50 72 6f 66 69 6c  GetPrivateProfil
169b0 65 53 65 63 74 69 6f 6e 4e 61 6d 65 73 57 28 0d  eSectionNamesW(.
169c0 0a 20 20 4c 50 57 53 54 52 20 6c 70 73 7a 52 65  .  LPWSTR lpszRe
169d0 74 75 72 6e 42 75 66 66 65 72 2c 0d 0a 20 20 44  turnBuffer,..  D
169e0 57 4f 52 44 20 6e 53 69 7a 65 2c 0d 0a 20 20 4c  WORD nSize,..  L
169f0 50 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d  PCWSTR lpFileNam
16a00 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  e);..// #ifdef U
16a10 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
16a20 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
16a30 20 47 65 74 50 72 69 76 61 74 65 50 72 6f 66 69   GetPrivateProfi
16a40 6c 65 53 65 63 74 69 6f 6e 4e 61 6d 65 73 41 20  leSectionNamesA 
16a50 47 65 74 50 72 69 76 61 74 65 50 72 6f 66 69 6c  GetPrivateProfil
16a60 65 53 65 63 74 69 6f 6e 4e 61 6d 65 73 3b 0d 0a  eSectionNames;..
16a70 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
16a80 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
16a90 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
16aa0 42 4f 4f 4c 20 47 65 74 50 72 69 76 61 74 65 50  BOOL GetPrivateP
16ab0 72 6f 66 69 6c 65 53 74 72 75 63 74 41 28 0d 0a  rofileStructA(..
16ac0 20 20 4c 50 43 53 54 52 20 6c 70 73 7a 53 65 63    LPCSTR lpszSec
16ad0 74 69 6f 6e 2c 0d 0a 20 20 4c 50 43 53 54 52 20  tion,..  LPCSTR 
16ae0 6c 70 73 7a 4b 65 79 2c 0d 0a 20 20 4c 50 56 4f  lpszKey,..  LPVO
16af0 49 44 20 6c 70 53 74 72 75 63 74 2c 0d 0a 20 20  ID lpStruct,..  
16b00 55 49 4e 54 20 75 53 69 7a 65 53 74 72 75 63 74  UINT uSizeStruct
16b10 2c 0d 0a 20 20 4c 50 43 53 54 52 20 73 7a 46 69  ,..  LPCSTR szFi
16b20 6c 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  le);..extern(Win
16b30 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
16b40 4c 20 47 65 74 50 72 69 76 61 74 65 50 72 6f 66  L GetPrivateProf
16b50 69 6c 65 53 74 72 75 63 74 57 28 0d 0a 20 20 4c  ileStructW(..  L
16b60 50 43 57 53 54 52 20 6c 70 73 7a 53 65 63 74 69  PCWSTR lpszSecti
16b70 6f 6e 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  on,..  LPCWSTR l
16b80 70 73 7a 4b 65 79 2c 0d 0a 20 20 4c 50 56 4f 49  pszKey,..  LPVOI
16b90 44 20 6c 70 53 74 72 75 63 74 2c 0d 0a 20 20 55  D lpStruct,..  U
16ba0 49 4e 54 20 75 53 69 7a 65 53 74 72 75 63 74 2c  INT uSizeStruct,
16bb0 0d 0a 20 20 4c 50 43 57 53 54 52 20 73 7a 46 69  ..  LPCWSTR szFi
16bc0 6c 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  le);..// #ifdef 
16bd0 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
16be0 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
16bf0 73 20 47 65 74 50 72 69 76 61 74 65 50 72 6f 66  s GetPrivateProf
16c00 69 6c 65 53 74 72 75 63 74 41 20 47 65 74 50 72  ileStructA GetPr
16c10 69 76 61 74 65 50 72 6f 66 69 6c 65 53 74 72 75  ivateProfileStru
16c20 63 74 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  ct;..// #endif /
16c30 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
16c40 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
16c50 70 6f 72 74 20 42 4f 4f 4c 20 57 72 69 74 65 50  port BOOL WriteP
16c60 72 69 76 61 74 65 50 72 6f 66 69 6c 65 53 74 72  rivateProfileStr
16c70 75 63 74 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  uctA(..  LPCSTR 
16c80 6c 70 73 7a 53 65 63 74 69 6f 6e 2c 0d 0a 20 20  lpszSection,..  
16c90 4c 50 43 53 54 52 20 6c 70 73 7a 4b 65 79 2c 0d  LPCSTR lpszKey,.
16ca0 0a 20 20 4c 50 56 4f 49 44 20 6c 70 53 74 72 75  .  LPVOID lpStru
16cb0 63 74 2c 0d 0a 20 20 55 49 4e 54 20 75 53 69 7a  ct,..  UINT uSiz
16cc0 65 53 74 72 75 63 74 2c 0d 0a 20 20 4c 50 43 53  eStruct,..  LPCS
16cd0 54 52 20 73 7a 46 69 6c 65 29 3b 0d 0a 65 78 74  TR szFile);..ext
16ce0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
16cf0 6f 72 74 20 42 4f 4f 4c 20 57 72 69 74 65 50 72  ort BOOL WritePr
16d00 69 76 61 74 65 50 72 6f 66 69 6c 65 53 74 72 75  ivateProfileStru
16d10 63 74 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20  ctW(..  LPCWSTR 
16d20 6c 70 73 7a 53 65 63 74 69 6f 6e 2c 0d 0a 20 20  lpszSection,..  
16d30 4c 50 43 57 53 54 52 20 6c 70 73 7a 4b 65 79 2c  LPCWSTR lpszKey,
16d40 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 53 74 72  ..  LPVOID lpStr
16d50 75 63 74 2c 0d 0a 20 20 55 49 4e 54 20 75 53 69  uct,..  UINT uSi
16d60 7a 65 53 74 72 75 63 74 2c 0d 0a 20 20 4c 50 43  zeStruct,..  LPC
16d70 57 53 54 52 20 73 7a 46 69 6c 65 29 3b 0d 0a 2f  WSTR szFile);../
16d80 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
16d90 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
16da0 6c 73 65 0d 0a 61 6c 69 61 73 20 57 72 69 74 65  lse..alias Write
16db0 50 72 69 76 61 74 65 50 72 6f 66 69 6c 65 53 74  PrivateProfileSt
16dc0 72 75 63 74 41 20 57 72 69 74 65 50 72 69 76 61  ructA WritePriva
16dd0 74 65 50 72 6f 66 69 6c 65 53 74 72 75 63 74 3b  teProfileStruct;
16de0 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
16df0 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
16e00 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
16e10 74 20 55 49 4e 54 20 47 65 74 44 72 69 76 65 54  t UINT GetDriveT
16e20 79 70 65 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  ypeA(..  LPCSTR 
16e30 6c 70 52 6f 6f 74 50 61 74 68 4e 61 6d 65 29 3b  lpRootPathName);
16e40 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
16e50 29 20 65 78 70 6f 72 74 20 55 49 4e 54 20 47 65  ) export UINT Ge
16e60 74 44 72 69 76 65 54 79 70 65 57 28 0d 0a 20 20  tDriveTypeW(..  
16e70 4c 50 43 57 53 54 52 20 6c 70 52 6f 6f 74 50 61  LPCWSTR lpRootPa
16e80 74 68 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66  thName);..// #if
16e90 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
16ea0 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
16eb0 61 6c 69 61 73 20 47 65 74 44 72 69 76 65 54 79  alias GetDriveTy
16ec0 70 65 41 20 47 65 74 44 72 69 76 65 54 79 70 65  peA GetDriveType
16ed0 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
16ee0 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65  !UNICODE....exte
16ef0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
16f00 72 74 20 55 49 4e 54 20 47 65 74 53 79 73 74 65  rt UINT GetSyste
16f10 6d 44 69 72 65 63 74 6f 72 79 41 28 0d 0a 20 20  mDirectoryA(..  
16f20 4c 50 53 54 52 20 6c 70 42 75 66 66 65 72 2c 0d  LPSTR lpBuffer,.
16f30 0a 20 20 55 49 4e 54 20 75 53 69 7a 65 29 3b 0d  .  UINT uSize);.
16f40 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
16f50 20 65 78 70 6f 72 74 20 55 49 4e 54 20 47 65 74   export UINT Get
16f60 53 79 73 74 65 6d 44 69 72 65 63 74 6f 72 79 57  SystemDirectoryW
16f70 28 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 42 75  (..  LPWSTR lpBu
16f80 66 66 65 72 2c 0d 0a 20 20 55 49 4e 54 20 75 53  ffer,..  UINT uS
16f90 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ize);..// #ifdef
16fa0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
16fb0 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
16fc0 61 73 20 47 65 74 53 79 73 74 65 6d 44 69 72 65  as GetSystemDire
16fd0 63 74 6f 72 79 41 20 47 65 74 53 79 73 74 65 6d  ctoryA GetSystem
16fe0 44 69 72 65 63 74 6f 72 79 3b 0d 0a 2f 2f 20 23  Directory;..// #
16ff0 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
17000 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
17010 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
17020 44 20 47 65 74 54 65 6d 70 50 61 74 68 41 28 0d  D GetTempPathA(.
17030 0a 20 20 44 57 4f 52 44 20 6e 42 75 66 66 65 72  .  DWORD nBuffer
17040 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 53 54 52  Length,..  LPSTR
17050 20 6c 70 42 75 66 66 65 72 29 3b 0d 0a 65 78 74   lpBuffer);..ext
17060 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
17070 6f 72 74 20 44 57 4f 52 44 20 47 65 74 54 65 6d  ort DWORD GetTem
17080 70 50 61 74 68 57 28 0d 0a 20 20 44 57 4f 52 44  pPathW(..  DWORD
17090 20 6e 42 75 66 66 65 72 4c 65 6e 67 74 68 2c 0d   nBufferLength,.
170a0 0a 20 20 4c 50 57 53 54 52 20 6c 70 42 75 66 66  .  LPWSTR lpBuff
170b0 65 72 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  er);..// #ifdef 
170c0 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
170d0 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
170e0 73 20 47 65 74 54 65 6d 70 50 61 74 68 41 20 47  s GetTempPathA G
170f0 65 74 54 65 6d 70 50 61 74 68 3b 0d 0a 2f 2f 20  etTempPath;..// 
17100 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
17110 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
17120 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e  dows) export UIN
17130 54 20 47 65 74 54 65 6d 70 46 69 6c 65 4e 61 6d  T GetTempFileNam
17140 65 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  eA(..  LPCSTR lp
17150 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  PathName,..  LPC
17160 53 54 52 20 6c 70 50 72 65 66 69 78 53 74 72 69  STR lpPrefixStri
17170 6e 67 2c 0d 0a 20 20 55 49 4e 54 20 75 55 6e 69  ng,..  UINT uUni
17180 71 75 65 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70  que,..  LPSTR lp
17190 54 65 6d 70 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a  TempFileName);..
171a0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
171b0 65 78 70 6f 72 74 20 55 49 4e 54 20 47 65 74 54  export UINT GetT
171c0 65 6d 70 46 69 6c 65 4e 61 6d 65 57 28 0d 0a 20  empFileNameW(.. 
171d0 20 4c 50 43 57 53 54 52 20 6c 70 50 61 74 68 4e   LPCWSTR lpPathN
171e0 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20  ame,..  LPCWSTR 
171f0 6c 70 50 72 65 66 69 78 53 74 72 69 6e 67 2c 0d  lpPrefixString,.
17200 0a 20 20 55 49 4e 54 20 75 55 6e 69 71 75 65 2c  .  UINT uUnique,
17210 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 54 65 6d  ..  LPWSTR lpTem
17220 70 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20  pFileName);..// 
17230 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
17240 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
17250 65 0d 0a 61 6c 69 61 73 20 47 65 74 54 65 6d 70  e..alias GetTemp
17260 46 69 6c 65 4e 61 6d 65 41 20 47 65 74 54 65 6d  FileNameA GetTem
17270 70 46 69 6c 65 4e 61 6d 65 3b 0d 0a 2f 2f 20 23  pFileName;..// #
17280 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
17290 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
172a0 6f 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e 54  ows) export UINT
172b0 20 47 65 74 57 69 6e 64 6f 77 73 44 69 72 65 63   GetWindowsDirec
172c0 74 6f 72 79 41 28 0d 0a 20 20 4c 50 53 54 52 20  toryA(..  LPSTR 
172d0 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 55 49 4e  lpBuffer,..  UIN
172e0 54 20 75 53 69 7a 65 29 3b 0d 0a 65 78 74 65 72  T uSize);..exter
172f0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
17300 74 20 55 49 4e 54 20 47 65 74 57 69 6e 64 6f 77  t UINT GetWindow
17310 73 44 69 72 65 63 74 6f 72 79 57 28 0d 0a 20 20  sDirectoryW(..  
17320 4c 50 57 53 54 52 20 6c 70 42 75 66 66 65 72 2c  LPWSTR lpBuffer,
17330 0d 0a 20 20 55 49 4e 54 20 75 53 69 7a 65 29 3b  ..  UINT uSize);
17340 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
17350 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
17360 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65   #else..alias Ge
17370 74 57 69 6e 64 6f 77 73 44 69 72 65 63 74 6f 72  tWindowsDirector
17380 79 41 20 47 65 74 57 69 6e 64 6f 77 73 44 69 72  yA GetWindowsDir
17390 65 63 74 6f 72 79 3b 0d 0a 2f 2f 20 23 65 6e 64  ectory;..// #end
173a0 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
173b0 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
173c0 29 20 65 78 70 6f 72 74 20 55 49 4e 54 20 47 65  ) export UINT Ge
173d0 74 53 79 73 74 65 6d 57 69 6e 64 6f 77 73 44 69  tSystemWindowsDi
173e0 72 65 63 74 6f 72 79 41 28 0d 0a 20 20 4c 50 53  rectoryA(..  LPS
173f0 54 52 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20  TR lpBuffer,..  
17400 55 49 4e 54 20 75 53 69 7a 65 29 3b 0d 0a 65 78  UINT uSize);..ex
17410 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
17420 70 6f 72 74 20 55 49 4e 54 20 47 65 74 53 79 73  port UINT GetSys
17430 74 65 6d 57 69 6e 64 6f 77 73 44 69 72 65 63 74  temWindowsDirect
17440 6f 72 79 57 28 0d 0a 20 20 4c 50 57 53 54 52 20  oryW(..  LPWSTR 
17450 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 55 49 4e  lpBuffer,..  UIN
17460 54 20 75 53 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69  T uSize);..// #i
17470 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
17480 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
17490 0a 61 6c 69 61 73 20 47 65 74 53 79 73 74 65 6d  .alias GetSystem
174a0 57 69 6e 64 6f 77 73 44 69 72 65 63 74 6f 72 79  WindowsDirectory
174b0 41 20 47 65 74 53 79 73 74 65 6d 57 69 6e 64 6f  A GetSystemWindo
174c0 77 73 44 69 72 65 63 74 6f 72 79 3b 0d 0a 2f 2f  wsDirectory;..//
174d0 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
174e0 4f 44 45 0d 0a 0d 0a 2f 2f 20 23 69 66 20 21 64  ODE....// #if !d
174f0 65 66 69 6e 65 64 28 52 43 5f 49 4e 56 4f 4b 45  efined(RC_INVOKE
17500 44 29 20 2f 2f 20 52 43 20 77 61 72 6e 73 20 62  D) // RC warns b
17510 65 63 61 75 73 65 20 22 57 49 4e 42 41 53 45 5f  ecause "WINBASE_
17520 44 45 43 4c 41 52 45 5f 47 45 54 5f 53 59 53 54  DECLARE_GET_SYST
17530 45 4d 5f 57 4f 57 36 34 5f 44 49 52 45 43 54 4f  EM_WOW64_DIRECTO
17540 52 59 22 20 69 73 20 61 20 62 69 74 20 6c 6f 6e  RY" is a bit lon
17550 67 2e 0d 0a 2f 2f 20 23 69 66 20 5f 57 49 4e 33  g...// #if _WIN3
17560 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30  2_WINNT >= 0x050
17570 31 20 7c 7c 20 64 65 66 69 6e 65 64 28 57 49 4e  1 || defined(WIN
17580 42 41 53 45 5f 44 45 43 4c 41 52 45 5f 47 45 54  BASE_DECLARE_GET
17590 5f 53 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44 49  _SYSTEM_WOW64_DI
175a0 52 45 43 54 4f 52 59 29 0d 0a 0d 0a 65 78 74 65  RECTORY)....exte
175b0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
175c0 72 74 20 55 49 4e 54 20 47 65 74 53 79 73 74 65  rt UINT GetSyste
175d0 6d 57 6f 77 36 34 44 69 72 65 63 74 6f 72 79 41  mWow64DirectoryA
175e0 28 0d 0a 20 20 4c 50 53 54 52 20 6c 70 42 75 66  (..  LPSTR lpBuf
175f0 66 65 72 2c 0d 0a 20 20 55 49 4e 54 20 75 53 69  fer,..  UINT uSi
17600 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  ze);..extern(Win
17610 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55 49 4e  dows) export UIN
17620 54 20 47 65 74 53 79 73 74 65 6d 57 6f 77 36 34  T GetSystemWow64
17630 44 69 72 65 63 74 6f 72 79 57 28 0d 0a 20 20 4c  DirectoryW(..  L
17640 50 57 53 54 52 20 6c 70 42 75 66 66 65 72 2c 0d  PWSTR lpBuffer,.
17650 0a 20 20 55 49 4e 54 20 75 53 69 7a 65 29 3b 0d  .  UINT uSize);.
17660 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
17670 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
17680 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74  #else..alias Get
17690 53 79 73 74 65 6d 57 6f 77 36 34 44 69 72 65 63  SystemWow64Direc
176a0 74 6f 72 79 41 20 47 65 74 53 79 73 74 65 6d 57  toryA GetSystemW
176b0 6f 77 36 34 44 69 72 65 63 74 6f 72 79 3b 0d 0a  ow64Directory;..
176c0 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
176d0 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
176e0 57 69 6e 64 6f 77 73 29 20 61 6c 69 61 73 20 55  Windows) alias U
176f0 49 4e 54 20 66 75 6e 63 74 69 6f 6e 28 20 4c 50  INT function( LP
17700 53 54 52 20 6c 70 42 75 66 66 65 72 2c 20 55 49  STR lpBuffer, UI
17710 4e 54 20 75 53 69 7a 65 29 20 50 47 45 54 5f 53  NT uSize) PGET_S
17720 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44 49 52 45  YSTEM_WOW64_DIRE
17730 43 54 4f 52 59 5f 41 3b 0d 0a 65 78 74 65 72 6e  CTORY_A;..extern
17740 28 57 69 6e 64 6f 77 73 29 20 61 6c 69 61 73 20  (Windows) alias 
17750 55 49 4e 54 20 66 75 6e 63 74 69 6f 6e 28 20 4c  UINT function( L
17760 50 57 53 54 52 20 6c 70 42 75 66 66 65 72 2c 20  PWSTR lpBuffer, 
17770 55 49 4e 54 20 75 53 69 7a 65 29 20 50 47 45 54  UINT uSize) PGET
17780 5f 53 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44 49  _SYSTEM_WOW64_DI
17790 52 45 43 54 4f 52 59 5f 57 3b 0d 0a 0d 0a 63 6f  RECTORY_W;....co
177a0 6e 73 74 20 63 68 61 72 5b 5d 20 47 45 54 5f 53  nst char[] GET_S
177b0 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44 49 52 45  YSTEM_WOW64_DIRE
177c0 43 54 4f 52 59 5f 4e 41 4d 45 5f 41 5f 41 20 3d  CTORY_NAME_A_A =
177d0 20 22 47 65 74 53 79 73 74 65 6d 57 6f 77 36 34   "GetSystemWow64
177e0 44 69 72 65 63 74 6f 72 79 41 22 3b 0d 0a 63 6f  DirectoryA";..co
177f0 6e 73 74 20 77 63 68 61 72 5b 5d 20 47 45 54 5f  nst wchar[] GET_
17800 53 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44 49 52  SYSTEM_WOW64_DIR
17810 45 43 54 4f 52 59 5f 4e 41 4d 45 5f 41 5f 57 20  ECTORY_NAME_A_W 
17820 3d 20 22 47 65 74 53 79 73 74 65 6d 57 6f 77 36  = "GetSystemWow6
17830 34 44 69 72 65 63 74 6f 72 79 41 22 3b 0d 0a 63  4DirectoryA";..c
17840 6f 6e 73 74 20 54 43 48 41 52 5b 5d 20 47 45 54  onst TCHAR[] GET
17850 5f 53 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44 49  _SYSTEM_WOW64_DI
17860 52 45 43 54 4f 52 59 5f 4e 41 4d 45 5f 41 5f 54  RECTORY_NAME_A_T
17870 20 3d 20 22 47 65 74 53 79 73 74 65 6d 57 6f 77   = "GetSystemWow
17880 36 34 44 69 72 65 63 74 6f 72 79 41 22 3b 0d 0a  64DirectoryA";..
17890 63 6f 6e 73 74 20 63 68 61 72 5b 5d 20 47 45 54  const char[] GET
178a0 5f 53 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44 49  _SYSTEM_WOW64_DI
178b0 52 45 43 54 4f 52 59 5f 4e 41 4d 45 5f 57 5f 41  RECTORY_NAME_W_A
178c0 20 3d 20 22 47 65 74 53 79 73 74 65 6d 57 6f 77   = "GetSystemWow
178d0 36 34 44 69 72 65 63 74 6f 72 79 57 22 3b 0d 0a  64DirectoryW";..
178e0 63 6f 6e 73 74 20 77 63 68 61 72 5b 5d 20 47 45  const wchar[] GE
178f0 54 5f 53 59 53 54 45 4d 5f 57 4f 57 36 34 5f 44  T_SYSTEM_WOW64_D
17900 49 52 45 43 54 4f 52 59 5f 4e 41 4d 45 5f 57 5f  IRECTORY_NAME_W_
17910 57 20 3d 20 22 47 65 74 53 79 73 74 65 6d 57 6f  W = "GetSystemWo
17920 77 36 34 44 69 72 65 63 74 6f 72 79 57 22 3b 0d  w64DirectoryW";.
17930 0a 63 6f 6e 73 74 20 54 43 48 41 52 5b 5d 20 47  .const TCHAR[] G
17940 45 54 5f 53 59 53 54 45 4d 5f 57 4f 57 36 34 5f  ET_SYSTEM_WOW64_
17950 44 49 52 45 43 54 4f 52 59 5f 4e 41 4d 45 5f 57  DIRECTORY_NAME_W
17960 5f 54 20 3d 20 22 47 65 74 53 79 73 74 65 6d 57  _T = "GetSystemW
17970 6f 77 36 34 44 69 72 65 63 74 6f 72 79 57 22 3b  ow64DirectoryW";
17980 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  ....// #ifdef UN
17990 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
179a0 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 2e 2e 2e  // #.....// #...
179b0 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
179c0 73 20 47 45 54 5f 53 59 53 54 45 4d 5f 57 4f 57  s GET_SYSTEM_WOW
179d0 36 34 5f 44 49 52 45 43 54 4f 52 59 5f 4e 41 4d  64_DIRECTORY_NAM
179e0 45 5f 41 5f 41 20 47 45 54 5f 53 59 53 54 45 4d  E_A_A GET_SYSTEM
179f0 5f 57 4f 57 36 34 5f 44 49 52 45 43 54 4f 52 59  _WOW64_DIRECTORY
17a00 5f 4e 41 4d 45 5f 54 5f 41 3b 0d 0a 61 6c 69 61  _NAME_T_A;..alia
17a10 73 20 47 45 54 5f 53 59 53 54 45 4d 5f 57 4f 57  s GET_SYSTEM_WOW
17a20 36 34 5f 44 49 52 45 43 54 4f 52 59 5f 4e 41 4d  64_DIRECTORY_NAM
17a30 45 5f 41 5f 57 20 47 45 54 5f 53 59 53 54 45 4d  E_A_W GET_SYSTEM
17a40 5f 57 4f 57 36 34 5f 44 49 52 45 43 54 4f 52 59  _WOW64_DIRECTORY
17a50 5f 4e 41 4d 45 5f 54 5f 57 3b 0d 0a 61 6c 69 61  _NAME_T_W;..alia
17a60 73 20 47 45 54 5f 53 59 53 54 45 4d 5f 57 4f 57  s GET_SYSTEM_WOW
17a70 36 34 5f 44 49 52 45 43 54 4f 52 59 5f 4e 41 4d  64_DIRECTORY_NAM
17a80 45 5f 41 5f 54 20 47 45 54 5f 53 59 53 54 45 4d  E_A_T GET_SYSTEM
17a90 5f 57 4f 57 36 34 5f 44 49 52 45 43 54 4f 52 59  _WOW64_DIRECTORY
17aa0 5f 4e 41 4d 45 5f 54 5f 54 3b 0d 0a 2f 2f 20 23  _NAME_T_T;..// #
17ab0 65 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23 65 6e 64  endif....// #end
17ac0 69 66 20 2f 2f 20 5f 57 49 4e 33 32 5f 57 49 4e  if // _WIN32_WIN
17ad0 4e 54 20 3e 3d 20 30 78 30 35 30 31 0d 0a 2f 2f  NT >= 0x0501..//
17ae0 20 23 65 6e 64 69 66 0d 0a 0d 0a 65 78 74 65 72   #endif....exter
17af0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
17b00 74 20 42 4f 4f 4c 20 53 65 74 43 75 72 72 65 6e  t BOOL SetCurren
17b10 74 44 69 72 65 63 74 6f 72 79 41 28 0d 0a 20 20  tDirectoryA(..  
17b20 4c 50 43 53 54 52 20 6c 70 50 61 74 68 4e 61 6d  LPCSTR lpPathNam
17b30 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  e);..extern(Wind
17b40 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
17b50 20 53 65 74 43 75 72 72 65 6e 74 44 69 72 65 63   SetCurrentDirec
17b60 74 6f 72 79 57 28 0d 0a 20 20 4c 50 43 57 53 54  toryW(..  LPCWST
17b70 52 20 6c 70 50 61 74 68 4e 61 6d 65 29 3b 0d 0a  R lpPathName);..
17b80 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
17b90 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
17ba0 65 6c 73 65 0d 0a 61 6c 69 61 73 20 53 65 74 43  else..alias SetC
17bb0 75 72 72 65 6e 74 44 69 72 65 63 74 6f 72 79 41  urrentDirectoryA
17bc0 20 53 65 74 43 75 72 72 65 6e 74 44 69 72 65 63   SetCurrentDirec
17bd0 74 6f 72 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  tory;..// #endif
17be0 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
17bf0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
17c00 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74  export DWORD Get
17c10 43 75 72 72 65 6e 74 44 69 72 65 63 74 6f 72 79  CurrentDirectory
17c20 41 28 0d 0a 20 20 44 57 4f 52 44 20 6e 42 75 66  A(..  DWORD nBuf
17c30 66 65 72 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50  ferLength,..  LP
17c40 53 54 52 20 6c 70 42 75 66 66 65 72 29 3b 0d 0a  STR lpBuffer);..
17c50 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
17c60 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74  export DWORD Get
17c70 43 75 72 72 65 6e 74 44 69 72 65 63 74 6f 72 79  CurrentDirectory
17c80 57 28 0d 0a 20 20 44 57 4f 52 44 20 6e 42 75 66  W(..  DWORD nBuf
17c90 66 65 72 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50  ferLength,..  LP
17ca0 57 53 54 52 20 6c 70 42 75 66 66 65 72 29 3b 0d  WSTR lpBuffer);.
17cb0 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
17cc0 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
17cd0 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74  #else..alias Get
17ce0 43 75 72 72 65 6e 74 44 69 72 65 63 74 6f 72 79  CurrentDirectory
17cf0 41 20 47 65 74 43 75 72 72 65 6e 74 44 69 72 65  A GetCurrentDire
17d00 63 74 6f 72 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69  ctory;..// #endi
17d10 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
17d20 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
17d30 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74   export BOOL Get
17d40 44 69 73 6b 46 72 65 65 53 70 61 63 65 41 28 0d  DiskFreeSpaceA(.
17d50 0a 20 20 4c 50 43 53 54 52 20 6c 70 52 6f 6f 74  .  LPCSTR lpRoot
17d60 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44  PathName,..  LPD
17d70 57 4f 52 44 20 6c 70 53 65 63 74 6f 72 73 50 65  WORD lpSectorsPe
17d80 72 43 6c 75 73 74 65 72 2c 0d 0a 20 20 4c 50 44  rCluster,..  LPD
17d90 57 4f 52 44 20 6c 70 42 79 74 65 73 50 65 72 53  WORD lpBytesPerS
17da0 65 63 74 6f 72 2c 0d 0a 20 20 4c 50 44 57 4f 52  ector,..  LPDWOR
17db0 44 20 6c 70 4e 75 6d 62 65 72 4f 66 46 72 65 65  D lpNumberOfFree
17dc0 43 6c 75 73 74 65 72 73 2c 0d 0a 20 20 4c 50 44  Clusters,..  LPD
17dd0 57 4f 52 44 20 6c 70 54 6f 74 61 6c 4e 75 6d 62  WORD lpTotalNumb
17de0 65 72 4f 66 43 6c 75 73 74 65 72 73 29 3b 0d 0a  erOfClusters);..
17df0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
17e00 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 44  export BOOL GetD
17e10 69 73 6b 46 72 65 65 53 70 61 63 65 57 28 0d 0a  iskFreeSpaceW(..
17e20 20 20 4c 50 43 57 53 54 52 20 6c 70 52 6f 6f 74    LPCWSTR lpRoot
17e30 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44  PathName,..  LPD
17e40 57 4f 52 44 20 6c 70 53 65 63 74 6f 72 73 50 65  WORD lpSectorsPe
17e50 72 43 6c 75 73 74 65 72 2c 0d 0a 20 20 4c 50 44  rCluster,..  LPD
17e60 57 4f 52 44 20 6c 70 42 79 74 65 73 50 65 72 53  WORD lpBytesPerS
17e70 65 63 74 6f 72 2c 0d 0a 20 20 4c 50 44 57 4f 52  ector,..  LPDWOR
17e80 44 20 6c 70 4e 75 6d 62 65 72 4f 66 46 72 65 65  D lpNumberOfFree
17e90 43 6c 75 73 74 65 72 73 2c 0d 0a 20 20 4c 50 44  Clusters,..  LPD
17ea0 57 4f 52 44 20 6c 70 54 6f 74 61 6c 4e 75 6d 62  WORD lpTotalNumb
17eb0 65 72 4f 66 43 6c 75 73 74 65 72 73 29 3b 0d 0a  erOfClusters);..
17ec0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
17ed0 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
17ee0 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 44  else..alias GetD
17ef0 69 73 6b 46 72 65 65 53 70 61 63 65 41 20 47 65  iskFreeSpaceA Ge
17f00 74 44 69 73 6b 46 72 65 65 53 70 61 63 65 3b 0d  tDiskFreeSpace;.
17f10 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
17f20 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
17f30 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
17f40 20 42 4f 4f 4c 20 47 65 74 44 69 73 6b 46 72 65   BOOL GetDiskFre
17f50 65 53 70 61 63 65 45 78 41 28 0d 0a 20 20 4c 50  eSpaceExA(..  LP
17f60 43 53 54 52 20 6c 70 44 69 72 65 63 74 6f 72 79  CSTR lpDirectory
17f70 4e 61 6d 65 2c 0d 0a 20 20 50 55 4c 41 52 47 45  Name,..  PULARGE
17f80 5f 49 4e 54 45 47 45 52 20 6c 70 46 72 65 65 42  _INTEGER lpFreeB
17f90 79 74 65 73 41 76 61 69 6c 61 62 6c 65 54 6f 43  ytesAvailableToC
17fa0 61 6c 6c 65 72 2c 0d 0a 20 20 50 55 4c 41 52 47  aller,..  PULARG
17fb0 45 5f 49 4e 54 45 47 45 52 20 6c 70 54 6f 74 61  E_INTEGER lpTota
17fc0 6c 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 2c 0d  lNumberOfBytes,.
17fd0 0a 20 20 50 55 4c 41 52 47 45 5f 49 4e 54 45 47  .  PULARGE_INTEG
17fe0 45 52 20 6c 70 54 6f 74 61 6c 4e 75 6d 62 65 72  ER lpTotalNumber
17ff0 4f 66 46 72 65 65 42 79 74 65 73 29 3b 0d 0a 65  OfFreeBytes);..e
18000 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
18010 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 44 69  xport BOOL GetDi
18020 73 6b 46 72 65 65 53 70 61 63 65 45 78 57 28 0d  skFreeSpaceExW(.
18030 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 44 69 72  .  LPCWSTR lpDir
18040 65 63 74 6f 72 79 4e 61 6d 65 2c 0d 0a 20 20 50  ectoryName,..  P
18050 55 4c 41 52 47 45 5f 49 4e 54 45 47 45 52 20 6c  ULARGE_INTEGER l
18060 70 46 72 65 65 42 79 74 65 73 41 76 61 69 6c 61  pFreeBytesAvaila
18070 62 6c 65 54 6f 43 61 6c 6c 65 72 2c 0d 0a 20 20  bleToCaller,..  
18080 50 55 4c 41 52 47 45 5f 49 4e 54 45 47 45 52 20  PULARGE_INTEGER 
18090 6c 70 54 6f 74 61 6c 4e 75 6d 62 65 72 4f 66 42  lpTotalNumberOfB
180a0 79 74 65 73 2c 0d 0a 20 20 50 55 4c 41 52 47 45  ytes,..  PULARGE
180b0 5f 49 4e 54 45 47 45 52 20 6c 70 54 6f 74 61 6c  _INTEGER lpTotal
180c0 4e 75 6d 62 65 72 4f 66 46 72 65 65 42 79 74 65  NumberOfFreeByte
180d0 73 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  s);..// #ifdef U
180e0 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
180f0 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
18100 20 47 65 74 44 69 73 6b 46 72 65 65 53 70 61 63   GetDiskFreeSpac
18110 65 45 78 41 20 47 65 74 44 69 73 6b 46 72 65 65  eExA GetDiskFree
18120 53 70 61 63 65 45 78 3b 0d 0a 2f 2f 20 23 65 6e  SpaceEx;..// #en
18130 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
18140 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
18150 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43  s) export BOOL C
18160 72 65 61 74 65 44 69 72 65 63 74 6f 72 79 41 28  reateDirectoryA(
18170 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 50 61 74  ..  LPCSTR lpPat
18180 68 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 45 43 55  hName,..  LPSECU
18190 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53 20  RITY_ATTRIBUTES 
181a0 6c 70 53 65 63 75 72 69 74 79 41 74 74 72 69 62  lpSecurityAttrib
181b0 75 74 65 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57  utes);..extern(W
181c0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
181d0 4f 4f 4c 20 43 72 65 61 74 65 44 69 72 65 63 74  OOL CreateDirect
181e0 6f 72 79 57 28 0d 0a 20 20 4c 50 43 57 53 54 52  oryW(..  LPCWSTR
181f0 20 6c 70 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20   lpPathName,..  
18200 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49  LPSECURITY_ATTRI
18210 42 55 54 45 53 20 6c 70 53 65 63 75 72 69 74 79  BUTES lpSecurity
18220 41 74 74 72 69 62 75 74 65 73 29 3b 0d 0a 2f 2f  Attributes);..//
18230 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
18240 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
18250 73 65 0d 0a 61 6c 69 61 73 20 43 72 65 61 74 65  se..alias Create
18260 44 69 72 65 63 74 6f 72 79 41 20 43 72 65 61 74  DirectoryA Creat
18270 65 44 69 72 65 63 74 6f 72 79 3b 0d 0a 2f 2f 20  eDirectory;..// 
18280 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
18290 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
182a0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
182b0 4c 20 43 72 65 61 74 65 44 69 72 65 63 74 6f 72  L CreateDirector
182c0 79 45 78 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  yExA(..  LPCSTR 
182d0 6c 70 54 65 6d 70 6c 61 74 65 44 69 72 65 63 74  lpTemplateDirect
182e0 6f 72 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ory,..  LPCSTR l
182f0 70 4e 65 77 44 69 72 65 63 74 6f 72 79 2c 0d 0a  pNewDirectory,..
18300 20 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54    LPSECURITY_ATT
18310 52 49 42 55 54 45 53 20 6c 70 53 65 63 75 72 69  RIBUTES lpSecuri
18320 74 79 41 74 74 72 69 62 75 74 65 73 29 3b 0d 0a  tyAttributes);..
18330 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
18340 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43 72 65 61  export BOOL Crea
18350 74 65 44 69 72 65 63 74 6f 72 79 45 78 57 28 0d  teDirectoryExW(.
18360 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 54 65 6d  .  LPCWSTR lpTem
18370 70 6c 61 74 65 44 69 72 65 63 74 6f 72 79 2c 0d  plateDirectory,.
18380 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 4e 65 77  .  LPCWSTR lpNew
18390 44 69 72 65 63 74 6f 72 79 2c 0d 0a 20 20 4c 50  Directory,..  LP
183a0 53 45 43 55 52 49 54 59 5f 41 54 54 52 49 42 55  SECURITY_ATTRIBU
183b0 54 45 53 20 6c 70 53 65 63 75 72 69 74 79 41 74  TES lpSecurityAt
183c0 74 72 69 62 75 74 65 73 29 3b 0d 0a 2f 2f 20 23  tributes);..// #
183d0 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
183e0 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  / #.....// #else
183f0 0d 0a 61 6c 69 61 73 20 43 72 65 61 74 65 44 69  ..alias CreateDi
18400 72 65 63 74 6f 72 79 45 78 41 20 43 72 65 61 74  rectoryExA Creat
18410 65 44 69 72 65 63 74 6f 72 79 45 78 3b 0d 0a 2f  eDirectoryEx;../
18420 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
18430 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
18440 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
18450 4f 4f 4c 20 52 65 6d 6f 76 65 44 69 72 65 63 74  OOL RemoveDirect
18460 6f 72 79 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  oryA(..  LPCSTR 
18470 6c 70 50 61 74 68 4e 61 6d 65 29 3b 0d 0a 65 78  lpPathName);..ex
18480 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
18490 70 6f 72 74 20 42 4f 4f 4c 20 52 65 6d 6f 76 65  port BOOL Remove
184a0 44 69 72 65 63 74 6f 72 79 57 28 0d 0a 20 20 4c  DirectoryW(..  L
184b0 50 43 57 53 54 52 20 6c 70 50 61 74 68 4e 61 6d  PCWSTR lpPathNam
184c0 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  e);..// #ifdef U
184d0 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
184e0 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
184f0 20 52 65 6d 6f 76 65 44 69 72 65 63 74 6f 72 79   RemoveDirectory
18500 41 20 52 65 6d 6f 76 65 44 69 72 65 63 74 6f 72  A RemoveDirector
18510 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  y;..// #endif //
18520 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
18530 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
18540 6f 72 74 20 44 57 4f 52 44 20 47 65 74 46 75 6c  ort DWORD GetFul
18550 6c 50 61 74 68 4e 61 6d 65 41 28 0d 0a 20 20 4c  lPathNameA(..  L
18560 50 43 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65  PCSTR lpFileName
18570 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 42 75 66 66  ,..  DWORD nBuff
18580 65 72 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 53  erLength,..  LPS
18590 54 52 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20  TR lpBuffer,..  
185a0 4c 50 53 54 52 20 2a 6c 70 46 69 6c 65 50 61 72  LPSTR *lpFilePar
185b0 74 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  t);..extern(Wind
185c0 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
185d0 44 20 47 65 74 46 75 6c 6c 50 61 74 68 4e 61 6d  D GetFullPathNam
185e0 65 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  eW(..  LPCWSTR l
185f0 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 44 57  pFileName,..  DW
18600 4f 52 44 20 6e 42 75 66 66 65 72 4c 65 6e 67 74  ORD nBufferLengt
18610 68 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 42  h,..  LPWSTR lpB
18620 75 66 66 65 72 2c 0d 0a 20 20 4c 50 57 53 54 52  uffer,..  LPWSTR
18630 20 2a 6c 70 46 69 6c 65 50 61 72 74 29 3b 0d 0a   *lpFilePart);..
18640 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
18650 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
18660 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 46  else..alias GetF
18670 75 6c 6c 50 61 74 68 4e 61 6d 65 41 20 47 65 74  ullPathNameA Get
18680 46 75 6c 6c 50 61 74 68 4e 61 6d 65 3b 0d 0a 2f  FullPathName;../
18690 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
186a0 43 4f 44 45 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75  CODE....enum : u
186b0 69 6e 74 20 7b 20 44 44 44 5f 52 41 57 5f 54 41  int { DDD_RAW_TA
186c0 52 47 45 54 5f 50 41 54 48 20 3d 20 30 78 30 30  RGET_PATH = 0x00
186d0 30 30 30 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a  000001 }..enum :
186e0 20 75 69 6e 74 20 7b 20 44 44 44 5f 52 45 4d 4f   uint { DDD_REMO
186f0 56 45 5f 44 45 46 49 4e 49 54 49 4f 4e 20 3d 20  VE_DEFINITION = 
18700 30 78 30 30 30 30 30 30 30 32 20 7d 0d 0a 65 6e  0x00000002 }..en
18710 75 6d 20 3a 20 75 69 6e 74 20 7b 20 44 44 44 5f  um : uint { DDD_
18720 45 58 41 43 54 5f 4d 41 54 43 48 5f 4f 4e 5f 52  EXACT_MATCH_ON_R
18730 45 4d 4f 56 45 20 3d 20 30 78 30 30 30 30 30 30  EMOVE = 0x000000
18740 30 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  04 }..enum : uin
18750 74 20 7b 20 44 44 44 5f 4e 4f 5f 42 52 4f 41 44  t { DDD_NO_BROAD
18760 43 41 53 54 5f 53 59 53 54 45 4d 20 3d 20 30 78  CAST_SYSTEM = 0x
18770 30 30 30 30 30 30 30 38 20 7d 0d 0a 65 6e 75 6d  00000008 }..enum
18780 20 3a 20 75 69 6e 74 20 7b 20 44 44 44 5f 4c 55   : uint { DDD_LU
18790 49 44 5f 42 52 4f 41 44 43 41 53 54 5f 44 52 49  ID_BROADCAST_DRI
187a0 56 45 20 3d 20 30 78 30 30 30 30 30 30 31 30 20  VE = 0x00000010 
187b0 7d 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  }....extern(Wind
187c0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
187d0 20 44 65 66 69 6e 65 44 6f 73 44 65 76 69 63 65   DefineDosDevice
187e0 41 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 6c  A(..  DWORD dwFl
187f0 61 67 73 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ags,..  LPCSTR l
18800 70 44 65 76 69 63 65 4e 61 6d 65 2c 0d 0a 20 20  pDeviceName,..  
18810 4c 50 43 53 54 52 20 6c 70 54 61 72 67 65 74 50  LPCSTR lpTargetP
18820 61 74 68 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ath);..extern(Wi
18830 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
18840 4f 4c 20 44 65 66 69 6e 65 44 6f 73 44 65 76 69  OL DefineDosDevi
18850 63 65 57 28 0d 0a 20 20 44 57 4f 52 44 20 64 77  ceW(..  DWORD dw
18860 46 6c 61 67 73 2c 0d 0a 20 20 4c 50 43 57 53 54  Flags,..  LPCWST
18870 52 20 6c 70 44 65 76 69 63 65 4e 61 6d 65 2c 0d  R lpDeviceName,.
18880 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 54 61 72  .  LPCWSTR lpTar
18890 67 65 74 50 61 74 68 29 3b 0d 0a 2f 2f 20 23 69  getPath);..// #i
188a0 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
188b0 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
188c0 0a 61 6c 69 61 73 20 44 65 66 69 6e 65 44 6f 73  .alias DefineDos
188d0 44 65 76 69 63 65 41 20 44 65 66 69 6e 65 44 6f  DeviceA DefineDo
188e0 73 44 65 76 69 63 65 3b 0d 0a 2f 2f 20 23 65 6e  sDevice;..// #en
188f0 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
18900 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
18910 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
18920 51 75 65 72 79 44 6f 73 44 65 76 69 63 65 41 28  QueryDosDeviceA(
18930 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 44 65 76  ..  LPCSTR lpDev
18940 69 63 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 54  iceName,..  LPST
18950 52 20 6c 70 54 61 72 67 65 74 50 61 74 68 2c 0d  R lpTargetPath,.
18960 0a 20 20 44 57 4f 52 44 20 75 63 63 68 4d 61 78  .  DWORD ucchMax
18970 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
18980 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44  ws) export DWORD
18990 20 51 75 65 72 79 44 6f 73 44 65 76 69 63 65 57   QueryDosDeviceW
189a0 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 44  (..  LPCWSTR lpD
189b0 65 76 69 63 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  eviceName,..  LP
189c0 57 53 54 52 20 6c 70 54 61 72 67 65 74 50 61 74  WSTR lpTargetPat
189d0 68 2c 0d 0a 20 20 44 57 4f 52 44 20 75 63 63 68  h,..  DWORD ucch
189e0 4d 61 78 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  Max);..// #ifdef
189f0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
18a00 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
18a10 61 73 20 51 75 65 72 79 44 6f 73 44 65 76 69 63  as QueryDosDevic
18a20 65 41 20 51 75 65 72 79 44 6f 73 44 65 76 69 63  eA QueryDosDevic
18a30 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  e;..// #endif //
18a40 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 2f 2f 20   !UNICODE....// 
18a50 23 64 65 66 69 6e 65 20 45 58 50 41 4e 44 5f 4c  #define EXPAND_L
18a60 4f 43 41 4c 5f 44 52 49 56 45 53 0d 0a 0d 0a 65  OCAL_DRIVES....e
18a70 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
18a80 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 43 72 65  xport HANDLE Cre
18a90 61 74 65 46 69 6c 65 41 28 0d 0a 20 20 4c 50 43  ateFileA(..  LPC
18aa0 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65 2c 0d  STR lpFileName,.
18ab0 0a 20 20 44 57 4f 52 44 20 64 77 44 65 73 69 72  .  DWORD dwDesir
18ac0 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 44 57 4f  edAccess,..  DWO
18ad0 52 44 20 64 77 53 68 61 72 65 4d 6f 64 65 2c 0d  RD dwShareMode,.
18ae0 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54  .  LPSECURITY_AT
18af0 54 52 49 42 55 54 45 53 20 6c 70 53 65 63 75 72  TRIBUTES lpSecur
18b00 69 74 79 41 74 74 72 69 62 75 74 65 73 2c 0d 0a  ityAttributes,..
18b10 20 20 44 57 4f 52 44 20 64 77 43 72 65 61 74 69    DWORD dwCreati
18b20 6f 6e 44 69 73 70 6f 73 69 74 69 6f 6e 2c 0d 0a  onDisposition,..
18b30 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73 41    DWORD dwFlagsA
18b40 6e 64 41 74 74 72 69 62 75 74 65 73 2c 0d 0a 20  ndAttributes,.. 
18b50 20 48 41 4e 44 4c 45 20 68 54 65 6d 70 6c 61 74   HANDLE hTemplat
18b60 65 46 69 6c 65 29 3b 0d 0a 65 78 74 65 72 6e 28  eFile);..extern(
18b70 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
18b80 48 41 4e 44 4c 45 20 43 72 65 61 74 65 46 69 6c  HANDLE CreateFil
18b90 65 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  eW(..  LPCWSTR l
18ba0 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 44 57  pFileName,..  DW
18bb0 4f 52 44 20 64 77 44 65 73 69 72 65 64 41 63 63  ORD dwDesiredAcc
18bc0 65 73 73 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77  ess,..  DWORD dw
18bd0 53 68 61 72 65 4d 6f 64 65 2c 0d 0a 20 20 4c 50  ShareMode,..  LP
18be0 53 45 43 55 52 49 54 59 5f 41 54 54 52 49 42 55  SECURITY_ATTRIBU
18bf0 54 45 53 20 6c 70 53 65 63 75 72 69 74 79 41 74  TES lpSecurityAt
18c00 74 72 69 62 75 74 65 73 2c 0d 0a 20 20 44 57 4f  tributes,..  DWO
18c10 52 44 20 64 77 43 72 65 61 74 69 6f 6e 44 69 73  RD dwCreationDis
18c20 70 6f 73 69 74 69 6f 6e 2c 0d 0a 20 20 44 57 4f  position,..  DWO
18c30 52 44 20 64 77 46 6c 61 67 73 41 6e 64 41 74 74  RD dwFlagsAndAtt
18c40 72 69 62 75 74 65 73 2c 0d 0a 20 20 48 41 4e 44  ributes,..  HAND
18c50 4c 45 20 68 54 65 6d 70 6c 61 74 65 46 69 6c 65  LE hTemplateFile
18c60 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
18c70 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
18c80 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
18c90 43 72 65 61 74 65 46 69 6c 65 41 20 43 72 65 61  CreateFileA Crea
18ca0 74 65 46 69 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64  teFile;..// #end
18cb0 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
18cc0 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
18cd0 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
18ce0 74 46 69 6c 65 41 74 74 72 69 62 75 74 65 73 41  tFileAttributesA
18cf0 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 69  (..  LPCSTR lpFi
18d00 6c 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  leName,..  DWORD
18d10 20 64 77 46 69 6c 65 41 74 74 72 69 62 75 74 65   dwFileAttribute
18d20 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  s);..extern(Wind
18d30 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
18d40 20 53 65 74 46 69 6c 65 41 74 74 72 69 62 75 74   SetFileAttribut
18d50 65 73 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20  esW(..  LPCWSTR 
18d60 6c 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 44  lpFileName,..  D
18d70 57 4f 52 44 20 64 77 46 69 6c 65 41 74 74 72 69  WORD dwFileAttri
18d80 62 75 74 65 73 29 3b 0d 0a 2f 2f 20 23 69 66 64  butes);..// #ifd
18d90 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
18da0 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
18db0 6c 69 61 73 20 53 65 74 46 69 6c 65 41 74 74 72  lias SetFileAttr
18dc0 69 62 75 74 65 73 41 20 53 65 74 46 69 6c 65 41  ibutesA SetFileA
18dd0 74 74 72 69 62 75 74 65 73 3b 0d 0a 2f 2f 20 23  ttributes;..// #
18de0 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
18df0 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
18e00 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
18e10 44 20 47 65 74 46 69 6c 65 41 74 74 72 69 62 75  D GetFileAttribu
18e20 74 65 73 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  tesA(..  LPCSTR 
18e30 6c 70 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a 65 78  lpFileName);..ex
18e40 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
18e50 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74 46 69  port DWORD GetFi
18e60 6c 65 41 74 74 72 69 62 75 74 65 73 57 28 0d 0a  leAttributesW(..
18e70 20 20 4c 50 43 57 53 54 52 20 6c 70 46 69 6c 65    LPCWSTR lpFile
18e80 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  Name);..// #ifde
18e90 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e  f UNICODE..// #.
18ea0 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c  ....// #else..al
18eb0 69 61 73 20 47 65 74 46 69 6c 65 41 74 74 72 69  ias GetFileAttri
18ec0 62 75 74 65 73 41 20 47 65 74 46 69 6c 65 41 74  butesA GetFileAt
18ed0 74 72 69 62 75 74 65 73 3b 0d 0a 2f 2f 20 23 65  tributes;..// #e
18ee0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
18ef0 0d 0a 0d 0a 61 6c 69 61 73 20 69 6e 74 20 5f 47  ....alias int _G
18f00 45 54 5f 46 49 4c 45 45 58 5f 49 4e 46 4f 5f 4c  ET_FILEEX_INFO_L
18f10 45 56 45 4c 53 3b 0d 0a 65 6e 75 6d 20 7b 0d 0a  EVELS;..enum {..
18f20 20 20 47 65 74 46 69 6c 65 45 78 49 6e 66 6f 53    GetFileExInfoS
18f30 74 61 6e 64 61 72 64 2c 0d 0a 20 20 47 65 74 46  tandard,..  GetF
18f40 69 6c 65 45 78 4d 61 78 49 6e 66 6f 4c 65 76 65  ileExMaxInfoLeve
18f50 6c 2c 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 47 45  l,..}..alias _GE
18f60 54 5f 46 49 4c 45 45 58 5f 49 4e 46 4f 5f 4c 45  T_FILEEX_INFO_LE
18f70 56 45 4c 53 20 47 45 54 5f 46 49 4c 45 45 58 5f  VELS GET_FILEEX_
18f80 49 4e 46 4f 5f 4c 45 56 45 4c 53 3b 0d 0a 0d 0a  INFO_LEVELS;....
18f90 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
18fa0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 46  export BOOL GetF
18fb0 69 6c 65 41 74 74 72 69 62 75 74 65 73 45 78 41  ileAttributesExA
18fc0 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 69  (..  LPCSTR lpFi
18fd0 6c 65 4e 61 6d 65 2c 0d 0a 20 20 47 45 54 5f 46  leName,..  GET_F
18fe0 49 4c 45 45 58 5f 49 4e 46 4f 5f 4c 45 56 45 4c  ILEEX_INFO_LEVEL
18ff0 53 20 66 49 6e 66 6f 4c 65 76 65 6c 49 64 2c 0d  S fInfoLevelId,.
19000 0a 20 20 4c 50 56 4f 49 44 20 6c 70 46 69 6c 65  .  LPVOID lpFile
19010 49 6e 66 6f 72 6d 61 74 69 6f 6e 29 3b 0d 0a 65  Information);..e
19020 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
19030 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 46 69  xport BOOL GetFi
19040 6c 65 41 74 74 72 69 62 75 74 65 73 45 78 57 28  leAttributesExW(
19050 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 46 69  ..  LPCWSTR lpFi
19060 6c 65 4e 61 6d 65 2c 0d 0a 20 20 47 45 54 5f 46  leName,..  GET_F
19070 49 4c 45 45 58 5f 49 4e 46 4f 5f 4c 45 56 45 4c  ILEEX_INFO_LEVEL
19080 53 20 66 49 6e 66 6f 4c 65 76 65 6c 49 64 2c 0d  S fInfoLevelId,.
19090 0a 20 20 4c 50 56 4f 49 44 20 6c 70 46 69 6c 65  .  LPVOID lpFile
190a0 49 6e 66 6f 72 6d 61 74 69 6f 6e 29 3b 0d 0a 2f  Information);../
190b0 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
190c0 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
190d0 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 46 69  lse..alias GetFi
190e0 6c 65 41 74 74 72 69 62 75 74 65 73 45 78 41 20  leAttributesExA 
190f0 47 65 74 46 69 6c 65 41 74 74 72 69 62 75 74 65  GetFileAttribute
19100 73 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  sEx;..// #endif 
19110 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65  // !UNICODE....e
19120 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
19130 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74 43  xport DWORD GetC
19140 6f 6d 70 72 65 73 73 65 64 46 69 6c 65 53 69 7a  ompressedFileSiz
19150 65 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  eA(..  LPCSTR lp
19160 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44  FileName,..  LPD
19170 57 4f 52 44 20 6c 70 46 69 6c 65 53 69 7a 65 48  WORD lpFileSizeH
19180 69 67 68 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  igh);..extern(Wi
19190 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57  ndows) export DW
191a0 4f 52 44 20 47 65 74 43 6f 6d 70 72 65 73 73 65  ORD GetCompresse
191b0 64 46 69 6c 65 53 69 7a 65 57 28 0d 0a 20 20 4c  dFileSizeW(..  L
191c0 50 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d  PCWSTR lpFileNam
191d0 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70  e,..  LPDWORD lp
191e0 46 69 6c 65 53 69 7a 65 48 69 67 68 29 3b 0d 0a  FileSizeHigh);..
191f0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
19200 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
19210 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 43  else..alias GetC
19220 6f 6d 70 72 65 73 73 65 64 46 69 6c 65 53 69 7a  ompressedFileSiz
19230 65 41 20 47 65 74 43 6f 6d 70 72 65 73 73 65 64  eA GetCompressed
19240 46 69 6c 65 53 69 7a 65 3b 0d 0a 2f 2f 20 23 65  FileSize;..// #e
19250 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
19260 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
19270 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
19280 44 65 6c 65 74 65 46 69 6c 65 41 28 0d 0a 20 20  DeleteFileA(..  
19290 4c 50 43 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d  LPCSTR lpFileNam
192a0 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  e);..extern(Wind
192b0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
192c0 20 44 65 6c 65 74 65 46 69 6c 65 57 28 0d 0a 20   DeleteFileW(.. 
192d0 20 4c 50 43 57 53 54 52 20 6c 70 46 69 6c 65 4e   LPCWSTR lpFileN
192e0 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ame);..// #ifdef
192f0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
19300 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
19310 61 73 20 44 65 6c 65 74 65 46 69 6c 65 41 20 44  as DeleteFileA D
19320 65 6c 65 74 65 46 69 6c 65 3b 0d 0a 2f 2f 20 23  eleteFile;..// #
19330 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
19340 45 0d 0a 0d 0a 2f 2f 20 23 69 66 28 5f 57 49 4e  E....// #if(_WIN
19350 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 34  32_WINNT >= 0x04
19360 30 30 29 0d 0a 61 6c 69 61 73 20 69 6e 74 20 5f  00)..alias int _
19370 46 49 4e 44 45 58 5f 49 4e 46 4f 5f 4c 45 56 45  FINDEX_INFO_LEVE
19380 4c 53 3b 0d 0a 65 6e 75 6d 20 7b 0d 0a 20 20 46  LS;..enum {..  F
19390 69 6e 64 45 78 49 6e 66 6f 53 74 61 6e 64 61 72  indExInfoStandar
193a0 64 2c 0d 0a 20 20 46 69 6e 64 45 78 49 6e 66 6f  d,..  FindExInfo
193b0 4d 61 78 49 6e 66 6f 4c 65 76 65 6c 2c 0d 0a 7d  MaxInfoLevel,..}
193c0 0d 0a 61 6c 69 61 73 20 5f 46 49 4e 44 45 58 5f  ..alias _FINDEX_
193d0 49 4e 46 4f 5f 4c 45 56 45 4c 53 20 46 49 4e 44  INFO_LEVELS FIND
193e0 45 58 5f 49 4e 46 4f 5f 4c 45 56 45 4c 53 3b 0d  EX_INFO_LEVELS;.
193f0 0a 0d 0a 61 6c 69 61 73 20 69 6e 74 20 5f 46 49  ...alias int _FI
19400 4e 44 45 58 5f 53 45 41 52 43 48 5f 4f 50 53 3b  NDEX_SEARCH_OPS;
19410 0d 0a 65 6e 75 6d 20 7b 0d 0a 20 20 46 69 6e 64  ..enum {..  Find
19420 45 78 53 65 61 72 63 68 4e 61 6d 65 4d 61 74 63  ExSearchNameMatc
19430 68 2c 0d 0a 20 20 46 69 6e 64 45 78 53 65 61 72  h,..  FindExSear
19440 63 68 4c 69 6d 69 74 54 6f 44 69 72 65 63 74 6f  chLimitToDirecto
19450 72 69 65 73 2c 0d 0a 20 20 46 69 6e 64 45 78 53  ries,..  FindExS
19460 65 61 72 63 68 4c 69 6d 69 74 54 6f 44 65 76 69  earchLimitToDevi
19470 63 65 73 2c 0d 0a 20 20 46 69 6e 64 45 78 53 65  ces,..  FindExSe
19480 61 72 63 68 4d 61 78 53 65 61 72 63 68 4f 70 2c  archMaxSearchOp,
19490 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f 46 49 4e 44  ..}..alias _FIND
194a0 45 58 5f 53 45 41 52 43 48 5f 4f 50 53 20 46 49  EX_SEARCH_OPS FI
194b0 4e 44 45 58 5f 53 45 41 52 43 48 5f 4f 50 53 3b  NDEX_SEARCH_OPS;
194c0 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20  ....enum : uint 
194d0 7b 20 46 49 4e 44 5f 46 49 52 53 54 5f 45 58 5f  { FIND_FIRST_EX_
194e0 43 41 53 45 5f 53 45 4e 53 49 54 49 56 45 20 3d  CASE_SENSITIVE =
194f0 20 30 78 30 30 30 30 30 30 30 31 20 7d 0d 0a 0d   0x00000001 }...
19500 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
19510 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 46   export HANDLE F
19520 69 6e 64 46 69 72 73 74 46 69 6c 65 45 78 41 28  indFirstFileExA(
19530 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 69 6c  ..  LPCSTR lpFil
19540 65 4e 61 6d 65 2c 0d 0a 20 20 46 49 4e 44 45 58  eName,..  FINDEX
19550 5f 49 4e 46 4f 5f 4c 45 56 45 4c 53 20 66 49 6e  _INFO_LEVELS fIn
19560 66 6f 4c 65 76 65 6c 49 64 2c 0d 0a 20 20 4c 50  foLevelId,..  LP
19570 56 4f 49 44 20 6c 70 46 69 6e 64 46 69 6c 65 44  VOID lpFindFileD
19580 61 74 61 2c 0d 0a 20 20 46 49 4e 44 45 58 5f 53  ata,..  FINDEX_S
19590 45 41 52 43 48 5f 4f 50 53 20 66 53 65 61 72 63  EARCH_OPS fSearc
195a0 68 4f 70 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c  hOp,..  LPVOID l
195b0 70 53 65 61 72 63 68 46 69 6c 74 65 72 2c 0d 0a  pSearchFilter,..
195c0 20 20 44 57 4f 52 44 20 64 77 41 64 64 69 74 69    DWORD dwAdditi
195d0 6f 6e 61 6c 46 6c 61 67 73 29 3b 0d 0a 65 78 74  onalFlags);..ext
195e0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
195f0 6f 72 74 20 48 41 4e 44 4c 45 20 46 69 6e 64 46  ort HANDLE FindF
19600 69 72 73 74 46 69 6c 65 45 78 57 28 0d 0a 20 20  irstFileExW(..  
19610 4c 50 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61  LPCWSTR lpFileNa
19620 6d 65 2c 0d 0a 20 20 46 49 4e 44 45 58 5f 49 4e  me,..  FINDEX_IN
19630 46 4f 5f 4c 45 56 45 4c 53 20 66 49 6e 66 6f 4c  FO_LEVELS fInfoL
19640 65 76 65 6c 49 64 2c 0d 0a 20 20 4c 50 56 4f 49  evelId,..  LPVOI
19650 44 20 6c 70 46 69 6e 64 46 69 6c 65 44 61 74 61  D lpFindFileData
19660 2c 0d 0a 20 20 46 49 4e 44 45 58 5f 53 45 41 52  ,..  FINDEX_SEAR
19670 43 48 5f 4f 50 53 20 66 53 65 61 72 63 68 4f 70  CH_OPS fSearchOp
19680 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 53 65  ,..  LPVOID lpSe
19690 61 72 63 68 46 69 6c 74 65 72 2c 0d 0a 20 20 44  archFilter,..  D
196a0 57 4f 52 44 20 64 77 41 64 64 69 74 69 6f 6e 61  WORD dwAdditiona
196b0 6c 46 6c 61 67 73 29 3b 0d 0a 2f 2f 20 23 69 66  lFlags);..// #if
196c0 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
196d0 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
196e0 61 6c 69 61 73 20 46 69 6e 64 46 69 72 73 74 46  alias FindFirstF
196f0 69 6c 65 45 78 41 20 46 69 6e 64 46 69 72 73 74  ileExA FindFirst
19700 46 69 6c 65 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64  FileEx;..// #end
19710 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
19720 2f 2f 20 23 65 6e 64 69 66 20 2f 2a 20 5f 57 49  // #endif /* _WI
19730 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30  N32_WINNT >= 0x0
19740 34 30 30 20 2a 2f 0d 0a 0d 0a 65 78 74 65 72 6e  400 */....extern
19750 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
19760 20 48 41 4e 44 4c 45 20 46 69 6e 64 46 69 72 73   HANDLE FindFirs
19770 74 46 69 6c 65 41 28 0d 0a 20 20 4c 50 43 53 54  tFileA(..  LPCST
19780 52 20 6c 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20  R lpFileName,.. 
19790 20 4c 50 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41   LPWIN32_FIND_DA
197a0 54 41 41 20 6c 70 46 69 6e 64 46 69 6c 65 44 61  TAA lpFindFileDa
197b0 74 61 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  ta);..extern(Win
197c0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
197d0 44 4c 45 20 46 69 6e 64 46 69 72 73 74 46 69 6c  DLE FindFirstFil
197e0 65 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  eW(..  LPCWSTR l
197f0 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  pFileName,..  LP
19800 57 49 4e 33 32 5f 46 49 4e 44 5f 44 41 54 41 57  WIN32_FIND_DATAW
19810 20 6c 70 46 69 6e 64 46 69 6c 65 44 61 74 61 29   lpFindFileData)
19820 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
19830 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
19840 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46  / #else..alias F
19850 69 6e 64 46 69 72 73 74 46 69 6c 65 41 20 46 69  indFirstFileA Fi
19860 6e 64 46 69 72 73 74 46 69 6c 65 3b 0d 0a 2f 2f  ndFirstFile;..//
19870 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
19880 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
19890 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
198a0 4f 4c 20 46 69 6e 64 4e 65 78 74 46 69 6c 65 41  OL FindNextFileA
198b0 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6e  (..  HANDLE hFin
198c0 64 46 69 6c 65 2c 0d 0a 20 20 4c 50 57 49 4e 33  dFile,..  LPWIN3
198d0 32 5f 46 49 4e 44 5f 44 41 54 41 41 20 6c 70 46  2_FIND_DATAA lpF
198e0 69 6e 64 46 69 6c 65 44 61 74 61 29 3b 0d 0a 65  indFileData);..e
198f0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
19900 78 70 6f 72 74 20 42 4f 4f 4c 20 46 69 6e 64 4e  xport BOOL FindN
19910 65 78 74 46 69 6c 65 57 28 0d 0a 20 20 48 41 4e  extFileW(..  HAN
19920 44 4c 45 20 68 46 69 6e 64 46 69 6c 65 2c 0d 0a  DLE hFindFile,..
19930 20 20 4c 50 57 49 4e 33 32 5f 46 49 4e 44 5f 44    LPWIN32_FIND_D
19940 41 54 41 57 20 6c 70 46 69 6e 64 46 69 6c 65 44  ATAW lpFindFileD
19950 61 74 61 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ata);..// #ifdef
19960 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
19970 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
19980 61 73 20 46 69 6e 64 4e 65 78 74 46 69 6c 65 41  as FindNextFileA
19990 20 46 69 6e 64 4e 65 78 74 46 69 6c 65 3b 0d 0a   FindNextFile;..
199a0 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
199b0 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
199c0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
199d0 44 57 4f 52 44 20 53 65 61 72 63 68 50 61 74 68  DWORD SearchPath
199e0 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 50  A(..  LPCSTR lpP
199f0 61 74 68 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ath,..  LPCSTR l
19a00 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  pFileName,..  LP
19a10 43 53 54 52 20 6c 70 45 78 74 65 6e 73 69 6f 6e  CSTR lpExtension
19a20 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 42 75 66 66  ,..  DWORD nBuff
19a30 65 72 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 53  erLength,..  LPS
19a40 54 52 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20  TR lpBuffer,..  
19a50 4c 50 53 54 52 20 2a 6c 70 46 69 6c 65 50 61 72  LPSTR *lpFilePar
19a60 74 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  t);..extern(Wind
19a70 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
19a80 44 20 53 65 61 72 63 68 50 61 74 68 57 28 0d 0a  D SearchPathW(..
19a90 20 20 4c 50 43 57 53 54 52 20 6c 70 50 61 74 68    LPCWSTR lpPath
19aa0 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 46  ,..  LPCWSTR lpF
19ab0 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57  ileName,..  LPCW
19ac0 53 54 52 20 6c 70 45 78 74 65 6e 73 69 6f 6e 2c  STR lpExtension,
19ad0 0d 0a 20 20 44 57 4f 52 44 20 6e 42 75 66 66 65  ..  DWORD nBuffe
19ae0 72 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 57 53  rLength,..  LPWS
19af0 54 52 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20  TR lpBuffer,..  
19b00 4c 50 57 53 54 52 20 2a 6c 70 46 69 6c 65 50 61  LPWSTR *lpFilePa
19b10 72 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  rt);..// #ifdef 
19b20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
19b30 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
19b40 73 20 53 65 61 72 63 68 50 61 74 68 41 20 53 65  s SearchPathA Se
19b50 61 72 63 68 50 61 74 68 3b 0d 0a 2f 2f 20 23 65  archPath;..// #e
19b60 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
19b70 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
19b80 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
19b90 43 6f 70 79 46 69 6c 65 41 28 0d 0a 20 20 4c 50  CopyFileA(..  LP
19ba0 43 53 54 52 20 6c 70 45 78 69 73 74 69 6e 67 46  CSTR lpExistingF
19bb0 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53  ileName,..  LPCS
19bc0 54 52 20 6c 70 4e 65 77 46 69 6c 65 4e 61 6d 65  TR lpNewFileName
19bd0 2c 0d 0a 20 20 42 4f 4f 4c 20 62 46 61 69 6c 49  ,..  BOOL bFailI
19be0 66 45 78 69 73 74 73 29 3b 0d 0a 65 78 74 65 72  fExists);..exter
19bf0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
19c00 74 20 42 4f 4f 4c 20 43 6f 70 79 46 69 6c 65 57  t BOOL CopyFileW
19c10 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 45  (..  LPCWSTR lpE
19c20 78 69 73 74 69 6e 67 46 69 6c 65 4e 61 6d 65 2c  xistingFileName,
19c30 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 4e 65  ..  LPCWSTR lpNe
19c40 77 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 42 4f  wFileName,..  BO
19c50 4f 4c 20 62 46 61 69 6c 49 66 45 78 69 73 74 73  OL bFailIfExists
19c60 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
19c70 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
19c80 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
19c90 43 6f 70 79 46 69 6c 65 41 20 43 6f 70 79 46 69  CopyFileA CopyFi
19ca0 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  le;..// #endif /
19cb0 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 2f 2f  / !UNICODE....//
19cc0 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e 4e   #if(_WIN32_WINN
19cd0 54 20 3e 3d 20 30 78 30 34 30 30 29 0d 0a 65 78  T >= 0x0400)..ex
19ce0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 61 6c  tern(Windows) al
19cf0 69 61 73 20 44 57 4f 52 44 20 66 75 6e 63 74 69  ias DWORD functi
19d00 6f 6e 28 20 4c 41 52 47 45 5f 49 4e 54 45 47 45  on( LARGE_INTEGE
19d10 52 20 54 6f 74 61 6c 46 69 6c 65 53 69 7a 65 2c  R TotalFileSize,
19d20 20 4c 41 52 47 45 5f 49 4e 54 45 47 45 52 20 54   LARGE_INTEGER T
19d30 6f 74 61 6c 42 79 74 65 73 54 72 61 6e 73 66 65  otalBytesTransfe
19d40 72 72 65 64 2c 20 4c 41 52 47 45 5f 49 4e 54 45  rred, LARGE_INTE
19d50 47 45 52 20 53 74 72 65 61 6d 53 69 7a 65 2c 20  GER StreamSize, 
19d60 4c 41 52 47 45 5f 49 4e 54 45 47 45 52 20 53 74  LARGE_INTEGER St
19d70 72 65 61 6d 42 79 74 65 73 54 72 61 6e 73 66 65  reamBytesTransfe
19d80 72 72 65 64 2c 20 44 57 4f 52 44 20 64 77 53 74  rred, DWORD dwSt
19d90 72 65 61 6d 4e 75 6d 62 65 72 2c 20 44 57 4f 52  reamNumber, DWOR
19da0 44 20 64 77 43 61 6c 6c 62 61 63 6b 52 65 61 73  D dwCallbackReas
19db0 6f 6e 2c 20 48 41 4e 44 4c 45 20 68 53 6f 75 72  on, HANDLE hSour
19dc0 63 65 46 69 6c 65 2c 20 48 41 4e 44 4c 45 20 68  ceFile, HANDLE h
19dd0 44 65 73 74 69 6e 61 74 69 6f 6e 46 69 6c 65 2c  DestinationFile,
19de0 20 4c 50 56 4f 49 44 20 6c 70 44 61 74 61 20 20   LPVOID lpData  
19df0 29 20 4c 50 50 52 4f 47 52 45 53 53 5f 52 4f 55  ) LPPROGRESS_ROU
19e00 54 49 4e 45 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  TINE;....extern(
19e10 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
19e20 42 4f 4f 4c 20 43 6f 70 79 46 69 6c 65 45 78 41  BOOL CopyFileExA
19e30 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 45 78  (..  LPCSTR lpEx
19e40 69 73 74 69 6e 67 46 69 6c 65 4e 61 6d 65 2c 0d  istingFileName,.
19e50 0a 20 20 4c 50 43 53 54 52 20 6c 70 4e 65 77 46  .  LPCSTR lpNewF
19e60 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 50 52  ileName,..  LPPR
19e70 4f 47 52 45 53 53 5f 52 4f 55 54 49 4e 45 20 6c  OGRESS_ROUTINE l
19e80 70 50 72 6f 67 72 65 73 73 52 6f 75 74 69 6e 65  pProgressRoutine
19e90 20 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 44   ,..  LPVOID lpD
19ea0 61 74 61 20 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20  ata ,..  LPBOOL 
19eb0 70 62 43 61 6e 63 65 6c 20 2c 0d 0a 20 20 44 57  pbCancel ,..  DW
19ec0 4f 52 44 20 64 77 43 6f 70 79 46 6c 61 67 73 29  ORD dwCopyFlags)
19ed0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
19ee0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43  s) export BOOL C
19ef0 6f 70 79 46 69 6c 65 45 78 57 28 0d 0a 20 20 4c  opyFileExW(..  L
19f00 50 43 57 53 54 52 20 6c 70 45 78 69 73 74 69 6e  PCWSTR lpExistin
19f10 67 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  gFileName,..  LP
19f20 43 57 53 54 52 20 6c 70 4e 65 77 46 69 6c 65 4e  CWSTR lpNewFileN
19f30 61 6d 65 2c 0d 0a 20 20 4c 50 50 52 4f 47 52 45  ame,..  LPPROGRE
19f40 53 53 5f 52 4f 55 54 49 4e 45 20 6c 70 50 72 6f  SS_ROUTINE lpPro
19f50 67 72 65 73 73 52 6f 75 74 69 6e 65 20 2c 0d 0a  gressRoutine ,..
19f60 20 20 4c 50 56 4f 49 44 20 6c 70 44 61 74 61 20    LPVOID lpData 
19f70 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20 70 62 43 61  ,..  LPBOOL pbCa
19f80 6e 63 65 6c 20 2c 0d 0a 20 20 44 57 4f 52 44 20  ncel ,..  DWORD 
19f90 64 77 43 6f 70 79 46 6c 61 67 73 29 3b 0d 0a 2f  dwCopyFlags);../
19fa0 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
19fb0 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
19fc0 6c 73 65 0d 0a 61 6c 69 61 73 20 43 6f 70 79 46  lse..alias CopyF
19fd0 69 6c 65 45 78 41 20 43 6f 70 79 46 69 6c 65 45  ileExA CopyFileE
19fe0 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  x;..// #endif //
19ff0 20 21 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 65   !UNICODE..// #e
1a000 6e 64 69 66 20 2f 2a 20 5f 57 49 4e 33 32 5f 57  ndif /* _WIN32_W
1a010 49 4e 4e 54 20 3e 3d 20 30 78 30 34 30 30 20 2a  INNT >= 0x0400 *
1a020 2f 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  /....extern(Wind
1a030 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1a040 20 4d 6f 76 65 46 69 6c 65 41 28 0d 0a 20 20 4c   MoveFileA(..  L
1a050 50 43 53 54 52 20 6c 70 45 78 69 73 74 69 6e 67  PCSTR lpExisting
1a060 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  FileName,..  LPC
1a070 53 54 52 20 6c 70 4e 65 77 46 69 6c 65 4e 61 6d  STR lpNewFileNam
1a080 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  e);..extern(Wind
1a090 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1a0a0 20 4d 6f 76 65 46 69 6c 65 57 28 0d 0a 20 20 4c   MoveFileW(..  L
1a0b0 50 43 57 53 54 52 20 6c 70 45 78 69 73 74 69 6e  PCWSTR lpExistin
1a0c0 67 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  gFileName,..  LP
1a0d0 43 57 53 54 52 20 6c 70 4e 65 77 46 69 6c 65 4e  CWSTR lpNewFileN
1a0e0 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ame);..// #ifdef
1a0f0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
1a100 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
1a110 61 73 20 4d 6f 76 65 46 69 6c 65 41 20 4d 6f 76  as MoveFileA Mov
1a120 65 46 69 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69  eFile;..// #endi
1a130 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
1a140 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1a150 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4d 6f 76   export BOOL Mov
1a160 65 46 69 6c 65 45 78 41 28 0d 0a 20 20 4c 50 43  eFileExA(..  LPC
1a170 53 54 52 20 6c 70 45 78 69 73 74 69 6e 67 46 69  STR lpExistingFi
1a180 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54  leName,..  LPCST
1a190 52 20 6c 70 4e 65 77 46 69 6c 65 4e 61 6d 65 2c  R lpNewFileName,
1a1a0 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67  ..  DWORD dwFlag
1a1b0 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  s);..extern(Wind
1a1c0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1a1d0 20 4d 6f 76 65 46 69 6c 65 45 78 57 28 0d 0a 20   MoveFileExW(.. 
1a1e0 20 4c 50 43 57 53 54 52 20 6c 70 45 78 69 73 74   LPCWSTR lpExist
1a1f0 69 6e 67 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20  ingFileName,..  
1a200 4c 50 43 57 53 54 52 20 6c 70 4e 65 77 46 69 6c  LPCWSTR lpNewFil
1a210 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20  eName,..  DWORD 
1a220 64 77 46 6c 61 67 73 29 3b 0d 0a 2f 2f 20 23 69  dwFlags);..// #i
1a230 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
1a240 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
1a250 0a 61 6c 69 61 73 20 4d 6f 76 65 46 69 6c 65 45  .alias MoveFileE
1a260 78 41 20 4d 6f 76 65 46 69 6c 65 45 78 3b 0d 0a  xA MoveFileEx;..
1a270 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
1a280 49 43 4f 44 45 0d 0a 0d 0a 2f 2f 20 23 69 66 20  ICODE....// #if 
1a290 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d  (_WIN32_WINNT >=
1a2a0 20 30 78 30 35 30 30 29 0d 0a 65 78 74 65 72 6e   0x0500)..extern
1a2b0 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1a2c0 20 42 4f 4f 4c 20 4d 6f 76 65 46 69 6c 65 57 69   BOOL MoveFileWi
1a2d0 74 68 50 72 6f 67 72 65 73 73 41 28 0d 0a 20 20  thProgressA(..  
1a2e0 4c 50 43 53 54 52 20 6c 70 45 78 69 73 74 69 6e  LPCSTR lpExistin
1a2f0 67 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  gFileName,..  LP
1a300 43 53 54 52 20 6c 70 4e 65 77 46 69 6c 65 4e 61  CSTR lpNewFileNa
1a310 6d 65 2c 0d 0a 20 20 4c 50 50 52 4f 47 52 45 53  me,..  LPPROGRES
1a320 53 5f 52 4f 55 54 49 4e 45 20 6c 70 50 72 6f 67  S_ROUTINE lpProg
1a330 72 65 73 73 52 6f 75 74 69 6e 65 20 2c 0d 0a 20  ressRoutine ,.. 
1a340 20 4c 50 56 4f 49 44 20 6c 70 44 61 74 61 20 2c   LPVOID lpData ,
1a350 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67  ..  DWORD dwFlag
1a360 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  s);..extern(Wind
1a370 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1a380 20 4d 6f 76 65 46 69 6c 65 57 69 74 68 50 72 6f   MoveFileWithPro
1a390 67 72 65 73 73 57 28 0d 0a 20 20 4c 50 43 57 53  gressW(..  LPCWS
1a3a0 54 52 20 6c 70 45 78 69 73 74 69 6e 67 46 69 6c  TR lpExistingFil
1a3b0 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54  eName,..  LPCWST
1a3c0 52 20 6c 70 4e 65 77 46 69 6c 65 4e 61 6d 65 2c  R lpNewFileName,
1a3d0 0d 0a 20 20 4c 50 50 52 4f 47 52 45 53 53 5f 52  ..  LPPROGRESS_R
1a3e0 4f 55 54 49 4e 45 20 6c 70 50 72 6f 67 72 65 73  OUTINE lpProgres
1a3f0 73 52 6f 75 74 69 6e 65 20 2c 0d 0a 20 20 4c 50  sRoutine ,..  LP
1a400 56 4f 49 44 20 6c 70 44 61 74 61 20 2c 0d 0a 20  VOID lpData ,.. 
1a410 20 44 57 4f 52 44 20 64 77 46 6c 61 67 73 29 3b   DWORD dwFlags);
1a420 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
1a430 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
1a440 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 4d 6f   #else..alias Mo
1a450 76 65 46 69 6c 65 57 69 74 68 50 72 6f 67 72 65  veFileWithProgre
1a460 73 73 41 20 4d 6f 76 65 46 69 6c 65 57 69 74 68  ssA MoveFileWith
1a470 50 72 6f 67 72 65 73 73 3b 0d 0a 2f 2f 20 23 65  Progress;..// #e
1a480 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
1a490 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 28  ..// #endif // (
1a4a0 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20  _WIN32_WINNT >= 
1a4b0 30 78 30 35 30 30 29 0d 0a 0d 0a 65 6e 75 6d 20  0x0500)....enum 
1a4c0 3a 20 75 69 6e 74 20 7b 20 4d 4f 56 45 46 49 4c  : uint { MOVEFIL
1a4d0 45 5f 52 45 50 4c 41 43 45 5f 45 58 49 53 54 49  E_REPLACE_EXISTI
1a4e0 4e 47 20 3d 20 30 78 30 30 30 30 30 30 30 31 20  NG = 0x00000001 
1a4f0 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
1a500 20 4d 4f 56 45 46 49 4c 45 5f 43 4f 50 59 5f 41   MOVEFILE_COPY_A
1a510 4c 4c 4f 57 45 44 20 3d 20 30 78 30 30 30 30 30  LLOWED = 0x00000
1a520 30 30 32 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  002 }..enum : ui
1a530 6e 74 20 7b 20 4d 4f 56 45 46 49 4c 45 5f 44 45  nt { MOVEFILE_DE
1a540 4c 41 59 5f 55 4e 54 49 4c 5f 52 45 42 4f 4f 54  LAY_UNTIL_REBOOT
1a550 20 3d 20 30 78 30 30 30 30 30 30 30 34 20 7d 0d   = 0x00000004 }.
1a560 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4d  .enum : uint { M
1a570 4f 56 45 46 49 4c 45 5f 57 52 49 54 45 5f 54 48  OVEFILE_WRITE_TH
1a580 52 4f 55 47 48 20 3d 20 30 78 30 30 30 30 30 30  ROUGH = 0x000000
1a590 30 38 20 7d 0d 0a 2f 2f 20 23 69 66 20 28 5f 57  08 }..// #if (_W
1a5a0 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78  IN32_WINNT >= 0x
1a5b0 30 35 30 30 29 0d 0a 65 6e 75 6d 20 3a 20 75 69  0500)..enum : ui
1a5c0 6e 74 20 7b 20 4d 4f 56 45 46 49 4c 45 5f 43 52  nt { MOVEFILE_CR
1a5d0 45 41 54 45 5f 48 41 52 44 4c 49 4e 4b 20 3d 20  EATE_HARDLINK = 
1a5e0 30 78 30 30 30 30 30 30 31 30 20 7d 0d 0a 65 6e  0x00000010 }..en
1a5f0 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4d 4f 56 45  um : uint { MOVE
1a600 46 49 4c 45 5f 46 41 49 4c 5f 49 46 5f 4e 4f 54  FILE_FAIL_IF_NOT
1a610 5f 54 52 41 43 4b 41 42 4c 45 20 3d 20 30 78 30  _TRACKABLE = 0x0
1a620 30 30 30 30 30 32 30 20 7d 0d 0a 2f 2f 20 23 65  0000020 }..// #e
1a630 6e 64 69 66 20 2f 2f 20 28 5f 57 49 4e 33 32 5f  ndif // (_WIN32_
1a640 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29  WINNT >= 0x0500)
1a650 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f 57 49 4e  ....// #if (_WIN
1a660 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35  32_WINNT >= 0x05
1a670 30 30 29 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  00)..extern(Wind
1a680 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1a690 20 52 65 70 6c 61 63 65 46 69 6c 65 41 28 0d 0a   ReplaceFileA(..
1a6a0 20 20 4c 50 43 53 54 52 20 6c 70 52 65 70 6c 61    LPCSTR lpRepla
1a6b0 63 65 64 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20  cedFileName,..  
1a6c0 4c 50 43 53 54 52 20 6c 70 52 65 70 6c 61 63 65  LPCSTR lpReplace
1a6d0 6d 65 6e 74 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20  mentFileName,.. 
1a6e0 20 4c 50 43 53 54 52 20 6c 70 42 61 63 6b 75 70   LPCSTR lpBackup
1a6f0 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f  FileName,..  DWO
1a700 52 44 20 64 77 52 65 70 6c 61 63 65 46 6c 61 67  RD dwReplaceFlag
1a710 73 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 45  s,..  LPVOID lpE
1a720 78 63 6c 75 64 65 2c 0d 0a 20 20 4c 50 56 4f 49  xclude,..  LPVOI
1a730 44 20 6c 70 52 65 73 65 72 76 65 64 29 3b 0d 0a  D lpReserved);..
1a740 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1a750 65 78 70 6f 72 74 20 42 4f 4f 4c 20 52 65 70 6c  export BOOL Repl
1a760 61 63 65 46 69 6c 65 57 28 0d 0a 20 20 4c 50 43  aceFileW(..  LPC
1a770 57 53 54 52 20 6c 70 52 65 70 6c 61 63 65 64 46  WSTR lpReplacedF
1a780 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57  ileName,..  LPCW
1a790 53 54 52 20 6c 70 52 65 70 6c 61 63 65 6d 65 6e  STR lpReplacemen
1a7a0 74 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  tFileName,..  LP
1a7b0 43 57 53 54 52 20 6c 70 42 61 63 6b 75 70 46 69  CWSTR lpBackupFi
1a7c0 6c 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  leName,..  DWORD
1a7d0 20 64 77 52 65 70 6c 61 63 65 46 6c 61 67 73 2c   dwReplaceFlags,
1a7e0 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 45 78 63  ..  LPVOID lpExc
1a7f0 6c 75 64 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20  lude,..  LPVOID 
1a800 6c 70 52 65 73 65 72 76 65 64 29 3b 0d 0a 2f 2f  lpReserved);..//
1a810 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
1a820 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
1a830 73 65 0d 0a 61 6c 69 61 73 20 52 65 70 6c 61 63  se..alias Replac
1a840 65 46 69 6c 65 41 20 52 65 70 6c 61 63 65 46 69  eFileA ReplaceFi
1a850 6c 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  le;..// #endif /
1a860 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  / !UNICODE..// #
1a870 65 6e 64 69 66 20 2f 2f 20 28 5f 57 49 4e 33 32  endif // (_WIN32
1a880 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30  _WINNT >= 0x0500
1a890 29 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f 57 49  )....// #if (_WI
1a8a0 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30  N32_WINNT >= 0x0
1a8b0 35 30 30 29 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  500)....extern(W
1a8c0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1a8d0 4f 4f 4c 20 43 72 65 61 74 65 48 61 72 64 4c 69  OOL CreateHardLi
1a8e0 6e 6b 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c  nkA(..  LPCSTR l
1a8f0 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  pFileName,..  LP
1a900 43 53 54 52 20 6c 70 45 78 69 73 74 69 6e 67 46  CSTR lpExistingF
1a910 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 45  ileName,..  LPSE
1a920 43 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45  CURITY_ATTRIBUTE
1a930 53 20 6c 70 53 65 63 75 72 69 74 79 41 74 74 72  S lpSecurityAttr
1a940 69 62 75 74 65 73 29 3b 0d 0a 65 78 74 65 72 6e  ibutes);..extern
1a950 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1a960 20 42 4f 4f 4c 20 43 72 65 61 74 65 48 61 72 64   BOOL CreateHard
1a970 4c 69 6e 6b 57 28 0d 0a 20 20 4c 50 43 57 53 54  LinkW(..  LPCWST
1a980 52 20 6c 70 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20  R lpFileName,.. 
1a990 20 4c 50 43 57 53 54 52 20 6c 70 45 78 69 73 74   LPCWSTR lpExist
1a9a0 69 6e 67 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20  ingFileName,..  
1a9b0 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49  LPSECURITY_ATTRI
1a9c0 42 55 54 45 53 20 6c 70 53 65 63 75 72 69 74 79  BUTES lpSecurity
1a9d0 41 74 74 72 69 62 75 74 65 73 29 3b 0d 0a 2f 2f  Attributes);..//
1a9e0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
1a9f0 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
1aa00 73 65 0d 0a 61 6c 69 61 73 20 43 72 65 61 74 65  se..alias Create
1aa10 48 61 72 64 4c 69 6e 6b 41 20 43 72 65 61 74 65  HardLinkA Create
1aa20 48 61 72 64 4c 69 6e 6b 3b 0d 0a 2f 2f 20 23 65  HardLink;..// #e
1aa30 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
1aa40 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  ....// #endif //
1aa50 20 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e   (_WIN32_WINNT >
1aa60 3d 20 30 78 30 35 30 30 29 0d 0a 0d 0a 65 78 74  = 0x0500)....ext
1aa70 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1aa80 6f 72 74 20 48 41 4e 44 4c 45 20 43 72 65 61 74  ort HANDLE Creat
1aa90 65 4e 61 6d 65 64 50 69 70 65 41 28 0d 0a 20 20  eNamedPipeA(..  
1aaa0 4c 50 43 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a  LPCSTR lpName,..
1aab0 20 20 44 57 4f 52 44 20 64 77 4f 70 65 6e 4d 6f    DWORD dwOpenMo
1aac0 64 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 50  de,..  DWORD dwP
1aad0 69 70 65 4d 6f 64 65 2c 0d 0a 20 20 44 57 4f 52  ipeMode,..  DWOR
1aae0 44 20 6e 4d 61 78 49 6e 73 74 61 6e 63 65 73 2c  D nMaxInstances,
1aaf0 0d 0a 20 20 44 57 4f 52 44 20 6e 4f 75 74 42 75  ..  DWORD nOutBu
1ab00 66 66 65 72 53 69 7a 65 2c 0d 0a 20 20 44 57 4f  fferSize,..  DWO
1ab10 52 44 20 6e 49 6e 42 75 66 66 65 72 53 69 7a 65  RD nInBufferSize
1ab20 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 44 65 66 61  ,..  DWORD nDefa
1ab30 75 6c 74 54 69 6d 65 4f 75 74 2c 0d 0a 20 20 4c  ultTimeOut,..  L
1ab40 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49 42  PSECURITY_ATTRIB
1ab50 55 54 45 53 20 6c 70 53 65 63 75 72 69 74 79 41  UTES lpSecurityA
1ab60 74 74 72 69 62 75 74 65 73 29 3b 0d 0a 65 78 74  ttributes);..ext
1ab70 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1ab80 6f 72 74 20 48 41 4e 44 4c 45 20 43 72 65 61 74  ort HANDLE Creat
1ab90 65 4e 61 6d 65 64 50 69 70 65 57 28 0d 0a 20 20  eNamedPipeW(..  
1aba0 4c 50 43 57 53 54 52 20 6c 70 4e 61 6d 65 2c 0d  LPCWSTR lpName,.
1abb0 0a 20 20 44 57 4f 52 44 20 64 77 4f 70 65 6e 4d  .  DWORD dwOpenM
1abc0 6f 64 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77  ode,..  DWORD dw
1abd0 50 69 70 65 4d 6f 64 65 2c 0d 0a 20 20 44 57 4f  PipeMode,..  DWO
1abe0 52 44 20 6e 4d 61 78 49 6e 73 74 61 6e 63 65 73  RD nMaxInstances
1abf0 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 4f 75 74 42  ,..  DWORD nOutB
1ac00 75 66 66 65 72 53 69 7a 65 2c 0d 0a 20 20 44 57  ufferSize,..  DW
1ac10 4f 52 44 20 6e 49 6e 42 75 66 66 65 72 53 69 7a  ORD nInBufferSiz
1ac20 65 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 44 65 66  e,..  DWORD nDef
1ac30 61 75 6c 74 54 69 6d 65 4f 75 74 2c 0d 0a 20 20  aultTimeOut,..  
1ac40 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49  LPSECURITY_ATTRI
1ac50 42 55 54 45 53 20 6c 70 53 65 63 75 72 69 74 79  BUTES lpSecurity
1ac60 41 74 74 72 69 62 75 74 65 73 29 3b 0d 0a 2f 2f  Attributes);..//
1ac70 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
1ac80 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
1ac90 73 65 0d 0a 61 6c 69 61 73 20 43 72 65 61 74 65  se..alias Create
1aca0 4e 61 6d 65 64 50 69 70 65 41 20 43 72 65 61 74  NamedPipeA Creat
1acb0 65 4e 61 6d 65 64 50 69 70 65 3b 0d 0a 2f 2f 20  eNamedPipe;..// 
1acc0 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
1acd0 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
1ace0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
1acf0 4c 20 47 65 74 4e 61 6d 65 64 50 69 70 65 48 61  L GetNamedPipeHa
1ad00 6e 64 6c 65 53 74 61 74 65 41 28 0d 0a 20 20 48  ndleStateA(..  H
1ad10 41 4e 44 4c 45 20 68 4e 61 6d 65 64 50 69 70 65  ANDLE hNamedPipe
1ad20 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 53  ,..  LPDWORD lpS
1ad30 74 61 74 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  tate,..  LPDWORD
1ad40 20 6c 70 43 75 72 49 6e 73 74 61 6e 63 65 73 2c   lpCurInstances,
1ad50 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 4d 61  ..  LPDWORD lpMa
1ad60 78 43 6f 6c 6c 65 63 74 69 6f 6e 43 6f 75 6e 74  xCollectionCount
1ad70 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 43  ,..  LPDWORD lpC
1ad80 6f 6c 6c 65 63 74 44 61 74 61 54 69 6d 65 6f 75  ollectDataTimeou
1ad90 74 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 55 73  t,..  LPSTR lpUs
1ada0 65 72 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  erName,..  DWORD
1adb0 20 6e 4d 61 78 55 73 65 72 4e 61 6d 65 53 69 7a   nMaxUserNameSiz
1adc0 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  e);..extern(Wind
1add0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1ade0 20 47 65 74 4e 61 6d 65 64 50 69 70 65 48 61 6e   GetNamedPipeHan
1adf0 64 6c 65 53 74 61 74 65 57 28 0d 0a 20 20 48 41  dleStateW(..  HA
1ae00 4e 44 4c 45 20 68 4e 61 6d 65 64 50 69 70 65 2c  NDLE hNamedPipe,
1ae10 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 53 74  ..  LPDWORD lpSt
1ae20 61 74 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  ate,..  LPDWORD 
1ae30 6c 70 43 75 72 49 6e 73 74 61 6e 63 65 73 2c 0d  lpCurInstances,.
1ae40 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 4d 61 78  .  LPDWORD lpMax
1ae50 43 6f 6c 6c 65 63 74 69 6f 6e 43 6f 75 6e 74 2c  CollectionCount,
1ae60 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 43 6f  ..  LPDWORD lpCo
1ae70 6c 6c 65 63 74 44 61 74 61 54 69 6d 65 6f 75 74  llectDataTimeout
1ae80 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 55 73  ,..  LPWSTR lpUs
1ae90 65 72 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  erName,..  DWORD
1aea0 20 6e 4d 61 78 55 73 65 72 4e 61 6d 65 53 69 7a   nMaxUserNameSiz
1aeb0 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55  e);..// #ifdef U
1aec0 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NICODE..// #....
1aed0 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73  .// #else..alias
1aee0 20 47 65 74 4e 61 6d 65 64 50 69 70 65 48 61 6e   GetNamedPipeHan
1aef0 64 6c 65 53 74 61 74 65 41 20 47 65 74 4e 61 6d  dleStateA GetNam
1af00 65 64 50 69 70 65 48 61 6e 64 6c 65 53 74 61 74  edPipeHandleStat
1af10 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  e;..// #endif //
1af20 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
1af30 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1af40 6f 72 74 20 42 4f 4f 4c 20 43 61 6c 6c 4e 61 6d  ort BOOL CallNam
1af50 65 64 50 69 70 65 41 28 0d 0a 20 20 4c 50 43 53  edPipeA(..  LPCS
1af60 54 52 20 6c 70 4e 61 6d 65 64 50 69 70 65 4e 61  TR lpNamedPipeNa
1af70 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70  me,..  LPVOID lp
1af80 49 6e 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f  InBuffer,..  DWO
1af90 52 44 20 6e 49 6e 42 75 66 66 65 72 53 69 7a 65  RD nInBufferSize
1afa0 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 4f 75  ,..  LPVOID lpOu
1afb0 74 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f 52  tBuffer,..  DWOR
1afc0 44 20 6e 4f 75 74 42 75 66 66 65 72 53 69 7a 65  D nOutBufferSize
1afd0 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 42  ,..  LPDWORD lpB
1afe0 79 74 65 73 52 65 61 64 2c 0d 0a 20 20 44 57 4f  ytesRead,..  DWO
1aff0 52 44 20 6e 54 69 6d 65 4f 75 74 29 3b 0d 0a 65  RD nTimeOut);..e
1b000 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
1b010 78 70 6f 72 74 20 42 4f 4f 4c 20 43 61 6c 6c 4e  xport BOOL CallN
1b020 61 6d 65 64 50 69 70 65 57 28 0d 0a 20 20 4c 50  amedPipeW(..  LP
1b030 43 57 53 54 52 20 6c 70 4e 61 6d 65 64 50 69 70  CWSTR lpNamedPip
1b040 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44  eName,..  LPVOID
1b050 20 6c 70 49 6e 42 75 66 66 65 72 2c 0d 0a 20 20   lpInBuffer,..  
1b060 44 57 4f 52 44 20 6e 49 6e 42 75 66 66 65 72 53  DWORD nInBufferS
1b070 69 7a 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c  ize,..  LPVOID l
1b080 70 4f 75 74 42 75 66 66 65 72 2c 0d 0a 20 20 44  pOutBuffer,..  D
1b090 57 4f 52 44 20 6e 4f 75 74 42 75 66 66 65 72 53  WORD nOutBufferS
1b0a0 69 7a 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  ize,..  LPDWORD 
1b0b0 6c 70 42 79 74 65 73 52 65 61 64 2c 0d 0a 20 20  lpBytesRead,..  
1b0c0 44 57 4f 52 44 20 6e 54 69 6d 65 4f 75 74 29 3b  DWORD nTimeOut);
1b0d0 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
1b0e0 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
1b0f0 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 43 61   #else..alias Ca
1b100 6c 6c 4e 61 6d 65 64 50 69 70 65 41 20 43 61 6c  llNamedPipeA Cal
1b110 6c 4e 61 6d 65 64 50 69 70 65 3b 0d 0a 2f 2f 20  lNamedPipe;..// 
1b120 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
1b130 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
1b140 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
1b150 4c 20 57 61 69 74 4e 61 6d 65 64 50 69 70 65 41  L WaitNamedPipeA
1b160 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4e 61  (..  LPCSTR lpNa
1b170 6d 65 64 50 69 70 65 4e 61 6d 65 2c 0d 0a 20 20  medPipeName,..  
1b180 44 57 4f 52 44 20 6e 54 69 6d 65 4f 75 74 29 3b  DWORD nTimeOut);
1b190 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
1b1a0 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 57 61  ) export BOOL Wa
1b1b0 69 74 4e 61 6d 65 64 50 69 70 65 57 28 0d 0a 20  itNamedPipeW(.. 
1b1c0 20 4c 50 43 57 53 54 52 20 6c 70 4e 61 6d 65 64   LPCWSTR lpNamed
1b1d0 50 69 70 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f  PipeName,..  DWO
1b1e0 52 44 20 6e 54 69 6d 65 4f 75 74 29 3b 0d 0a 2f  RD nTimeOut);../
1b1f0 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
1b200 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
1b210 6c 73 65 0d 0a 61 6c 69 61 73 20 57 61 69 74 4e  lse..alias WaitN
1b220 61 6d 65 64 50 69 70 65 41 20 57 61 69 74 4e 61  amedPipeA WaitNa
1b230 6d 65 64 50 69 70 65 3b 0d 0a 2f 2f 20 23 65 6e  medPipe;..// #en
1b240 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
1b250 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
1b260 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
1b270 65 74 56 6f 6c 75 6d 65 4c 61 62 65 6c 41 28 0d  etVolumeLabelA(.
1b280 0a 20 20 4c 50 43 53 54 52 20 6c 70 52 6f 6f 74  .  LPCSTR lpRoot
1b290 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  PathName,..  LPC
1b2a0 53 54 52 20 6c 70 56 6f 6c 75 6d 65 4e 61 6d 65  STR lpVolumeName
1b2b0 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
1b2c0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
1b2d0 53 65 74 56 6f 6c 75 6d 65 4c 61 62 65 6c 57 28  SetVolumeLabelW(
1b2e0 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 52 6f  ..  LPCWSTR lpRo
1b2f0 6f 74 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20 4c  otPathName,..  L
1b300 50 43 57 53 54 52 20 6c 70 56 6f 6c 75 6d 65 4e  PCWSTR lpVolumeN
1b310 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ame);..// #ifdef
1b320 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
1b330 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
1b340 61 73 20 53 65 74 56 6f 6c 75 6d 65 4c 61 62 65  as SetVolumeLabe
1b350 6c 41 20 53 65 74 56 6f 6c 75 6d 65 4c 61 62 65  lA SetVolumeLabe
1b360 6c 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  l;..// #endif //
1b370 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
1b380 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1b390 6f 72 74 20 56 4f 49 44 20 53 65 74 46 69 6c 65  ort VOID SetFile
1b3a0 41 70 69 73 54 6f 4f 45 4d 28 29 3b 0d 0a 0d 0a  ApisToOEM();....
1b3b0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1b3c0 65 78 70 6f 72 74 20 56 4f 49 44 20 53 65 74 46  export VOID SetF
1b3d0 69 6c 65 41 70 69 73 54 6f 41 4e 53 49 28 29 3b  ileApisToANSI();
1b3e0 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
1b3f0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
1b400 41 72 65 46 69 6c 65 41 70 69 73 41 4e 53 49 28  AreFileApisANSI(
1b410 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
1b420 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
1b430 4c 20 47 65 74 56 6f 6c 75 6d 65 49 6e 66 6f 72  L GetVolumeInfor
1b440 6d 61 74 69 6f 6e 41 28 0d 0a 20 20 4c 50 43 53  mationA(..  LPCS
1b450 54 52 20 6c 70 52 6f 6f 74 50 61 74 68 4e 61 6d  TR lpRootPathNam
1b460 65 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 56 6f  e,..  LPSTR lpVo
1b470 6c 75 6d 65 4e 61 6d 65 42 75 66 66 65 72 2c 0d  lumeNameBuffer,.
1b480 0a 20 20 44 57 4f 52 44 20 6e 56 6f 6c 75 6d 65  .  DWORD nVolume
1b490 4e 61 6d 65 53 69 7a 65 2c 0d 0a 20 20 4c 50 44  NameSize,..  LPD
1b4a0 57 4f 52 44 20 6c 70 56 6f 6c 75 6d 65 53 65 72  WORD lpVolumeSer
1b4b0 69 61 6c 4e 75 6d 62 65 72 2c 0d 0a 20 20 4c 50  ialNumber,..  LP
1b4c0 44 57 4f 52 44 20 6c 70 4d 61 78 69 6d 75 6d 43  DWORD lpMaximumC
1b4d0 6f 6d 70 6f 6e 65 6e 74 4c 65 6e 67 74 68 2c 0d  omponentLength,.
1b4e0 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 46 69 6c  .  LPDWORD lpFil
1b4f0 65 53 79 73 74 65 6d 46 6c 61 67 73 2c 0d 0a 20  eSystemFlags,.. 
1b500 20 4c 50 53 54 52 20 6c 70 46 69 6c 65 53 79 73   LPSTR lpFileSys
1b510 74 65 6d 4e 61 6d 65 42 75 66 66 65 72 2c 0d 0a  temNameBuffer,..
1b520 20 20 44 57 4f 52 44 20 6e 46 69 6c 65 53 79 73    DWORD nFileSys
1b530 74 65 6d 4e 61 6d 65 53 69 7a 65 29 3b 0d 0a 65  temNameSize);..e
1b540 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
1b550 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 56 6f  xport BOOL GetVo
1b560 6c 75 6d 65 49 6e 66 6f 72 6d 61 74 69 6f 6e 57  lumeInformationW
1b570 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 52  (..  LPCWSTR lpR
1b580 6f 6f 74 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20  ootPathName,..  
1b590 4c 50 57 53 54 52 20 6c 70 56 6f 6c 75 6d 65 4e  LPWSTR lpVolumeN
1b5a0 61 6d 65 42 75 66 66 65 72 2c 0d 0a 20 20 44 57  ameBuffer,..  DW
1b5b0 4f 52 44 20 6e 56 6f 6c 75 6d 65 4e 61 6d 65 53  ORD nVolumeNameS
1b5c0 69 7a 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  ize,..  LPDWORD 
1b5d0 6c 70 56 6f 6c 75 6d 65 53 65 72 69 61 6c 4e 75  lpVolumeSerialNu
1b5e0 6d 62 65 72 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  mber,..  LPDWORD
1b5f0 20 6c 70 4d 61 78 69 6d 75 6d 43 6f 6d 70 6f 6e   lpMaximumCompon
1b600 65 6e 74 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50  entLength,..  LP
1b610 44 57 4f 52 44 20 6c 70 46 69 6c 65 53 79 73 74  DWORD lpFileSyst
1b620 65 6d 46 6c 61 67 73 2c 0d 0a 20 20 4c 50 57 53  emFlags,..  LPWS
1b630 54 52 20 6c 70 46 69 6c 65 53 79 73 74 65 6d 4e  TR lpFileSystemN
1b640 61 6d 65 42 75 66 66 65 72 2c 0d 0a 20 20 44 57  ameBuffer,..  DW
1b650 4f 52 44 20 6e 46 69 6c 65 53 79 73 74 65 6d 4e  ORD nFileSystemN
1b660 61 6d 65 53 69 7a 65 29 3b 0d 0a 2f 2f 20 23 69  ameSize);..// #i
1b670 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
1b680 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
1b690 0a 61 6c 69 61 73 20 47 65 74 56 6f 6c 75 6d 65  .alias GetVolume
1b6a0 49 6e 66 6f 72 6d 61 74 69 6f 6e 41 20 47 65 74  InformationA Get
1b6b0 56 6f 6c 75 6d 65 49 6e 66 6f 72 6d 61 74 69 6f  VolumeInformatio
1b6c0 6e 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  n;..// #endif //
1b6d0 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
1b6e0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1b6f0 6f 72 74 20 42 4f 4f 4c 20 43 61 6e 63 65 6c 49  ort BOOL CancelI
1b700 6f 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69  o(..  HANDLE hFi
1b710 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  le);....extern(W
1b720 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1b730 4f 4f 4c 20 43 6c 65 61 72 45 76 65 6e 74 4c 6f  OOL ClearEventLo
1b740 67 41 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45  gA(..  HANDLE hE
1b750 76 65 6e 74 4c 6f 67 2c 0d 0a 20 20 4c 50 43 53  ventLog,..  LPCS
1b760 54 52 20 6c 70 42 61 63 6b 75 70 46 69 6c 65 4e  TR lpBackupFileN
1b770 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ame);..extern(Wi
1b780 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1b790 4f 4c 20 43 6c 65 61 72 45 76 65 6e 74 4c 6f 67  OL ClearEventLog
1b7a0 57 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45 76  W(..  HANDLE hEv
1b7b0 65 6e 74 4c 6f 67 2c 0d 0a 20 20 4c 50 43 57 53  entLog,..  LPCWS
1b7c0 54 52 20 6c 70 42 61 63 6b 75 70 46 69 6c 65 4e  TR lpBackupFileN
1b7d0 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ame);..// #ifdef
1b7e0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
1b7f0 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
1b800 61 73 20 43 6c 65 61 72 45 76 65 6e 74 4c 6f 67  as ClearEventLog
1b810 41 20 43 6c 65 61 72 45 76 65 6e 74 4c 6f 67 3b  A ClearEventLog;
1b820 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
1b830 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
1b840 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1b850 74 20 42 4f 4f 4c 20 42 61 63 6b 75 70 45 76 65  t BOOL BackupEve
1b860 6e 74 4c 6f 67 41 28 0d 0a 20 20 48 41 4e 44 4c  ntLogA(..  HANDL
1b870 45 20 68 45 76 65 6e 74 4c 6f 67 2c 0d 0a 20 20  E hEventLog,..  
1b880 4c 50 43 53 54 52 20 6c 70 42 61 63 6b 75 70 46  LPCSTR lpBackupF
1b890 69 6c 65 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72  ileName);..exter
1b8a0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1b8b0 74 20 42 4f 4f 4c 20 42 61 63 6b 75 70 45 76 65  t BOOL BackupEve
1b8c0 6e 74 4c 6f 67 57 28 0d 0a 20 20 48 41 4e 44 4c  ntLogW(..  HANDL
1b8d0 45 20 68 45 76 65 6e 74 4c 6f 67 2c 0d 0a 20 20  E hEventLog,..  
1b8e0 4c 50 43 57 53 54 52 20 6c 70 42 61 63 6b 75 70  LPCWSTR lpBackup
1b8f0 46 69 6c 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23  FileName);..// #
1b900 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
1b910 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  / #.....// #else
1b920 0d 0a 61 6c 69 61 73 20 42 61 63 6b 75 70 45 76  ..alias BackupEv
1b930 65 6e 74 4c 6f 67 41 20 42 61 63 6b 75 70 45 76  entLogA BackupEv
1b940 65 6e 74 4c 6f 67 3b 0d 0a 2f 2f 20 23 65 6e 64  entLog;..// #end
1b950 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
1b960 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
1b970 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43 6c  ) export BOOL Cl
1b980 6f 73 65 45 76 65 6e 74 4c 6f 67 28 0d 0a 20 20  oseEventLog(..  
1b990 48 41 4e 44 4c 45 20 68 45 76 65 6e 74 4c 6f 67  HANDLE hEventLog
1b9a0 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
1b9b0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
1b9c0 4c 20 44 65 72 65 67 69 73 74 65 72 45 76 65 6e  L DeregisterEven
1b9d0 74 53 6f 75 72 63 65 28 0d 0a 20 20 48 41 4e 44  tSource(..  HAND
1b9e0 4c 45 20 68 45 76 65 6e 74 4c 6f 67 29 3b 0d 0a  LE hEventLog);..
1b9f0 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
1ba00 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4e 6f  ) export BOOL No
1ba10 74 69 66 79 43 68 61 6e 67 65 45 76 65 6e 74 4c  tifyChangeEventL
1ba20 6f 67 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45  og(..  HANDLE hE
1ba30 76 65 6e 74 4c 6f 67 2c 0d 0a 20 20 48 41 4e 44  ventLog,..  HAND
1ba40 4c 45 20 68 45 76 65 6e 74 29 3b 0d 0a 0d 0a 65  LE hEvent);....e
1ba50 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
1ba60 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 4e 75  xport BOOL GetNu
1ba70 6d 62 65 72 4f 66 45 76 65 6e 74 4c 6f 67 52 65  mberOfEventLogRe
1ba80 63 6f 72 64 73 28 0d 0a 20 20 48 41 4e 44 4c 45  cords(..  HANDLE
1ba90 20 68 45 76 65 6e 74 4c 6f 67 2c 0d 0a 20 20 50   hEventLog,..  P
1baa0 44 57 4f 52 44 20 4e 75 6d 62 65 72 4f 66 52 65  DWORD NumberOfRe
1bab0 63 6f 72 64 73 29 3b 0d 0a 0d 0a 65 78 74 65 72  cords);....exter
1bac0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1bad0 74 20 42 4f 4f 4c 20 47 65 74 4f 6c 64 65 73 74  t BOOL GetOldest
1bae0 45 76 65 6e 74 4c 6f 67 52 65 63 6f 72 64 28 0d  EventLogRecord(.
1baf0 0a 20 20 48 41 4e 44 4c 45 20 68 45 76 65 6e 74  .  HANDLE hEvent
1bb00 4c 6f 67 2c 0d 0a 20 20 50 44 57 4f 52 44 20 4f  Log,..  PDWORD O
1bb10 6c 64 65 73 74 52 65 63 6f 72 64 29 3b 0d 0a 0d  ldestRecord);...
1bb20 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1bb30 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 4f   export HANDLE O
1bb40 70 65 6e 45 76 65 6e 74 4c 6f 67 41 28 0d 0a 20  penEventLogA(.. 
1bb50 20 4c 50 43 53 54 52 20 6c 70 55 4e 43 53 65 72   LPCSTR lpUNCSer
1bb60 76 65 72 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53  verName,..  LPCS
1bb70 54 52 20 6c 70 53 6f 75 72 63 65 4e 61 6d 65 29  TR lpSourceName)
1bb80 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
1bb90 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45  s) export HANDLE
1bba0 20 4f 70 65 6e 45 76 65 6e 74 4c 6f 67 57 28 0d   OpenEventLogW(.
1bbb0 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 55 4e 43  .  LPCWSTR lpUNC
1bbc0 53 65 72 76 65 72 4e 61 6d 65 2c 0d 0a 20 20 4c  ServerName,..  L
1bbd0 50 43 57 53 54 52 20 6c 70 53 6f 75 72 63 65 4e  PCWSTR lpSourceN
1bbe0 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ame);..// #ifdef
1bbf0 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
1bc00 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
1bc10 61 73 20 4f 70 65 6e 45 76 65 6e 74 4c 6f 67 41  as OpenEventLogA
1bc20 20 4f 70 65 6e 45 76 65 6e 74 4c 6f 67 3b 0d 0a   OpenEventLog;..
1bc30 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
1bc40 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
1bc50 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1bc60 48 41 4e 44 4c 45 20 52 65 67 69 73 74 65 72 45  HANDLE RegisterE
1bc70 76 65 6e 74 53 6f 75 72 63 65 41 28 0d 0a 20 20  ventSourceA(..  
1bc80 4c 50 43 53 54 52 20 6c 70 55 4e 43 53 65 72 76  LPCSTR lpUNCServ
1bc90 65 72 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54  erName,..  LPCST
1bca0 52 20 6c 70 53 6f 75 72 63 65 4e 61 6d 65 29 3b  R lpSourceName);
1bcb0 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
1bcc0 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45 20  ) export HANDLE 
1bcd0 52 65 67 69 73 74 65 72 45 76 65 6e 74 53 6f 75  RegisterEventSou
1bce0 72 63 65 57 28 0d 0a 20 20 4c 50 43 57 53 54 52  rceW(..  LPCWSTR
1bcf0 20 6c 70 55 4e 43 53 65 72 76 65 72 4e 61 6d 65   lpUNCServerName
1bd00 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53  ,..  LPCWSTR lpS
1bd10 6f 75 72 63 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20  ourceName);..// 
1bd20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
1bd30 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
1bd40 65 0d 0a 61 6c 69 61 73 20 52 65 67 69 73 74 65  e..alias Registe
1bd50 72 45 76 65 6e 74 53 6f 75 72 63 65 41 20 52 65  rEventSourceA Re
1bd60 67 69 73 74 65 72 45 76 65 6e 74 53 6f 75 72 63  gisterEventSourc
1bd70 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  e;..// #endif //
1bd80 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
1bd90 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1bda0 6f 72 74 20 48 41 4e 44 4c 45 20 4f 70 65 6e 42  ort HANDLE OpenB
1bdb0 61 63 6b 75 70 45 76 65 6e 74 4c 6f 67 41 28 0d  ackupEventLogA(.
1bdc0 0a 20 20 4c 50 43 53 54 52 20 6c 70 55 4e 43 53  .  LPCSTR lpUNCS
1bdd0 65 72 76 65 72 4e 61 6d 65 2c 0d 0a 20 20 4c 50  erverName,..  LP
1bde0 43 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65 29  CSTR lpFileName)
1bdf0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
1be00 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45  s) export HANDLE
1be10 20 4f 70 65 6e 42 61 63 6b 75 70 45 76 65 6e 74   OpenBackupEvent
1be20 4c 6f 67 57 28 0d 0a 20 20 4c 50 43 57 53 54 52  LogW(..  LPCWSTR
1be30 20 6c 70 55 4e 43 53 65 72 76 65 72 4e 61 6d 65   lpUNCServerName
1be40 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 46  ,..  LPCWSTR lpF
1be50 69 6c 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69  ileName);..// #i
1be60 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
1be70 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
1be80 0a 61 6c 69 61 73 20 4f 70 65 6e 42 61 63 6b 75  .alias OpenBacku
1be90 70 45 76 65 6e 74 4c 6f 67 41 20 4f 70 65 6e 42  pEventLogA OpenB
1bea0 61 63 6b 75 70 45 76 65 6e 74 4c 6f 67 3b 0d 0a  ackupEventLog;..
1beb0 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
1bec0 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
1bed0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1bee0 42 4f 4f 4c 20 52 65 61 64 45 76 65 6e 74 4c 6f  BOOL ReadEventLo
1bef0 67 41 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45  gA(..  HANDLE hE
1bf00 76 65 6e 74 4c 6f 67 2c 0d 0a 20 20 44 57 4f 52  ventLog,..  DWOR
1bf10 44 20 64 77 52 65 61 64 46 6c 61 67 73 2c 0d 0a  D dwReadFlags,..
1bf20 20 20 44 57 4f 52 44 20 64 77 52 65 63 6f 72 64    DWORD dwRecord
1bf30 4f 66 66 73 65 74 2c 0d 0a 20 20 4c 50 56 4f 49  Offset,..  LPVOI
1bf40 44 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 44  D lpBuffer,..  D
1bf50 57 4f 52 44 20 6e 4e 75 6d 62 65 72 4f 66 42 79  WORD nNumberOfBy
1bf60 74 65 73 54 6f 52 65 61 64 2c 0d 0a 20 20 44 57  tesToRead,..  DW
1bf70 4f 52 44 20 2a 70 6e 42 79 74 65 73 52 65 61 64  ORD *pnBytesRead
1bf80 2c 0d 0a 20 20 44 57 4f 52 44 20 2a 70 6e 4d 69  ,..  DWORD *pnMi
1bf90 6e 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 4e 65  nNumberOfBytesNe
1bfa0 65 64 65 64 29 3b 0d 0a 65 78 74 65 72 6e 28 57  eded);..extern(W
1bfb0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1bfc0 4f 4f 4c 20 52 65 61 64 45 76 65 6e 74 4c 6f 67  OOL ReadEventLog
1bfd0 57 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45 76  W(..  HANDLE hEv
1bfe0 65 6e 74 4c 6f 67 2c 0d 0a 20 20 44 57 4f 52 44  entLog,..  DWORD
1bff0 20 64 77 52 65 61 64 46 6c 61 67 73 2c 0d 0a 20   dwReadFlags,.. 
1c000 20 44 57 4f 52 44 20 64 77 52 65 63 6f 72 64 4f   DWORD dwRecordO
1c010 66 66 73 65 74 2c 0d 0a 20 20 4c 50 56 4f 49 44  ffset,..  LPVOID
1c020 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 44 57   lpBuffer,..  DW
1c030 4f 52 44 20 6e 4e 75 6d 62 65 72 4f 66 42 79 74  ORD nNumberOfByt
1c040 65 73 54 6f 52 65 61 64 2c 0d 0a 20 20 44 57 4f  esToRead,..  DWO
1c050 52 44 20 2a 70 6e 42 79 74 65 73 52 65 61 64 2c  RD *pnBytesRead,
1c060 0d 0a 20 20 44 57 4f 52 44 20 2a 70 6e 4d 69 6e  ..  DWORD *pnMin
1c070 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 4e 65 65  NumberOfBytesNee
1c080 64 65 64 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ded);..// #ifdef
1c090 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
1c0a0 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
1c0b0 61 73 20 52 65 61 64 45 76 65 6e 74 4c 6f 67 41  as ReadEventLogA
1c0c0 20 52 65 61 64 45 76 65 6e 74 4c 6f 67 3b 0d 0a   ReadEventLog;..
1c0d0 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
1c0e0 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
1c0f0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1c100 42 4f 4f 4c 20 52 65 70 6f 72 74 45 76 65 6e 74  BOOL ReportEvent
1c110 41 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45 76  A(..  HANDLE hEv
1c120 65 6e 74 4c 6f 67 2c 0d 0a 20 20 57 4f 52 44 20  entLog,..  WORD 
1c130 77 54 79 70 65 2c 0d 0a 20 20 57 4f 52 44 20 77  wType,..  WORD w
1c140 43 61 74 65 67 6f 72 79 2c 0d 0a 20 20 44 57 4f  Category,..  DWO
1c150 52 44 20 64 77 45 76 65 6e 74 49 44 2c 0d 0a 20  RD dwEventID,.. 
1c160 20 50 53 49 44 20 6c 70 55 73 65 72 53 69 64 2c   PSID lpUserSid,
1c170 0d 0a 20 20 57 4f 52 44 20 77 4e 75 6d 53 74 72  ..  WORD wNumStr
1c180 69 6e 67 73 2c 0d 0a 20 20 44 57 4f 52 44 20 64  ings,..  DWORD d
1c190 77 44 61 74 61 53 69 7a 65 2c 0d 0a 20 20 4c 50  wDataSize,..  LP
1c1a0 43 53 54 52 20 2a 6c 70 53 74 72 69 6e 67 73 2c  CSTR *lpStrings,
1c1b0 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 52 61 77  ..  LPVOID lpRaw
1c1c0 44 61 74 61 29 3b 0d 0a 65 78 74 65 72 6e 28 57  Data);..extern(W
1c1d0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1c1e0 4f 4f 4c 20 52 65 70 6f 72 74 45 76 65 6e 74 57  OOL ReportEventW
1c1f0 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 45 76 65  (..  HANDLE hEve
1c200 6e 74 4c 6f 67 2c 0d 0a 20 20 57 4f 52 44 20 77  ntLog,..  WORD w
1c210 54 79 70 65 2c 0d 0a 20 20 57 4f 52 44 20 77 43  Type,..  WORD wC
1c220 61 74 65 67 6f 72 79 2c 0d 0a 20 20 44 57 4f 52  ategory,..  DWOR
1c230 44 20 64 77 45 76 65 6e 74 49 44 2c 0d 0a 20 20  D dwEventID,..  
1c240 50 53 49 44 20 6c 70 55 73 65 72 53 69 64 2c 0d  PSID lpUserSid,.
1c250 0a 20 20 57 4f 52 44 20 77 4e 75 6d 53 74 72 69  .  WORD wNumStri
1c260 6e 67 73 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77  ngs,..  DWORD dw
1c270 44 61 74 61 53 69 7a 65 2c 0d 0a 20 20 4c 50 43  DataSize,..  LPC
1c280 57 53 54 52 20 2a 6c 70 53 74 72 69 6e 67 73 2c  WSTR *lpStrings,
1c290 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 52 61 77  ..  LPVOID lpRaw
1c2a0 44 61 74 61 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  Data);..// #ifde
1c2b0 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e  f UNICODE..// #.
1c2c0 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c  ....// #else..al
1c2d0 69 61 73 20 52 65 70 6f 72 74 45 76 65 6e 74 41  ias ReportEventA
1c2e0 20 52 65 70 6f 72 74 45 76 65 6e 74 3b 0d 0a 2f   ReportEvent;../
1c2f0 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
1c300 43 4f 44 45 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75  CODE....enum : u
1c310 69 6e 74 20 7b 20 45 56 45 4e 54 4c 4f 47 5f 46  int { EVENTLOG_F
1c320 55 4c 4c 5f 49 4e 46 4f 20 3d 20 30 20 7d 0d 0a  ULL_INFO = 0 }..
1c330 0d 0a 73 74 72 75 63 74 20 5f 45 56 45 4e 54 4c  ..struct _EVENTL
1c340 4f 47 5f 46 55 4c 4c 5f 49 4e 46 4f 52 4d 41 54  OG_FULL_INFORMAT
1c350 49 4f 4e 20 7b 0d 0a 20 20 44 57 4f 52 44 20 64  ION {..  DWORD d
1c360 77 46 75 6c 6c 3b 0d 0a 7d 0d 0a 61 6c 69 61 73  wFull;..}..alias
1c370 20 5f 45 56 45 4e 54 4c 4f 47 5f 46 55 4c 4c 5f   _EVENTLOG_FULL_
1c380 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 45 56 45 4e  INFORMATION EVEN
1c390 54 4c 4f 47 5f 46 55 4c 4c 5f 49 4e 46 4f 52 4d  TLOG_FULL_INFORM
1c3a0 41 54 49 4f 4e 3b 0d 0a 61 6c 69 61 73 20 5f 45  ATION;..alias _E
1c3b0 56 45 4e 54 4c 4f 47 5f 46 55 4c 4c 5f 49 4e 46  VENTLOG_FULL_INF
1c3c0 4f 52 4d 41 54 49 4f 4e 2a 20 4c 50 45 56 45 4e  ORMATION* LPEVEN
1c3d0 54 4c 4f 47 5f 46 55 4c 4c 5f 49 4e 46 4f 52 4d  TLOG_FULL_INFORM
1c3e0 41 54 49 4f 4e 3b 0d 0a 0d 0a 65 78 74 65 72 6e  ATION;....extern
1c3f0 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1c400 20 42 4f 4f 4c 20 47 65 74 45 76 65 6e 74 4c 6f   BOOL GetEventLo
1c410 67 49 6e 66 6f 72 6d 61 74 69 6f 6e 28 0d 0a 20  gInformation(.. 
1c420 20 48 41 4e 44 4c 45 20 68 45 76 65 6e 74 4c 6f   HANDLE hEventLo
1c430 67 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 49 6e  g,..  DWORD dwIn
1c440 66 6f 4c 65 76 65 6c 2c 0d 0a 20 20 4c 50 56 4f  foLevel,..  LPVO
1c450 49 44 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20  ID lpBuffer,..  
1c460 44 57 4f 52 44 20 63 62 42 75 66 53 69 7a 65 2c  DWORD cbBufSize,
1c470 0d 0a 20 20 4c 50 44 57 4f 52 44 20 70 63 62 42  ..  LPDWORD pcbB
1c480 79 74 65 73 4e 65 65 64 65 64 29 3b 0d 0a 0d 0a  ytesNeeded);....
1c490 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1c4a0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 44 75 70 6c  export BOOL Dupl
1c4b0 69 63 61 74 65 54 6f 6b 65 6e 28 0d 0a 20 20 48  icateToken(..  H
1c4c0 41 4e 44 4c 45 20 45 78 69 73 74 69 6e 67 54 6f  ANDLE ExistingTo
1c4d0 6b 65 6e 48 61 6e 64 6c 65 2c 0d 0a 20 20 53 45  kenHandle,..  SE
1c4e0 43 55 52 49 54 59 5f 49 4d 50 45 52 53 4f 4e 41  CURITY_IMPERSONA
1c4f0 54 49 4f 4e 5f 4c 45 56 45 4c 20 49 6d 70 65 72  TION_LEVEL Imper
1c500 73 6f 6e 61 74 69 6f 6e 4c 65 76 65 6c 2c 0d 0a  sonationLevel,..
1c510 20 20 50 48 41 4e 44 4c 45 20 44 75 70 6c 69 63    PHANDLE Duplic
1c520 61 74 65 54 6f 6b 65 6e 48 61 6e 64 6c 65 29 3b  ateTokenHandle);
1c530 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
1c540 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
1c550 47 65 74 4b 65 72 6e 65 6c 4f 62 6a 65 63 74 53  GetKernelObjectS
1c560 65 63 75 72 69 74 79 28 0d 0a 20 20 48 41 4e 44  ecurity(..  HAND
1c570 4c 45 20 48 61 6e 64 6c 65 2c 0d 0a 20 20 53 45  LE Handle,..  SE
1c580 43 55 52 49 54 59 5f 49 4e 46 4f 52 4d 41 54 49  CURITY_INFORMATI
1c590 4f 4e 20 52 65 71 75 65 73 74 65 64 49 6e 66 6f  ON RequestedInfo
1c5a0 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 50 53 45 43  rmation,..  PSEC
1c5b0 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52  URITY_DESCRIPTOR
1c5c0 20 70 53 65 63 75 72 69 74 79 44 65 73 63 72 69   pSecurityDescri
1c5d0 70 74 6f 72 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  ptor,..  DWORD n
1c5e0 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 44 57 4f  Length,..  LPDWO
1c5f0 52 44 20 6c 70 6e 4c 65 6e 67 74 68 4e 65 65 64  RD lpnLengthNeed
1c600 65 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ed);....extern(W
1c610 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1c620 4f 4f 4c 20 49 6d 70 65 72 73 6f 6e 61 74 65 4e  OOL ImpersonateN
1c630 61 6d 65 64 50 69 70 65 43 6c 69 65 6e 74 28 0d  amedPipeClient(.
1c640 0a 20 20 48 41 4e 44 4c 45 20 68 4e 61 6d 65 64  .  HANDLE hNamed
1c650 50 69 70 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  Pipe);....extern
1c660 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1c670 20 42 4f 4f 4c 20 49 6d 70 65 72 73 6f 6e 61 74   BOOL Impersonat
1c680 65 53 65 6c 66 28 0d 0a 20 20 53 45 43 55 52 49  eSelf(..  SECURI
1c690 54 59 5f 49 4d 50 45 52 53 4f 4e 41 54 49 4f 4e  TY_IMPERSONATION
1c6a0 5f 4c 45 56 45 4c 20 49 6d 70 65 72 73 6f 6e 61  _LEVEL Impersona
1c6b0 74 69 6f 6e 4c 65 76 65 6c 29 3b 0d 0a 0d 0a 65  tionLevel);....e
1c6c0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
1c6d0 78 70 6f 72 74 20 42 4f 4f 4c 20 52 65 76 65 72  xport BOOL Rever
1c6e0 74 54 6f 53 65 6c 66 28 29 3b 0d 0a 0d 0a 65 78  tToSelf();....ex
1c6f0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
1c700 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 54 68 72  port BOOL SetThr
1c710 65 61 64 54 6f 6b 65 6e 28 0d 0a 20 20 50 48 41  eadToken(..  PHA
1c720 4e 44 4c 45 20 54 68 72 65 61 64 2c 0d 0a 20 20  NDLE Thread,..  
1c730 48 41 4e 44 4c 45 20 54 6f 6b 65 6e 29 3b 0d 0a  HANDLE Token);..
1c740 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
1c750 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 63  ) export BOOL Ac
1c760 63 65 73 73 43 68 65 63 6b 28 0d 0a 20 20 50 53  cessCheck(..  PS
1c770 45 43 55 52 49 54 59 5f 44 45 53 43 52 49 50 54  ECURITY_DESCRIPT
1c780 4f 52 20 70 53 65 63 75 72 69 74 79 44 65 73 63  OR pSecurityDesc
1c790 72 69 70 74 6f 72 2c 0d 0a 20 20 48 41 4e 44 4c  riptor,..  HANDL
1c7a0 45 20 43 6c 69 65 6e 74 54 6f 6b 65 6e 2c 0d 0a  E ClientToken,..
1c7b0 20 20 44 57 4f 52 44 20 44 65 73 69 72 65 64 41    DWORD DesiredA
1c7c0 63 63 65 73 73 2c 0d 0a 20 20 50 47 45 4e 45 52  ccess,..  PGENER
1c7d0 49 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e 65 72  IC_MAPPING Gener
1c7e0 69 63 4d 61 70 70 69 6e 67 2c 0d 0a 20 20 50 50  icMapping,..  PP
1c7f0 52 49 56 49 4c 45 47 45 5f 53 45 54 20 50 72 69  RIVILEGE_SET Pri
1c800 76 69 6c 65 67 65 53 65 74 2c 0d 0a 20 20 4c 50  vilegeSet,..  LP
1c810 44 57 4f 52 44 20 50 72 69 76 69 6c 65 67 65 53  DWORD PrivilegeS
1c820 65 74 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 44  etLength,..  LPD
1c830 57 4f 52 44 20 47 72 61 6e 74 65 64 41 63 63 65  WORD GrantedAcce
1c840 73 73 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20 41 63  ss,..  LPBOOL Ac
1c850 63 65 73 73 53 74 61 74 75 73 29 3b 0d 0a 0d 0a  cessStatus);....
1c860 2f 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49  // #if(_WIN32_WI
1c870 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 0d 0a  NNT >= 0x0500)..
1c880 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1c890 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 63 63 65  export BOOL Acce
1c8a0 73 73 43 68 65 63 6b 42 79 54 79 70 65 28 0d 0a  ssCheckByType(..
1c8b0 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53 43    PSECURITY_DESC
1c8c0 52 49 50 54 4f 52 20 70 53 65 63 75 72 69 74 79  RIPTOR pSecurity
1c8d0 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20 50  Descriptor,..  P
1c8e0 53 49 44 20 50 72 69 6e 63 69 70 61 6c 53 65 6c  SID PrincipalSel
1c8f0 66 53 69 64 2c 0d 0a 20 20 48 41 4e 44 4c 45 20  fSid,..  HANDLE 
1c900 43 6c 69 65 6e 74 54 6f 6b 65 6e 2c 0d 0a 20 20  ClientToken,..  
1c910 44 57 4f 52 44 20 44 65 73 69 72 65 64 41 63 63  DWORD DesiredAcc
1c920 65 73 73 2c 0d 0a 20 20 50 4f 42 4a 45 43 54 5f  ess,..  POBJECT_
1c930 54 59 50 45 5f 4c 49 53 54 20 4f 62 6a 65 63 74  TYPE_LIST Object
1c940 54 79 70 65 4c 69 73 74 2c 0d 0a 20 20 44 57 4f  TypeList,..  DWO
1c950 52 44 20 4f 62 6a 65 63 74 54 79 70 65 4c 69 73  RD ObjectTypeLis
1c960 74 4c 65 6e 67 74 68 2c 0d 0a 20 20 50 47 45 4e  tLength,..  PGEN
1c970 45 52 49 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e  ERIC_MAPPING Gen
1c980 65 72 69 63 4d 61 70 70 69 6e 67 2c 0d 0a 20 20  ericMapping,..  
1c990 50 50 52 49 56 49 4c 45 47 45 5f 53 45 54 20 50  PPRIVILEGE_SET P
1c9a0 72 69 76 69 6c 65 67 65 53 65 74 2c 0d 0a 20 20  rivilegeSet,..  
1c9b0 4c 50 44 57 4f 52 44 20 50 72 69 76 69 6c 65 67  LPDWORD Privileg
1c9c0 65 53 65 74 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c  eSetLength,..  L
1c9d0 50 44 57 4f 52 44 20 47 72 61 6e 74 65 64 41 63  PDWORD GrantedAc
1c9e0 63 65 73 73 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20  cess,..  LPBOOL 
1c9f0 41 63 63 65 73 73 53 74 61 74 75 73 29 3b 0d 0a  AccessStatus);..
1ca00 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
1ca10 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 63  ) export BOOL Ac
1ca20 63 65 73 73 43 68 65 63 6b 42 79 54 79 70 65 52  cessCheckByTypeR
1ca30 65 73 75 6c 74 4c 69 73 74 28 0d 0a 20 20 50 53  esultList(..  PS
1ca40 45 43 55 52 49 54 59 5f 44 45 53 43 52 49 50 54  ECURITY_DESCRIPT
1ca50 4f 52 20 70 53 65 63 75 72 69 74 79 44 65 73 63  OR pSecurityDesc
1ca60 72 69 70 74 6f 72 2c 0d 0a 20 20 50 53 49 44 20  riptor,..  PSID 
1ca70 50 72 69 6e 63 69 70 61 6c 53 65 6c 66 53 69 64  PrincipalSelfSid
1ca80 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 43 6c 69 65  ,..  HANDLE Clie
1ca90 6e 74 54 6f 6b 65 6e 2c 0d 0a 20 20 44 57 4f 52  ntToken,..  DWOR
1caa0 44 20 44 65 73 69 72 65 64 41 63 63 65 73 73 2c  D DesiredAccess,
1cab0 0d 0a 20 20 50 4f 42 4a 45 43 54 5f 54 59 50 45  ..  POBJECT_TYPE
1cac0 5f 4c 49 53 54 20 4f 62 6a 65 63 74 54 79 70 65  _LIST ObjectType
1cad0 4c 69 73 74 2c 0d 0a 20 20 44 57 4f 52 44 20 4f  List,..  DWORD O
1cae0 62 6a 65 63 74 54 79 70 65 4c 69 73 74 4c 65 6e  bjectTypeListLen
1caf0 67 74 68 2c 0d 0a 20 20 50 47 45 4e 45 52 49 43  gth,..  PGENERIC
1cb00 5f 4d 41 50 50 49 4e 47 20 47 65 6e 65 72 69 63  _MAPPING Generic
1cb10 4d 61 70 70 69 6e 67 2c 0d 0a 20 20 50 50 52 49  Mapping,..  PPRI
1cb20 56 49 4c 45 47 45 5f 53 45 54 20 50 72 69 76 69  VILEGE_SET Privi
1cb30 6c 65 67 65 53 65 74 2c 0d 0a 20 20 4c 50 44 57  legeSet,..  LPDW
1cb40 4f 52 44 20 50 72 69 76 69 6c 65 67 65 53 65 74  ORD PrivilegeSet
1cb50 4c 65 6e 67 74 68 2c 0d 0a 20 20 4c 50 44 57 4f  Length,..  LPDWO
1cb60 52 44 20 47 72 61 6e 74 65 64 41 63 63 65 73 73  RD GrantedAccess
1cb70 4c 69 73 74 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  List,..  LPDWORD
1cb80 20 41 63 63 65 73 73 53 74 61 74 75 73 4c 69 73   AccessStatusLis
1cb90 74 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  t);..// #endif /
1cba0 2a 20 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e  * _WIN32_WINNT >
1cbb0 3d 20 20 30 78 30 35 30 30 20 2a 2f 0d 0a 0d 0a  =  0x0500 */....
1cbc0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1cbd0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4f 70 65 6e  export BOOL Open
1cbe0 50 72 6f 63 65 73 73 54 6f 6b 65 6e 28 0d 0a 20  ProcessToken(.. 
1cbf0 20 48 41 4e 44 4c 45 20 50 72 6f 63 65 73 73 48   HANDLE ProcessH
1cc00 61 6e 64 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20  andle,..  DWORD 
1cc10 44 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a  DesiredAccess,..
1cc20 20 20 50 48 41 4e 44 4c 45 20 54 6f 6b 65 6e 48    PHANDLE TokenH
1cc30 61 6e 64 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72  andle);....exter
1cc40 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1cc50 74 20 42 4f 4f 4c 20 4f 70 65 6e 54 68 72 65 61  t BOOL OpenThrea
1cc60 64 54 6f 6b 65 6e 28 0d 0a 20 20 48 41 4e 44 4c  dToken(..  HANDL
1cc70 45 20 54 68 72 65 61 64 48 61 6e 64 6c 65 2c 0d  E ThreadHandle,.
1cc80 0a 20 20 44 57 4f 52 44 20 44 65 73 69 72 65 64  .  DWORD Desired
1cc90 41 63 63 65 73 73 2c 0d 0a 20 20 42 4f 4f 4c 20  Access,..  BOOL 
1cca0 4f 70 65 6e 41 73 53 65 6c 66 2c 0d 0a 20 20 50  OpenAsSelf,..  P
1ccb0 48 41 4e 44 4c 45 20 54 6f 6b 65 6e 48 61 6e 64  HANDLE TokenHand
1ccc0 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  le);....extern(W
1ccd0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1cce0 4f 4f 4c 20 47 65 74 54 6f 6b 65 6e 49 6e 66 6f  OOL GetTokenInfo
1ccf0 72 6d 61 74 69 6f 6e 28 0d 0a 20 20 48 41 4e 44  rmation(..  HAND
1cd00 4c 45 20 54 6f 6b 65 6e 48 61 6e 64 6c 65 2c 0d  LE TokenHandle,.
1cd10 0a 20 20 54 4f 4b 45 4e 5f 49 4e 46 4f 52 4d 41  .  TOKEN_INFORMA
1cd20 54 49 4f 4e 5f 43 4c 41 53 53 20 54 6f 6b 65 6e  TION_CLASS Token
1cd30 49 6e 66 6f 72 6d 61 74 69 6f 6e 43 6c 61 73 73  InformationClass
1cd40 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 54 6f 6b 65  ,..  LPVOID Toke
1cd50 6e 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20  nInformation,.. 
1cd60 20 44 57 4f 52 44 20 54 6f 6b 65 6e 49 6e 66 6f   DWORD TokenInfo
1cd70 72 6d 61 74 69 6f 6e 4c 65 6e 67 74 68 2c 0d 0a  rmationLength,..
1cd80 20 20 50 44 57 4f 52 44 20 52 65 74 75 72 6e 4c    PDWORD ReturnL
1cd90 65 6e 67 74 68 29 3b 0d 0a 0d 0a 65 78 74 65 72  ength);....exter
1cda0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1cdb0 74 20 42 4f 4f 4c 20 53 65 74 54 6f 6b 65 6e 49  t BOOL SetTokenI
1cdc0 6e 66 6f 72 6d 61 74 69 6f 6e 28 0d 0a 20 20 48  nformation(..  H
1cdd0 41 4e 44 4c 45 20 54 6f 6b 65 6e 48 61 6e 64 6c  ANDLE TokenHandl
1cde0 65 2c 0d 0a 20 20 54 4f 4b 45 4e 5f 49 4e 46 4f  e,..  TOKEN_INFO
1cdf0 52 4d 41 54 49 4f 4e 5f 43 4c 41 53 53 20 54 6f  RMATION_CLASS To
1ce00 6b 65 6e 49 6e 66 6f 72 6d 61 74 69 6f 6e 43 6c  kenInformationCl
1ce10 61 73 73 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 54  ass,..  LPVOID T
1ce20 6f 6b 65 6e 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c  okenInformation,
1ce30 0d 0a 20 20 44 57 4f 52 44 20 54 6f 6b 65 6e 49  ..  DWORD TokenI
1ce40 6e 66 6f 72 6d 61 74 69 6f 6e 4c 65 6e 67 74 68  nformationLength
1ce50 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
1ce60 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
1ce70 4c 20 41 64 6a 75 73 74 54 6f 6b 65 6e 50 72 69  L AdjustTokenPri
1ce80 76 69 6c 65 67 65 73 28 0d 0a 20 20 48 41 4e 44  vileges(..  HAND
1ce90 4c 45 20 54 6f 6b 65 6e 48 61 6e 64 6c 65 2c 0d  LE TokenHandle,.
1cea0 0a 20 20 42 4f 4f 4c 20 44 69 73 61 62 6c 65 41  .  BOOL DisableA
1ceb0 6c 6c 50 72 69 76 69 6c 65 67 65 73 2c 0d 0a 20  llPrivileges,.. 
1cec0 20 50 54 4f 4b 45 4e 5f 50 52 49 56 49 4c 45 47   PTOKEN_PRIVILEG
1ced0 45 53 20 4e 65 77 53 74 61 74 65 2c 0d 0a 20 20  ES NewState,..  
1cee0 44 57 4f 52 44 20 42 75 66 66 65 72 4c 65 6e 67  DWORD BufferLeng
1cef0 74 68 2c 0d 0a 20 20 50 54 4f 4b 45 4e 5f 50 52  th,..  PTOKEN_PR
1cf00 49 56 49 4c 45 47 45 53 20 50 72 65 76 69 6f 75  IVILEGES Previou
1cf10 73 53 74 61 74 65 2c 0d 0a 20 20 50 44 57 4f 52  sState,..  PDWOR
1cf20 44 20 52 65 74 75 72 6e 4c 65 6e 67 74 68 29 3b  D ReturnLength);
1cf30 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
1cf40 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
1cf50 41 64 6a 75 73 74 54 6f 6b 65 6e 47 72 6f 75 70  AdjustTokenGroup
1cf60 73 28 0d 0a 20 20 48 41 4e 44 4c 45 20 54 6f 6b  s(..  HANDLE Tok
1cf70 65 6e 48 61 6e 64 6c 65 2c 0d 0a 20 20 42 4f 4f  enHandle,..  BOO
1cf80 4c 20 52 65 73 65 74 54 6f 44 65 66 61 75 6c 74  L ResetToDefault
1cf90 2c 0d 0a 20 20 50 54 4f 4b 45 4e 5f 47 52 4f 55  ,..  PTOKEN_GROU
1cfa0 50 53 20 4e 65 77 53 74 61 74 65 2c 0d 0a 20 20  PS NewState,..  
1cfb0 44 57 4f 52 44 20 42 75 66 66 65 72 4c 65 6e 67  DWORD BufferLeng
1cfc0 74 68 2c 0d 0a 20 20 50 54 4f 4b 45 4e 5f 47 52  th,..  PTOKEN_GR
1cfd0 4f 55 50 53 20 50 72 65 76 69 6f 75 73 53 74 61  OUPS PreviousSta
1cfe0 74 65 2c 0d 0a 20 20 50 44 57 4f 52 44 20 52 65  te,..  PDWORD Re
1cff0 74 75 72 6e 4c 65 6e 67 74 68 29 3b 0d 0a 0d 0a  turnLength);....
1d000 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1d010 65 78 70 6f 72 74 20 42 4f 4f 4c 20 50 72 69 76  export BOOL Priv
1d020 69 6c 65 67 65 43 68 65 63 6b 28 0d 0a 20 20 48  ilegeCheck(..  H
1d030 41 4e 44 4c 45 20 43 6c 69 65 6e 74 54 6f 6b 65  ANDLE ClientToke
1d040 6e 2c 0d 0a 20 20 50 50 52 49 56 49 4c 45 47 45  n,..  PPRIVILEGE
1d050 5f 53 45 54 20 52 65 71 75 69 72 65 64 50 72 69  _SET RequiredPri
1d060 76 69 6c 65 67 65 73 2c 0d 0a 20 20 4c 50 42 4f  vileges,..  LPBO
1d070 4f 4c 20 70 66 52 65 73 75 6c 74 29 3b 0d 0a 0d  OL pfResult);...
1d080 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1d090 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 63 63   export BOOL Acc
1d0a0 65 73 73 43 68 65 63 6b 41 6e 64 41 75 64 69 74  essCheckAndAudit
1d0b0 41 6c 61 72 6d 41 28 0d 0a 20 20 4c 50 43 53 54  AlarmA(..  LPCST
1d0c0 52 20 53 75 62 73 79 73 74 65 6d 4e 61 6d 65 2c  R SubsystemName,
1d0d0 0d 0a 20 20 4c 50 56 4f 49 44 20 48 61 6e 64 6c  ..  LPVOID Handl
1d0e0 65 49 64 2c 0d 0a 20 20 4c 50 53 54 52 20 4f 62  eId,..  LPSTR Ob
1d0f0 6a 65 63 74 54 79 70 65 4e 61 6d 65 2c 0d 0a 20  jectTypeName,.. 
1d100 20 4c 50 53 54 52 20 4f 62 6a 65 63 74 4e 61 6d   LPSTR ObjectNam
1d110 65 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f  e,..  PSECURITY_
1d120 44 45 53 43 52 49 50 54 4f 52 20 53 65 63 75 72  DESCRIPTOR Secur
1d130 69 74 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a  ityDescriptor,..
1d140 20 20 44 57 4f 52 44 20 44 65 73 69 72 65 64 41    DWORD DesiredA
1d150 63 63 65 73 73 2c 0d 0a 20 20 50 47 45 4e 45 52  ccess,..  PGENER
1d160 49 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e 65 72  IC_MAPPING Gener
1d170 69 63 4d 61 70 70 69 6e 67 2c 0d 0a 20 20 42 4f  icMapping,..  BO
1d180 4f 4c 20 4f 62 6a 65 63 74 43 72 65 61 74 69 6f  OL ObjectCreatio
1d190 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 47 72  n,..  LPDWORD Gr
1d1a0 61 6e 74 65 64 41 63 63 65 73 73 2c 0d 0a 20 20  antedAccess,..  
1d1b0 4c 50 42 4f 4f 4c 20 41 63 63 65 73 73 53 74 61  LPBOOL AccessSta
1d1c0 74 75 73 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20 70  tus,..  LPBOOL p
1d1d0 66 47 65 6e 65 72 61 74 65 4f 6e 43 6c 6f 73 65  fGenerateOnClose
1d1e0 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
1d1f0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
1d200 41 63 63 65 73 73 43 68 65 63 6b 41 6e 64 41 75  AccessCheckAndAu
1d210 64 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20 4c 50  ditAlarmW(..  LP
1d220 43 57 53 54 52 20 53 75 62 73 79 73 74 65 6d 4e  CWSTR SubsystemN
1d230 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 48  ame,..  LPVOID H
1d240 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 4c 50 57 53  andleId,..  LPWS
1d250 54 52 20 4f 62 6a 65 63 74 54 79 70 65 4e 61 6d  TR ObjectTypeNam
1d260 65 2c 0d 0a 20 20 4c 50 57 53 54 52 20 4f 62 6a  e,..  LPWSTR Obj
1d270 65 63 74 4e 61 6d 65 2c 0d 0a 20 20 50 53 45 43  ectName,..  PSEC
1d280 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52  URITY_DESCRIPTOR
1d290 20 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70   SecurityDescrip
1d2a0 74 6f 72 2c 0d 0a 20 20 44 57 4f 52 44 20 44 65  tor,..  DWORD De
1d2b0 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20 20  siredAccess,..  
1d2c0 50 47 45 4e 45 52 49 43 5f 4d 41 50 50 49 4e 47  PGENERIC_MAPPING
1d2d0 20 47 65 6e 65 72 69 63 4d 61 70 70 69 6e 67 2c   GenericMapping,
1d2e0 0d 0a 20 20 42 4f 4f 4c 20 4f 62 6a 65 63 74 43  ..  BOOL ObjectC
1d2f0 72 65 61 74 69 6f 6e 2c 0d 0a 20 20 4c 50 44 57  reation,..  LPDW
1d300 4f 52 44 20 47 72 61 6e 74 65 64 41 63 63 65 73  ORD GrantedAcces
1d310 73 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20 41 63 63  s,..  LPBOOL Acc
1d320 65 73 73 53 74 61 74 75 73 2c 0d 0a 20 20 4c 50  essStatus,..  LP
1d330 42 4f 4f 4c 20 70 66 47 65 6e 65 72 61 74 65 4f  BOOL pfGenerateO
1d340 6e 43 6c 6f 73 65 29 3b 0d 0a 2f 2f 20 23 69 66  nClose);..// #if
1d350 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
1d360 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
1d370 61 6c 69 61 73 20 41 63 63 65 73 73 43 68 65 63  alias AccessChec
1d380 6b 41 6e 64 41 75 64 69 74 41 6c 61 72 6d 41 20  kAndAuditAlarmA 
1d390 41 63 63 65 73 73 43 68 65 63 6b 41 6e 64 41 75  AccessCheckAndAu
1d3a0 64 69 74 41 6c 61 72 6d 3b 0d 0a 2f 2f 20 23 65  ditAlarm;..// #e
1d3b0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
1d3c0 0d 0a 0d 0a 2f 2f 20 23 69 66 28 5f 57 49 4e 33  ....// #if(_WIN3
1d3d0 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30  2_WINNT >= 0x050
1d3e0 30 29 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  0)....extern(Win
1d3f0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
1d400 4c 20 41 63 63 65 73 73 43 68 65 63 6b 42 79 54  L AccessCheckByT
1d410 79 70 65 41 6e 64 41 75 64 69 74 41 6c 61 72 6d  ypeAndAuditAlarm
1d420 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 53 75 62  A(..  LPCSTR Sub
1d430 73 79 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 4c  systemName,..  L
1d440 50 56 4f 49 44 20 48 61 6e 64 6c 65 49 64 2c 0d  PVOID HandleId,.
1d450 0a 20 20 4c 50 43 53 54 52 20 4f 62 6a 65 63 74  .  LPCSTR Object
1d460 54 79 70 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  TypeName,..  LPC
1d470 53 54 52 20 4f 62 6a 65 63 74 4e 61 6d 65 2c 0d  STR ObjectName,.
1d480 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53  .  PSECURITY_DES
1d490 43 52 49 50 54 4f 52 20 53 65 63 75 72 69 74 79  CRIPTOR Security
1d4a0 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20 50  Descriptor,..  P
1d4b0 53 49 44 20 50 72 69 6e 63 69 70 61 6c 53 65 6c  SID PrincipalSel
1d4c0 66 53 69 64 2c 0d 0a 20 20 44 57 4f 52 44 20 44  fSid,..  DWORD D
1d4d0 65 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20  esiredAccess,.. 
1d4e0 20 41 55 44 49 54 5f 45 56 45 4e 54 5f 54 59 50   AUDIT_EVENT_TYP
1d4f0 45 20 41 75 64 69 74 54 79 70 65 2c 0d 0a 20 20  E AuditType,..  
1d500 44 57 4f 52 44 20 46 6c 61 67 73 2c 0d 0a 20 20  DWORD Flags,..  
1d510 50 4f 42 4a 45 43 54 5f 54 59 50 45 5f 4c 49 53  POBJECT_TYPE_LIS
1d520 54 20 4f 62 6a 65 63 74 54 79 70 65 4c 69 73 74  T ObjectTypeList
1d530 2c 0d 0a 20 20 44 57 4f 52 44 20 4f 62 6a 65 63  ,..  DWORD Objec
1d540 74 54 79 70 65 4c 69 73 74 4c 65 6e 67 74 68 2c  tTypeListLength,
1d550 0d 0a 20 20 50 47 45 4e 45 52 49 43 5f 4d 41 50  ..  PGENERIC_MAP
1d560 50 49 4e 47 20 47 65 6e 65 72 69 63 4d 61 70 70  PING GenericMapp
1d570 69 6e 67 2c 0d 0a 20 20 42 4f 4f 4c 20 4f 62 6a  ing,..  BOOL Obj
1d580 65 63 74 43 72 65 61 74 69 6f 6e 2c 0d 0a 20 20  ectCreation,..  
1d590 4c 50 44 57 4f 52 44 20 47 72 61 6e 74 65 64 41  LPDWORD GrantedA
1d5a0 63 63 65 73 73 2c 0d 0a 20 20 4c 50 42 4f 4f 4c  ccess,..  LPBOOL
1d5b0 20 41 63 63 65 73 73 53 74 61 74 75 73 2c 0d 0a   AccessStatus,..
1d5c0 20 20 4c 50 42 4f 4f 4c 20 70 66 47 65 6e 65 72    LPBOOL pfGener
1d5d0 61 74 65 4f 6e 43 6c 6f 73 65 29 3b 0d 0a 65 78  ateOnClose);..ex
1d5e0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
1d5f0 70 6f 72 74 20 42 4f 4f 4c 20 41 63 63 65 73 73  port BOOL Access
1d600 43 68 65 63 6b 42 79 54 79 70 65 41 6e 64 41 75  CheckByTypeAndAu
1d610 64 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20 4c 50  ditAlarmW(..  LP
1d620 43 57 53 54 52 20 53 75 62 73 79 73 74 65 6d 4e  CWSTR SubsystemN
1d630 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 48  ame,..  LPVOID H
1d640 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 4c 50 43 57  andleId,..  LPCW
1d650 53 54 52 20 4f 62 6a 65 63 74 54 79 70 65 4e 61  STR ObjectTypeNa
1d660 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 4f  me,..  LPCWSTR O
1d670 62 6a 65 63 74 4e 61 6d 65 2c 0d 0a 20 20 50 53  bjectName,..  PS
1d680 45 43 55 52 49 54 59 5f 44 45 53 43 52 49 50 54  ECURITY_DESCRIPT
1d690 4f 52 20 53 65 63 75 72 69 74 79 44 65 73 63 72  OR SecurityDescr
1d6a0 69 70 74 6f 72 2c 0d 0a 20 20 50 53 49 44 20 50  iptor,..  PSID P
1d6b0 72 69 6e 63 69 70 61 6c 53 65 6c 66 53 69 64 2c  rincipalSelfSid,
1d6c0 0d 0a 20 20 44 57 4f 52 44 20 44 65 73 69 72 65  ..  DWORD Desire
1d6d0 64 41 63 63 65 73 73 2c 0d 0a 20 20 41 55 44 49  dAccess,..  AUDI
1d6e0 54 5f 45 56 45 4e 54 5f 54 59 50 45 20 41 75 64  T_EVENT_TYPE Aud
1d6f0 69 74 54 79 70 65 2c 0d 0a 20 20 44 57 4f 52 44  itType,..  DWORD
1d700 20 46 6c 61 67 73 2c 0d 0a 20 20 50 4f 42 4a 45   Flags,..  POBJE
1d710 43 54 5f 54 59 50 45 5f 4c 49 53 54 20 4f 62 6a  CT_TYPE_LIST Obj
1d720 65 63 74 54 79 70 65 4c 69 73 74 2c 0d 0a 20 20  ectTypeList,..  
1d730 44 57 4f 52 44 20 4f 62 6a 65 63 74 54 79 70 65  DWORD ObjectType
1d740 4c 69 73 74 4c 65 6e 67 74 68 2c 0d 0a 20 20 50  ListLength,..  P
1d750 47 45 4e 45 52 49 43 5f 4d 41 50 50 49 4e 47 20  GENERIC_MAPPING 
1d760 47 65 6e 65 72 69 63 4d 61 70 70 69 6e 67 2c 0d  GenericMapping,.
1d770 0a 20 20 42 4f 4f 4c 20 4f 62 6a 65 63 74 43 72  .  BOOL ObjectCr
1d780 65 61 74 69 6f 6e 2c 0d 0a 20 20 4c 50 44 57 4f  eation,..  LPDWO
1d790 52 44 20 47 72 61 6e 74 65 64 41 63 63 65 73 73  RD GrantedAccess
1d7a0 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20 41 63 63 65  ,..  LPBOOL Acce
1d7b0 73 73 53 74 61 74 75 73 2c 0d 0a 20 20 4c 50 42  ssStatus,..  LPB
1d7c0 4f 4f 4c 20 70 66 47 65 6e 65 72 61 74 65 4f 6e  OOL pfGenerateOn
1d7d0 43 6c 6f 73 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  Close);..// #ifd
1d7e0 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
1d7f0 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
1d800 6c 69 61 73 20 41 63 63 65 73 73 43 68 65 63 6b  lias AccessCheck
1d810 42 79 54 79 70 65 41 6e 64 41 75 64 69 74 41 6c  ByTypeAndAuditAl
1d820 61 72 6d 41 20 41 63 63 65 73 73 43 68 65 63 6b  armA AccessCheck
1d830 42 79 54 79 70 65 41 6e 64 41 75 64 69 74 41 6c  ByTypeAndAuditAl
1d840 61 72 6d 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  arm;..// #endif 
1d850 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65  // !UNICODE....e
1d860 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
1d870 78 70 6f 72 74 20 42 4f 4f 4c 20 41 63 63 65 73  xport BOOL Acces
1d880 73 43 68 65 63 6b 42 79 54 79 70 65 52 65 73 75  sCheckByTypeResu
1d890 6c 74 4c 69 73 74 41 6e 64 41 75 64 69 74 41 6c  ltListAndAuditAl
1d8a0 61 72 6d 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  armA(..  LPCSTR 
1d8b0 53 75 62 73 79 73 74 65 6d 4e 61 6d 65 2c 0d 0a  SubsystemName,..
1d8c0 20 20 4c 50 56 4f 49 44 20 48 61 6e 64 6c 65 49    LPVOID HandleI
1d8d0 64 2c 0d 0a 20 20 4c 50 43 53 54 52 20 4f 62 6a  d,..  LPCSTR Obj
1d8e0 65 63 74 54 79 70 65 4e 61 6d 65 2c 0d 0a 20 20  ectTypeName,..  
1d8f0 4c 50 43 53 54 52 20 4f 62 6a 65 63 74 4e 61 6d  LPCSTR ObjectNam
1d900 65 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f  e,..  PSECURITY_
1d910 44 45 53 43 52 49 50 54 4f 52 20 53 65 63 75 72  DESCRIPTOR Secur
1d920 69 74 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a  ityDescriptor,..
1d930 20 20 50 53 49 44 20 50 72 69 6e 63 69 70 61 6c    PSID Principal
1d940 53 65 6c 66 53 69 64 2c 0d 0a 20 20 44 57 4f 52  SelfSid,..  DWOR
1d950 44 20 44 65 73 69 72 65 64 41 63 63 65 73 73 2c  D DesiredAccess,
1d960 0d 0a 20 20 41 55 44 49 54 5f 45 56 45 4e 54 5f  ..  AUDIT_EVENT_
1d970 54 59 50 45 20 41 75 64 69 74 54 79 70 65 2c 0d  TYPE AuditType,.
1d980 0a 20 20 44 57 4f 52 44 20 46 6c 61 67 73 2c 0d  .  DWORD Flags,.
1d990 0a 20 20 50 4f 42 4a 45 43 54 5f 54 59 50 45 5f  .  POBJECT_TYPE_
1d9a0 4c 49 53 54 20 4f 62 6a 65 63 74 54 79 70 65 4c  LIST ObjectTypeL
1d9b0 69 73 74 2c 0d 0a 20 20 44 57 4f 52 44 20 4f 62  ist,..  DWORD Ob
1d9c0 6a 65 63 74 54 79 70 65 4c 69 73 74 4c 65 6e 67  jectTypeListLeng
1d9d0 74 68 2c 0d 0a 20 20 50 47 45 4e 45 52 49 43 5f  th,..  PGENERIC_
1d9e0 4d 41 50 50 49 4e 47 20 47 65 6e 65 72 69 63 4d  MAPPING GenericM
1d9f0 61 70 70 69 6e 67 2c 0d 0a 20 20 42 4f 4f 4c 20  apping,..  BOOL 
1da00 4f 62 6a 65 63 74 43 72 65 61 74 69 6f 6e 2c 0d  ObjectCreation,.
1da10 0a 20 20 4c 50 44 57 4f 52 44 20 47 72 61 6e 74  .  LPDWORD Grant
1da20 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 4c 50 44  edAccess,..  LPD
1da30 57 4f 52 44 20 41 63 63 65 73 73 53 74 61 74 75  WORD AccessStatu
1da40 73 4c 69 73 74 2c 0d 0a 20 20 4c 50 42 4f 4f 4c  sList,..  LPBOOL
1da50 20 70 66 47 65 6e 65 72 61 74 65 4f 6e 43 6c 6f   pfGenerateOnClo
1da60 73 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  se);..extern(Win
1da70 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
1da80 4c 20 41 63 63 65 73 73 43 68 65 63 6b 42 79 54  L AccessCheckByT
1da90 79 70 65 52 65 73 75 6c 74 4c 69 73 74 41 6e 64  ypeResultListAnd
1daa0 41 75 64 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20  AuditAlarmW(..  
1dab0 4c 50 43 57 53 54 52 20 53 75 62 73 79 73 74 65  LPCWSTR Subsyste
1dac0 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44  mName,..  LPVOID
1dad0 20 48 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 4c 50   HandleId,..  LP
1dae0 43 57 53 54 52 20 4f 62 6a 65 63 74 54 79 70 65  CWSTR ObjectType
1daf0 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52  Name,..  LPCWSTR
1db00 20 4f 62 6a 65 63 74 4e 61 6d 65 2c 0d 0a 20 20   ObjectName,..  
1db10 50 53 45 43 55 52 49 54 59 5f 44 45 53 43 52 49  PSECURITY_DESCRI
1db20 50 54 4f 52 20 53 65 63 75 72 69 74 79 44 65 73  PTOR SecurityDes
1db30 63 72 69 70 74 6f 72 2c 0d 0a 20 20 50 53 49 44  criptor,..  PSID
1db40 20 50 72 69 6e 63 69 70 61 6c 53 65 6c 66 53 69   PrincipalSelfSi
1db50 64 2c 0d 0a 20 20 44 57 4f 52 44 20 44 65 73 69  d,..  DWORD Desi
1db60 72 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 41 55  redAccess,..  AU
1db70 44 49 54 5f 45 56 45 4e 54 5f 54 59 50 45 20 41  DIT_EVENT_TYPE A
1db80 75 64 69 74 54 79 70 65 2c 0d 0a 20 20 44 57 4f  uditType,..  DWO
1db90 52 44 20 46 6c 61 67 73 2c 0d 0a 20 20 50 4f 42  RD Flags,..  POB
1dba0 4a 45 43 54 5f 54 59 50 45 5f 4c 49 53 54 20 4f  JECT_TYPE_LIST O
1dbb0 62 6a 65 63 74 54 79 70 65 4c 69 73 74 2c 0d 0a  bjectTypeList,..
1dbc0 20 20 44 57 4f 52 44 20 4f 62 6a 65 63 74 54 79    DWORD ObjectTy
1dbd0 70 65 4c 69 73 74 4c 65 6e 67 74 68 2c 0d 0a 20  peListLength,.. 
1dbe0 20 50 47 45 4e 45 52 49 43 5f 4d 41 50 50 49 4e   PGENERIC_MAPPIN
1dbf0 47 20 47 65 6e 65 72 69 63 4d 61 70 70 69 6e 67  G GenericMapping
1dc00 2c 0d 0a 20 20 42 4f 4f 4c 20 4f 62 6a 65 63 74  ,..  BOOL Object
1dc10 43 72 65 61 74 69 6f 6e 2c 0d 0a 20 20 4c 50 44  Creation,..  LPD
1dc20 57 4f 52 44 20 47 72 61 6e 74 65 64 41 63 63 65  WORD GrantedAcce
1dc30 73 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 41  ss,..  LPDWORD A
1dc40 63 63 65 73 73 53 74 61 74 75 73 4c 69 73 74 2c  ccessStatusList,
1dc50 0d 0a 20 20 4c 50 42 4f 4f 4c 20 70 66 47 65 6e  ..  LPBOOL pfGen
1dc60 65 72 61 74 65 4f 6e 43 6c 6f 73 65 29 3b 0d 0a  erateOnClose);..
1dc70 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
1dc80 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
1dc90 65 6c 73 65 0d 0a 61 6c 69 61 73 20 41 63 63 65  else..alias Acce
1dca0 73 73 43 68 65 63 6b 42 79 54 79 70 65 52 65 73  ssCheckByTypeRes
1dcb0 75 6c 74 4c 69 73 74 41 6e 64 41 75 64 69 74 41  ultListAndAuditA
1dcc0 6c 61 72 6d 41 20 41 63 63 65 73 73 43 68 65 63  larmA AccessChec
1dcd0 6b 42 79 54 79 70 65 52 65 73 75 6c 74 4c 69 73  kByTypeResultLis
1dce0 74 41 6e 64 41 75 64 69 74 41 6c 61 72 6d 3b 0d  tAndAuditAlarm;.
1dcf0 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
1dd00 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
1dd10 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1dd20 20 42 4f 4f 4c 20 41 63 63 65 73 73 43 68 65 63   BOOL AccessChec
1dd30 6b 42 79 54 79 70 65 52 65 73 75 6c 74 4c 69 73  kByTypeResultLis
1dd40 74 41 6e 64 41 75 64 69 74 41 6c 61 72 6d 42 79  tAndAuditAlarmBy
1dd50 48 61 6e 64 6c 65 41 28 0d 0a 20 20 4c 50 43 53  HandleA(..  LPCS
1dd60 54 52 20 53 75 62 73 79 73 74 65 6d 4e 61 6d 65  TR SubsystemName
1dd70 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 48 61 6e 64  ,..  LPVOID Hand
1dd80 6c 65 49 64 2c 0d 0a 20 20 48 41 4e 44 4c 45 20  leId,..  HANDLE 
1dd90 43 6c 69 65 6e 74 54 6f 6b 65 6e 2c 0d 0a 20 20  ClientToken,..  
1dda0 4c 50 43 53 54 52 20 4f 62 6a 65 63 74 54 79 70  LPCSTR ObjectTyp
1ddb0 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52  eName,..  LPCSTR
1ddc0 20 4f 62 6a 65 63 74 4e 61 6d 65 2c 0d 0a 20 20   ObjectName,..  
1ddd0 50 53 45 43 55 52 49 54 59 5f 44 45 53 43 52 49  PSECURITY_DESCRI
1dde0 50 54 4f 52 20 53 65 63 75 72 69 74 79 44 65 73  PTOR SecurityDes
1ddf0 63 72 69 70 74 6f 72 2c 0d 0a 20 20 50 53 49 44  criptor,..  PSID
1de00 20 50 72 69 6e 63 69 70 61 6c 53 65 6c 66 53 69   PrincipalSelfSi
1de10 64 2c 0d 0a 20 20 44 57 4f 52 44 20 44 65 73 69  d,..  DWORD Desi
1de20 72 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 41 55  redAccess,..  AU
1de30 44 49 54 5f 45 56 45 4e 54 5f 54 59 50 45 20 41  DIT_EVENT_TYPE A
1de40 75 64 69 74 54 79 70 65 2c 0d 0a 20 20 44 57 4f  uditType,..  DWO
1de50 52 44 20 46 6c 61 67 73 2c 0d 0a 20 20 50 4f 42  RD Flags,..  POB
1de60 4a 45 43 54 5f 54 59 50 45 5f 4c 49 53 54 20 4f  JECT_TYPE_LIST O
1de70 62 6a 65 63 74 54 79 70 65 4c 69 73 74 2c 0d 0a  bjectTypeList,..
1de80 20 20 44 57 4f 52 44 20 4f 62 6a 65 63 74 54 79    DWORD ObjectTy
1de90 70 65 4c 69 73 74 4c 65 6e 67 74 68 2c 0d 0a 20  peListLength,.. 
1dea0 20 50 47 45 4e 45 52 49 43 5f 4d 41 50 50 49 4e   PGENERIC_MAPPIN
1deb0 47 20 47 65 6e 65 72 69 63 4d 61 70 70 69 6e 67  G GenericMapping
1dec0 2c 0d 0a 20 20 42 4f 4f 4c 20 4f 62 6a 65 63 74  ,..  BOOL Object
1ded0 43 72 65 61 74 69 6f 6e 2c 0d 0a 20 20 4c 50 44  Creation,..  LPD
1dee0 57 4f 52 44 20 47 72 61 6e 74 65 64 41 63 63 65  WORD GrantedAcce
1def0 73 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 41  ss,..  LPDWORD A
1df00 63 63 65 73 73 53 74 61 74 75 73 4c 69 73 74 2c  ccessStatusList,
1df10 0d 0a 20 20 4c 50 42 4f 4f 4c 20 70 66 47 65 6e  ..  LPBOOL pfGen
1df20 65 72 61 74 65 4f 6e 43 6c 6f 73 65 29 3b 0d 0a  erateOnClose);..
1df30 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1df40 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 63 63 65  export BOOL Acce
1df50 73 73 43 68 65 63 6b 42 79 54 79 70 65 52 65 73  ssCheckByTypeRes
1df60 75 6c 74 4c 69 73 74 41 6e 64 41 75 64 69 74 41  ultListAndAuditA
1df70 6c 61 72 6d 42 79 48 61 6e 64 6c 65 57 28 0d 0a  larmByHandleW(..
1df80 20 20 4c 50 43 57 53 54 52 20 53 75 62 73 79 73    LPCWSTR Subsys
1df90 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f  temName,..  LPVO
1dfa0 49 44 20 48 61 6e 64 6c 65 49 64 2c 0d 0a 20 20  ID HandleId,..  
1dfb0 48 41 4e 44 4c 45 20 43 6c 69 65 6e 74 54 6f 6b  HANDLE ClientTok
1dfc0 65 6e 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 4f  en,..  LPCWSTR O
1dfd0 62 6a 65 63 74 54 79 70 65 4e 61 6d 65 2c 0d 0a  bjectTypeName,..
1dfe0 20 20 4c 50 43 57 53 54 52 20 4f 62 6a 65 63 74    LPCWSTR Object
1dff0 4e 61 6d 65 2c 0d 0a 20 20 50 53 45 43 55 52 49  Name,..  PSECURI
1e000 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20 53 65  TY_DESCRIPTOR Se
1e010 63 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72  curityDescriptor
1e020 2c 0d 0a 20 20 50 53 49 44 20 50 72 69 6e 63 69  ,..  PSID Princi
1e030 70 61 6c 53 65 6c 66 53 69 64 2c 0d 0a 20 20 44  palSelfSid,..  D
1e040 57 4f 52 44 20 44 65 73 69 72 65 64 41 63 63 65  WORD DesiredAcce
1e050 73 73 2c 0d 0a 20 20 41 55 44 49 54 5f 45 56 45  ss,..  AUDIT_EVE
1e060 4e 54 5f 54 59 50 45 20 41 75 64 69 74 54 79 70  NT_TYPE AuditTyp
1e070 65 2c 0d 0a 20 20 44 57 4f 52 44 20 46 6c 61 67  e,..  DWORD Flag
1e080 73 2c 0d 0a 20 20 50 4f 42 4a 45 43 54 5f 54 59  s,..  POBJECT_TY
1e090 50 45 5f 4c 49 53 54 20 4f 62 6a 65 63 74 54 79  PE_LIST ObjectTy
1e0a0 70 65 4c 69 73 74 2c 0d 0a 20 20 44 57 4f 52 44  peList,..  DWORD
1e0b0 20 4f 62 6a 65 63 74 54 79 70 65 4c 69 73 74 4c   ObjectTypeListL
1e0c0 65 6e 67 74 68 2c 0d 0a 20 20 50 47 45 4e 45 52  ength,..  PGENER
1e0d0 49 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e 65 72  IC_MAPPING Gener
1e0e0 69 63 4d 61 70 70 69 6e 67 2c 0d 0a 20 20 42 4f  icMapping,..  BO
1e0f0 4f 4c 20 4f 62 6a 65 63 74 43 72 65 61 74 69 6f  OL ObjectCreatio
1e100 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 47 72  n,..  LPDWORD Gr
1e110 61 6e 74 65 64 41 63 63 65 73 73 2c 0d 0a 20 20  antedAccess,..  
1e120 4c 50 44 57 4f 52 44 20 41 63 63 65 73 73 53 74  LPDWORD AccessSt
1e130 61 74 75 73 4c 69 73 74 2c 0d 0a 20 20 4c 50 42  atusList,..  LPB
1e140 4f 4f 4c 20 70 66 47 65 6e 65 72 61 74 65 4f 6e  OOL pfGenerateOn
1e150 43 6c 6f 73 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  Close);..// #ifd
1e160 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
1e170 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
1e180 6c 69 61 73 20 41 63 63 65 73 73 43 68 65 63 6b  lias AccessCheck
1e190 42 79 54 79 70 65 52 65 73 75 6c 74 4c 69 73 74  ByTypeResultList
1e1a0 41 6e 64 41 75 64 69 74 41 6c 61 72 6d 42 79 48  AndAuditAlarmByH
1e1b0 61 6e 64 6c 65 41 20 41 63 63 65 73 73 43 68 65  andleA AccessChe
1e1c0 63 6b 42 79 54 79 70 65 52 65 73 75 6c 74 4c 69  ckByTypeResultLi
1e1d0 73 74 41 6e 64 41 75 64 69 74 41 6c 61 72 6d 42  stAndAuditAlarmB
1e1e0 79 48 61 6e 64 6c 65 3b 0d 0a 2f 2f 20 23 65 6e  yHandle;..// #en
1e1f0 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
1e200 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 28  ...// #endif //(
1e210 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20  _WIN32_WINNT >= 
1e220 30 78 30 35 30 30 29 0d 0a 0d 0a 65 78 74 65 72  0x0500)....exter
1e230 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1e240 74 20 42 4f 4f 4c 20 4f 62 6a 65 63 74 4f 70 65  t BOOL ObjectOpe
1e250 6e 41 75 64 69 74 41 6c 61 72 6d 41 28 0d 0a 20  nAuditAlarmA(.. 
1e260 20 4c 50 43 53 54 52 20 53 75 62 73 79 73 74 65   LPCSTR Subsyste
1e270 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44  mName,..  LPVOID
1e280 20 48 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 4c 50   HandleId,..  LP
1e290 53 54 52 20 4f 62 6a 65 63 74 54 79 70 65 4e 61  STR ObjectTypeNa
1e2a0 6d 65 2c 0d 0a 20 20 4c 50 53 54 52 20 4f 62 6a  me,..  LPSTR Obj
1e2b0 65 63 74 4e 61 6d 65 2c 0d 0a 20 20 50 53 45 43  ectName,..  PSEC
1e2c0 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52  URITY_DESCRIPTOR
1e2d0 20 70 53 65 63 75 72 69 74 79 44 65 73 63 72 69   pSecurityDescri
1e2e0 70 74 6f 72 2c 0d 0a 20 20 48 41 4e 44 4c 45 20  ptor,..  HANDLE 
1e2f0 43 6c 69 65 6e 74 54 6f 6b 65 6e 2c 0d 0a 20 20  ClientToken,..  
1e300 44 57 4f 52 44 20 44 65 73 69 72 65 64 41 63 63  DWORD DesiredAcc
1e310 65 73 73 2c 0d 0a 20 20 44 57 4f 52 44 20 47 72  ess,..  DWORD Gr
1e320 61 6e 74 65 64 41 63 63 65 73 73 2c 0d 0a 20 20  antedAccess,..  
1e330 50 50 52 49 56 49 4c 45 47 45 5f 53 45 54 20 50  PPRIVILEGE_SET P
1e340 72 69 76 69 6c 65 67 65 73 2c 0d 0a 20 20 42 4f  rivileges,..  BO
1e350 4f 4c 20 4f 62 6a 65 63 74 43 72 65 61 74 69 6f  OL ObjectCreatio
1e360 6e 2c 0d 0a 20 20 42 4f 4f 4c 20 41 63 63 65 73  n,..  BOOL Acces
1e370 73 47 72 61 6e 74 65 64 2c 0d 0a 20 20 4c 50 42  sGranted,..  LPB
1e380 4f 4f 4c 20 47 65 6e 65 72 61 74 65 4f 6e 43 6c  OOL GenerateOnCl
1e390 6f 73 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ose);..extern(Wi
1e3a0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1e3b0 4f 4c 20 4f 62 6a 65 63 74 4f 70 65 6e 41 75 64  OL ObjectOpenAud
1e3c0 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20 4c 50 43  itAlarmW(..  LPC
1e3d0 57 53 54 52 20 53 75 62 73 79 73 74 65 6d 4e 61  WSTR SubsystemNa
1e3e0 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 48 61  me,..  LPVOID Ha
1e3f0 6e 64 6c 65 49 64 2c 0d 0a 20 20 4c 50 57 53 54  ndleId,..  LPWST
1e400 52 20 4f 62 6a 65 63 74 54 79 70 65 4e 61 6d 65  R ObjectTypeName
1e410 2c 0d 0a 20 20 4c 50 57 53 54 52 20 4f 62 6a 65  ,..  LPWSTR Obje
1e420 63 74 4e 61 6d 65 2c 0d 0a 20 20 50 53 45 43 55  ctName,..  PSECU
1e430 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20  RITY_DESCRIPTOR 
1e440 70 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70  pSecurityDescrip
1e450 74 6f 72 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 43  tor,..  HANDLE C
1e460 6c 69 65 6e 74 54 6f 6b 65 6e 2c 0d 0a 20 20 44  lientToken,..  D
1e470 57 4f 52 44 20 44 65 73 69 72 65 64 41 63 63 65  WORD DesiredAcce
1e480 73 73 2c 0d 0a 20 20 44 57 4f 52 44 20 47 72 61  ss,..  DWORD Gra
1e490 6e 74 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 50  ntedAccess,..  P
1e4a0 50 52 49 56 49 4c 45 47 45 5f 53 45 54 20 50 72  PRIVILEGE_SET Pr
1e4b0 69 76 69 6c 65 67 65 73 2c 0d 0a 20 20 42 4f 4f  ivileges,..  BOO
1e4c0 4c 20 4f 62 6a 65 63 74 43 72 65 61 74 69 6f 6e  L ObjectCreation
1e4d0 2c 0d 0a 20 20 42 4f 4f 4c 20 41 63 63 65 73 73  ,..  BOOL Access
1e4e0 47 72 61 6e 74 65 64 2c 0d 0a 20 20 4c 50 42 4f  Granted,..  LPBO
1e4f0 4f 4c 20 47 65 6e 65 72 61 74 65 4f 6e 43 6c 6f  OL GenerateOnClo
1e500 73 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  se);..// #ifdef 
1e510 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
1e520 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
1e530 73 20 4f 62 6a 65 63 74 4f 70 65 6e 41 75 64 69  s ObjectOpenAudi
1e540 74 41 6c 61 72 6d 41 20 4f 62 6a 65 63 74 4f 70  tAlarmA ObjectOp
1e550 65 6e 41 75 64 69 74 41 6c 61 72 6d 3b 0d 0a 2f  enAuditAlarm;../
1e560 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
1e570 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
1e580 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1e590 4f 4f 4c 20 4f 62 6a 65 63 74 50 72 69 76 69 6c  OOL ObjectPrivil
1e5a0 65 67 65 41 75 64 69 74 41 6c 61 72 6d 41 28 0d  egeAuditAlarmA(.
1e5b0 0a 20 20 4c 50 43 53 54 52 20 53 75 62 73 79 73  .  LPCSTR Subsys
1e5c0 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f  temName,..  LPVO
1e5d0 49 44 20 48 61 6e 64 6c 65 49 64 2c 0d 0a 20 20  ID HandleId,..  
1e5e0 48 41 4e 44 4c 45 20 43 6c 69 65 6e 74 54 6f 6b  HANDLE ClientTok
1e5f0 65 6e 2c 0d 0a 20 20 44 57 4f 52 44 20 44 65 73  en,..  DWORD Des
1e600 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20 20 50  iredAccess,..  P
1e610 50 52 49 56 49 4c 45 47 45 5f 53 45 54 20 50 72  PRIVILEGE_SET Pr
1e620 69 76 69 6c 65 67 65 73 2c 0d 0a 20 20 42 4f 4f  ivileges,..  BOO
1e630 4c 20 41 63 63 65 73 73 47 72 61 6e 74 65 64 29  L AccessGranted)
1e640 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
1e650 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4f  s) export BOOL O
1e660 62 6a 65 63 74 50 72 69 76 69 6c 65 67 65 41 75  bjectPrivilegeAu
1e670 64 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20 4c 50  ditAlarmW(..  LP
1e680 43 57 53 54 52 20 53 75 62 73 79 73 74 65 6d 4e  CWSTR SubsystemN
1e690 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 48  ame,..  LPVOID H
1e6a0 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 48 41 4e 44  andleId,..  HAND
1e6b0 4c 45 20 43 6c 69 65 6e 74 54 6f 6b 65 6e 2c 0d  LE ClientToken,.
1e6c0 0a 20 20 44 57 4f 52 44 20 44 65 73 69 72 65 64  .  DWORD Desired
1e6d0 41 63 63 65 73 73 2c 0d 0a 20 20 50 50 52 49 56  Access,..  PPRIV
1e6e0 49 4c 45 47 45 5f 53 45 54 20 50 72 69 76 69 6c  ILEGE_SET Privil
1e6f0 65 67 65 73 2c 0d 0a 20 20 42 4f 4f 4c 20 41 63  eges,..  BOOL Ac
1e700 63 65 73 73 47 72 61 6e 74 65 64 29 3b 0d 0a 2f  cessGranted);../
1e710 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
1e720 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
1e730 6c 73 65 0d 0a 61 6c 69 61 73 20 4f 62 6a 65 63  lse..alias Objec
1e740 74 50 72 69 76 69 6c 65 67 65 41 75 64 69 74 41  tPrivilegeAuditA
1e750 6c 61 72 6d 41 20 4f 62 6a 65 63 74 50 72 69 76  larmA ObjectPriv
1e760 69 6c 65 67 65 41 75 64 69 74 41 6c 61 72 6d 3b  ilegeAuditAlarm;
1e770 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
1e780 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
1e790 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1e7a0 74 20 42 4f 4f 4c 20 4f 62 6a 65 63 74 43 6c 6f  t BOOL ObjectClo
1e7b0 73 65 41 75 64 69 74 41 6c 61 72 6d 41 28 0d 0a  seAuditAlarmA(..
1e7c0 20 20 4c 50 43 53 54 52 20 53 75 62 73 79 73 74    LPCSTR Subsyst
1e7d0 65 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49  emName,..  LPVOI
1e7e0 44 20 48 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 42  D HandleId,..  B
1e7f0 4f 4f 4c 20 47 65 6e 65 72 61 74 65 4f 6e 43 6c  OOL GenerateOnCl
1e800 6f 73 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ose);..extern(Wi
1e810 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1e820 4f 4c 20 4f 62 6a 65 63 74 43 6c 6f 73 65 41 75  OL ObjectCloseAu
1e830 64 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20 4c 50  ditAlarmW(..  LP
1e840 43 57 53 54 52 20 53 75 62 73 79 73 74 65 6d 4e  CWSTR SubsystemN
1e850 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 48  ame,..  LPVOID H
1e860 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 42 4f 4f 4c  andleId,..  BOOL
1e870 20 47 65 6e 65 72 61 74 65 4f 6e 43 6c 6f 73 65   GenerateOnClose
1e880 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
1e890 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
1e8a0 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
1e8b0 4f 62 6a 65 63 74 43 6c 6f 73 65 41 75 64 69 74  ObjectCloseAudit
1e8c0 41 6c 61 72 6d 41 20 4f 62 6a 65 63 74 43 6c 6f  AlarmA ObjectClo
1e8d0 73 65 41 75 64 69 74 41 6c 61 72 6d 3b 0d 0a 2f  seAuditAlarm;../
1e8e0 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
1e8f0 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
1e900 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
1e910 4f 4f 4c 20 4f 62 6a 65 63 74 44 65 6c 65 74 65  OOL ObjectDelete
1e920 41 75 64 69 74 41 6c 61 72 6d 41 28 0d 0a 20 20  AuditAlarmA(..  
1e930 4c 50 43 53 54 52 20 53 75 62 73 79 73 74 65 6d  LPCSTR Subsystem
1e940 4e 61 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20  Name,..  LPVOID 
1e950 48 61 6e 64 6c 65 49 64 2c 0d 0a 20 20 42 4f 4f  HandleId,..  BOO
1e960 4c 20 47 65 6e 65 72 61 74 65 4f 6e 43 6c 6f 73  L GenerateOnClos
1e970 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  e);..extern(Wind
1e980 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1e990 20 4f 62 6a 65 63 74 44 65 6c 65 74 65 41 75 64   ObjectDeleteAud
1e9a0 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20 4c 50 43  itAlarmW(..  LPC
1e9b0 57 53 54 52 20 53 75 62 73 79 73 74 65 6d 4e 61  WSTR SubsystemNa
1e9c0 6d 65 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 48 61  me,..  LPVOID Ha
1e9d0 6e 64 6c 65 49 64 2c 0d 0a 20 20 42 4f 4f 4c 20  ndleId,..  BOOL 
1e9e0 47 65 6e 65 72 61 74 65 4f 6e 43 6c 6f 73 65 29  GenerateOnClose)
1e9f0 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
1ea00 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
1ea10 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 4f  / #else..alias O
1ea20 62 6a 65 63 74 44 65 6c 65 74 65 41 75 64 69 74  bjectDeleteAudit
1ea30 41 6c 61 72 6d 41 20 4f 62 6a 65 63 74 44 65 6c  AlarmA ObjectDel
1ea40 65 74 65 41 75 64 69 74 41 6c 61 72 6d 3b 0d 0a  eteAuditAlarm;..
1ea50 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
1ea60 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
1ea70 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1ea80 42 4f 4f 4c 20 50 72 69 76 69 6c 65 67 65 64 53  BOOL PrivilegedS
1ea90 65 72 76 69 63 65 41 75 64 69 74 41 6c 61 72 6d  erviceAuditAlarm
1eaa0 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 53 75 62  A(..  LPCSTR Sub
1eab0 73 79 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 4c  systemName,..  L
1eac0 50 43 53 54 52 20 53 65 72 76 69 63 65 4e 61 6d  PCSTR ServiceNam
1ead0 65 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 43 6c 69  e,..  HANDLE Cli
1eae0 65 6e 74 54 6f 6b 65 6e 2c 0d 0a 20 20 50 50 52  entToken,..  PPR
1eaf0 49 56 49 4c 45 47 45 5f 53 45 54 20 50 72 69 76  IVILEGE_SET Priv
1eb00 69 6c 65 67 65 73 2c 0d 0a 20 20 42 4f 4f 4c 20  ileges,..  BOOL 
1eb10 41 63 63 65 73 73 47 72 61 6e 74 65 64 29 3b 0d  AccessGranted);.
1eb20 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1eb30 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 50 72 69   export BOOL Pri
1eb40 76 69 6c 65 67 65 64 53 65 72 76 69 63 65 41 75  vilegedServiceAu
1eb50 64 69 74 41 6c 61 72 6d 57 28 0d 0a 20 20 4c 50  ditAlarmW(..  LP
1eb60 43 57 53 54 52 20 53 75 62 73 79 73 74 65 6d 4e  CWSTR SubsystemN
1eb70 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20  ame,..  LPCWSTR 
1eb80 53 65 72 76 69 63 65 4e 61 6d 65 2c 0d 0a 20 20  ServiceName,..  
1eb90 48 41 4e 44 4c 45 20 43 6c 69 65 6e 74 54 6f 6b  HANDLE ClientTok
1eba0 65 6e 2c 0d 0a 20 20 50 50 52 49 56 49 4c 45 47  en,..  PPRIVILEG
1ebb0 45 5f 53 45 54 20 50 72 69 76 69 6c 65 67 65 73  E_SET Privileges
1ebc0 2c 0d 0a 20 20 42 4f 4f 4c 20 41 63 63 65 73 73  ,..  BOOL Access
1ebd0 47 72 61 6e 74 65 64 29 3b 0d 0a 2f 2f 20 23 69  Granted);..// #i
1ebe0 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
1ebf0 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
1ec00 0a 61 6c 69 61 73 20 50 72 69 76 69 6c 65 67 65  .alias Privilege
1ec10 64 53 65 72 76 69 63 65 41 75 64 69 74 41 6c 61  dServiceAuditAla
1ec20 72 6d 41 20 50 72 69 76 69 6c 65 67 65 64 53 65  rmA PrivilegedSe
1ec30 72 76 69 63 65 41 75 64 69 74 41 6c 61 72 6d 3b  rviceAuditAlarm;
1ec40 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
1ec50 55 4e 49 43 4f 44 45 0d 0a 0d 0a 2f 2f 20 23 69  UNICODE....// #i
1ec60 66 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e  f(_WIN32_WINNT >
1ec70 3d 20 30 78 30 35 30 31 29 0d 0a 0d 0a 65 6e 75  = 0x0501)....enu
1ec80 6d 20 5f 30 20 7b 0d 0a 0d 0a 20 20 57 69 6e 4e  m _0 {....  WinN
1ec90 75 6c 6c 53 69 64 20 3d 20 30 2c 0d 0a 20 20 57  ullSid = 0,..  W
1eca0 69 6e 57 6f 72 6c 64 53 69 64 20 3d 20 31 2c 0d  inWorldSid = 1,.
1ecb0 0a 20 20 57 69 6e 4c 6f 63 61 6c 53 69 64 20 3d  .  WinLocalSid =
1ecc0 20 32 2c 0d 0a 20 20 57 69 6e 43 72 65 61 74 6f   2,..  WinCreato
1ecd0 72 4f 77 6e 65 72 53 69 64 20 3d 20 33 2c 0d 0a  rOwnerSid = 3,..
1ece0 20 20 57 69 6e 43 72 65 61 74 6f 72 47 72 6f 75    WinCreatorGrou
1ecf0 70 53 69 64 20 3d 20 34 2c 0d 0a 20 20 57 69 6e  pSid = 4,..  Win
1ed00 43 72 65 61 74 6f 72 4f 77 6e 65 72 53 65 72 76  CreatorOwnerServ
1ed10 65 72 53 69 64 20 3d 20 35 2c 0d 0a 20 20 57 69  erSid = 5,..  Wi
1ed20 6e 43 72 65 61 74 6f 72 47 72 6f 75 70 53 65 72  nCreatorGroupSer
1ed30 76 65 72 53 69 64 20 3d 20 36 2c 0d 0a 20 20 57  verSid = 6,..  W
1ed40 69 6e 4e 74 41 75 74 68 6f 72 69 74 79 53 69 64  inNtAuthoritySid
1ed50 20 3d 20 37 2c 0d 0a 20 20 57 69 6e 44 69 61 6c   = 7,..  WinDial
1ed60 75 70 53 69 64 20 3d 20 38 2c 0d 0a 20 20 57 69  upSid = 8,..  Wi
1ed70 6e 4e 65 74 77 6f 72 6b 53 69 64 20 3d 20 39 2c  nNetworkSid = 9,
1ed80 0d 0a 20 20 57 69 6e 42 61 74 63 68 53 69 64 20  ..  WinBatchSid 
1ed90 3d 20 31 30 2c 0d 0a 20 20 57 69 6e 49 6e 74 65  = 10,..  WinInte
1eda0 72 61 63 74 69 76 65 53 69 64 20 3d 20 31 31 2c  ractiveSid = 11,
1edb0 0d 0a 20 20 57 69 6e 53 65 72 76 69 63 65 53 69  ..  WinServiceSi
1edc0 64 20 3d 20 31 32 2c 0d 0a 20 20 57 69 6e 41 6e  d = 12,..  WinAn
1edd0 6f 6e 79 6d 6f 75 73 53 69 64 20 3d 20 31 33 2c  onymousSid = 13,
1ede0 0d 0a 20 20 57 69 6e 50 72 6f 78 79 53 69 64 20  ..  WinProxySid 
1edf0 3d 20 31 34 2c 0d 0a 20 20 57 69 6e 45 6e 74 65  = 14,..  WinEnte
1ee00 72 70 72 69 73 65 43 6f 6e 74 72 6f 6c 6c 65 72  rpriseController
1ee10 73 53 69 64 20 3d 20 31 35 2c 0d 0a 20 20 57 69  sSid = 15,..  Wi
1ee20 6e 53 65 6c 66 53 69 64 20 3d 20 31 36 2c 0d 0a  nSelfSid = 16,..
1ee30 20 20 57 69 6e 41 75 74 68 65 6e 74 69 63 61 74    WinAuthenticat
1ee40 65 64 55 73 65 72 53 69 64 20 3d 20 31 37 2c 0d  edUserSid = 17,.
1ee50 0a 20 20 57 69 6e 52 65 73 74 72 69 63 74 65 64  .  WinRestricted
1ee60 43 6f 64 65 53 69 64 20 3d 20 31 38 2c 0d 0a 20  CodeSid = 18,.. 
1ee70 20 57 69 6e 54 65 72 6d 69 6e 61 6c 53 65 72 76   WinTerminalServ
1ee80 65 72 53 69 64 20 3d 20 31 39 2c 0d 0a 20 20 57  erSid = 19,..  W
1ee90 69 6e 52 65 6d 6f 74 65 4c 6f 67 6f 6e 49 64 53  inRemoteLogonIdS
1eea0 69 64 20 3d 20 32 30 2c 0d 0a 20 20 57 69 6e 4c  id = 20,..  WinL
1eeb0 6f 67 6f 6e 49 64 73 53 69 64 20 3d 20 32 31 2c  ogonIdsSid = 21,
1eec0 0d 0a 20 20 57 69 6e 4c 6f 63 61 6c 53 79 73 74  ..  WinLocalSyst
1eed0 65 6d 53 69 64 20 3d 20 32 32 2c 0d 0a 20 20 57  emSid = 22,..  W
1eee0 69 6e 4c 6f 63 61 6c 53 65 72 76 69 63 65 53 69  inLocalServiceSi
1eef0 64 20 3d 20 32 33 2c 0d 0a 20 20 57 69 6e 4e 65  d = 23,..  WinNe
1ef00 74 77 6f 72 6b 53 65 72 76 69 63 65 53 69 64 20  tworkServiceSid 
1ef10 3d 20 32 34 2c 0d 0a 20 20 57 69 6e 42 75 69 6c  = 24,..  WinBuil
1ef20 74 69 6e 44 6f 6d 61 69 6e 53 69 64 20 3d 20 32  tinDomainSid = 2
1ef30 35 2c 0d 0a 20 20 57 69 6e 42 75 69 6c 74 69 6e  5,..  WinBuiltin
1ef40 41 64 6d 69 6e 69 73 74 72 61 74 6f 72 73 53 69  AdministratorsSi
1ef50 64 20 3d 20 32 36 2c 0d 0a 20 20 57 69 6e 42 75  d = 26,..  WinBu
1ef60 69 6c 74 69 6e 55 73 65 72 73 53 69 64 20 3d 20  iltinUsersSid = 
1ef70 32 37 2c 0d 0a 20 20 57 69 6e 42 75 69 6c 74 69  27,..  WinBuilti
1ef80 6e 47 75 65 73 74 73 53 69 64 20 3d 20 32 38 2c  nGuestsSid = 28,
1ef90 0d 0a 20 20 57 69 6e 42 75 69 6c 74 69 6e 50 6f  ..  WinBuiltinPo
1efa0 77 65 72 55 73 65 72 73 53 69 64 20 3d 20 32 39  werUsersSid = 29
1efb0 2c 0d 0a 20 20 57 69 6e 42 75 69 6c 74 69 6e 41  ,..  WinBuiltinA
1efc0 63 63 6f 75 6e 74 4f 70 65 72 61 74 6f 72 73 53  ccountOperatorsS
1efd0 69 64 20 3d 20 33 30 2c 0d 0a 20 20 57 69 6e 42  id = 30,..  WinB
1efe0 75 69 6c 74 69 6e 53 79 73 74 65 6d 4f 70 65 72  uiltinSystemOper
1eff0 61 74 6f 72 73 53 69 64 20 3d 20 33 31 2c 0d 0a  atorsSid = 31,..
1f000 20 20 57 69 6e 42 75 69 6c 74 69 6e 50 72 69 6e    WinBuiltinPrin
1f010 74 4f 70 65 72 61 74 6f 72 73 53 69 64 20 3d 20  tOperatorsSid = 
1f020 33 32 2c 0d 0a 20 20 57 69 6e 42 75 69 6c 74 69  32,..  WinBuilti
1f030 6e 42 61 63 6b 75 70 4f 70 65 72 61 74 6f 72 73  nBackupOperators
1f040 53 69 64 20 3d 20 33 33 2c 0d 0a 20 20 57 69 6e  Sid = 33,..  Win
1f050 42 75 69 6c 74 69 6e 52 65 70 6c 69 63 61 74 6f  BuiltinReplicato
1f060 72 53 69 64 20 3d 20 33 34 2c 0d 0a 20 20 57 69  rSid = 34,..  Wi
1f070 6e 42 75 69 6c 74 69 6e 50 72 65 57 69 6e 64 6f  nBuiltinPreWindo
1f080 77 73 32 30 30 30 43 6f 6d 70 61 74 69 62 6c 65  ws2000Compatible
1f090 41 63 63 65 73 73 53 69 64 20 3d 20 33 35 2c 0d  AccessSid = 35,.
1f0a0 0a 20 20 57 69 6e 42 75 69 6c 74 69 6e 52 65 6d  .  WinBuiltinRem
1f0b0 6f 74 65 44 65 73 6b 74 6f 70 55 73 65 72 73 53  oteDesktopUsersS
1f0c0 69 64 20 3d 20 33 36 2c 0d 0a 20 20 57 69 6e 42  id = 36,..  WinB
1f0d0 75 69 6c 74 69 6e 4e 65 74 77 6f 72 6b 43 6f 6e  uiltinNetworkCon
1f0e0 66 69 67 75 72 61 74 69 6f 6e 4f 70 65 72 61 74  figurationOperat
1f0f0 6f 72 73 53 69 64 20 3d 20 33 37 2c 0d 0a 20 20  orsSid = 37,..  
1f100 57 69 6e 41 63 63 6f 75 6e 74 41 64 6d 69 6e 69  WinAccountAdmini
1f110 73 74 72 61 74 6f 72 53 69 64 20 3d 20 33 38 2c  stratorSid = 38,
1f120 0d 0a 20 20 57 69 6e 41 63 63 6f 75 6e 74 47 75  ..  WinAccountGu
1f130 65 73 74 53 69 64 20 3d 20 33 39 2c 0d 0a 20 20  estSid = 39,..  
1f140 57 69 6e 41 63 63 6f 75 6e 74 4b 72 62 74 67 74  WinAccountKrbtgt
1f150 53 69 64 20 3d 20 34 30 2c 0d 0a 20 20 57 69 6e  Sid = 40,..  Win
1f160 41 63 63 6f 75 6e 74 44 6f 6d 61 69 6e 41 64 6d  AccountDomainAdm
1f170 69 6e 73 53 69 64 20 3d 20 34 31 2c 0d 0a 20 20  insSid = 41,..  
1f180 57 69 6e 41 63 63 6f 75 6e 74 44 6f 6d 61 69 6e  WinAccountDomain
1f190 55 73 65 72 73 53 69 64 20 3d 20 34 32 2c 0d 0a  UsersSid = 42,..
1f1a0 20 20 57 69 6e 41 63 63 6f 75 6e 74 44 6f 6d 61    WinAccountDoma
1f1b0 69 6e 47 75 65 73 74 73 53 69 64 20 3d 20 34 33  inGuestsSid = 43
1f1c0 2c 0d 0a 20 20 57 69 6e 41 63 63 6f 75 6e 74 43  ,..  WinAccountC
1f1d0 6f 6d 70 75 74 65 72 73 53 69 64 20 3d 20 34 34  omputersSid = 44
1f1e0 2c 0d 0a 20 20 57 69 6e 41 63 63 6f 75 6e 74 43  ,..  WinAccountC
1f1f0 6f 6e 74 72 6f 6c 6c 65 72 73 53 69 64 20 3d 20  ontrollersSid = 
1f200 34 35 2c 0d 0a 20 20 57 69 6e 41 63 63 6f 75 6e  45,..  WinAccoun
1f210 74 43 65 72 74 41 64 6d 69 6e 73 53 69 64 20 3d  tCertAdminsSid =
1f220 20 34 36 2c 0d 0a 20 20 57 69 6e 41 63 63 6f 75   46,..  WinAccou
1f230 6e 74 53 63 68 65 6d 61 41 64 6d 69 6e 73 53 69  ntSchemaAdminsSi
1f240 64 20 3d 20 34 37 2c 0d 0a 20 20 57 69 6e 41 63  d = 47,..  WinAc
1f250 63 6f 75 6e 74 45 6e 74 65 72 70 72 69 73 65 41  countEnterpriseA
1f260 64 6d 69 6e 73 53 69 64 20 3d 20 34 38 2c 0d 0a  dminsSid = 48,..
1f270 20 20 57 69 6e 41 63 63 6f 75 6e 74 50 6f 6c 69    WinAccountPoli
1f280 63 79 41 64 6d 69 6e 73 53 69 64 20 3d 20 34 39  cyAdminsSid = 49
1f290 2c 0d 0a 20 20 57 69 6e 41 63 63 6f 75 6e 74 52  ,..  WinAccountR
1f2a0 61 73 41 6e 64 49 61 73 53 65 72 76 65 72 73 53  asAndIasServersS
1f2b0 69 64 20 3d 20 35 30 2c 0d 0a 0d 0a 7d 0d 0a 61  id = 50,....}..a
1f2c0 6c 69 61 73 20 5f 30 20 57 45 4c 4c 5f 4b 4e 4f  lias _0 WELL_KNO
1f2d0 57 4e 5f 53 49 44 5f 54 59 50 45 3b 0d 0a 0d 0a  WN_SID_TYPE;....
1f2e0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1f2f0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 49 73 57 65  export BOOL IsWe
1f300 6c 6c 4b 6e 6f 77 6e 53 69 64 28 0d 0a 20 20 50  llKnownSid(..  P
1f310 53 49 44 20 70 53 69 64 2c 0d 0a 20 20 57 45 4c  SID pSid,..  WEL
1f320 4c 5f 4b 4e 4f 57 4e 5f 53 49 44 5f 54 59 50 45  L_KNOWN_SID_TYPE
1f330 20 57 65 6c 6c 4b 6e 6f 77 6e 53 69 64 54 79 70   WellKnownSidTyp
1f340 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
1f350 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1f360 4f 4c 20 43 72 65 61 74 65 57 65 6c 6c 4b 6e 6f  OL CreateWellKno
1f370 77 6e 53 69 64 28 0d 0a 20 20 57 45 4c 4c 5f 4b  wnSid(..  WELL_K
1f380 4e 4f 57 4e 5f 53 49 44 5f 54 59 50 45 20 57 65  NOWN_SID_TYPE We
1f390 6c 6c 4b 6e 6f 77 6e 53 69 64 54 79 70 65 2c 0d  llKnownSidType,.
1f3a0 0a 20 20 50 53 49 44 20 44 6f 6d 61 69 6e 53 69  .  PSID DomainSi
1f3b0 64 20 2c 0d 0a 20 20 50 53 49 44 20 70 53 69 64  d ,..  PSID pSid
1f3c0 2c 0d 0a 20 20 44 57 4f 52 44 20 2a 63 62 53 69  ,..  DWORD *cbSi
1f3d0 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  d);....extern(Wi
1f3e0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1f3f0 4f 4c 20 45 71 75 61 6c 44 6f 6d 61 69 6e 53 69  OL EqualDomainSi
1f400 64 28 0d 0a 20 20 50 53 49 44 20 70 53 69 64 31  d(..  PSID pSid1
1f410 2c 0d 0a 20 20 50 53 49 44 20 70 53 69 64 32 2c  ,..  PSID pSid2,
1f420 0d 0a 20 20 42 4f 4f 4c 20 2a 70 66 45 71 75 61  ..  BOOL *pfEqua
1f430 6c 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  l);....extern(Wi
1f440 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1f450 4f 4c 20 47 65 74 57 69 6e 64 6f 77 73 41 63 63  OL GetWindowsAcc
1f460 6f 75 6e 74 44 6f 6d 61 69 6e 53 69 64 28 0d 0a  ountDomainSid(..
1f470 20 20 50 53 49 44 20 70 53 69 64 2c 0d 0a 20 20    PSID pSid,..  
1f480 50 53 49 44 20 70 70 44 6f 6d 61 69 6e 53 69 64  PSID ppDomainSid
1f490 20 2c 0d 0a 20 20 44 57 4f 52 44 20 2a 63 62 53   ,..  DWORD *cbS
1f4a0 69 64 29 3b 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69  id);....// #endi
1f4b0 66 20 2f 2f 28 5f 57 49 4e 33 32 5f 57 49 4e 4e  f //(_WIN32_WINN
1f4c0 54 20 3e 3d 20 30 78 30 35 30 31 29 0d 0a 0d 0a  T >= 0x0501)....
1f4d0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1f4e0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 49 73 56 61  export BOOL IsVa
1f4f0 6c 69 64 53 69 64 28 0d 0a 20 20 50 53 49 44 20  lidSid(..  PSID 
1f500 70 53 69 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  pSid);....extern
1f510 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1f520 20 42 4f 4f 4c 20 45 71 75 61 6c 53 69 64 28 0d   BOOL EqualSid(.
1f530 0a 20 20 50 53 49 44 20 70 53 69 64 31 2c 0d 0a  .  PSID pSid1,..
1f540 20 20 50 53 49 44 20 70 53 69 64 32 29 3b 0d 0a    PSID pSid2);..
1f550 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
1f560 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 45 71  ) export BOOL Eq
1f570 75 61 6c 50 72 65 66 69 78 53 69 64 28 0d 0a 20  ualPrefixSid(.. 
1f580 20 50 53 49 44 20 70 53 69 64 31 2c 0d 0a 20 20   PSID pSid1,..  
1f590 50 53 49 44 20 70 53 69 64 32 29 3b 0d 0a 0d 0a  PSID pSid2);....
1f5a0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1f5b0 65 78 70 6f 72 74 20 44 57 4f 52 44 20 47 65 74  export DWORD Get
1f5c0 53 69 64 4c 65 6e 67 74 68 52 65 71 75 69 72 65  SidLengthRequire
1f5d0 64 28 0d 0a 20 20 55 43 48 41 52 20 6e 53 75 62  d(..  UCHAR nSub
1f5e0 41 75 74 68 6f 72 69 74 79 43 6f 75 6e 74 29 3b  AuthorityCount);
1f5f0 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
1f600 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
1f610 41 6c 6c 6f 63 61 74 65 41 6e 64 49 6e 69 74 69  AllocateAndIniti
1f620 61 6c 69 7a 65 53 69 64 28 0d 0a 20 20 50 53 49  alizeSid(..  PSI
1f630 44 5f 49 44 45 4e 54 49 46 49 45 52 5f 41 55 54  D_IDENTIFIER_AUT
1f640 48 4f 52 49 54 59 20 70 49 64 65 6e 74 69 66 69  HORITY pIdentifi
1f650 65 72 41 75 74 68 6f 72 69 74 79 2c 0d 0a 20 20  erAuthority,..  
1f660 42 59 54 45 20 6e 53 75 62 41 75 74 68 6f 72 69  BYTE nSubAuthori
1f670 74 79 43 6f 75 6e 74 2c 0d 0a 20 20 44 57 4f 52  tyCount,..  DWOR
1f680 44 20 6e 53 75 62 41 75 74 68 6f 72 69 74 79 30  D nSubAuthority0
1f690 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 53 75 62 41  ,..  DWORD nSubA
1f6a0 75 74 68 6f 72 69 74 79 31 2c 0d 0a 20 20 44 57  uthority1,..  DW
1f6b0 4f 52 44 20 6e 53 75 62 41 75 74 68 6f 72 69 74  ORD nSubAuthorit
1f6c0 79 32 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 53 75  y2,..  DWORD nSu
1f6d0 62 41 75 74 68 6f 72 69 74 79 33 2c 0d 0a 20 20  bAuthority3,..  
1f6e0 44 57 4f 52 44 20 6e 53 75 62 41 75 74 68 6f 72  DWORD nSubAuthor
1f6f0 69 74 79 34 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  ity4,..  DWORD n
1f700 53 75 62 41 75 74 68 6f 72 69 74 79 35 2c 0d 0a  SubAuthority5,..
1f710 20 20 44 57 4f 52 44 20 6e 53 75 62 41 75 74 68    DWORD nSubAuth
1f720 6f 72 69 74 79 36 2c 0d 0a 20 20 44 57 4f 52 44  ority6,..  DWORD
1f730 20 6e 53 75 62 41 75 74 68 6f 72 69 74 79 37 2c   nSubAuthority7,
1f740 0d 0a 20 20 50 53 49 44 20 2a 70 53 69 64 29 3b  ..  PSID *pSid);
1f750 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
1f760 77 73 29 20 65 78 70 6f 72 74 20 50 56 4f 49 44  ws) export PVOID
1f770 20 46 72 65 65 53 69 64 28 0d 0a 20 20 50 53 49   FreeSid(..  PSI
1f780 44 20 70 53 69 64 29 3b 0d 0a 0d 0a 65 78 74 65  D pSid);....exte
1f790 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
1f7a0 72 74 20 42 4f 4f 4c 20 49 6e 69 74 69 61 6c 69  rt BOOL Initiali
1f7b0 7a 65 53 69 64 28 0d 0a 20 20 50 53 49 44 20 53  zeSid(..  PSID S
1f7c0 69 64 2c 0d 0a 20 20 50 53 49 44 5f 49 44 45 4e  id,..  PSID_IDEN
1f7d0 54 49 46 49 45 52 5f 41 55 54 48 4f 52 49 54 59  TIFIER_AUTHORITY
1f7e0 20 70 49 64 65 6e 74 69 66 69 65 72 41 75 74 68   pIdentifierAuth
1f7f0 6f 72 69 74 79 2c 0d 0a 20 20 42 59 54 45 20 6e  ority,..  BYTE n
1f800 53 75 62 41 75 74 68 6f 72 69 74 79 43 6f 75 6e  SubAuthorityCoun
1f810 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  t);....extern(Wi
1f820 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 50 53  ndows) export PS
1f830 49 44 5f 49 44 45 4e 54 49 46 49 45 52 5f 41 55  ID_IDENTIFIER_AU
1f840 54 48 4f 52 49 54 59 20 47 65 74 53 69 64 49 64  THORITY GetSidId
1f850 65 6e 74 69 66 69 65 72 41 75 74 68 6f 72 69 74  entifierAuthorit
1f860 79 28 0d 0a 20 20 50 53 49 44 20 70 53 69 64 29  y(..  PSID pSid)
1f870 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
1f880 6f 77 73 29 20 65 78 70 6f 72 74 20 50 44 57 4f  ows) export PDWO
1f890 52 44 20 47 65 74 53 69 64 53 75 62 41 75 74 68  RD GetSidSubAuth
1f8a0 6f 72 69 74 79 28 0d 0a 20 20 50 53 49 44 20 70  ority(..  PSID p
1f8b0 53 69 64 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 53  Sid,..  DWORD nS
1f8c0 75 62 41 75 74 68 6f 72 69 74 79 29 3b 0d 0a 0d  ubAuthority);...
1f8d0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1f8e0 20 65 78 70 6f 72 74 20 50 55 43 48 41 52 20 47   export PUCHAR G
1f8f0 65 74 53 69 64 53 75 62 41 75 74 68 6f 72 69 74  etSidSubAuthorit
1f900 79 43 6f 75 6e 74 28 0d 0a 20 20 50 53 49 44 20  yCount(..  PSID 
1f910 70 53 69 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  pSid);....extern
1f920 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1f930 20 44 57 4f 52 44 20 47 65 74 4c 65 6e 67 74 68   DWORD GetLength
1f940 53 69 64 28 0d 0a 20 20 50 53 49 44 20 70 53 69  Sid(..  PSID pSi
1f950 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  d);....extern(Wi
1f960 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1f970 4f 4c 20 43 6f 70 79 53 69 64 28 0d 0a 20 20 44  OL CopySid(..  D
1f980 57 4f 52 44 20 6e 44 65 73 74 69 6e 61 74 69 6f  WORD nDestinatio
1f990 6e 53 69 64 4c 65 6e 67 74 68 2c 0d 0a 20 20 50  nSidLength,..  P
1f9a0 53 49 44 20 70 44 65 73 74 69 6e 61 74 69 6f 6e  SID pDestination
1f9b0 53 69 64 2c 0d 0a 20 20 50 53 49 44 20 70 53 6f  Sid,..  PSID pSo
1f9c0 75 72 63 65 53 69 64 29 3b 0d 0a 0d 0a 65 78 74  urceSid);....ext
1f9d0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1f9e0 6f 72 74 20 42 4f 4f 4c 20 41 72 65 41 6c 6c 41  ort BOOL AreAllA
1f9f0 63 63 65 73 73 65 73 47 72 61 6e 74 65 64 28 0d  ccessesGranted(.
1fa00 0a 20 20 44 57 4f 52 44 20 47 72 61 6e 74 65 64  .  DWORD Granted
1fa10 41 63 63 65 73 73 2c 0d 0a 20 20 44 57 4f 52 44  Access,..  DWORD
1fa20 20 44 65 73 69 72 65 64 41 63 63 65 73 73 29 3b   DesiredAccess);
1fa30 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
1fa40 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
1fa50 41 72 65 41 6e 79 41 63 63 65 73 73 65 73 47 72  AreAnyAccessesGr
1fa60 61 6e 74 65 64 28 0d 0a 20 20 44 57 4f 52 44 20  anted(..  DWORD 
1fa70 47 72 61 6e 74 65 64 41 63 63 65 73 73 2c 0d 0a  GrantedAccess,..
1fa80 20 20 44 57 4f 52 44 20 44 65 73 69 72 65 64 41    DWORD DesiredA
1fa90 63 63 65 73 73 29 3b 0d 0a 0d 0a 65 78 74 65 72  ccess);....exter
1faa0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1fab0 74 20 56 4f 49 44 20 4d 61 70 47 65 6e 65 72 69  t VOID MapGeneri
1fac0 63 4d 61 73 6b 28 0d 0a 20 20 50 44 57 4f 52 44  cMask(..  PDWORD
1fad0 20 41 63 63 65 73 73 4d 61 73 6b 2c 0d 0a 20 20   AccessMask,..  
1fae0 50 47 45 4e 45 52 49 43 5f 4d 41 50 50 49 4e 47  PGENERIC_MAPPING
1faf0 20 47 65 6e 65 72 69 63 4d 61 70 70 69 6e 67 29   GenericMapping)
1fb00 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
1fb10 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1fb20 20 49 73 56 61 6c 69 64 41 63 6c 28 0d 0a 20 20   IsValidAcl(..  
1fb30 50 41 43 4c 20 70 41 63 6c 29 3b 0d 0a 0d 0a 65  PACL pAcl);....e
1fb40 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
1fb50 78 70 6f 72 74 20 42 4f 4f 4c 20 49 6e 69 74 69  xport BOOL Initi
1fb60 61 6c 69 7a 65 41 63 6c 28 0d 0a 20 20 50 41 43  alizeAcl(..  PAC
1fb70 4c 20 70 41 63 6c 2c 0d 0a 20 20 44 57 4f 52 44  L pAcl,..  DWORD
1fb80 20 6e 41 63 6c 4c 65 6e 67 74 68 2c 0d 0a 20 20   nAclLength,..  
1fb90 44 57 4f 52 44 20 64 77 41 63 6c 52 65 76 69 73  DWORD dwAclRevis
1fba0 69 6f 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ion);....extern(
1fbb0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1fbc0 42 4f 4f 4c 20 47 65 74 41 63 6c 49 6e 66 6f 72  BOOL GetAclInfor
1fbd0 6d 61 74 69 6f 6e 28 0d 0a 20 20 50 41 43 4c 20  mation(..  PACL 
1fbe0 70 41 63 6c 2c 0d 0a 20 20 4c 50 56 4f 49 44 20  pAcl,..  LPVOID 
1fbf0 70 41 63 6c 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c  pAclInformation,
1fc00 0d 0a 20 20 44 57 4f 52 44 20 6e 41 63 6c 49 6e  ..  DWORD nAclIn
1fc10 66 6f 72 6d 61 74 69 6f 6e 4c 65 6e 67 74 68 2c  formationLength,
1fc20 0d 0a 20 20 41 43 4c 5f 49 4e 46 4f 52 4d 41 54  ..  ACL_INFORMAT
1fc30 49 4f 4e 5f 43 4c 41 53 53 20 64 77 41 63 6c 49  ION_CLASS dwAclI
1fc40 6e 66 6f 72 6d 61 74 69 6f 6e 43 6c 61 73 73 29  nformationClass)
1fc50 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
1fc60 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
1fc70 20 53 65 74 41 63 6c 49 6e 66 6f 72 6d 61 74 69   SetAclInformati
1fc80 6f 6e 28 0d 0a 20 20 50 41 43 4c 20 70 41 63 6c  on(..  PACL pAcl
1fc90 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 70 41 63 6c  ,..  LPVOID pAcl
1fca0 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20  Information,..  
1fcb0 44 57 4f 52 44 20 6e 41 63 6c 49 6e 66 6f 72 6d  DWORD nAclInform
1fcc0 61 74 69 6f 6e 4c 65 6e 67 74 68 2c 0d 0a 20 20  ationLength,..  
1fcd0 41 43 4c 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 5f  ACL_INFORMATION_
1fce0 43 4c 41 53 53 20 64 77 41 63 6c 49 6e 66 6f 72  CLASS dwAclInfor
1fcf0 6d 61 74 69 6f 6e 43 6c 61 73 73 29 3b 0d 0a 0d  mationClass);...
1fd00 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1fd10 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 64 64   export BOOL Add
1fd20 41 63 65 28 0d 0a 20 20 50 41 43 4c 20 70 41 63  Ace(..  PACL pAc
1fd30 6c 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 41 63  l,..  DWORD dwAc
1fd40 65 52 65 76 69 73 69 6f 6e 2c 0d 0a 20 20 44 57  eRevision,..  DW
1fd50 4f 52 44 20 64 77 53 74 61 72 74 69 6e 67 41 63  ORD dwStartingAc
1fd60 65 49 6e 64 65 78 2c 0d 0a 20 20 4c 50 56 4f 49  eIndex,..  LPVOI
1fd70 44 20 70 41 63 65 4c 69 73 74 2c 0d 0a 20 20 44  D pAceList,..  D
1fd80 57 4f 52 44 20 6e 41 63 65 4c 69 73 74 4c 65 6e  WORD nAceListLen
1fd90 67 74 68 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  gth);....extern(
1fda0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1fdb0 42 4f 4f 4c 20 44 65 6c 65 74 65 41 63 65 28 0d  BOOL DeleteAce(.
1fdc0 0a 20 20 50 41 43 4c 20 70 41 63 6c 2c 0d 0a 20  .  PACL pAcl,.. 
1fdd0 20 44 57 4f 52 44 20 64 77 41 63 65 49 6e 64 65   DWORD dwAceInde
1fde0 78 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  x);....extern(Wi
1fdf0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
1fe00 4f 4c 20 47 65 74 41 63 65 28 0d 0a 20 20 50 41  OL GetAce(..  PA
1fe10 43 4c 20 70 41 63 6c 2c 0d 0a 20 20 44 57 4f 52  CL pAcl,..  DWOR
1fe20 44 20 64 77 41 63 65 49 6e 64 65 78 2c 0d 0a 20  D dwAceIndex,.. 
1fe30 20 4c 50 56 4f 49 44 20 2a 70 41 63 65 29 3b 0d   LPVOID *pAce);.
1fe40 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
1fe50 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41  s) export BOOL A
1fe60 64 64 41 63 63 65 73 73 41 6c 6c 6f 77 65 64 41  ddAccessAllowedA
1fe70 63 65 28 0d 0a 20 20 50 41 43 4c 20 70 41 63 6c  ce(..  PACL pAcl
1fe80 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 41 63 65  ,..  DWORD dwAce
1fe90 52 65 76 69 73 69 6f 6e 2c 0d 0a 20 20 44 57 4f  Revision,..  DWO
1fea0 52 44 20 41 63 63 65 73 73 4d 61 73 6b 2c 0d 0a  RD AccessMask,..
1feb0 20 20 50 53 49 44 20 70 53 69 64 29 3b 0d 0a 0d    PSID pSid);...
1fec0 0a 2f 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57  .// #if(_WIN32_W
1fed0 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 0d  INNT >= 0x0500).
1fee0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1fef0 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 64 64   export BOOL Add
1ff00 41 63 63 65 73 73 41 6c 6c 6f 77 65 64 41 63 65  AccessAllowedAce
1ff10 45 78 28 0d 0a 20 20 50 41 43 4c 20 70 41 63 6c  Ex(..  PACL pAcl
1ff20 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 41 63 65  ,..  DWORD dwAce
1ff30 52 65 76 69 73 69 6f 6e 2c 0d 0a 20 20 44 57 4f  Revision,..  DWO
1ff40 52 44 20 41 63 65 46 6c 61 67 73 2c 0d 0a 20 20  RD AceFlags,..  
1ff50 44 57 4f 52 44 20 41 63 63 65 73 73 4d 61 73 6b  DWORD AccessMask
1ff60 2c 0d 0a 20 20 50 53 49 44 20 70 53 69 64 29 3b  ,..  PSID pSid);
1ff70 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a 20 5f  ..// #endif /* _
1ff80 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 20  WIN32_WINNT >=  
1ff90 30 78 30 35 30 30 20 2a 2f 0d 0a 0d 0a 65 78 74  0x0500 */....ext
1ffa0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
1ffb0 6f 72 74 20 42 4f 4f 4c 20 41 64 64 41 63 63 65  ort BOOL AddAcce
1ffc0 73 73 44 65 6e 69 65 64 41 63 65 28 0d 0a 20 20  ssDeniedAce(..  
1ffd0 50 41 43 4c 20 70 41 63 6c 2c 0d 0a 20 20 44 57  PACL pAcl,..  DW
1ffe0 4f 52 44 20 64 77 41 63 65 52 65 76 69 73 69 6f  ORD dwAceRevisio
1fff0 6e 2c 0d 0a 20 20 44 57 4f 52 44 20 41 63 63 65  n,..  DWORD Acce
20000 73 73 4d 61 73 6b 2c 0d 0a 20 20 50 53 49 44 20  ssMask,..  PSID 
20010 70 53 69 64 29 3b 0d 0a 0d 0a 2f 2f 20 23 69 66  pSid);....// #if
20020 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d  (_WIN32_WINNT >=
20030 20 30 78 30 35 30 30 29 0d 0a 65 78 74 65 72 6e   0x0500)..extern
20040 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
20050 20 42 4f 4f 4c 20 41 64 64 41 63 63 65 73 73 44   BOOL AddAccessD
20060 65 6e 69 65 64 41 63 65 45 78 28 0d 0a 20 20 50  eniedAceEx(..  P
20070 41 43 4c 20 70 41 63 6c 2c 0d 0a 20 20 44 57 4f  ACL pAcl,..  DWO
20080 52 44 20 64 77 41 63 65 52 65 76 69 73 69 6f 6e  RD dwAceRevision
20090 2c 0d 0a 20 20 44 57 4f 52 44 20 41 63 65 46 6c  ,..  DWORD AceFl
200a0 61 67 73 2c 0d 0a 20 20 44 57 4f 52 44 20 41 63  ags,..  DWORD Ac
200b0 63 65 73 73 4d 61 73 6b 2c 0d 0a 20 20 50 53 49  cessMask,..  PSI
200c0 44 20 70 53 69 64 29 3b 0d 0a 2f 2f 20 23 65 6e  D pSid);..// #en
200d0 64 69 66 20 2f 2a 20 5f 57 49 4e 33 32 5f 57 49  dif /* _WIN32_WI
200e0 4e 4e 54 20 3e 3d 20 20 30 78 30 35 30 30 20 2a  NNT >=  0x0500 *
200f0 2f 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  /....extern(Wind
20100 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
20110 20 41 64 64 41 75 64 69 74 41 63 63 65 73 73 41   AddAuditAccessA
20120 63 65 28 0d 0a 20 20 50 41 43 4c 20 70 41 63 6c  ce(..  PACL pAcl
20130 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 41 63 65  ,..  DWORD dwAce
20140 52 65 76 69 73 69 6f 6e 2c 0d 0a 20 20 44 57 4f  Revision,..  DWO
20150 52 44 20 64 77 41 63 63 65 73 73 4d 61 73 6b 2c  RD dwAccessMask,
20160 0d 0a 20 20 50 53 49 44 20 70 53 69 64 2c 0d 0a  ..  PSID pSid,..
20170 20 20 42 4f 4f 4c 20 62 41 75 64 69 74 53 75 63    BOOL bAuditSuc
20180 63 65 73 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62 41  cess,..  BOOL bA
20190 75 64 69 74 46 61 69 6c 75 72 65 29 3b 0d 0a 0d  uditFailure);...
201a0 0a 2f 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57  .// #if(_WIN32_W
201b0 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 0d  INNT >= 0x0500).
201c0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
201d0 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 64 64   export BOOL Add
201e0 41 75 64 69 74 41 63 63 65 73 73 41 63 65 45 78  AuditAccessAceEx
201f0 28 0d 0a 20 20 50 41 43 4c 20 70 41 63 6c 2c 0d  (..  PACL pAcl,.
20200 0a 20 20 44 57 4f 52 44 20 64 77 41 63 65 52 65  .  DWORD dwAceRe
20210 76 69 73 69 6f 6e 2c 0d 0a 20 20 44 57 4f 52 44  vision,..  DWORD
20220 20 41 63 65 46 6c 61 67 73 2c 0d 0a 20 20 44 57   AceFlags,..  DW
20230 4f 52 44 20 64 77 41 63 63 65 73 73 4d 61 73 6b  ORD dwAccessMask
20240 2c 0d 0a 20 20 50 53 49 44 20 70 53 69 64 2c 0d  ,..  PSID pSid,.
20250 0a 20 20 42 4f 4f 4c 20 62 41 75 64 69 74 53 75  .  BOOL bAuditSu
20260 63 63 65 73 73 2c 0d 0a 20 20 42 4f 4f 4c 20 62  ccess,..  BOOL b
20270 41 75 64 69 74 46 61 69 6c 75 72 65 29 3b 0d 0a  AuditFailure);..
20280 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
20290 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 64  ) export BOOL Ad
202a0 64 41 63 63 65 73 73 41 6c 6c 6f 77 65 64 4f 62  dAccessAllowedOb
202b0 6a 65 63 74 41 63 65 28 0d 0a 20 20 50 41 43 4c  jectAce(..  PACL
202c0 20 70 41 63 6c 2c 0d 0a 20 20 44 57 4f 52 44 20   pAcl,..  DWORD 
202d0 64 77 41 63 65 52 65 76 69 73 69 6f 6e 2c 0d 0a  dwAceRevision,..
202e0 20 20 44 57 4f 52 44 20 41 63 65 46 6c 61 67 73    DWORD AceFlags
202f0 2c 0d 0a 20 20 44 57 4f 52 44 20 41 63 63 65 73  ,..  DWORD Acces
20300 73 4d 61 73 6b 2c 0d 0a 20 20 47 55 49 44 20 2a  sMask,..  GUID *
20310 4f 62 6a 65 63 74 54 79 70 65 47 75 69 64 2c 0d  ObjectTypeGuid,.
20320 0a 20 20 47 55 49 44 20 2a 49 6e 68 65 72 69 74  .  GUID *Inherit
20330 65 64 4f 62 6a 65 63 74 54 79 70 65 47 75 69 64  edObjectTypeGuid
20340 2c 0d 0a 20 20 50 53 49 44 20 70 53 69 64 29 3b  ,..  PSID pSid);
20350 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
20360 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
20370 41 64 64 41 63 63 65 73 73 44 65 6e 69 65 64 4f  AddAccessDeniedO
20380 62 6a 65 63 74 41 63 65 28 0d 0a 20 20 50 41 43  bjectAce(..  PAC
20390 4c 20 70 41 63 6c 2c 0d 0a 20 20 44 57 4f 52 44  L pAcl,..  DWORD
203a0 20 64 77 41 63 65 52 65 76 69 73 69 6f 6e 2c 0d   dwAceRevision,.
203b0 0a 20 20 44 57 4f 52 44 20 41 63 65 46 6c 61 67  .  DWORD AceFlag
203c0 73 2c 0d 0a 20 20 44 57 4f 52 44 20 41 63 63 65  s,..  DWORD Acce
203d0 73 73 4d 61 73 6b 2c 0d 0a 20 20 47 55 49 44 20  ssMask,..  GUID 
203e0 2a 4f 62 6a 65 63 74 54 79 70 65 47 75 69 64 2c  *ObjectTypeGuid,
203f0 0d 0a 20 20 47 55 49 44 20 2a 49 6e 68 65 72 69  ..  GUID *Inheri
20400 74 65 64 4f 62 6a 65 63 74 54 79 70 65 47 75 69  tedObjectTypeGui
20410 64 2c 0d 0a 20 20 50 53 49 44 20 70 53 69 64 29  d,..  PSID pSid)
20420 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
20430 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
20440 20 41 64 64 41 75 64 69 74 41 63 63 65 73 73 4f   AddAuditAccessO
20450 62 6a 65 63 74 41 63 65 28 0d 0a 20 20 50 41 43  bjectAce(..  PAC
20460 4c 20 70 41 63 6c 2c 0d 0a 20 20 44 57 4f 52 44  L pAcl,..  DWORD
20470 20 64 77 41 63 65 52 65 76 69 73 69 6f 6e 2c 0d   dwAceRevision,.
20480 0a 20 20 44 57 4f 52 44 20 41 63 65 46 6c 61 67  .  DWORD AceFlag
20490 73 2c 0d 0a 20 20 44 57 4f 52 44 20 41 63 63 65  s,..  DWORD Acce
204a0 73 73 4d 61 73 6b 2c 0d 0a 20 20 47 55 49 44 20  ssMask,..  GUID 
204b0 2a 4f 62 6a 65 63 74 54 79 70 65 47 75 69 64 2c  *ObjectTypeGuid,
204c0 0d 0a 20 20 47 55 49 44 20 2a 49 6e 68 65 72 69  ..  GUID *Inheri
204d0 74 65 64 4f 62 6a 65 63 74 54 79 70 65 47 75 69  tedObjectTypeGui
204e0 64 2c 0d 0a 20 20 50 53 49 44 20 70 53 69 64 2c  d,..  PSID pSid,
204f0 0d 0a 20 20 42 4f 4f 4c 20 62 41 75 64 69 74 53  ..  BOOL bAuditS
20500 75 63 63 65 73 73 2c 0d 0a 20 20 42 4f 4f 4c 20  uccess,..  BOOL 
20510 62 41 75 64 69 74 46 61 69 6c 75 72 65 29 3b 0d  bAuditFailure);.
20520 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a 20 5f 57  .// #endif /* _W
20530 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 20 30  IN32_WINNT >=  0
20540 78 30 35 30 30 20 2a 2f 0d 0a 0d 0a 65 78 74 65  x0500 */....exte
20550 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
20560 72 74 20 42 4f 4f 4c 20 46 69 6e 64 46 69 72 73  rt BOOL FindFirs
20570 74 46 72 65 65 41 63 65 28 0d 0a 20 20 50 41 43  tFreeAce(..  PAC
20580 4c 20 70 41 63 6c 2c 0d 0a 20 20 4c 50 56 4f 49  L pAcl,..  LPVOI
20590 44 20 2a 70 41 63 65 29 3b 0d 0a 0d 0a 65 78 74  D *pAce);....ext
205a0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
205b0 6f 72 74 20 42 4f 4f 4c 20 49 6e 69 74 69 61 6c  ort BOOL Initial
205c0 69 7a 65 53 65 63 75 72 69 74 79 44 65 73 63 72  izeSecurityDescr
205d0 69 70 74 6f 72 28 0d 0a 20 20 50 53 45 43 55 52  iptor(..  PSECUR
205e0 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70  ITY_DESCRIPTOR p
205f0 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74  SecurityDescript
20600 6f 72 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 52  or,..  DWORD dwR
20610 65 76 69 73 69 6f 6e 29 3b 0d 0a 0d 0a 65 78 74  evision);....ext
20620 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
20630 6f 72 74 20 42 4f 4f 4c 20 49 73 56 61 6c 69 64  ort BOOL IsValid
20640 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74  SecurityDescript
20650 6f 72 28 0d 0a 20 20 50 53 45 43 55 52 49 54 59  or(..  PSECURITY
20660 5f 44 45 53 43 52 49 50 54 4f 52 20 70 53 65 63  _DESCRIPTOR pSec
20670 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72 29  urityDescriptor)
20680 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
20690 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52  ows) export DWOR
206a0 44 20 47 65 74 53 65 63 75 72 69 74 79 44 65 73  D GetSecurityDes
206b0 63 72 69 70 74 6f 72 4c 65 6e 67 74 68 28 0d 0a  criptorLength(..
206c0 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53 43    PSECURITY_DESC
206d0 52 49 50 54 4f 52 20 70 53 65 63 75 72 69 74 79  RIPTOR pSecurity
206e0 44 65 73 63 72 69 70 74 6f 72 29 3b 0d 0a 0d 0a  Descriptor);....
206f0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
20700 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 53  export BOOL GetS
20710 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74 6f  ecurityDescripto
20720 72 43 6f 6e 74 72 6f 6c 28 0d 0a 20 20 50 53 45  rControl(..  PSE
20730 43 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f  CURITY_DESCRIPTO
20740 52 20 70 53 65 63 75 72 69 74 79 44 65 73 63 72  R pSecurityDescr
20750 69 70 74 6f 72 2c 0d 0a 20 20 50 53 45 43 55 52  iptor,..  PSECUR
20760 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 5f 43  ITY_DESCRIPTOR_C
20770 4f 4e 54 52 4f 4c 20 70 43 6f 6e 74 72 6f 6c 2c  ONTROL pControl,
20780 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 64 77  ..  LPDWORD lpdw
20790 52 65 76 69 73 69 6f 6e 29 3b 0d 0a 0d 0a 2f 2f  Revision);....//
207a0 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e 4e   #if(_WIN32_WINN
207b0 54 20 3e 3d 20 30 78 30 35 30 30 29 0d 0a 65 78  T >= 0x0500)..ex
207c0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
207d0 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 53 65 63  port BOOL SetSec
207e0 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72 43  urityDescriptorC
207f0 6f 6e 74 72 6f 6c 28 0d 0a 20 20 50 53 45 43 55  ontrol(..  PSECU
20800 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20  RITY_DESCRIPTOR 
20810 70 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70  pSecurityDescrip
20820 74 6f 72 2c 0d 0a 20 20 53 45 43 55 52 49 54 59  tor,..  SECURITY
20830 5f 44 45 53 43 52 49 50 54 4f 52 5f 43 4f 4e 54  _DESCRIPTOR_CONT
20840 52 4f 4c 20 43 6f 6e 74 72 6f 6c 42 69 74 73 4f  ROL ControlBitsO
20850 66 49 6e 74 65 72 65 73 74 2c 0d 0a 20 20 53 45  fInterest,..  SE
20860 43 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f  CURITY_DESCRIPTO
20870 52 5f 43 4f 4e 54 52 4f 4c 20 43 6f 6e 74 72 6f  R_CONTROL Contro
20880 6c 42 69 74 73 54 6f 53 65 74 29 3b 0d 0a 2f 2f  lBitsToSet);..//
20890 20 23 65 6e 64 69 66 20 2f 2a 20 5f 57 49 4e 33   #endif /* _WIN3
208a0 32 5f 57 49 4e 4e 54 20 3e 3d 20 20 30 78 30 35  2_WINNT >=  0x05
208b0 30 30 20 2a 2f 0d 0a 0d 0a 65 78 74 65 72 6e 28  00 */....extern(
208c0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
208d0 42 4f 4f 4c 20 53 65 74 53 65 63 75 72 69 74 79  BOOL SetSecurity
208e0 44 65 73 63 72 69 70 74 6f 72 44 61 63 6c 28 0d  DescriptorDacl(.
208f0 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53  .  PSECURITY_DES
20900 43 52 49 50 54 4f 52 20 70 53 65 63 75 72 69 74  CRIPTOR pSecurit
20910 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20  yDescriptor,..  
20920 42 4f 4f 4c 20 62 44 61 63 6c 50 72 65 73 65 6e  BOOL bDaclPresen
20930 74 2c 0d 0a 20 20 50 41 43 4c 20 70 44 61 63 6c  t,..  PACL pDacl
20940 2c 0d 0a 20 20 42 4f 4f 4c 20 62 44 61 63 6c 44  ,..  BOOL bDaclD
20950 65 66 61 75 6c 74 65 64 29 3b 0d 0a 0d 0a 65 78  efaulted);....ex
20960 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
20970 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 53 65 63  port BOOL GetSec
20980 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72 44  urityDescriptorD
20990 61 63 6c 28 0d 0a 20 20 50 53 45 43 55 52 49 54  acl(..  PSECURIT
209a0 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70 53 65  Y_DESCRIPTOR pSe
209b0 63 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72  curityDescriptor
209c0 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20 6c 70 62 44  ,..  LPBOOL lpbD
209d0 61 63 6c 50 72 65 73 65 6e 74 2c 0d 0a 20 20 50  aclPresent,..  P
209e0 41 43 4c 20 2a 70 44 61 63 6c 2c 0d 0a 20 20 4c  ACL *pDacl,..  L
209f0 50 42 4f 4f 4c 20 6c 70 62 44 61 63 6c 44 65 66  PBOOL lpbDaclDef
20a00 61 75 6c 74 65 64 29 3b 0d 0a 0d 0a 65 78 74 65  aulted);....exte
20a10 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
20a20 72 74 20 42 4f 4f 4c 20 53 65 74 53 65 63 75 72  rt BOOL SetSecur
20a30 69 74 79 44 65 73 63 72 69 70 74 6f 72 53 61 63  ityDescriptorSac
20a40 6c 28 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f  l(..  PSECURITY_
20a50 44 45 53 43 52 49 50 54 4f 52 20 70 53 65 63 75  DESCRIPTOR pSecu
20a60 72 69 74 79 44 65 73 63 72 69 70 74 6f 72 2c 0d  rityDescriptor,.
20a70 0a 20 20 42 4f 4f 4c 20 62 53 61 63 6c 50 72 65  .  BOOL bSaclPre
20a80 73 65 6e 74 2c 0d 0a 20 20 50 41 43 4c 20 70 53  sent,..  PACL pS
20a90 61 63 6c 2c 0d 0a 20 20 42 4f 4f 4c 20 62 53 61  acl,..  BOOL bSa
20aa0 63 6c 44 65 66 61 75 6c 74 65 64 29 3b 0d 0a 0d  clDefaulted);...
20ab0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
20ac0 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74   export BOOL Get
20ad0 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74  SecurityDescript
20ae0 6f 72 53 61 63 6c 28 0d 0a 20 20 50 53 45 43 55  orSacl(..  PSECU
20af0 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20  RITY_DESCRIPTOR 
20b00 70 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70  pSecurityDescrip
20b10 74 6f 72 2c 0d 0a 20 20 4c 50 42 4f 4f 4c 20 6c  tor,..  LPBOOL l
20b20 70 62 53 61 63 6c 50 72 65 73 65 6e 74 2c 0d 0a  pbSaclPresent,..
20b30 20 20 50 41 43 4c 20 2a 70 53 61 63 6c 2c 0d 0a    PACL *pSacl,..
20b40 20 20 4c 50 42 4f 4f 4c 20 6c 70 62 53 61 63 6c    LPBOOL lpbSacl
20b50 44 65 66 61 75 6c 74 65 64 29 3b 0d 0a 0d 0a 65  Defaulted);....e
20b60 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
20b70 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 53 65  xport BOOL SetSe
20b80 63 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72  curityDescriptor
20b90 4f 77 6e 65 72 28 0d 0a 20 20 50 53 45 43 55 52  Owner(..  PSECUR
20ba0 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70  ITY_DESCRIPTOR p
20bb0 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74  SecurityDescript
20bc0 6f 72 2c 0d 0a 20 20 50 53 49 44 20 70 4f 77 6e  or,..  PSID pOwn
20bd0 65 72 2c 0d 0a 20 20 42 4f 4f 4c 20 62 4f 77 6e  er,..  BOOL bOwn
20be0 65 72 44 65 66 61 75 6c 74 65 64 29 3b 0d 0a 0d  erDefaulted);...
20bf0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
20c00 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74   export BOOL Get
20c10 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74  SecurityDescript
20c20 6f 72 4f 77 6e 65 72 28 0d 0a 20 20 50 53 45 43  orOwner(..  PSEC
20c30 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52  URITY_DESCRIPTOR
20c40 20 70 53 65 63 75 72 69 74 79 44 65 73 63 72 69   pSecurityDescri
20c50 70 74 6f 72 2c 0d 0a 20 20 50 53 49 44 20 2a 70  ptor,..  PSID *p
20c60 4f 77 6e 65 72 2c 0d 0a 20 20 4c 50 42 4f 4f 4c  Owner,..  LPBOOL
20c70 20 6c 70 62 4f 77 6e 65 72 44 65 66 61 75 6c 74   lpbOwnerDefault
20c80 65 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ed);....extern(W
20c90 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
20ca0 4f 4f 4c 20 53 65 74 53 65 63 75 72 69 74 79 44  OOL SetSecurityD
20cb0 65 73 63 72 69 70 74 6f 72 47 72 6f 75 70 28 0d  escriptorGroup(.
20cc0 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53  .  PSECURITY_DES
20cd0 43 52 49 50 54 4f 52 20 70 53 65 63 75 72 69 74  CRIPTOR pSecurit
20ce0 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20  yDescriptor,..  
20cf0 50 53 49 44 20 70 47 72 6f 75 70 2c 0d 0a 20 20  PSID pGroup,..  
20d00 42 4f 4f 4c 20 62 47 72 6f 75 70 44 65 66 61 75  BOOL bGroupDefau
20d10 6c 74 65 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  lted);....extern
20d20 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
20d30 20 42 4f 4f 4c 20 47 65 74 53 65 63 75 72 69 74   BOOL GetSecurit
20d40 79 44 65 73 63 72 69 70 74 6f 72 47 72 6f 75 70  yDescriptorGroup
20d50 28 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44  (..  PSECURITY_D
20d60 45 53 43 52 49 50 54 4f 52 20 70 53 65 63 75 72  ESCRIPTOR pSecur
20d70 69 74 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a  ityDescriptor,..
20d80 20 20 50 53 49 44 20 2a 70 47 72 6f 75 70 2c 0d    PSID *pGroup,.
20d90 0a 20 20 4c 50 42 4f 4f 4c 20 6c 70 62 47 72 6f  .  LPBOOL lpbGro
20da0 75 70 44 65 66 61 75 6c 74 65 64 29 3b 0d 0a 0d  upDefaulted);...
20db0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
20dc0 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20 53 65   export DWORD Se
20dd0 74 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70  tSecurityDescrip
20de0 74 6f 72 52 4d 43 6f 6e 74 72 6f 6c 28 0d 0a 20  torRMControl(.. 
20df0 20 50 53 45 43 55 52 49 54 59 5f 44 45 53 43 52   PSECURITY_DESCR
20e00 49 50 54 4f 52 20 53 65 63 75 72 69 74 79 44 65  IPTOR SecurityDe
20e10 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20 50 55 43  scriptor,..  PUC
20e20 48 41 52 20 52 4d 43 6f 6e 74 72 6f 6c 20 29 3b  HAR RMControl );
20e30 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
20e40 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44  ws) export DWORD
20e50 20 47 65 74 53 65 63 75 72 69 74 79 44 65 73 63   GetSecurityDesc
20e60 72 69 70 74 6f 72 52 4d 43 6f 6e 74 72 6f 6c 28  riptorRMControl(
20e70 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44 45  ..  PSECURITY_DE
20e80 53 43 52 49 50 54 4f 52 20 53 65 63 75 72 69 74  SCRIPTOR Securit
20e90 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20  yDescriptor,..  
20ea0 50 55 43 48 41 52 20 52 4d 43 6f 6e 74 72 6f 6c  PUCHAR RMControl
20eb0 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
20ec0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
20ed0 4c 20 43 72 65 61 74 65 50 72 69 76 61 74 65 4f  L CreatePrivateO
20ee0 62 6a 65 63 74 53 65 63 75 72 69 74 79 28 0d 0a  bjectSecurity(..
20ef0 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53 43    PSECURITY_DESC
20f00 52 49 50 54 4f 52 20 50 61 72 65 6e 74 44 65 73  RIPTOR ParentDes
20f10 63 72 69 70 74 6f 72 2c 0d 0a 20 20 50 53 45 43  criptor,..  PSEC
20f20 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52  URITY_DESCRIPTOR
20f30 20 43 72 65 61 74 6f 72 44 65 73 63 72 69 70 74   CreatorDescript
20f40 6f 72 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59  or,..  PSECURITY
20f50 5f 44 45 53 43 52 49 50 54 4f 52 20 2a 20 4e 65  _DESCRIPTOR * Ne
20f60 77 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20  wDescriptor,..  
20f70 42 4f 4f 4c 20 49 73 44 69 72 65 63 74 6f 72 79  BOOL IsDirectory
20f80 4f 62 6a 65 63 74 2c 0d 0a 20 20 48 41 4e 44 4c  Object,..  HANDL
20f90 45 20 54 6f 6b 65 6e 2c 0d 0a 20 20 50 47 45 4e  E Token,..  PGEN
20fa0 45 52 49 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e  ERIC_MAPPING Gen
20fb0 65 72 69 63 4d 61 70 70 69 6e 67 29 3b 0d 0a 0d  ericMapping);...
20fc0 0a 2f 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57  .// #if(_WIN32_W
20fd0 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 0d  INNT >= 0x0500).
20fe0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
20ff0 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43 6f 6e   export BOOL Con
21000 76 65 72 74 54 6f 41 75 74 6f 49 6e 68 65 72 69  vertToAutoInheri
21010 74 50 72 69 76 61 74 65 4f 62 6a 65 63 74 53 65  tPrivateObjectSe
21020 63 75 72 69 74 79 28 0d 0a 20 20 50 53 45 43 55  curity(..  PSECU
21030 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20  RITY_DESCRIPTOR 
21040 50 61 72 65 6e 74 44 65 73 63 72 69 70 74 6f 72  ParentDescriptor
21050 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44  ,..  PSECURITY_D
21060 45 53 43 52 49 50 54 4f 52 20 43 75 72 72 65 6e  ESCRIPTOR Curren
21070 74 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70  tSecurityDescrip
21080 74 6f 72 2c 0d 0a 20 20 50 53 45 43 55 52 49 54  tor,..  PSECURIT
21090 59 5f 44 45 53 43 52 49 50 54 4f 52 20 2a 4e 65  Y_DESCRIPTOR *Ne
210a0 77 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70  wSecurityDescrip
210b0 74 6f 72 2c 0d 0a 20 20 47 55 49 44 20 2a 4f 62  tor,..  GUID *Ob
210c0 6a 65 63 74 54 79 70 65 2c 0d 0a 20 20 42 4f 4f  jectType,..  BOO
210d0 4c 45 41 4e 20 49 73 44 69 72 65 63 74 6f 72 79  LEAN IsDirectory
210e0 4f 62 6a 65 63 74 2c 0d 0a 20 20 50 47 45 4e 45  Object,..  PGENE
210f0 52 49 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e 65  RIC_MAPPING Gene
21100 72 69 63 4d 61 70 70 69 6e 67 29 3b 0d 0a 0d 0a  ricMapping);....
21110 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
21120 65 78 70 6f 72 74 20 42 4f 4f 4c 20 43 72 65 61  export BOOL Crea
21130 74 65 50 72 69 76 61 74 65 4f 62 6a 65 63 74 53  tePrivateObjectS
21140 65 63 75 72 69 74 79 45 78 28 0d 0a 20 20 50 53  ecurityEx(..  PS
21150 45 43 55 52 49 54 59 5f 44 45 53 43 52 49 50 54  ECURITY_DESCRIPT
21160 4f 52 20 50 61 72 65 6e 74 44 65 73 63 72 69 70  OR ParentDescrip
21170 74 6f 72 2c 0d 0a 20 20 50 53 45 43 55 52 49 54  tor,..  PSECURIT
21180 59 5f 44 45 53 43 52 49 50 54 4f 52 20 43 72 65  Y_DESCRIPTOR Cre
21190 61 74 6f 72 44 65 73 63 72 69 70 74 6f 72 2c 0d  atorDescriptor,.
211a0 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53  .  PSECURITY_DES
211b0 43 52 49 50 54 4f 52 20 2a 20 4e 65 77 44 65 73  CRIPTOR * NewDes
211c0 63 72 69 70 74 6f 72 2c 0d 0a 20 20 47 55 49 44  criptor,..  GUID
211d0 20 2a 4f 62 6a 65 63 74 54 79 70 65 20 2c 0d 0a   *ObjectType ,..
211e0 20 20 42 4f 4f 4c 20 49 73 43 6f 6e 74 61 69 6e    BOOL IsContain
211f0 65 72 4f 62 6a 65 63 74 2c 0d 0a 20 20 55 4c 4f  erObject,..  ULO
21200 4e 47 20 41 75 74 6f 49 6e 68 65 72 69 74 46 6c  NG AutoInheritFl
21210 61 67 73 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 54  ags,..  HANDLE T
21220 6f 6b 65 6e 2c 0d 0a 20 20 50 47 45 4e 45 52 49  oken,..  PGENERI
21230 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e 65 72 69  C_MAPPING Generi
21240 63 4d 61 70 70 69 6e 67 29 3b 0d 0a 0d 0a 65 78  cMapping);....ex
21250 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
21260 70 6f 72 74 20 42 4f 4f 4c 20 43 72 65 61 74 65  port BOOL Create
21270 50 72 69 76 61 74 65 4f 62 6a 65 63 74 53 65 63  PrivateObjectSec
21280 75 72 69 74 79 57 69 74 68 4d 75 6c 74 69 70 6c  urityWithMultipl
21290 65 49 6e 68 65 72 69 74 61 6e 63 65 28 0d 0a 20  eInheritance(.. 
212a0 20 50 53 45 43 55 52 49 54 59 5f 44 45 53 43 52   PSECURITY_DESCR
212b0 49 50 54 4f 52 20 50 61 72 65 6e 74 44 65 73 63  IPTOR ParentDesc
212c0 72 69 70 74 6f 72 2c 0d 0a 20 20 50 53 45 43 55  riptor,..  PSECU
212d0 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20  RITY_DESCRIPTOR 
212e0 43 72 65 61 74 6f 72 44 65 73 63 72 69 70 74 6f  CreatorDescripto
212f0 72 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f  r,..  PSECURITY_
21300 44 45 53 43 52 49 50 54 4f 52 20 2a 20 4e 65 77  DESCRIPTOR * New
21310 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20 47  Descriptor,..  G
21320 55 49 44 20 2a 2a 4f 62 6a 65 63 74 54 79 70 65  UID **ObjectType
21330 73 20 2c 0d 0a 20 20 55 4c 4f 4e 47 20 47 75 69  s ,..  ULONG Gui
21340 64 43 6f 75 6e 74 2c 0d 0a 20 20 42 4f 4f 4c 20  dCount,..  BOOL 
21350 49 73 43 6f 6e 74 61 69 6e 65 72 4f 62 6a 65 63  IsContainerObjec
21360 74 2c 0d 0a 20 20 55 4c 4f 4e 47 20 41 75 74 6f  t,..  ULONG Auto
21370 49 6e 68 65 72 69 74 46 6c 61 67 73 2c 0d 0a 20  InheritFlags,.. 
21380 20 48 41 4e 44 4c 45 20 54 6f 6b 65 6e 2c 0d 0a   HANDLE Token,..
21390 20 20 50 47 45 4e 45 52 49 43 5f 4d 41 50 50 49    PGENERIC_MAPPI
213a0 4e 47 20 47 65 6e 65 72 69 63 4d 61 70 70 69 6e  NG GenericMappin
213b0 67 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  g);..// #endif /
213c0 2a 20 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e  * _WIN32_WINNT >
213d0 3d 20 20 30 78 30 35 30 30 20 2a 2f 0d 0a 0d 0a  =  0x0500 */....
213e0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
213f0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 50  export BOOL SetP
21400 72 69 76 61 74 65 4f 62 6a 65 63 74 53 65 63 75  rivateObjectSecu
21410 72 69 74 79 28 0d 0a 20 20 53 45 43 55 52 49 54  rity(..  SECURIT
21420 59 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 53 65  Y_INFORMATION Se
21430 63 75 72 69 74 79 49 6e 66 6f 72 6d 61 74 69 6f  curityInformatio
21440 6e 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f  n,..  PSECURITY_
21450 44 45 53 43 52 49 50 54 4f 52 20 4d 6f 64 69 66  DESCRIPTOR Modif
21460 69 63 61 74 69 6f 6e 44 65 73 63 72 69 70 74 6f  icationDescripto
21470 72 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f  r,..  PSECURITY_
21480 44 45 53 43 52 49 50 54 4f 52 20 2a 4f 62 6a 65  DESCRIPTOR *Obje
21490 63 74 73 53 65 63 75 72 69 74 79 44 65 73 63 72  ctsSecurityDescr
214a0 69 70 74 6f 72 2c 0d 0a 20 20 50 47 45 4e 45 52  iptor,..  PGENER
214b0 49 43 5f 4d 41 50 50 49 4e 47 20 47 65 6e 65 72  IC_MAPPING Gener
214c0 69 63 4d 61 70 70 69 6e 67 2c 0d 0a 20 20 48 41  icMapping,..  HA
214d0 4e 44 4c 45 20 54 6f 6b 65 6e 29 3b 0d 0a 0d 0a  NDLE Token);....
214e0 2f 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49  // #if(_WIN32_WI
214f0 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 0d 0a  NNT >= 0x0500)..
21500 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
21510 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65 74 50  export BOOL SetP
21520 72 69 76 61 74 65 4f 62 6a 65 63 74 53 65 63 75  rivateObjectSecu
21530 72 69 74 79 45 78 28 0d 0a 20 20 53 45 43 55 52  rityEx(..  SECUR
21540 49 54 59 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20  ITY_INFORMATION 
21550 53 65 63 75 72 69 74 79 49 6e 66 6f 72 6d 61 74  SecurityInformat
21560 69 6f 6e 2c 0d 0a 20 20 50 53 45 43 55 52 49 54  ion,..  PSECURIT
21570 59 5f 44 45 53 43 52 49 50 54 4f 52 20 4d 6f 64  Y_DESCRIPTOR Mod
21580 69 66 69 63 61 74 69 6f 6e 44 65 73 63 72 69 70  ificationDescrip
21590 74 6f 72 2c 0d 0a 20 20 50 53 45 43 55 52 49 54  tor,..  PSECURIT
215a0 59 5f 44 45 53 43 52 49 50 54 4f 52 20 2a 4f 62  Y_DESCRIPTOR *Ob
215b0 6a 65 63 74 73 53 65 63 75 72 69 74 79 44 65 73  jectsSecurityDes
215c0 63 72 69 70 74 6f 72 2c 0d 0a 20 20 55 4c 4f 4e  criptor,..  ULON
215d0 47 20 41 75 74 6f 49 6e 68 65 72 69 74 46 6c 61  G AutoInheritFla
215e0 67 73 2c 0d 0a 20 20 50 47 45 4e 45 52 49 43 5f  gs,..  PGENERIC_
215f0 4d 41 50 50 49 4e 47 20 47 65 6e 65 72 69 63 4d  MAPPING GenericM
21600 61 70 70 69 6e 67 2c 0d 0a 20 20 48 41 4e 44 4c  apping,..  HANDL
21610 45 20 54 6f 6b 65 6e 20 29 3b 0d 0a 2f 2f 20 23  E Token );..// #
21620 65 6e 64 69 66 20 2f 2a 20 5f 57 49 4e 33 32 5f  endif /* _WIN32_
21630 57 49 4e 4e 54 20 3e 3d 20 20 30 78 30 35 30 30  WINNT >=  0x0500
21640 20 2a 2f 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69   */....extern(Wi
21650 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
21660 4f 4c 20 47 65 74 50 72 69 76 61 74 65 4f 62 6a  OL GetPrivateObj
21670 65 63 74 53 65 63 75 72 69 74 79 28 0d 0a 20 20  ectSecurity(..  
21680 50 53 45 43 55 52 49 54 59 5f 44 45 53 43 52 49  PSECURITY_DESCRI
21690 50 54 4f 52 20 4f 62 6a 65 63 74 44 65 73 63 72  PTOR ObjectDescr
216a0 69 70 74 6f 72 2c 0d 0a 20 20 53 45 43 55 52 49  iptor,..  SECURI
216b0 54 59 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 53  TY_INFORMATION S
216c0 65 63 75 72 69 74 79 49 6e 66 6f 72 6d 61 74 69  ecurityInformati
216d0 6f 6e 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59  on,..  PSECURITY
216e0 5f 44 45 53 43 52 49 50 54 4f 52 20 52 65 73 75  _DESCRIPTOR Resu
216f0 6c 74 61 6e 74 44 65 73 63 72 69 70 74 6f 72 2c  ltantDescriptor,
21700 0d 0a 20 20 44 57 4f 52 44 20 44 65 73 63 72 69  ..  DWORD Descri
21710 70 74 6f 72 4c 65 6e 67 74 68 2c 0d 0a 20 20 50  ptorLength,..  P
21720 44 57 4f 52 44 20 52 65 74 75 72 6e 4c 65 6e 67  DWORD ReturnLeng
21730 74 68 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  th);....extern(W
21740 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
21750 4f 4f 4c 20 44 65 73 74 72 6f 79 50 72 69 76 61  OOL DestroyPriva
21760 74 65 4f 62 6a 65 63 74 53 65 63 75 72 69 74 79  teObjectSecurity
21770 28 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44  (..  PSECURITY_D
21780 45 53 43 52 49 50 54 4f 52 20 2a 20 4f 62 6a 65  ESCRIPTOR * Obje
21790 63 74 44 65 73 63 72 69 70 74 6f 72 29 3b 0d 0a  ctDescriptor);..
217a0 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
217b0 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4d 61  ) export BOOL Ma
217c0 6b 65 53 65 6c 66 52 65 6c 61 74 69 76 65 53 44  keSelfRelativeSD
217d0 28 0d 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44  (..  PSECURITY_D
217e0 45 53 43 52 49 50 54 4f 52 20 70 41 62 73 6f 6c  ESCRIPTOR pAbsol
217f0 75 74 65 53 65 63 75 72 69 74 79 44 65 73 63 72  uteSecurityDescr
21800 69 70 74 6f 72 2c 0d 0a 20 20 50 53 45 43 55 52  iptor,..  PSECUR
21810 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70  ITY_DESCRIPTOR p
21820 53 65 6c 66 52 65 6c 61 74 69 76 65 53 65 63 75  SelfRelativeSecu
21830 72 69 74 79 44 65 73 63 72 69 70 74 6f 72 2c 0d  rityDescriptor,.
21840 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 64 77 42  .  LPDWORD lpdwB
21850 75 66 66 65 72 4c 65 6e 67 74 68 29 3b 0d 0a 0d  ufferLength);...
21860 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
21870 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4d 61 6b   export BOOL Mak
21880 65 41 62 73 6f 6c 75 74 65 53 44 28 0d 0a 20 20  eAbsoluteSD(..  
21890 50 53 45 43 55 52 49 54 59 5f 44 45 53 43 52 49  PSECURITY_DESCRI
218a0 50 54 4f 52 20 70 53 65 6c 66 52 65 6c 61 74 69  PTOR pSelfRelati
218b0 76 65 53 65 63 75 72 69 74 79 44 65 73 63 72 69  veSecurityDescri
218c0 70 74 6f 72 2c 0d 0a 20 20 50 53 45 43 55 52 49  ptor,..  PSECURI
218d0 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70 41  TY_DESCRIPTOR pA
218e0 62 73 6f 6c 75 74 65 53 65 63 75 72 69 74 79 44  bsoluteSecurityD
218f0 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20 4c 50  escriptor,..  LP
21900 44 57 4f 52 44 20 6c 70 64 77 41 62 73 6f 6c 75  DWORD lpdwAbsolu
21910 74 65 53 65 63 75 72 69 74 79 44 65 73 63 72 69  teSecurityDescri
21920 70 74 6f 72 53 69 7a 65 2c 0d 0a 20 20 50 41 43  ptorSize,..  PAC
21930 4c 20 70 44 61 63 6c 2c 0d 0a 20 20 4c 50 44 57  L pDacl,..  LPDW
21940 4f 52 44 20 6c 70 64 77 44 61 63 6c 53 69 7a 65  ORD lpdwDaclSize
21950 2c 0d 0a 20 20 50 41 43 4c 20 70 53 61 63 6c 2c  ,..  PACL pSacl,
21960 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 64 77  ..  LPDWORD lpdw
21970 53 61 63 6c 53 69 7a 65 2c 0d 0a 20 20 50 53 49  SaclSize,..  PSI
21980 44 20 70 4f 77 6e 65 72 2c 0d 0a 20 20 4c 50 44  D pOwner,..  LPD
21990 57 4f 52 44 20 6c 70 64 77 4f 77 6e 65 72 53 69  WORD lpdwOwnerSi
219a0 7a 65 2c 0d 0a 20 20 50 53 49 44 20 70 50 72 69  ze,..  PSID pPri
219b0 6d 61 72 79 47 72 6f 75 70 2c 0d 0a 20 20 4c 50  maryGroup,..  LP
219c0 44 57 4f 52 44 20 6c 70 64 77 50 72 69 6d 61 72  DWORD lpdwPrimar
219d0 79 47 72 6f 75 70 53 69 7a 65 29 3b 0d 0a 0d 0a  yGroupSize);....
219e0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
219f0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4d 61 6b 65  export BOOL Make
21a00 41 62 73 6f 6c 75 74 65 53 44 32 28 0d 0a 20 20  AbsoluteSD2(..  
21a10 50 53 45 43 55 52 49 54 59 5f 44 45 53 43 52 49  PSECURITY_DESCRI
21a20 50 54 4f 52 20 70 53 65 6c 66 52 65 6c 61 74 69  PTOR pSelfRelati
21a30 76 65 53 65 63 75 72 69 74 79 44 65 73 63 72 69  veSecurityDescri
21a40 70 74 6f 72 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  ptor,..  LPDWORD
21a50 20 6c 70 64 77 42 75 66 66 65 72 53 69 7a 65 29   lpdwBufferSize)
21a60 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
21a70 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
21a80 20 53 65 74 46 69 6c 65 53 65 63 75 72 69 74 79   SetFileSecurity
21a90 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46  A(..  LPCSTR lpF
21aa0 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 53 45 43 55  ileName,..  SECU
21ab0 52 49 54 59 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e  RITY_INFORMATION
21ac0 20 53 65 63 75 72 69 74 79 49 6e 66 6f 72 6d 61   SecurityInforma
21ad0 74 69 6f 6e 2c 0d 0a 20 20 50 53 45 43 55 52 49  tion,..  PSECURI
21ae0 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70 53  TY_DESCRIPTOR pS
21af0 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74 6f  ecurityDescripto
21b00 72 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  r);..extern(Wind
21b10 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
21b20 20 53 65 74 46 69 6c 65 53 65 63 75 72 69 74 79   SetFileSecurity
21b30 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  W(..  LPCWSTR lp
21b40 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 53 45 43  FileName,..  SEC
21b50 55 52 49 54 59 5f 49 4e 46 4f 52 4d 41 54 49 4f  URITY_INFORMATIO
21b60 4e 20 53 65 63 75 72 69 74 79 49 6e 66 6f 72 6d  N SecurityInform
21b70 61 74 69 6f 6e 2c 0d 0a 20 20 50 53 45 43 55 52  ation,..  PSECUR
21b80 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70  ITY_DESCRIPTOR p
21b90 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74  SecurityDescript
21ba0 6f 72 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  or);..// #ifdef 
21bb0 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
21bc0 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
21bd0 73 20 53 65 74 46 69 6c 65 53 65 63 75 72 69 74  s SetFileSecurit
21be0 79 41 20 53 65 74 46 69 6c 65 53 65 63 75 72 69  yA SetFileSecuri
21bf0 74 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  ty;..// #endif /
21c00 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
21c10 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
21c20 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 46 69 6c  port BOOL GetFil
21c30 65 53 65 63 75 72 69 74 79 41 28 0d 0a 20 20 4c  eSecurityA(..  L
21c40 50 43 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65  PCSTR lpFileName
21c50 2c 0d 0a 20 20 53 45 43 55 52 49 54 59 5f 49 4e  ,..  SECURITY_IN
21c60 46 4f 52 4d 41 54 49 4f 4e 20 52 65 71 75 65 73  FORMATION Reques
21c70 74 65 64 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d  tedInformation,.
21c80 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53  .  PSECURITY_DES
21c90 43 52 49 50 54 4f 52 20 70 53 65 63 75 72 69 74  CRIPTOR pSecurit
21ca0 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20  yDescriptor,..  
21cb0 44 57 4f 52 44 20 6e 4c 65 6e 67 74 68 2c 0d 0a  DWORD nLength,..
21cc0 20 20 4c 50 44 57 4f 52 44 20 6c 70 6e 4c 65 6e    LPDWORD lpnLen
21cd0 67 74 68 4e 65 65 64 65 64 29 3b 0d 0a 65 78 74  gthNeeded);..ext
21ce0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
21cf0 6f 72 74 20 42 4f 4f 4c 20 47 65 74 46 69 6c 65  ort BOOL GetFile
21d00 53 65 63 75 72 69 74 79 57 28 0d 0a 20 20 4c 50  SecurityW(..  LP
21d10 43 57 53 54 52 20 6c 70 46 69 6c 65 4e 61 6d 65  CWSTR lpFileName
21d20 2c 0d 0a 20 20 53 45 43 55 52 49 54 59 5f 49 4e  ,..  SECURITY_IN
21d30 46 4f 52 4d 41 54 49 4f 4e 20 52 65 71 75 65 73  FORMATION Reques
21d40 74 65 64 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d  tedInformation,.
21d50 0a 20 20 50 53 45 43 55 52 49 54 59 5f 44 45 53  .  PSECURITY_DES
21d60 43 52 49 50 54 4f 52 20 70 53 65 63 75 72 69 74  CRIPTOR pSecurit
21d70 79 44 65 73 63 72 69 70 74 6f 72 2c 0d 0a 20 20  yDescriptor,..  
21d80 44 57 4f 52 44 20 6e 4c 65 6e 67 74 68 2c 0d 0a  DWORD nLength,..
21d90 20 20 4c 50 44 57 4f 52 44 20 6c 70 6e 4c 65 6e    LPDWORD lpnLen
21da0 67 74 68 4e 65 65 64 65 64 29 3b 0d 0a 2f 2f 20  gthNeeded);..// 
21db0 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
21dc0 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
21dd0 65 0d 0a 61 6c 69 61 73 20 47 65 74 46 69 6c 65  e..alias GetFile
21de0 53 65 63 75 72 69 74 79 41 20 47 65 74 46 69 6c  SecurityA GetFil
21df0 65 53 65 63 75 72 69 74 79 3b 0d 0a 2f 2f 20 23  eSecurity;..// #
21e00 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
21e10 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
21e20 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
21e30 20 53 65 74 4b 65 72 6e 65 6c 4f 62 6a 65 63 74   SetKernelObject
21e40 53 65 63 75 72 69 74 79 28 0d 0a 20 20 48 41 4e  Security(..  HAN
21e50 44 4c 45 20 48 61 6e 64 6c 65 2c 0d 0a 20 20 53  DLE Handle,..  S
21e60 45 43 55 52 49 54 59 5f 49 4e 46 4f 52 4d 41 54  ECURITY_INFORMAT
21e70 49 4f 4e 20 53 65 63 75 72 69 74 79 49 6e 66 6f  ION SecurityInfo
21e80 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 50 53 45 43  rmation,..  PSEC
21e90 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 4f 52  URITY_DESCRIPTOR
21ea0 20 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70   SecurityDescrip
21eb0 74 6f 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  tor);....extern(
21ec0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
21ed0 48 41 4e 44 4c 45 20 46 69 6e 64 46 69 72 73 74  HANDLE FindFirst
21ee0 43 68 61 6e 67 65 4e 6f 74 69 66 69 63 61 74 69  ChangeNotificati
21ef0 6f 6e 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c  onA(..  LPCSTR l
21f00 70 50 61 74 68 4e 61 6d 65 2c 0d 0a 20 20 42 4f  pPathName,..  BO
21f10 4f 4c 20 62 57 61 74 63 68 53 75 62 74 72 65 65  OL bWatchSubtree
21f20 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 4e 6f 74  ,..  DWORD dwNot
21f30 69 66 79 46 69 6c 74 65 72 29 3b 0d 0a 65 78 74  ifyFilter);..ext
21f40 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
21f50 6f 72 74 20 48 41 4e 44 4c 45 20 46 69 6e 64 46  ort HANDLE FindF
21f60 69 72 73 74 43 68 61 6e 67 65 4e 6f 74 69 66 69  irstChangeNotifi
21f70 63 61 74 69 6f 6e 57 28 0d 0a 20 20 4c 50 43 57  cationW(..  LPCW
21f80 53 54 52 20 6c 70 50 61 74 68 4e 61 6d 65 2c 0d  STR lpPathName,.
21f90 0a 20 20 42 4f 4f 4c 20 62 57 61 74 63 68 53 75  .  BOOL bWatchSu
21fa0 62 74 72 65 65 2c 0d 0a 20 20 44 57 4f 52 44 20  btree,..  DWORD 
21fb0 64 77 4e 6f 74 69 66 79 46 69 6c 74 65 72 29 3b  dwNotifyFilter);
21fc0 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
21fd0 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  ODE..// #.....//
21fe0 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46 69   #else..alias Fi
21ff0 6e 64 46 69 72 73 74 43 68 61 6e 67 65 4e 6f 74  ndFirstChangeNot
22000 69 66 69 63 61 74 69 6f 6e 41 20 46 69 6e 64 46  ificationA FindF
22010 69 72 73 74 43 68 61 6e 67 65 4e 6f 74 69 66 69  irstChangeNotifi
22020 63 61 74 69 6f 6e 3b 0d 0a 2f 2f 20 23 65 6e 64  cation;..// #end
22030 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
22040 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
22050 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 46 69  ) export BOOL Fi
22060 6e 64 4e 65 78 74 43 68 61 6e 67 65 4e 6f 74 69  ndNextChangeNoti
22070 66 69 63 61 74 69 6f 6e 28 0d 0a 20 20 48 41 4e  fication(..  HAN
22080 44 4c 45 20 68 43 68 61 6e 67 65 48 61 6e 64 6c  DLE hChangeHandl
22090 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  e);....extern(Wi
220a0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
220b0 4f 4c 20 46 69 6e 64 43 6c 6f 73 65 43 68 61 6e  OL FindCloseChan
220c0 67 65 4e 6f 74 69 66 69 63 61 74 69 6f 6e 28 0d  geNotification(.
220d0 0a 20 20 48 41 4e 44 4c 45 20 68 43 68 61 6e 67  .  HANDLE hChang
220e0 65 48 61 6e 64 6c 65 29 3b 0d 0a 0d 0a 2f 2f 20  eHandle);....// 
220f0 23 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54  #if(_WIN32_WINNT
22100 20 3e 3d 20 30 78 30 34 30 30 29 0d 0a 65 78 74   >= 0x0400)..ext
22110 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
22120 6f 72 74 20 42 4f 4f 4c 20 52 65 61 64 44 69 72  ort BOOL ReadDir
22130 65 63 74 6f 72 79 43 68 61 6e 67 65 73 57 28 0d  ectoryChangesW(.
22140 0a 20 20 48 41 4e 44 4c 45 20 68 44 69 72 65 63  .  HANDLE hDirec
22150 74 6f 72 79 2c 0d 0a 20 20 4c 50 56 4f 49 44 20  tory,..  LPVOID 
22160 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 44 57 4f  lpBuffer,..  DWO
22170 52 44 20 6e 42 75 66 66 65 72 4c 65 6e 67 74 68  RD nBufferLength
22180 2c 0d 0a 20 20 42 4f 4f 4c 20 62 57 61 74 63 68  ,..  BOOL bWatch
22190 53 75 62 74 72 65 65 2c 0d 0a 20 20 44 57 4f 52  Subtree,..  DWOR
221a0 44 20 64 77 4e 6f 74 69 66 79 46 69 6c 74 65 72  D dwNotifyFilter
221b0 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 42  ,..  LPDWORD lpB
221c0 79 74 65 73 52 65 74 75 72 6e 65 64 2c 0d 0a 20  ytesReturned,.. 
221d0 20 4c 50 4f 56 45 52 4c 41 50 50 45 44 20 6c 70   LPOVERLAPPED lp
221e0 4f 76 65 72 6c 61 70 70 65 64 2c 0d 0a 20 20 4c  Overlapped,..  L
221f0 50 4f 56 45 52 4c 41 50 50 45 44 5f 43 4f 4d 50  POVERLAPPED_COMP
22200 4c 45 54 49 4f 4e 5f 52 4f 55 54 49 4e 45 20 6c  LETION_ROUTINE l
22210 70 43 6f 6d 70 6c 65 74 69 6f 6e 52 6f 75 74 69  pCompletionRouti
22220 6e 65 29 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  ne);..// #endif 
22230 2f 2a 20 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  /* _WIN32_WINNT 
22240 3e 3d 20 30 78 30 34 30 30 20 2a 2f 0d 0a 0d 0a  >= 0x0400 */....
22250 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
22260 65 78 70 6f 72 74 20 42 4f 4f 4c 20 56 69 72 74  export BOOL Virt
22270 75 61 6c 4c 6f 63 6b 28 0d 0a 20 20 4c 50 56 4f  ualLock(..  LPVO
22280 49 44 20 6c 70 41 64 64 72 65 73 73 2c 0d 0a 20  ID lpAddress,.. 
22290 20 53 49 5a 45 5f 54 20 64 77 53 69 7a 65 29 3b   SIZE_T dwSize);
222a0 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
222b0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
222c0 56 69 72 74 75 61 6c 55 6e 6c 6f 63 6b 28 0d 0a  VirtualUnlock(..
222d0 20 20 4c 50 56 4f 49 44 20 6c 70 41 64 64 72 65    LPVOID lpAddre
222e0 73 73 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 64 77  ss,..  SIZE_T dw
222f0 53 69 7a 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  Size);....extern
22300 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
22310 20 4c 50 56 4f 49 44 20 4d 61 70 56 69 65 77 4f   LPVOID MapViewO
22320 66 46 69 6c 65 45 78 28 0d 0a 20 20 48 41 4e 44  fFileEx(..  HAND
22330 4c 45 20 68 46 69 6c 65 4d 61 70 70 69 6e 67 4f  LE hFileMappingO
22340 62 6a 65 63 74 2c 0d 0a 20 20 44 57 4f 52 44 20  bject,..  DWORD 
22350 64 77 44 65 73 69 72 65 64 41 63 63 65 73 73 2c  dwDesiredAccess,
22360 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 69 6c 65  ..  DWORD dwFile
22370 4f 66 66 73 65 74 48 69 67 68 2c 0d 0a 20 20 44  OffsetHigh,..  D
22380 57 4f 52 44 20 64 77 46 69 6c 65 4f 66 66 73 65  WORD dwFileOffse
22390 74 4c 6f 77 2c 0d 0a 20 20 53 49 5a 45 5f 54 20  tLow,..  SIZE_T 
223a0 64 77 4e 75 6d 62 65 72 4f 66 42 79 74 65 73 54  dwNumberOfBytesT
223b0 6f 4d 61 70 2c 0d 0a 20 20 4c 50 56 4f 49 44 20  oMap,..  LPVOID 
223c0 6c 70 42 61 73 65 41 64 64 72 65 73 73 29 3b 0d  lpBaseAddress);.
223d0 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
223e0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
223f0 65 74 50 72 69 6f 72 69 74 79 43 6c 61 73 73 28  etPriorityClass(
22400 0d 0a 20 20 48 41 4e 44 4c 45 20 68 50 72 6f 63  ..  HANDLE hProc
22410 65 73 73 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77  ess,..  DWORD dw
22420 50 72 69 6f 72 69 74 79 43 6c 61 73 73 29 3b 0d  PriorityClass);.
22430 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
22440 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
22450 47 65 74 50 72 69 6f 72 69 74 79 43 6c 61 73 73  GetPriorityClass
22460 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 50 72 6f  (..  HANDLE hPro
22470 63 65 73 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  cess);....extern
22480 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
22490 20 42 4f 4f 4c 20 49 73 42 61 64 52 65 61 64 50   BOOL IsBadReadP
224a0 74 72 28 0d 0a 20 20 56 4f 49 44 20 2a 6c 70 2c  tr(..  VOID *lp,
224b0 0d 0a 20 20 55 49 4e 54 5f 50 54 52 20 75 63 62  ..  UINT_PTR ucb
224c0 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
224d0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
224e0 4c 20 49 73 42 61 64 57 72 69 74 65 50 74 72 28  L IsBadWritePtr(
224f0 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 2c 0d 0a  ..  LPVOID lp,..
22500 20 20 55 49 4e 54 5f 50 54 52 20 75 63 62 29 3b    UINT_PTR ucb);
22510 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
22520 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
22530 49 73 42 61 64 48 75 67 65 52 65 61 64 50 74 72  IsBadHugeReadPtr
22540 28 0d 0a 20 20 56 4f 49 44 20 2a 6c 70 2c 0d 0a  (..  VOID *lp,..
22550 20 20 55 49 4e 54 5f 50 54 52 20 75 63 62 29 3b    UINT_PTR ucb);
22560 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
22570 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
22580 49 73 42 61 64 48 75 67 65 57 72 69 74 65 50 74  IsBadHugeWritePt
22590 72 28 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 2c  r(..  LPVOID lp,
225a0 0d 0a 20 20 55 49 4e 54 5f 50 54 52 20 75 63 62  ..  UINT_PTR ucb
225b0 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
225c0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
225d0 4c 20 49 73 42 61 64 43 6f 64 65 50 74 72 28 0d  L IsBadCodePtr(.
225e0 0a 20 20 46 41 52 50 52 4f 43 20 6c 70 66 6e 29  .  FARPROC lpfn)
225f0 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
22600 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
22610 20 49 73 42 61 64 53 74 72 69 6e 67 50 74 72 41   IsBadStringPtrA
22620 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 73 7a  (..  LPCSTR lpsz
22630 2c 0d 0a 20 20 55 49 4e 54 5f 50 54 52 20 75 63  ,..  UINT_PTR uc
22640 63 68 4d 61 78 29 3b 0d 0a 65 78 74 65 72 6e 28  chMax);..extern(
22650 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
22660 42 4f 4f 4c 20 49 73 42 61 64 53 74 72 69 6e 67  BOOL IsBadString
22670 50 74 72 57 28 0d 0a 20 20 4c 50 43 57 53 54 52  PtrW(..  LPCWSTR
22680 20 6c 70 73 7a 2c 0d 0a 20 20 55 49 4e 54 5f 50   lpsz,..  UINT_P
22690 54 52 20 75 63 63 68 4d 61 78 29 3b 0d 0a 2f 2f  TR ucchMax);..//
226a0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
226b0 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
226c0 73 65 0d 0a 61 6c 69 61 73 20 49 73 42 61 64 53  se..alias IsBadS
226d0 74 72 69 6e 67 50 74 72 41 20 49 73 42 61 64 53  tringPtrA IsBadS
226e0 74 72 69 6e 67 50 74 72 3b 0d 0a 2f 2f 20 23 65  tringPtr;..// #e
226f0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
22700 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
22710 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
22720 4c 6f 6f 6b 75 70 41 63 63 6f 75 6e 74 53 69 64  LookupAccountSid
22730 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 53  A(..  LPCSTR lpS
22740 79 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 50 53  ystemName,..  PS
22750 49 44 20 53 69 64 2c 0d 0a 20 20 4c 50 53 54 52  ID Sid,..  LPSTR
22760 20 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52   Name,..  LPDWOR
22770 44 20 63 62 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53  D cbName,..  LPS
22780 54 52 20 52 65 66 65 72 65 6e 63 65 64 44 6f 6d  TR ReferencedDom
22790 61 69 6e 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 57  ainName,..  LPDW
227a0 4f 52 44 20 63 62 52 65 66 65 72 65 6e 63 65 64  ORD cbReferenced
227b0 44 6f 6d 61 69 6e 4e 61 6d 65 2c 0d 0a 20 20 50  DomainName,..  P
227c0 53 49 44 5f 4e 41 4d 45 5f 55 53 45 20 70 65 55  SID_NAME_USE peU
227d0 73 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  se);..extern(Win
227e0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
227f0 4c 20 4c 6f 6f 6b 75 70 41 63 63 6f 75 6e 74 53  L LookupAccountS
22800 69 64 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20  idW(..  LPCWSTR 
22810 6c 70 53 79 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20  lpSystemName,.. 
22820 20 50 53 49 44 20 53 69 64 2c 0d 0a 20 20 4c 50   PSID Sid,..  LP
22830 57 53 54 52 20 4e 61 6d 65 2c 0d 0a 20 20 4c 50  WSTR Name,..  LP
22840 44 57 4f 52 44 20 63 62 4e 61 6d 65 2c 0d 0a 20  DWORD cbName,.. 
22850 20 4c 50 57 53 54 52 20 52 65 66 65 72 65 6e 63   LPWSTR Referenc
22860 65 64 44 6f 6d 61 69 6e 4e 61 6d 65 2c 0d 0a 20  edDomainName,.. 
22870 20 4c 50 44 57 4f 52 44 20 63 62 52 65 66 65 72   LPDWORD cbRefer
22880 65 6e 63 65 64 44 6f 6d 61 69 6e 4e 61 6d 65 2c  encedDomainName,
22890 0d 0a 20 20 50 53 49 44 5f 4e 41 4d 45 5f 55 53  ..  PSID_NAME_US
228a0 45 20 70 65 55 73 65 29 3b 0d 0a 2f 2f 20 23 69  E peUse);..// #i
228b0 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
228c0 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
228d0 0a 61 6c 69 61 73 20 4c 6f 6f 6b 75 70 41 63 63  .alias LookupAcc
228e0 6f 75 6e 74 53 69 64 41 20 4c 6f 6f 6b 75 70 41  ountSidA LookupA
228f0 63 63 6f 75 6e 74 53 69 64 3b 0d 0a 2f 2f 20 23  ccountSid;..// #
22900 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
22910 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
22920 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
22930 20 4c 6f 6f 6b 75 70 41 63 63 6f 75 6e 74 4e 61   LookupAccountNa
22940 6d 65 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c  meA(..  LPCSTR l
22950 70 53 79 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20  pSystemName,..  
22960 4c 50 43 53 54 52 20 6c 70 41 63 63 6f 75 6e 74  LPCSTR lpAccount
22970 4e 61 6d 65 2c 0d 0a 20 20 50 53 49 44 20 53 69  Name,..  PSID Si
22980 64 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 63 62  d,..  LPDWORD cb
22990 53 69 64 2c 0d 0a 20 20 4c 50 53 54 52 20 52 65  Sid,..  LPSTR Re
229a0 66 65 72 65 6e 63 65 64 44 6f 6d 61 69 6e 4e 61  ferencedDomainNa
229b0 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 63  me,..  LPDWORD c
229c0 62 52 65 66 65 72 65 6e 63 65 64 44 6f 6d 61 69  bReferencedDomai
229d0 6e 4e 61 6d 65 2c 0d 0a 20 20 50 53 49 44 5f 4e  nName,..  PSID_N
229e0 41 4d 45 5f 55 53 45 20 70 65 55 73 65 29 3b 0d  AME_USE peUse);.
229f0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
22a00 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4c 6f 6f   export BOOL Loo
22a10 6b 75 70 41 63 63 6f 75 6e 74 4e 61 6d 65 57 28  kupAccountNameW(
22a20 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53 79  ..  LPCWSTR lpSy
22a30 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  stemName,..  LPC
22a40 57 53 54 52 20 6c 70 41 63 63 6f 75 6e 74 4e 61  WSTR lpAccountNa
22a50 6d 65 2c 0d 0a 20 20 50 53 49 44 20 53 69 64 2c  me,..  PSID Sid,
22a60 0d 0a 20 20 4c 50 44 57 4f 52 44 20 63 62 53 69  ..  LPDWORD cbSi
22a70 64 2c 0d 0a 20 20 4c 50 57 53 54 52 20 52 65 66  d,..  LPWSTR Ref
22a80 65 72 65 6e 63 65 64 44 6f 6d 61 69 6e 4e 61 6d  erencedDomainNam
22a90 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 63 62  e,..  LPDWORD cb
22aa0 52 65 66 65 72 65 6e 63 65 64 44 6f 6d 61 69 6e  ReferencedDomain
22ab0 4e 61 6d 65 2c 0d 0a 20 20 50 53 49 44 5f 4e 41  Name,..  PSID_NA
22ac0 4d 45 5f 55 53 45 20 70 65 55 73 65 29 3b 0d 0a  ME_USE peUse);..
22ad0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
22ae0 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
22af0 65 6c 73 65 0d 0a 61 6c 69 61 73 20 4c 6f 6f 6b  else..alias Look
22b00 75 70 41 63 63 6f 75 6e 74 4e 61 6d 65 41 20 4c  upAccountNameA L
22b10 6f 6f 6b 75 70 41 63 63 6f 75 6e 74 4e 61 6d 65  ookupAccountName
22b20 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
22b30 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65  !UNICODE....exte
22b40 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
22b50 72 74 20 42 4f 4f 4c 20 4c 6f 6f 6b 75 70 50 72  rt BOOL LookupPr
22b60 69 76 69 6c 65 67 65 56 61 6c 75 65 41 28 0d 0a  ivilegeValueA(..
22b70 20 20 4c 50 43 53 54 52 20 6c 70 53 79 73 74 65    LPCSTR lpSyste
22b80 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52  mName,..  LPCSTR
22b90 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 50 4c 55 49   lpName,..  PLUI
22ba0 44 20 6c 70 4c 75 69 64 29 3b 0d 0a 65 78 74 65  D lpLuid);..exte
22bb0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
22bc0 72 74 20 42 4f 4f 4c 20 4c 6f 6f 6b 75 70 50 72  rt BOOL LookupPr
22bd0 69 76 69 6c 65 67 65 56 61 6c 75 65 57 28 0d 0a  ivilegeValueW(..
22be0 20 20 4c 50 43 57 53 54 52 20 6c 70 53 79 73 74    LPCWSTR lpSyst
22bf0 65 6d 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53  emName,..  LPCWS
22c00 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 50 4c  TR lpName,..  PL
22c10 55 49 44 20 6c 70 4c 75 69 64 29 3b 0d 0a 2f 2f  UID lpLuid);..//
22c20 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
22c30 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
22c40 73 65 0d 0a 61 6c 69 61 73 20 4c 6f 6f 6b 75 70  se..alias Lookup
22c50 50 72 69 76 69 6c 65 67 65 56 61 6c 75 65 41 20  PrivilegeValueA 
22c60 4c 6f 6f 6b 75 70 50 72 69 76 69 6c 65 67 65 56  LookupPrivilegeV
22c70 61 6c 75 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  alue;..// #endif
22c80 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
22c90 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
22ca0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4c 6f 6f 6b  export BOOL Look
22cb0 75 70 50 72 69 76 69 6c 65 67 65 4e 61 6d 65 41  upPrivilegeNameA
22cc0 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 79  (..  LPCSTR lpSy
22cd0 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 50 4c 55  stemName,..  PLU
22ce0 49 44 20 6c 70 4c 75 69 64 2c 0d 0a 20 20 4c 50  ID lpLuid,..  LP
22cf0 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 4c  STR lpName,..  L
22d00 50 44 57 4f 52 44 20 63 62 4e 61 6d 65 29 3b 0d  PDWORD cbName);.
22d10 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
22d20 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4c 6f 6f   export BOOL Loo
22d30 6b 75 70 50 72 69 76 69 6c 65 67 65 4e 61 6d 65  kupPrivilegeName
22d40 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  W(..  LPCWSTR lp
22d50 53 79 73 74 65 6d 4e 61 6d 65 2c 0d 0a 20 20 50  SystemName,..  P
22d60 4c 55 49 44 20 6c 70 4c 75 69 64 2c 0d 0a 20 20  LUID lpLuid,..  
22d70 4c 50 57 53 54 52 20 6c 70 4e 61 6d 65 2c 0d 0a  LPWSTR lpName,..
22d80 20 20 4c 50 44 57 4f 52 44 20 63 62 4e 61 6d 65    LPDWORD cbName
22d90 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
22da0 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
22db0 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
22dc0 4c 6f 6f 6b 75 70 50 72 69 76 69 6c 65 67 65 4e  LookupPrivilegeN
22dd0 61 6d 65 41 20 4c 6f 6f 6b 75 70 50 72 69 76 69  ameA LookupPrivi
22de0 6c 65 67 65 4e 61 6d 65 3b 0d 0a 2f 2f 20 23 65  legeName;..// #e
22df0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
22e00 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
22e10 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
22e20 4c 6f 6f 6b 75 70 50 72 69 76 69 6c 65 67 65 44  LookupPrivilegeD
22e30 69 73 70 6c 61 79 4e 61 6d 65 41 28 0d 0a 20 20  isplayNameA(..  
22e40 4c 50 43 53 54 52 20 6c 70 53 79 73 74 65 6d 4e  LPCSTR lpSystemN
22e50 61 6d 65 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  ame,..  LPCSTR l
22e60 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 54 52 20  pName,..  LPSTR 
22e70 6c 70 44 69 73 70 6c 61 79 4e 61 6d 65 2c 0d 0a  lpDisplayName,..
22e80 20 20 4c 50 44 57 4f 52 44 20 63 62 44 69 73 70    LPDWORD cbDisp
22e90 6c 61 79 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 57  layName,..  LPDW
22ea0 4f 52 44 20 6c 70 4c 61 6e 67 75 61 67 65 49 64  ORD lpLanguageId
22eb0 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
22ec0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
22ed0 4c 6f 6f 6b 75 70 50 72 69 76 69 6c 65 67 65 44  LookupPrivilegeD
22ee0 69 73 70 6c 61 79 4e 61 6d 65 57 28 0d 0a 20 20  isplayNameW(..  
22ef0 4c 50 43 57 53 54 52 20 6c 70 53 79 73 74 65 6d  LPCWSTR lpSystem
22f00 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52  Name,..  LPCWSTR
22f10 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53   lpName,..  LPWS
22f20 54 52 20 6c 70 44 69 73 70 6c 61 79 4e 61 6d 65  TR lpDisplayName
22f30 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 63 62 44  ,..  LPDWORD cbD
22f40 69 73 70 6c 61 79 4e 61 6d 65 2c 0d 0a 20 20 4c  isplayName,..  L
22f50 50 44 57 4f 52 44 20 6c 70 4c 61 6e 67 75 61 67  PDWORD lpLanguag
22f60 65 49 64 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  eId);..// #ifdef
22f70 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
22f80 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
22f90 61 73 20 4c 6f 6f 6b 75 70 50 72 69 76 69 6c 65  as LookupPrivile
22fa0 67 65 44 69 73 70 6c 61 79 4e 61 6d 65 41 20 4c  geDisplayNameA L
22fb0 6f 6f 6b 75 70 50 72 69 76 69 6c 65 67 65 44 69  ookupPrivilegeDi
22fc0 73 70 6c 61 79 4e 61 6d 65 3b 0d 0a 2f 2f 20 23  splayName;..// #
22fd0 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
22fe0 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
22ff0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
23000 20 41 6c 6c 6f 63 61 74 65 4c 6f 63 61 6c 6c 79   AllocateLocally
23010 55 6e 69 71 75 65 49 64 28 0d 0a 20 20 50 4c 55  UniqueId(..  PLU
23020 49 44 20 4c 75 69 64 29 3b 0d 0a 0d 0a 65 78 74  ID Luid);....ext
23030 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
23040 6f 72 74 20 42 4f 4f 4c 20 42 75 69 6c 64 43 6f  ort BOOL BuildCo
23050 6d 6d 44 43 42 41 28 0d 0a 20 20 4c 50 43 53 54  mmDCBA(..  LPCST
23060 52 20 6c 70 44 65 66 2c 0d 0a 20 20 4c 50 44 43  R lpDef,..  LPDC
23070 42 20 6c 70 44 43 42 29 3b 0d 0a 65 78 74 65 72  B lpDCB);..exter
23080 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
23090 74 20 42 4f 4f 4c 20 42 75 69 6c 64 43 6f 6d 6d  t BOOL BuildComm
230a0 44 43 42 57 28 0d 0a 20 20 4c 50 43 57 53 54 52  DCBW(..  LPCWSTR
230b0 20 6c 70 44 65 66 2c 0d 0a 20 20 4c 50 44 43 42   lpDef,..  LPDCB
230c0 20 6c 70 44 43 42 29 3b 0d 0a 2f 2f 20 23 69 66   lpDCB);..// #if
230d0 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
230e0 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
230f0 61 6c 69 61 73 20 42 75 69 6c 64 43 6f 6d 6d 44  alias BuildCommD
23100 43 42 41 20 42 75 69 6c 64 43 6f 6d 6d 44 43 42  CBA BuildCommDCB
23110 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
23120 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65  !UNICODE....exte
23130 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
23140 72 74 20 42 4f 4f 4c 20 42 75 69 6c 64 43 6f 6d  rt BOOL BuildCom
23150 6d 44 43 42 41 6e 64 54 69 6d 65 6f 75 74 73 41  mDCBAndTimeoutsA
23160 28 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 44 65  (..  LPCSTR lpDe
23170 66 2c 0d 0a 20 20 4c 50 44 43 42 20 6c 70 44 43  f,..  LPDCB lpDC
23180 42 2c 0d 0a 20 20 4c 50 43 4f 4d 4d 54 49 4d 45  B,..  LPCOMMTIME
23190 4f 55 54 53 20 6c 70 43 6f 6d 6d 54 69 6d 65 6f  OUTS lpCommTimeo
231a0 75 74 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  uts);..extern(Wi
231b0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
231c0 4f 4c 20 42 75 69 6c 64 43 6f 6d 6d 44 43 42 41  OL BuildCommDCBA
231d0 6e 64 54 69 6d 65 6f 75 74 73 57 28 0d 0a 20 20  ndTimeoutsW(..  
231e0 4c 50 43 57 53 54 52 20 6c 70 44 65 66 2c 0d 0a  LPCWSTR lpDef,..
231f0 20 20 4c 50 44 43 42 20 6c 70 44 43 42 2c 0d 0a    LPDCB lpDCB,..
23200 20 20 4c 50 43 4f 4d 4d 54 49 4d 45 4f 55 54 53    LPCOMMTIMEOUTS
23210 20 6c 70 43 6f 6d 6d 54 69 6d 65 6f 75 74 73 29   lpCommTimeouts)
23220 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
23230 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
23240 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 42  / #else..alias B
23250 75 69 6c 64 43 6f 6d 6d 44 43 42 41 6e 64 54 69  uildCommDCBAndTi
23260 6d 65 6f 75 74 73 41 20 42 75 69 6c 64 43 6f 6d  meoutsA BuildCom
23270 6d 44 43 42 41 6e 64 54 69 6d 65 6f 75 74 73 3b  mDCBAndTimeouts;
23280 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
23290 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
232a0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
232b0 74 20 42 4f 4f 4c 20 43 6f 6d 6d 43 6f 6e 66 69  t BOOL CommConfi
232c0 67 44 69 61 6c 6f 67 41 28 0d 0a 20 20 4c 50 43  gDialogA(..  LPC
232d0 53 54 52 20 6c 70 73 7a 4e 61 6d 65 2c 0d 0a 20  STR lpszName,.. 
232e0 20 48 57 4e 44 20 68 57 6e 64 2c 0d 0a 20 20 4c   HWND hWnd,..  L
232f0 50 43 4f 4d 4d 43 4f 4e 46 49 47 20 6c 70 43 43  PCOMMCONFIG lpCC
23300 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
23310 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
23320 43 6f 6d 6d 43 6f 6e 66 69 67 44 69 61 6c 6f 67  CommConfigDialog
23330 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  W(..  LPCWSTR lp
23340 73 7a 4e 61 6d 65 2c 0d 0a 20 20 48 57 4e 44 20  szName,..  HWND 
23350 68 57 6e 64 2c 0d 0a 20 20 4c 50 43 4f 4d 4d 43  hWnd,..  LPCOMMC
23360 4f 4e 46 49 47 20 6c 70 43 43 29 3b 0d 0a 2f 2f  ONFIG lpCC);..//
23370 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
23380 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
23390 73 65 0d 0a 61 6c 69 61 73 20 43 6f 6d 6d 43 6f  se..alias CommCo
233a0 6e 66 69 67 44 69 61 6c 6f 67 41 20 43 6f 6d 6d  nfigDialogA Comm
233b0 43 6f 6e 66 69 67 44 69 61 6c 6f 67 3b 0d 0a 2f  ConfigDialog;../
233c0 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
233d0 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
233e0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
233f0 4f 4f 4c 20 47 65 74 44 65 66 61 75 6c 74 43 6f  OOL GetDefaultCo
23400 6d 6d 43 6f 6e 66 69 67 41 28 0d 0a 20 20 4c 50  mmConfigA(..  LP
23410 43 53 54 52 20 6c 70 73 7a 4e 61 6d 65 2c 0d 0a  CSTR lpszName,..
23420 20 20 4c 50 43 4f 4d 4d 43 4f 4e 46 49 47 20 6c    LPCOMMCONFIG l
23430 70 43 43 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  pCC,..  LPDWORD 
23440 6c 70 64 77 53 69 7a 65 29 3b 0d 0a 65 78 74 65  lpdwSize);..exte
23450 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
23460 72 74 20 42 4f 4f 4c 20 47 65 74 44 65 66 61 75  rt BOOL GetDefau
23470 6c 74 43 6f 6d 6d 43 6f 6e 66 69 67 57 28 0d 0a  ltCommConfigW(..
23480 20 20 4c 50 43 57 53 54 52 20 6c 70 73 7a 4e 61    LPCWSTR lpszNa
23490 6d 65 2c 0d 0a 20 20 4c 50 43 4f 4d 4d 43 4f 4e  me,..  LPCOMMCON
234a0 46 49 47 20 6c 70 43 43 2c 0d 0a 20 20 4c 50 44  FIG lpCC,..  LPD
234b0 57 4f 52 44 20 6c 70 64 77 53 69 7a 65 29 3b 0d  WORD lpdwSize);.
234c0 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
234d0 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
234e0 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74  #else..alias Get
234f0 44 65 66 61 75 6c 74 43 6f 6d 6d 43 6f 6e 66 69  DefaultCommConfi
23500 67 41 20 47 65 74 44 65 66 61 75 6c 74 43 6f 6d  gA GetDefaultCom
23510 6d 43 6f 6e 66 69 67 3b 0d 0a 2f 2f 20 23 65 6e  mConfig;..// #en
23520 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
23530 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
23540 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
23550 65 74 44 65 66 61 75 6c 74 43 6f 6d 6d 43 6f 6e  etDefaultCommCon
23560 66 69 67 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  figA(..  LPCSTR 
23570 6c 70 73 7a 4e 61 6d 65 2c 0d 0a 20 20 4c 50 43  lpszName,..  LPC
23580 4f 4d 4d 43 4f 4e 46 49 47 20 6c 70 43 43 2c 0d  OMMCONFIG lpCC,.
23590 0a 20 20 44 57 4f 52 44 20 64 77 53 69 7a 65 29  .  DWORD dwSize)
235a0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
235b0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
235c0 65 74 44 65 66 61 75 6c 74 43 6f 6d 6d 43 6f 6e  etDefaultCommCon
235d0 66 69 67 57 28 0d 0a 20 20 4c 50 43 57 53 54 52  figW(..  LPCWSTR
235e0 20 6c 70 73 7a 4e 61 6d 65 2c 0d 0a 20 20 4c 50   lpszName,..  LP
235f0 43 4f 4d 4d 43 4f 4e 46 49 47 20 6c 70 43 43 2c  COMMCONFIG lpCC,
23600 0d 0a 20 20 44 57 4f 52 44 20 64 77 53 69 7a 65  ..  DWORD dwSize
23610 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
23620 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
23630 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
23640 53 65 74 44 65 66 61 75 6c 74 43 6f 6d 6d 43 6f  SetDefaultCommCo
23650 6e 66 69 67 41 20 53 65 74 44 65 66 61 75 6c 74  nfigA SetDefault
23660 43 6f 6d 6d 43 6f 6e 66 69 67 3b 0d 0a 2f 2f 20  CommConfig;..// 
23670 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
23680 44 45 0d 0a 0d 0a 2f 2f 20 23 69 66 6e 64 65 66  DE....// #ifndef
23690 20 5f 4d 41 43 0d 0a 65 6e 75 6d 20 3a 20 75 69   _MAC..enum : ui
236a0 6e 74 20 7b 20 4d 41 58 5f 43 4f 4d 50 55 54 45  nt { MAX_COMPUTE
236b0 52 4e 41 4d 45 5f 4c 45 4e 47 54 48 20 3d 20 31  RNAME_LENGTH = 1
236c0 35 20 7d 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f  5 }..// #else../
236d0 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69  / #.....// #endi
236e0 66 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  f....extern(Wind
236f0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
23700 20 47 65 74 43 6f 6d 70 75 74 65 72 4e 61 6d 65   GetComputerName
23710 41 28 0d 0a 20 20 4c 50 53 54 52 20 6c 70 42 75  A(..  LPSTR lpBu
23720 66 66 65 72 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  ffer,..  LPDWORD
23730 20 6e 53 69 7a 65 29 3b 0d 0a 65 78 74 65 72 6e   nSize);..extern
23740 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
23750 20 42 4f 4f 4c 20 47 65 74 43 6f 6d 70 75 74 65   BOOL GetCompute
23760 72 4e 61 6d 65 57 28 0d 0a 20 20 4c 50 57 53 54  rNameW(..  LPWST
23770 52 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 4c  R lpBuffer,..  L
23780 50 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b 0d 0a  PDWORD nSize);..
23790 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
237a0 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
237b0 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 43  else..alias GetC
237c0 6f 6d 70 75 74 65 72 4e 61 6d 65 41 20 47 65 74  omputerNameA Get
237d0 43 6f 6d 70 75 74 65 72 4e 61 6d 65 3b 0d 0a 2f  ComputerName;../
237e0 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
237f0 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
23800 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
23810 4f 4f 4c 20 53 65 74 43 6f 6d 70 75 74 65 72 4e  OOL SetComputerN
23820 61 6d 65 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  ameA(..  LPCSTR 
23830 6c 70 43 6f 6d 70 75 74 65 72 4e 61 6d 65 29 3b  lpComputerName);
23840 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
23850 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53 65  ) export BOOL Se
23860 74 43 6f 6d 70 75 74 65 72 4e 61 6d 65 57 28 0d  tComputerNameW(.
23870 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 43 6f 6d  .  LPCWSTR lpCom
23880 70 75 74 65 72 4e 61 6d 65 29 3b 0d 0a 2f 2f 20  puterName);..// 
23890 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a  #ifdef UNICODE..
238a0 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73  // #.....// #els
238b0 65 0d 0a 61 6c 69 61 73 20 53 65 74 43 6f 6d 70  e..alias SetComp
238c0 75 74 65 72 4e 61 6d 65 41 20 53 65 74 43 6f 6d  uterNameA SetCom
238d0 70 75 74 65 72 4e 61 6d 65 3b 0d 0a 2f 2f 20 23  puterName;..// #
238e0 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44  endif // !UNICOD
238f0 45 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f 57 49  E....// #if (_WI
23900 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30  N32_WINNT >= 0x0
23910 35 30 30 29 0d 0a 0d 0a 61 6c 69 61 73 20 69 6e  500)....alias in
23920 74 20 5f 43 4f 4d 50 55 54 45 52 5f 4e 41 4d 45  t _COMPUTER_NAME
23930 5f 46 4f 52 4d 41 54 3b 0d 0a 65 6e 75 6d 20 7b  _FORMAT;..enum {
23940 0d 0a 20 20 43 6f 6d 70 75 74 65 72 4e 61 6d 65  ..  ComputerName
23950 4e 65 74 42 49 4f 53 2c 0d 0a 20 20 43 6f 6d 70  NetBIOS,..  Comp
23960 75 74 65 72 4e 61 6d 65 44 6e 73 48 6f 73 74 6e  uterNameDnsHostn
23970 61 6d 65 2c 0d 0a 20 20 43 6f 6d 70 75 74 65 72  ame,..  Computer
23980 4e 61 6d 65 44 6e 73 44 6f 6d 61 69 6e 2c 0d 0a  NameDnsDomain,..
23990 20 20 43 6f 6d 70 75 74 65 72 4e 61 6d 65 44 6e    ComputerNameDn
239a0 73 46 75 6c 6c 79 51 75 61 6c 69 66 69 65 64 2c  sFullyQualified,
239b0 0d 0a 20 20 43 6f 6d 70 75 74 65 72 4e 61 6d 65  ..  ComputerName
239c0 50 68 79 73 69 63 61 6c 4e 65 74 42 49 4f 53 2c  PhysicalNetBIOS,
239d0 0d 0a 20 20 43 6f 6d 70 75 74 65 72 4e 61 6d 65  ..  ComputerName
239e0 50 68 79 73 69 63 61 6c 44 6e 73 48 6f 73 74 6e  PhysicalDnsHostn
239f0 61 6d 65 2c 0d 0a 20 20 43 6f 6d 70 75 74 65 72  ame,..  Computer
23a00 4e 61 6d 65 50 68 79 73 69 63 61 6c 44 6e 73 44  NamePhysicalDnsD
23a10 6f 6d 61 69 6e 2c 0d 0a 20 20 43 6f 6d 70 75 74  omain,..  Comput
23a20 65 72 4e 61 6d 65 50 68 79 73 69 63 61 6c 44 6e  erNamePhysicalDn
23a30 73 46 75 6c 6c 79 51 75 61 6c 69 66 69 65 64 2c  sFullyQualified,
23a40 0d 0a 20 20 43 6f 6d 70 75 74 65 72 4e 61 6d 65  ..  ComputerName
23a50 4d 61 78 2c 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f  Max,..}..alias _
23a60 43 4f 4d 50 55 54 45 52 5f 4e 41 4d 45 5f 46 4f  COMPUTER_NAME_FO
23a70 52 4d 41 54 20 43 4f 4d 50 55 54 45 52 5f 4e 41  RMAT COMPUTER_NA
23a80 4d 45 5f 46 4f 52 4d 41 54 3b 0d 0a 0d 0a 65 78  ME_FORMAT;....ex
23a90 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
23aa0 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 43 6f 6d  port BOOL GetCom
23ab0 70 75 74 65 72 4e 61 6d 65 45 78 41 28 0d 0a 20  puterNameExA(.. 
23ac0 20 43 4f 4d 50 55 54 45 52 5f 4e 41 4d 45 5f 46   COMPUTER_NAME_F
23ad0 4f 52 4d 41 54 20 4e 61 6d 65 54 79 70 65 2c 0d  ORMAT NameType,.
23ae0 0a 20 20 4c 50 53 54 52 20 6c 70 42 75 66 66 65  .  LPSTR lpBuffe
23af0 72 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6e 53  r,..  LPDWORD nS
23b00 69 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ize);..extern(Wi
23b10 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
23b20 4f 4c 20 47 65 74 43 6f 6d 70 75 74 65 72 4e 61  OL GetComputerNa
23b30 6d 65 45 78 57 28 0d 0a 20 20 43 4f 4d 50 55 54  meExW(..  COMPUT
23b40 45 52 5f 4e 41 4d 45 5f 46 4f 52 4d 41 54 20 4e  ER_NAME_FORMAT N
23b50 61 6d 65 54 79 70 65 2c 0d 0a 20 20 4c 50 57 53  ameType,..  LPWS
23b60 54 52 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20  TR lpBuffer,..  
23b70 4c 50 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b 0d  LPDWORD nSize);.
23b80 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
23b90 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
23ba0 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74  #else..alias Get
23bb0 43 6f 6d 70 75 74 65 72 4e 61 6d 65 45 78 41 20  ComputerNameExA 
23bc0 47 65 74 43 6f 6d 70 75 74 65 72 4e 61 6d 65 45  GetComputerNameE
23bd0 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  x;..// #endif //
23be0 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
23bf0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
23c00 6f 72 74 20 42 4f 4f 4c 20 53 65 74 43 6f 6d 70  ort BOOL SetComp
23c10 75 74 65 72 4e 61 6d 65 45 78 41 28 0d 0a 20 20  uterNameExA(..  
23c20 43 4f 4d 50 55 54 45 52 5f 4e 41 4d 45 5f 46 4f  COMPUTER_NAME_FO
23c30 52 4d 41 54 20 4e 61 6d 65 54 79 70 65 2c 0d 0a  RMAT NameType,..
23c40 20 20 4c 50 43 53 54 52 20 6c 70 42 75 66 66 65    LPCSTR lpBuffe
23c50 72 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  r);..extern(Wind
23c60 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
23c70 20 53 65 74 43 6f 6d 70 75 74 65 72 4e 61 6d 65   SetComputerName
23c80 45 78 57 28 0d 0a 20 20 43 4f 4d 50 55 54 45 52  ExW(..  COMPUTER
23c90 5f 4e 41 4d 45 5f 46 4f 52 4d 41 54 20 4e 61 6d  _NAME_FORMAT Nam
23ca0 65 54 79 70 65 2c 0d 0a 20 20 4c 50 43 57 53 54  eType,..  LPCWST
23cb0 52 20 6c 70 42 75 66 66 65 72 29 3b 0d 0a 2f 2f  R lpBuffer);..//
23cc0 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
23cd0 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
23ce0 73 65 0d 0a 61 6c 69 61 73 20 53 65 74 43 6f 6d  se..alias SetCom
23cf0 70 75 74 65 72 4e 61 6d 65 45 78 41 20 53 65 74  puterNameExA Set
23d00 43 6f 6d 70 75 74 65 72 4e 61 6d 65 45 78 3b 0d  ComputerNameEx;.
23d10 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
23d20 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
23d30 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
23d40 20 44 57 4f 52 44 20 41 64 64 4c 6f 63 61 6c 41   DWORD AddLocalA
23d50 6c 74 65 72 6e 61 74 65 43 6f 6d 70 75 74 65 72  lternateComputer
23d60 4e 61 6d 65 41 28 0d 0a 20 20 4c 50 43 53 54 52  NameA(..  LPCSTR
23d70 20 6c 70 44 6e 73 46 51 48 6f 73 74 6e 61 6d 65   lpDnsFQHostname
23d80 2c 0d 0a 20 20 55 4c 4f 4e 47 20 75 6c 46 6c 61  ,..  ULONG ulFla
23d90 67 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  gs);..extern(Win
23da0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f  dows) export DWO
23db0 52 44 20 41 64 64 4c 6f 63 61 6c 41 6c 74 65 72  RD AddLocalAlter
23dc0 6e 61 74 65 43 6f 6d 70 75 74 65 72 4e 61 6d 65  nateComputerName
23dd0 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  W(..  LPCWSTR lp
23de0 44 6e 73 46 51 48 6f 73 74 6e 61 6d 65 2c 0d 0a  DnsFQHostname,..
23df0 20 20 55 4c 4f 4e 47 20 75 6c 46 6c 61 67 73 29    ULONG ulFlags)
23e00 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
23e10 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
23e20 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 41  / #else..alias A
23e30 64 64 4c 6f 63 61 6c 41 6c 74 65 72 6e 61 74 65  ddLocalAlternate
23e40 43 6f 6d 70 75 74 65 72 4e 61 6d 65 41 20 41 64  ComputerNameA Ad
23e50 64 4c 6f 63 61 6c 41 6c 74 65 72 6e 61 74 65 43  dLocalAlternateC
23e60 6f 6d 70 75 74 65 72 4e 61 6d 65 3b 0d 0a 2f 2f  omputerName;..//
23e70 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
23e80 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
23e90 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57  ndows) export DW
23ea0 4f 52 44 20 52 65 6d 6f 76 65 4c 6f 63 61 6c 41  ORD RemoveLocalA
23eb0 6c 74 65 72 6e 61 74 65 43 6f 6d 70 75 74 65 72  lternateComputer
23ec0 4e 61 6d 65 41 28 0d 0a 20 20 4c 50 43 53 54 52  NameA(..  LPCSTR
23ed0 20 6c 70 41 6c 74 44 6e 73 46 51 48 6f 73 74 6e   lpAltDnsFQHostn
23ee0 61 6d 65 2c 0d 0a 20 20 55 4c 4f 4e 47 20 75 6c  ame,..  ULONG ul
23ef0 46 6c 61 67 73 29 3b 0d 0a 65 78 74 65 72 6e 28  Flags);..extern(
23f00 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
23f10 44 57 4f 52 44 20 52 65 6d 6f 76 65 4c 6f 63 61  DWORD RemoveLoca
23f20 6c 41 6c 74 65 72 6e 61 74 65 43 6f 6d 70 75 74  lAlternateComput
23f30 65 72 4e 61 6d 65 57 28 0d 0a 20 20 4c 50 43 57  erNameW(..  LPCW
23f40 53 54 52 20 6c 70 41 6c 74 44 6e 73 46 51 48 6f  STR lpAltDnsFQHo
23f50 73 74 6e 61 6d 65 2c 0d 0a 20 20 55 4c 4f 4e 47  stname,..  ULONG
23f60 20 75 6c 46 6c 61 67 73 29 3b 0d 0a 2f 2f 20 23   ulFlags);..// #
23f70 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
23f80 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  / #.....// #else
23f90 0d 0a 61 6c 69 61 73 20 52 65 6d 6f 76 65 4c 6f  ..alias RemoveLo
23fa0 63 61 6c 41 6c 74 65 72 6e 61 74 65 43 6f 6d 70  calAlternateComp
23fb0 75 74 65 72 4e 61 6d 65 41 20 52 65 6d 6f 76 65  uterNameA Remove
23fc0 4c 6f 63 61 6c 41 6c 74 65 72 6e 61 74 65 43 6f  LocalAlternateCo
23fd0 6d 70 75 74 65 72 4e 61 6d 65 3b 0d 0a 2f 2f 20  mputerName;..// 
23fe0 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f  #endif // !UNICO
23ff0 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  DE....extern(Win
24000 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44 57 4f  dows) export DWO
24010 52 44 20 53 65 74 4c 6f 63 61 6c 50 72 69 6d 61  RD SetLocalPrima
24020 72 79 43 6f 6d 70 75 74 65 72 4e 61 6d 65 41 28  ryComputerNameA(
24030 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 41 6c 74  ..  LPCSTR lpAlt
24040 44 6e 73 46 51 48 6f 73 74 6e 61 6d 65 2c 0d 0a  DnsFQHostname,..
24050 20 20 55 4c 4f 4e 47 20 75 6c 46 6c 61 67 73 29    ULONG ulFlags)
24060 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
24070 73 29 20 65 78 70 6f 72 74 20 44 57 4f 52 44 20  s) export DWORD 
24080 53 65 74 4c 6f 63 61 6c 50 72 69 6d 61 72 79 43  SetLocalPrimaryC
24090 6f 6d 70 75 74 65 72 4e 61 6d 65 57 28 0d 0a 20  omputerNameW(.. 
240a0 20 4c 50 43 57 53 54 52 20 6c 70 41 6c 74 44 6e   LPCWSTR lpAltDn
240b0 73 46 51 48 6f 73 74 6e 61 6d 65 2c 0d 0a 20 20  sFQHostname,..  
240c0 55 4c 4f 4e 47 20 75 6c 46 6c 61 67 73 29 3b 0d  ULONG ulFlags);.
240d0 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
240e0 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20  DE..// #.....// 
240f0 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 53 65 74  #else..alias Set
24100 4c 6f 63 61 6c 50 72 69 6d 61 72 79 43 6f 6d 70  LocalPrimaryComp
24110 75 74 65 72 4e 61 6d 65 41 20 53 65 74 4c 6f 63  uterNameA SetLoc
24120 61 6c 50 72 69 6d 61 72 79 43 6f 6d 70 75 74 65  alPrimaryCompute
24130 72 4e 61 6d 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69  rName;..// #endi
24140 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
24150 0a 61 6c 69 61 73 20 69 6e 74 20 5f 43 4f 4d 50  .alias int _COMP
24160 55 54 45 52 5f 4e 41 4d 45 5f 54 59 50 45 3b 0d  UTER_NAME_TYPE;.
24170 0a 65 6e 75 6d 20 7b 0d 0a 20 20 50 72 69 6d 61  .enum {..  Prima
24180 72 79 43 6f 6d 70 75 74 65 72 4e 61 6d 65 2c 0d  ryComputerName,.
24190 0a 20 20 41 6c 74 65 72 6e 61 74 65 43 6f 6d 70  .  AlternateComp
241a0 75 74 65 72 4e 61 6d 65 73 2c 0d 0a 20 20 41 6c  uterNames,..  Al
241b0 6c 43 6f 6d 70 75 74 65 72 4e 61 6d 65 73 2c 0d  lComputerNames,.
241c0 0a 20 20 43 6f 6d 70 75 74 65 72 4e 61 6d 65 54  .  ComputerNameT
241d0 79 70 65 4d 61 78 2c 0d 0a 7d 0d 0a 61 6c 69 61  ypeMax,..}..alia
241e0 73 20 5f 43 4f 4d 50 55 54 45 52 5f 4e 41 4d 45  s _COMPUTER_NAME
241f0 5f 54 59 50 45 20 43 4f 4d 50 55 54 45 52 5f 4e  _TYPE COMPUTER_N
24200 41 4d 45 5f 54 59 50 45 3b 0d 0a 0d 0a 65 78 74  AME_TYPE;....ext
24210 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
24220 6f 72 74 20 44 57 4f 52 44 20 45 6e 75 6d 65 72  ort DWORD Enumer
24230 61 74 65 4c 6f 63 61 6c 43 6f 6d 70 75 74 65 72  ateLocalComputer
24240 4e 61 6d 65 73 41 28 0d 0a 20 20 43 4f 4d 50 55  NamesA(..  COMPU
24250 54 45 52 5f 4e 41 4d 45 5f 54 59 50 45 20 4e 61  TER_NAME_TYPE Na
24260 6d 65 54 79 70 65 2c 0d 0a 20 20 55 4c 4f 4e 47  meType,..  ULONG
24270 20 75 6c 46 6c 61 67 73 2c 0d 0a 20 20 4c 50 53   ulFlags,..  LPS
24280 54 52 20 6c 70 44 6e 73 46 51 48 6f 73 74 6e 61  TR lpDnsFQHostna
24290 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6e  me,..  LPDWORD n
242a0 53 69 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57  Size);..extern(W
242b0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 44  indows) export D
242c0 57 4f 52 44 20 45 6e 75 6d 65 72 61 74 65 4c 6f  WORD EnumerateLo
242d0 63 61 6c 43 6f 6d 70 75 74 65 72 4e 61 6d 65 73  calComputerNames
242e0 57 28 0d 0a 20 20 43 4f 4d 50 55 54 45 52 5f 4e  W(..  COMPUTER_N
242f0 41 4d 45 5f 54 59 50 45 20 4e 61 6d 65 54 79 70  AME_TYPE NameTyp
24300 65 2c 0d 0a 20 20 55 4c 4f 4e 47 20 75 6c 46 6c  e,..  ULONG ulFl
24310 61 67 73 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c  ags,..  LPWSTR l
24320 70 44 6e 73 46 51 48 6f 73 74 6e 61 6d 65 2c 0d  pDnsFQHostname,.
24330 0a 20 20 4c 50 44 57 4f 52 44 20 6e 53 69 7a 65  .  LPDWORD nSize
24340 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
24350 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
24360 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
24370 45 6e 75 6d 65 72 61 74 65 4c 6f 63 61 6c 43 6f  EnumerateLocalCo
24380 6d 70 75 74 65 72 4e 61 6d 65 73 41 20 45 6e 75  mputerNamesA Enu
24390 6d 65 72 61 74 65 4c 6f 63 61 6c 43 6f 6d 70 75  merateLocalCompu
243a0 74 65 72 4e 61 6d 65 73 3b 0d 0a 2f 2f 20 23 65  terNames;..// #e
243b0 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
243c0 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
243d0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
243e0 44 6e 73 48 6f 73 74 6e 61 6d 65 54 6f 43 6f 6d  DnsHostnameToCom
243f0 70 75 74 65 72 4e 61 6d 65 41 28 0d 0a 20 20 4c  puterNameA(..  L
24400 50 43 53 54 52 20 48 6f 73 74 6e 61 6d 65 2c 0d  PCSTR Hostname,.
24410 0a 20 20 4c 50 53 54 52 20 43 6f 6d 70 75 74 65  .  LPSTR Compute
24420 72 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52  rName,..  LPDWOR
24430 44 20 6e 53 69 7a 65 29 3b 0d 0a 65 78 74 65 72  D nSize);..exter
24440 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
24450 74 20 42 4f 4f 4c 20 44 6e 73 48 6f 73 74 6e 61  t BOOL DnsHostna
24460 6d 65 54 6f 43 6f 6d 70 75 74 65 72 4e 61 6d 65  meToComputerName
24470 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 48 6f  W(..  LPCWSTR Ho
24480 73 74 6e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53 54  stname,..  LPWST
24490 52 20 43 6f 6d 70 75 74 65 72 4e 61 6d 65 2c 0d  R ComputerName,.
244a0 0a 20 20 4c 50 44 57 4f 52 44 20 6e 53 69 7a 65  .  LPDWORD nSize
244b0 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
244c0 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
244d0 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
244e0 44 6e 73 48 6f 73 74 6e 61 6d 65 54 6f 43 6f 6d  DnsHostnameToCom
244f0 70 75 74 65 72 4e 61 6d 65 41 20 44 6e 73 48 6f  puterNameA DnsHo
24500 73 74 6e 61 6d 65 54 6f 43 6f 6d 70 75 74 65 72  stnameToComputer
24510 4e 61 6d 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  Name;..// #endif
24520 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
24530 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 5f 57 49  // #endif // _WI
24540 4e 33 32 5f 57 49 4e 4e 54 0d 0a 0d 0a 65 78 74  N32_WINNT....ext
24550 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
24560 6f 72 74 20 42 4f 4f 4c 20 47 65 74 55 73 65 72  ort BOOL GetUser
24570 4e 61 6d 65 41 28 0d 0a 20 20 4c 50 53 54 52 20  NameA(..  LPSTR 
24580 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 4c 50 44  lpBuffer,..  LPD
24590 57 4f 52 44 20 6e 53 69 7a 65 29 3b 0d 0a 65 78  WORD nSize);..ex
245a0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
245b0 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 55 73 65  port BOOL GetUse
245c0 72 4e 61 6d 65 57 28 0d 0a 20 20 4c 50 57 53 54  rNameW(..  LPWST
245d0 52 20 6c 70 42 75 66 66 65 72 2c 0d 0a 20 20 4c  R lpBuffer,..  L
245e0 50 44 57 4f 52 44 20 6e 53 69 7a 65 29 3b 0d 0a  PDWORD nSize);..
245f0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
24600 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
24610 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 55  else..alias GetU
24620 73 65 72 4e 61 6d 65 41 20 47 65 74 55 73 65 72  serNameA GetUser
24630 4e 61 6d 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  Name;..// #endif
24640 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
24650 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4f  enum : uint { LO
24660 47 4f 4e 33 32 5f 4c 4f 47 4f 4e 5f 49 4e 54 45  GON32_LOGON_INTE
24670 52 41 43 54 49 56 45 20 3d 20 32 20 7d 0d 0a 65  RACTIVE = 2 }..e
24680 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4f 47  num : uint { LOG
24690 4f 4e 33 32 5f 4c 4f 47 4f 4e 5f 4e 45 54 57 4f  ON32_LOGON_NETWO
246a0 52 4b 20 3d 20 33 20 7d 0d 0a 65 6e 75 6d 20 3a  RK = 3 }..enum :
246b0 20 75 69 6e 74 20 7b 20 4c 4f 47 4f 4e 33 32 5f   uint { LOGON32_
246c0 4c 4f 47 4f 4e 5f 42 41 54 43 48 20 3d 20 34 20  LOGON_BATCH = 4 
246d0 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
246e0 20 4c 4f 47 4f 4e 33 32 5f 4c 4f 47 4f 4e 5f 53   LOGON32_LOGON_S
246f0 45 52 56 49 43 45 20 3d 20 35 20 7d 0d 0a 65 6e  ERVICE = 5 }..en
24700 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4f 47 4f  um : uint { LOGO
24710 4e 33 32 5f 4c 4f 47 4f 4e 5f 55 4e 4c 4f 43 4b  N32_LOGON_UNLOCK
24720 20 3d 20 37 20 7d 0d 0a 2f 2f 20 23 69 66 28 5f   = 7 }..// #if(_
24730 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30  WIN32_WINNT >= 0
24740 78 30 35 30 30 29 0d 0a 65 6e 75 6d 20 3a 20 75  x0500)..enum : u
24750 69 6e 74 20 7b 20 4c 4f 47 4f 4e 33 32 5f 4c 4f  int { LOGON32_LO
24760 47 4f 4e 5f 4e 45 54 57 4f 52 4b 5f 43 4c 45 41  GON_NETWORK_CLEA
24770 52 54 45 58 54 20 3d 20 38 20 7d 0d 0a 65 6e 75  RTEXT = 8 }..enu
24780 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4f 47 4f 4e  m : uint { LOGON
24790 33 32 5f 4c 4f 47 4f 4e 5f 4e 45 57 5f 43 52 45  32_LOGON_NEW_CRE
247a0 44 45 4e 54 49 41 4c 53 20 3d 20 39 20 7d 0d 0a  DENTIALS = 9 }..
247b0 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 28 5f 57  // #endif // (_W
247c0 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78  IN32_WINNT >= 0x
247d0 30 35 30 30 29 0d 0a 0d 0a 65 6e 75 6d 20 3a 20  0500)....enum : 
247e0 75 69 6e 74 20 7b 20 4c 4f 47 4f 4e 33 32 5f 50  uint { LOGON32_P
247f0 52 4f 56 49 44 45 52 5f 44 45 46 41 55 4c 54 20  ROVIDER_DEFAULT 
24800 3d 20 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  = 0 }..enum : ui
24810 6e 74 20 7b 20 4c 4f 47 4f 4e 33 32 5f 50 52 4f  nt { LOGON32_PRO
24820 56 49 44 45 52 5f 57 49 4e 4e 54 33 35 20 3d 20  VIDER_WINNT35 = 
24830 31 20 7d 0d 0a 2f 2f 20 23 69 66 28 5f 57 49 4e  1 }..// #if(_WIN
24840 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 34  32_WINNT >= 0x04
24850 30 30 29 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  00)..enum : uint
24860 20 7b 20 4c 4f 47 4f 4e 33 32 5f 50 52 4f 56 49   { LOGON32_PROVI
24870 44 45 52 5f 57 49 4e 4e 54 34 30 20 3d 20 32 20  DER_WINNT40 = 2 
24880 7d 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a 20  }..// #endif /* 
24890 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20  _WIN32_WINNT >= 
248a0 30 78 30 34 30 30 20 2a 2f 0d 0a 2f 2f 20 23 69  0x0400 */..// #i
248b0 66 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e  f(_WIN32_WINNT >
248c0 3d 20 30 78 30 35 30 30 29 0d 0a 65 6e 75 6d 20  = 0x0500)..enum 
248d0 3a 20 75 69 6e 74 20 7b 20 4c 4f 47 4f 4e 33 32  : uint { LOGON32
248e0 5f 50 52 4f 56 49 44 45 52 5f 57 49 4e 4e 54 35  _PROVIDER_WINNT5
248f0 30 20 3d 20 33 20 7d 0d 0a 2f 2f 20 23 65 6e 64  0 = 3 }..// #end
24900 69 66 20 2f 2f 20 28 5f 57 49 4e 33 32 5f 57 49  if // (_WIN32_WI
24910 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 0d 0a  NNT >= 0x0500)..
24920 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
24930 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4c 6f  ) export BOOL Lo
24940 67 6f 6e 55 73 65 72 41 28 0d 0a 20 20 4c 50 53  gonUserA(..  LPS
24950 54 52 20 6c 70 73 7a 55 73 65 72 6e 61 6d 65 2c  TR lpszUsername,
24960 0d 0a 20 20 4c 50 53 54 52 20 6c 70 73 7a 44 6f  ..  LPSTR lpszDo
24970 6d 61 69 6e 2c 0d 0a 20 20 4c 50 53 54 52 20 6c  main,..  LPSTR l
24980 70 73 7a 50 61 73 73 77 6f 72 64 2c 0d 0a 20 20  pszPassword,..  
24990 44 57 4f 52 44 20 64 77 4c 6f 67 6f 6e 54 79 70  DWORD dwLogonTyp
249a0 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 4c 6f  e,..  DWORD dwLo
249b0 67 6f 6e 50 72 6f 76 69 64 65 72 2c 0d 0a 20 20  gonProvider,..  
249c0 50 48 41 4e 44 4c 45 20 70 68 54 6f 6b 65 6e 29  PHANDLE phToken)
249d0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
249e0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4c  s) export BOOL L
249f0 6f 67 6f 6e 55 73 65 72 57 28 0d 0a 20 20 4c 50  ogonUserW(..  LP
24a00 57 53 54 52 20 6c 70 73 7a 55 73 65 72 6e 61 6d  WSTR lpszUsernam
24a10 65 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 73  e,..  LPWSTR lps
24a20 7a 44 6f 6d 61 69 6e 2c 0d 0a 20 20 4c 50 57 53  zDomain,..  LPWS
24a30 54 52 20 6c 70 73 7a 50 61 73 73 77 6f 72 64 2c  TR lpszPassword,
24a40 0d 0a 20 20 44 57 4f 52 44 20 64 77 4c 6f 67 6f  ..  DWORD dwLogo
24a50 6e 54 79 70 65 2c 0d 0a 20 20 44 57 4f 52 44 20  nType,..  DWORD 
24a60 64 77 4c 6f 67 6f 6e 50 72 6f 76 69 64 65 72 2c  dwLogonProvider,
24a70 0d 0a 20 20 50 48 41 4e 44 4c 45 20 70 68 54 6f  ..  PHANDLE phTo
24a80 6b 65 6e 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ken);..// #ifdef
24a90 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
24aa0 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
24ab0 61 73 20 4c 6f 67 6f 6e 55 73 65 72 41 20 4c 6f  as LogonUserA Lo
24ac0 67 6f 6e 55 73 65 72 3b 0d 0a 2f 2f 20 23 65 6e  gonUser;..// #en
24ad0 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
24ae0 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
24af0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 4c  s) export BOOL L
24b00 6f 67 6f 6e 55 73 65 72 45 78 41 28 0d 0a 20 20  ogonUserExA(..  
24b10 4c 50 53 54 52 20 6c 70 73 7a 55 73 65 72 6e 61  LPSTR lpszUserna
24b20 6d 65 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 73  me,..  LPSTR lps
24b30 7a 44 6f 6d 61 69 6e 2c 0d 0a 20 20 4c 50 53 54  zDomain,..  LPST
24b40 52 20 6c 70 73 7a 50 61 73 73 77 6f 72 64 2c 0d  R lpszPassword,.
24b50 0a 20 20 44 57 4f 52 44 20 64 77 4c 6f 67 6f 6e  .  DWORD dwLogon
24b60 54 79 70 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64  Type,..  DWORD d
24b70 77 4c 6f 67 6f 6e 50 72 6f 76 69 64 65 72 2c 0d  wLogonProvider,.
24b80 0a 20 20 50 48 41 4e 44 4c 45 20 70 68 54 6f 6b  .  PHANDLE phTok
24b90 65 6e 20 2c 0d 0a 20 20 50 53 49 44 20 2a 70 70  en ,..  PSID *pp
24ba0 4c 6f 67 6f 6e 53 69 64 20 2c 0d 0a 20 20 50 56  LogonSid ,..  PV
24bb0 4f 49 44 20 2a 70 70 50 72 6f 66 69 6c 65 42 75  OID *ppProfileBu
24bc0 66 66 65 72 20 2c 0d 0a 20 20 4c 50 44 57 4f 52  ffer ,..  LPDWOR
24bd0 44 20 70 64 77 50 72 6f 66 69 6c 65 4c 65 6e 67  D pdwProfileLeng
24be0 74 68 20 2c 0d 0a 20 20 50 51 55 4f 54 41 5f 4c  th ,..  PQUOTA_L
24bf0 49 4d 49 54 53 20 70 51 75 6f 74 61 4c 69 6d 69  IMITS pQuotaLimi
24c00 74 73 20 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ts );..extern(Wi
24c10 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
24c20 4f 4c 20 4c 6f 67 6f 6e 55 73 65 72 45 78 57 28  OL LogonUserExW(
24c30 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 73 7a 55  ..  LPWSTR lpszU
24c40 73 65 72 6e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53  sername,..  LPWS
24c50 54 52 20 6c 70 73 7a 44 6f 6d 61 69 6e 2c 0d 0a  TR lpszDomain,..
24c60 20 20 4c 50 57 53 54 52 20 6c 70 73 7a 50 61 73    LPWSTR lpszPas
24c70 73 77 6f 72 64 2c 0d 0a 20 20 44 57 4f 52 44 20  sword,..  DWORD 
24c80 64 77 4c 6f 67 6f 6e 54 79 70 65 2c 0d 0a 20 20  dwLogonType,..  
24c90 44 57 4f 52 44 20 64 77 4c 6f 67 6f 6e 50 72 6f  DWORD dwLogonPro
24ca0 76 69 64 65 72 2c 0d 0a 20 20 50 48 41 4e 44 4c  vider,..  PHANDL
24cb0 45 20 70 68 54 6f 6b 65 6e 20 2c 0d 0a 20 20 50  E phToken ,..  P
24cc0 53 49 44 20 2a 70 70 4c 6f 67 6f 6e 53 69 64 20  SID *ppLogonSid 
24cd0 2c 0d 0a 20 20 50 56 4f 49 44 20 2a 70 70 50 72  ,..  PVOID *ppPr
24ce0 6f 66 69 6c 65 42 75 66 66 65 72 20 2c 0d 0a 20  ofileBuffer ,.. 
24cf0 20 4c 50 44 57 4f 52 44 20 70 64 77 50 72 6f 66   LPDWORD pdwProf
24d00 69 6c 65 4c 65 6e 67 74 68 20 2c 0d 0a 20 20 50  ileLength ,..  P
24d10 51 55 4f 54 41 5f 4c 49 4d 49 54 53 20 70 51 75  QUOTA_LIMITS pQu
24d20 6f 74 61 4c 69 6d 69 74 73 20 29 3b 0d 0a 2f 2f  otaLimits );..//
24d30 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
24d40 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
24d50 73 65 0d 0a 61 6c 69 61 73 20 4c 6f 67 6f 6e 55  se..alias LogonU
24d60 73 65 72 45 78 41 20 4c 6f 67 6f 6e 55 73 65 72  serExA LogonUser
24d70 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  Ex;..// #endif /
24d80 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
24d90 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
24da0 70 6f 72 74 20 42 4f 4f 4c 20 49 6d 70 65 72 73  port BOOL Impers
24db0 6f 6e 61 74 65 4c 6f 67 67 65 64 4f 6e 55 73 65  onateLoggedOnUse
24dc0 72 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 54 6f  r(..  HANDLE hTo
24dd0 6b 65 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ken);....extern(
24de0 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
24df0 42 4f 4f 4c 20 43 72 65 61 74 65 50 72 6f 63 65  BOOL CreateProce
24e00 73 73 41 73 55 73 65 72 41 28 0d 0a 20 20 48 41  ssAsUserA(..  HA
24e10 4e 44 4c 45 20 68 54 6f 6b 65 6e 2c 0d 0a 20 20  NDLE hToken,..  
24e20 4c 50 43 53 54 52 20 6c 70 41 70 70 6c 69 63 61  LPCSTR lpApplica
24e30 74 69 6f 6e 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53  tionName,..  LPS
24e40 54 52 20 6c 70 43 6f 6d 6d 61 6e 64 4c 69 6e 65  TR lpCommandLine
24e50 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f  ,..  LPSECURITY_
24e60 41 54 54 52 49 42 55 54 45 53 20 6c 70 50 72 6f  ATTRIBUTES lpPro
24e70 63 65 73 73 41 74 74 72 69 62 75 74 65 73 2c 0d  cessAttributes,.
24e80 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54  .  LPSECURITY_AT
24e90 54 52 49 42 55 54 45 53 20 6c 70 54 68 72 65 61  TRIBUTES lpThrea
24ea0 64 41 74 74 72 69 62 75 74 65 73 2c 0d 0a 20 20  dAttributes,..  
24eb0 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61 6e  BOOL bInheritHan
24ec0 64 6c 65 73 2c 0d 0a 20 20 44 57 4f 52 44 20 64  dles,..  DWORD d
24ed0 77 43 72 65 61 74 69 6f 6e 46 6c 61 67 73 2c 0d  wCreationFlags,.
24ee0 0a 20 20 4c 50 56 4f 49 44 20 6c 70 45 6e 76 69  .  LPVOID lpEnvi
24ef0 72 6f 6e 6d 65 6e 74 2c 0d 0a 20 20 4c 50 43 53  ronment,..  LPCS
24f00 54 52 20 6c 70 43 75 72 72 65 6e 74 44 69 72 65  TR lpCurrentDire
24f10 63 74 6f 72 79 2c 0d 0a 20 20 4c 50 53 54 41 52  ctory,..  LPSTAR
24f20 54 55 50 49 4e 46 4f 41 20 6c 70 53 74 61 72 74  TUPINFOA lpStart
24f30 75 70 49 6e 66 6f 2c 0d 0a 20 20 4c 50 50 52 4f  upInfo,..  LPPRO
24f40 43 45 53 53 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e  CESS_INFORMATION
24f50 20 6c 70 50 72 6f 63 65 73 73 49 6e 66 6f 72 6d   lpProcessInform
24f60 61 74 69 6f 6e 29 3b 0d 0a 65 78 74 65 72 6e 28  ation);..extern(
24f70 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
24f80 42 4f 4f 4c 20 43 72 65 61 74 65 50 72 6f 63 65  BOOL CreateProce
24f90 73 73 41 73 55 73 65 72 57 28 0d 0a 20 20 48 41  ssAsUserW(..  HA
24fa0 4e 44 4c 45 20 68 54 6f 6b 65 6e 2c 0d 0a 20 20  NDLE hToken,..  
24fb0 4c 50 43 57 53 54 52 20 6c 70 41 70 70 6c 69 63  LPCWSTR lpApplic
24fc0 61 74 69 6f 6e 4e 61 6d 65 2c 0d 0a 20 20 4c 50  ationName,..  LP
24fd0 57 53 54 52 20 6c 70 43 6f 6d 6d 61 6e 64 4c 69  WSTR lpCommandLi
24fe0 6e 65 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54  ne,..  LPSECURIT
24ff0 59 5f 41 54 54 52 49 42 55 54 45 53 20 6c 70 50  Y_ATTRIBUTES lpP
25000 72 6f 63 65 73 73 41 74 74 72 69 62 75 74 65 73  rocessAttributes
25010 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f  ,..  LPSECURITY_
25020 41 54 54 52 49 42 55 54 45 53 20 6c 70 54 68 72  ATTRIBUTES lpThr
25030 65 61 64 41 74 74 72 69 62 75 74 65 73 2c 0d 0a  eadAttributes,..
25040 20 20 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48    BOOL bInheritH
25050 61 6e 64 6c 65 73 2c 0d 0a 20 20 44 57 4f 52 44  andles,..  DWORD
25060 20 64 77 43 72 65 61 74 69 6f 6e 46 6c 61 67 73   dwCreationFlags
25070 2c 0d 0a 20 20 4c 50 56 4f 49 44 20 6c 70 45 6e  ,..  LPVOID lpEn
25080 76 69 72 6f 6e 6d 65 6e 74 2c 0d 0a 20 20 4c 50  vironment,..  LP
25090 43 57 53 54 52 20 6c 70 43 75 72 72 65 6e 74 44  CWSTR lpCurrentD
250a0 69 72 65 63 74 6f 72 79 2c 0d 0a 20 20 4c 50 53  irectory,..  LPS
250b0 54 41 52 54 55 50 49 4e 46 4f 57 20 6c 70 53 74  TARTUPINFOW lpSt
250c0 61 72 74 75 70 49 6e 66 6f 2c 0d 0a 20 20 4c 50  artupInfo,..  LP
250d0 50 52 4f 43 45 53 53 5f 49 4e 46 4f 52 4d 41 54  PROCESS_INFORMAT
250e0 49 4f 4e 20 6c 70 50 72 6f 63 65 73 73 49 6e 66  ION lpProcessInf
250f0 6f 72 6d 61 74 69 6f 6e 29 3b 0d 0a 2f 2f 20 23  ormation);..// #
25100 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
25110 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65  / #.....// #else
25120 0d 0a 61 6c 69 61 73 20 43 72 65 61 74 65 50 72  ..alias CreatePr
25130 6f 63 65 73 73 41 73 55 73 65 72 41 20 43 72 65  ocessAsUserA Cre
25140 61 74 65 50 72 6f 63 65 73 73 41 73 55 73 65 72  ateProcessAsUser
25150 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
25160 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 2f 2f 20 23  !UNICODE....// #
25170 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  if(_WIN32_WINNT 
25180 3e 3d 20 30 78 30 35 30 30 29 0d 0a 0d 0a 65 6e  >= 0x0500)....en
25190 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4f 47 4f  um : uint { LOGO
251a0 4e 5f 57 49 54 48 5f 50 52 4f 46 49 4c 45 20 3d  N_WITH_PROFILE =
251b0 20 30 78 30 30 30 30 30 30 30 31 20 7d 0d 0a 65   0x00000001 }..e
251c0 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4c 4f 47  num : uint { LOG
251d0 4f 4e 5f 4e 45 54 43 52 45 44 45 4e 54 49 41 4c  ON_NETCREDENTIAL
251e0 53 5f 4f 4e 4c 59 20 3d 20 30 78 30 30 30 30 30  S_ONLY = 0x00000
251f0 30 30 32 20 7d 0d 0a 0d 0a 65 78 74 65 72 6e 28  002 }....extern(
25200 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
25210 42 4f 4f 4c 20 43 72 65 61 74 65 50 72 6f 63 65  BOOL CreateProce
25220 73 73 57 69 74 68 4c 6f 67 6f 6e 57 28 0d 0a 20  ssWithLogonW(.. 
25230 20 4c 50 43 57 53 54 52 20 6c 70 55 73 65 72 6e   LPCWSTR lpUsern
25240 61 6d 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20  ame,..  LPCWSTR 
25250 6c 70 44 6f 6d 61 69 6e 2c 0d 0a 20 20 4c 50 43  lpDomain,..  LPC
25260 57 53 54 52 20 6c 70 50 61 73 73 77 6f 72 64 2c  WSTR lpPassword,
25270 0d 0a 20 20 44 57 4f 52 44 20 64 77 4c 6f 67 6f  ..  DWORD dwLogo
25280 6e 46 6c 61 67 73 2c 0d 0a 20 20 4c 50 43 57 53  nFlags,..  LPCWS
25290 54 52 20 6c 70 41 70 70 6c 69 63 61 74 69 6f 6e  TR lpApplication
252a0 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53 54 52 20  Name,..  LPWSTR 
252b0 6c 70 43 6f 6d 6d 61 6e 64 4c 69 6e 65 2c 0d 0a  lpCommandLine,..
252c0 20 20 44 57 4f 52 44 20 64 77 43 72 65 61 74 69    DWORD dwCreati
252d0 6f 6e 46 6c 61 67 73 2c 0d 0a 20 20 4c 50 56 4f  onFlags,..  LPVO
252e0 49 44 20 6c 70 45 6e 76 69 72 6f 6e 6d 65 6e 74  ID lpEnvironment
252f0 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 43  ,..  LPCWSTR lpC
25300 75 72 72 65 6e 74 44 69 72 65 63 74 6f 72 79 2c  urrentDirectory,
25310 0d 0a 20 20 4c 50 53 54 41 52 54 55 50 49 4e 46  ..  LPSTARTUPINF
25320 4f 57 20 6c 70 53 74 61 72 74 75 70 49 6e 66 6f  OW lpStartupInfo
25330 2c 0d 0a 20 20 4c 50 50 52 4f 43 45 53 53 5f 49  ,..  LPPROCESS_I
25340 4e 46 4f 52 4d 41 54 49 4f 4e 20 6c 70 50 72 6f  NFORMATION lpPro
25350 63 65 73 73 49 6e 66 6f 72 6d 61 74 69 6f 6e 29  cessInformation)
25360 3b 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  ;....// #endif /
25370 2f 20 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  / (_WIN32_WINNT 
25380 3e 3d 20 30 78 30 35 30 30 29 0d 0a 0d 0a 65 78  >= 0x0500)....ex
25390 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
253a0 70 6f 72 74 20 42 4f 4f 4c 20 49 6d 70 65 72 73  port BOOL Impers
253b0 6f 6e 61 74 65 41 6e 6f 6e 79 6d 6f 75 73 54 6f  onateAnonymousTo
253c0 6b 65 6e 28 0d 0a 20 20 48 41 4e 44 4c 45 20 54  ken(..  HANDLE T
253d0 68 72 65 61 64 48 61 6e 64 6c 65 29 3b 0d 0a 0d  hreadHandle);...
253e0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
253f0 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 44 75 70   export BOOL Dup
25400 6c 69 63 61 74 65 54 6f 6b 65 6e 45 78 28 0d 0a  licateTokenEx(..
25410 20 20 48 41 4e 44 4c 45 20 68 45 78 69 73 74 69    HANDLE hExisti
25420 6e 67 54 6f 6b 65 6e 2c 0d 0a 20 20 44 57 4f 52  ngToken,..  DWOR
25430 44 20 64 77 44 65 73 69 72 65 64 41 63 63 65 73  D dwDesiredAcces
25440 73 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59  s,..  LPSECURITY
25450 5f 41 54 54 52 49 42 55 54 45 53 20 6c 70 54 6f  _ATTRIBUTES lpTo
25460 6b 65 6e 41 74 74 72 69 62 75 74 65 73 2c 0d 0a  kenAttributes,..
25470 20 20 53 45 43 55 52 49 54 59 5f 49 4d 50 45 52    SECURITY_IMPER
25480 53 4f 4e 41 54 49 4f 4e 5f 4c 45 56 45 4c 20 49  SONATION_LEVEL I
25490 6d 70 65 72 73 6f 6e 61 74 69 6f 6e 4c 65 76 65  mpersonationLeve
254a0 6c 2c 0d 0a 20 20 54 4f 4b 45 4e 5f 54 59 50 45  l,..  TOKEN_TYPE
254b0 20 54 6f 6b 65 6e 54 79 70 65 2c 0d 0a 20 20 50   TokenType,..  P
254c0 48 41 4e 44 4c 45 20 70 68 4e 65 77 54 6f 6b 65  HANDLE phNewToke
254d0 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  n);....extern(Wi
254e0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
254f0 4f 4c 20 43 72 65 61 74 65 52 65 73 74 72 69 63  OL CreateRestric
25500 74 65 64 54 6f 6b 65 6e 28 0d 0a 20 20 48 41 4e  tedToken(..  HAN
25510 44 4c 45 20 45 78 69 73 74 69 6e 67 54 6f 6b 65  DLE ExistingToke
25520 6e 48 61 6e 64 6c 65 2c 0d 0a 20 20 44 57 4f 52  nHandle,..  DWOR
25530 44 20 46 6c 61 67 73 2c 0d 0a 20 20 44 57 4f 52  D Flags,..  DWOR
25540 44 20 44 69 73 61 62 6c 65 53 69 64 43 6f 75 6e  D DisableSidCoun
25550 74 2c 0d 0a 20 20 50 53 49 44 5f 41 4e 44 5f 41  t,..  PSID_AND_A
25560 54 54 52 49 42 55 54 45 53 20 53 69 64 73 54 6f  TTRIBUTES SidsTo
25570 44 69 73 61 62 6c 65 20 2c 0d 0a 20 20 44 57 4f  Disable ,..  DWO
25580 52 44 20 44 65 6c 65 74 65 50 72 69 76 69 6c 65  RD DeletePrivile
25590 67 65 43 6f 75 6e 74 2c 0d 0a 20 20 50 4c 55 49  geCount,..  PLUI
255a0 44 5f 41 4e 44 5f 41 54 54 52 49 42 55 54 45 53  D_AND_ATTRIBUTES
255b0 20 50 72 69 76 69 6c 65 67 65 73 54 6f 44 65 6c   PrivilegesToDel
255c0 65 74 65 20 2c 0d 0a 20 20 44 57 4f 52 44 20 52  ete ,..  DWORD R
255d0 65 73 74 72 69 63 74 65 64 53 69 64 43 6f 75 6e  estrictedSidCoun
255e0 74 2c 0d 0a 20 20 50 53 49 44 5f 41 4e 44 5f 41  t,..  PSID_AND_A
255f0 54 54 52 49 42 55 54 45 53 20 53 69 64 73 54 6f  TTRIBUTES SidsTo
25600 52 65 73 74 72 69 63 74 20 2c 0d 0a 20 20 50 48  Restrict ,..  PH
25610 41 4e 44 4c 45 20 4e 65 77 54 6f 6b 65 6e 48 61  ANDLE NewTokenHa
25620 6e 64 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  ndle);....extern
25630 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
25640 20 42 4f 4f 4c 20 49 73 54 6f 6b 65 6e 52 65 73   BOOL IsTokenRes
25650 74 72 69 63 74 65 64 28 0d 0a 20 20 48 41 4e 44  tricted(..  HAND
25660 4c 45 20 54 6f 6b 65 6e 48 61 6e 64 6c 65 29 3b  LE TokenHandle);
25670 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
25680 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
25690 49 73 54 6f 6b 65 6e 55 6e 74 72 75 73 74 65 64  IsTokenUntrusted
256a0 28 0d 0a 20 20 48 41 4e 44 4c 45 20 54 6f 6b 65  (..  HANDLE Toke
256b0 6e 48 61 6e 64 6c 65 29 3b 0d 0a 0d 0a 65 78 74  nHandle);....ext
256c0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
256d0 6f 72 74 20 42 4f 4f 4c 20 43 68 65 63 6b 54 6f  ort BOOL CheckTo
256e0 6b 65 6e 4d 65 6d 62 65 72 73 68 69 70 28 0d 0a  kenMembership(..
256f0 20 20 48 41 4e 44 4c 45 20 54 6f 6b 65 6e 48 61    HANDLE TokenHa
25700 6e 64 6c 65 20 2c 0d 0a 20 20 50 53 49 44 20 53  ndle ,..  PSID S
25710 69 64 54 6f 43 68 65 63 6b 2c 0d 0a 20 20 50 42  idToCheck,..  PB
25720 4f 4f 4c 20 49 73 4d 65 6d 62 65 72 29 3b 0d 0a  OOL IsMember);..
25730 0d 0a 2f 2f 20 23 69 66 20 28 5f 57 49 4e 33 32  ..// #if (_WIN32
25740 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30  _WINNT >= 0x0500
25750 29 0d 0a 0d 0a 61 6c 69 61 73 20 57 41 49 54 4f  )....alias WAITO
25760 52 54 49 4d 45 52 43 41 4c 4c 42 41 43 4b 46 55  RTIMERCALLBACKFU
25770 4e 43 20 57 41 49 54 4f 52 54 49 4d 45 52 43 41  NC WAITORTIMERCA
25780 4c 4c 42 41 43 4b 3b 0d 0a 0d 0a 65 78 74 65 72  LLBACK;....exter
25790 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
257a0 74 20 42 4f 4f 4c 20 52 65 67 69 73 74 65 72 57  t BOOL RegisterW
257b0 61 69 74 46 6f 72 53 69 6e 67 6c 65 4f 62 6a 65  aitForSingleObje
257c0 63 74 28 0d 0a 20 20 50 48 41 4e 44 4c 45 20 70  ct(..  PHANDLE p
257d0 68 4e 65 77 57 61 69 74 4f 62 6a 65 63 74 2c 0d  hNewWaitObject,.
257e0 0a 20 20 48 41 4e 44 4c 45 20 68 4f 62 6a 65 63  .  HANDLE hObjec
257f0 74 2c 0d 0a 20 20 57 41 49 54 4f 52 54 49 4d 45  t,..  WAITORTIME
25800 52 43 41 4c 4c 42 41 43 4b 20 43 61 6c 6c 62 61  RCALLBACK Callba
25810 63 6b 2c 0d 0a 20 20 50 56 4f 49 44 20 43 6f 6e  ck,..  PVOID Con
25820 74 65 78 74 2c 0d 0a 20 20 55 4c 4f 4e 47 20 64  text,..  ULONG d
25830 77 4d 69 6c 6c 69 73 65 63 6f 6e 64 73 2c 0d 0a  wMilliseconds,..
25840 20 20 55 4c 4f 4e 47 20 64 77 46 6c 61 67 73 29    ULONG dwFlags)
25850 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
25860 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44  ows) export HAND
25870 4c 45 20 52 65 67 69 73 74 65 72 57 61 69 74 46  LE RegisterWaitF
25880 6f 72 53 69 6e 67 6c 65 4f 62 6a 65 63 74 45 78  orSingleObjectEx
25890 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 4f 62 6a  (..  HANDLE hObj
258a0 65 63 74 2c 0d 0a 20 20 57 41 49 54 4f 52 54 49  ect,..  WAITORTI
258b0 4d 45 52 43 41 4c 4c 42 41 43 4b 20 43 61 6c 6c  MERCALLBACK Call
258c0 62 61 63 6b 2c 0d 0a 20 20 50 56 4f 49 44 20 43  back,..  PVOID C
258d0 6f 6e 74 65 78 74 2c 0d 0a 20 20 55 4c 4f 4e 47  ontext,..  ULONG
258e0 20 64 77 4d 69 6c 6c 69 73 65 63 6f 6e 64 73 2c   dwMilliseconds,
258f0 0d 0a 20 20 55 4c 4f 4e 47 20 64 77 46 6c 61 67  ..  ULONG dwFlag
25900 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  s);....extern(Wi
25910 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
25920 4f 4c 20 55 6e 72 65 67 69 73 74 65 72 57 61 69  OL UnregisterWai
25930 74 28 0d 0a 20 20 48 41 4e 44 4c 45 20 57 61 69  t(..  HANDLE Wai
25940 74 48 61 6e 64 6c 65 29 3b 0d 0a 0d 0a 65 78 74  tHandle);....ext
25950 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
25960 6f 72 74 20 42 4f 4f 4c 20 55 6e 72 65 67 69 73  ort BOOL Unregis
25970 74 65 72 57 61 69 74 45 78 28 0d 0a 20 20 48 41  terWaitEx(..  HA
25980 4e 44 4c 45 20 57 61 69 74 48 61 6e 64 6c 65 2c  NDLE WaitHandle,
25990 0d 0a 20 20 48 41 4e 44 4c 45 20 43 6f 6d 70 6c  ..  HANDLE Compl
259a0 65 74 69 6f 6e 45 76 65 6e 74 29 3b 0d 0a 0d 0a  etionEvent);....
259b0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
259c0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 51 75 65 75  export BOOL Queu
259d0 65 55 73 65 72 57 6f 72 6b 49 74 65 6d 28 0d 0a  eUserWorkItem(..
259e0 20 20 4c 50 54 48 52 45 41 44 5f 53 54 41 52 54    LPTHREAD_START
259f0 5f 52 4f 55 54 49 4e 45 20 46 75 6e 63 74 69 6f  _ROUTINE Functio
25a00 6e 2c 0d 0a 20 20 50 56 4f 49 44 20 43 6f 6e 74  n,..  PVOID Cont
25a10 65 78 74 2c 0d 0a 20 20 55 4c 4f 4e 47 20 46 6c  ext,..  ULONG Fl
25a20 61 67 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ags);....extern(
25a30 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
25a40 42 4f 4f 4c 20 42 69 6e 64 49 6f 43 6f 6d 70 6c  BOOL BindIoCompl
25a50 65 74 69 6f 6e 43 61 6c 6c 62 61 63 6b 28 0d 0a  etionCallback(..
25a60 20 20 48 41 4e 44 4c 45 20 46 69 6c 65 48 61 6e    HANDLE FileHan
25a70 64 6c 65 2c 0d 0a 20 20 4c 50 4f 56 45 52 4c 41  dle,..  LPOVERLA
25a80 50 50 45 44 5f 43 4f 4d 50 4c 45 54 49 4f 4e 5f  PPED_COMPLETION_
25a90 52 4f 55 54 49 4e 45 20 46 75 6e 63 74 69 6f 6e  ROUTINE Function
25aa0 2c 0d 0a 20 20 55 4c 4f 4e 47 20 46 6c 61 67 73  ,..  ULONG Flags
25ab0 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
25ac0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
25ad0 44 4c 45 20 43 72 65 61 74 65 54 69 6d 65 72 51  DLE CreateTimerQ
25ae0 75 65 75 65 28 29 3b 0d 0a 0d 0a 65 78 74 65 72  ueue();....exter
25af0 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
25b00 74 20 42 4f 4f 4c 20 43 72 65 61 74 65 54 69 6d  t BOOL CreateTim
25b10 65 72 51 75 65 75 65 54 69 6d 65 72 28 0d 0a 20  erQueueTimer(.. 
25b20 20 50 48 41 4e 44 4c 45 20 70 68 4e 65 77 54 69   PHANDLE phNewTi
25b30 6d 65 72 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 54  mer,..  HANDLE T
25b40 69 6d 65 72 51 75 65 75 65 2c 0d 0a 20 20 57 41  imerQueue,..  WA
25b50 49 54 4f 52 54 49 4d 45 52 43 41 4c 4c 42 41 43  ITORTIMERCALLBAC
25b60 4b 20 43 61 6c 6c 62 61 63 6b 2c 0d 0a 20 20 50  K Callback,..  P
25b70 56 4f 49 44 20 50 61 72 61 6d 65 74 65 72 2c 0d  VOID Parameter,.
25b80 0a 20 20 44 57 4f 52 44 20 44 75 65 54 69 6d 65  .  DWORD DueTime
25b90 2c 0d 0a 20 20 44 57 4f 52 44 20 50 65 72 69 6f  ,..  DWORD Perio
25ba0 64 2c 0d 0a 20 20 55 4c 4f 4e 47 20 46 6c 61 67  d,..  ULONG Flag
25bb0 73 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  s);....extern(Wi
25bc0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
25bd0 4f 4c 20 43 68 61 6e 67 65 54 69 6d 65 72 51 75  OL ChangeTimerQu
25be0 65 75 65 54 69 6d 65 72 28 0d 0a 20 20 48 41 4e  eueTimer(..  HAN
25bf0 44 4c 45 20 54 69 6d 65 72 51 75 65 75 65 2c 0d  DLE TimerQueue,.
25c00 0a 20 20 48 41 4e 44 4c 45 20 54 69 6d 65 72 2c  .  HANDLE Timer,
25c10 0d 0a 20 20 55 4c 4f 4e 47 20 44 75 65 54 69 6d  ..  ULONG DueTim
25c20 65 2c 0d 0a 20 20 55 4c 4f 4e 47 20 50 65 72 69  e,..  ULONG Peri
25c30 6f 64 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  od);....extern(W
25c40 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
25c50 4f 4f 4c 20 44 65 6c 65 74 65 54 69 6d 65 72 51  OOL DeleteTimerQ
25c60 75 65 75 65 54 69 6d 65 72 28 0d 0a 20 20 48 41  ueueTimer(..  HA
25c70 4e 44 4c 45 20 54 69 6d 65 72 51 75 65 75 65 2c  NDLE TimerQueue,
25c80 0d 0a 20 20 48 41 4e 44 4c 45 20 54 69 6d 65 72  ..  HANDLE Timer
25c90 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 43 6f 6d 70  ,..  HANDLE Comp
25ca0 6c 65 74 69 6f 6e 45 76 65 6e 74 29 3b 0d 0a 0d  letionEvent);...
25cb0 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
25cc0 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 44 65 6c   export BOOL Del
25cd0 65 74 65 54 69 6d 65 72 51 75 65 75 65 45 78 28  eteTimerQueueEx(
25ce0 0d 0a 20 20 48 41 4e 44 4c 45 20 54 69 6d 65 72  ..  HANDLE Timer
25cf0 51 75 65 75 65 2c 0d 0a 20 20 48 41 4e 44 4c 45  Queue,..  HANDLE
25d00 20 43 6f 6d 70 6c 65 74 69 6f 6e 45 76 65 6e 74   CompletionEvent
25d10 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
25d20 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e  dows) export HAN
25d30 44 4c 45 20 53 65 74 54 69 6d 65 72 51 75 65 75  DLE SetTimerQueu
25d40 65 54 69 6d 65 72 28 0d 0a 20 20 48 41 4e 44 4c  eTimer(..  HANDL
25d50 45 20 54 69 6d 65 72 51 75 65 75 65 2c 0d 0a 20  E TimerQueue,.. 
25d60 20 57 41 49 54 4f 52 54 49 4d 45 52 43 41 4c 4c   WAITORTIMERCALL
25d70 42 41 43 4b 20 43 61 6c 6c 62 61 63 6b 2c 0d 0a  BACK Callback,..
25d80 20 20 50 56 4f 49 44 20 50 61 72 61 6d 65 74 65    PVOID Paramete
25d90 72 2c 0d 0a 20 20 44 57 4f 52 44 20 44 75 65 54  r,..  DWORD DueT
25da0 69 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20 50 65  ime,..  DWORD Pe
25db0 72 69 6f 64 2c 0d 0a 20 20 42 4f 4f 4c 20 50 72  riod,..  BOOL Pr
25dc0 65 66 65 72 49 6f 29 3b 0d 0a 0d 0a 65 78 74 65  eferIo);....exte
25dd0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
25de0 72 74 20 42 4f 4f 4c 20 43 61 6e 63 65 6c 54 69  rt BOOL CancelTi
25df0 6d 65 72 51 75 65 75 65 54 69 6d 65 72 28 0d 0a  merQueueTimer(..
25e00 20 20 48 41 4e 44 4c 45 20 54 69 6d 65 72 51 75    HANDLE TimerQu
25e10 65 75 65 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 54  eue,..  HANDLE T
25e20 69 6d 65 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  imer);....extern
25e30 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
25e40 20 42 4f 4f 4c 20 44 65 6c 65 74 65 54 69 6d 65   BOOL DeleteTime
25e50 72 51 75 65 75 65 28 0d 0a 20 20 48 41 4e 44 4c  rQueue(..  HANDL
25e60 45 20 54 69 6d 65 72 51 75 65 75 65 29 3b 0d 0a  E TimerQueue);..
25e70 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 5f  ..// #endif // _
25e80 57 49 4e 33 32 5f 57 49 4e 4e 54 0d 0a 0d 0a 2f  WIN32_WINNT..../
25e90 2f 20 23 69 66 28 5f 57 49 4e 33 32 5f 57 49 4e  / #if(_WIN32_WIN
25ea0 4e 54 20 3e 3d 20 30 78 30 34 30 30 29 0d 0a 0d  NT >= 0x0400)...
25eb0 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 48  .enum : uint { H
25ec0 57 5f 50 52 4f 46 49 4c 45 5f 47 55 49 44 4c 45  W_PROFILE_GUIDLE
25ed0 4e 20 3d 20 33 39 20 7d 0d 0a 65 6e 75 6d 20 3a  N = 39 }..enum :
25ee0 20 75 69 6e 74 20 7b 20 4d 41 58 5f 50 52 4f 46   uint { MAX_PROF
25ef0 49 4c 45 5f 4c 45 4e 20 3d 20 38 30 20 7d 0d 0a  ILE_LEN = 80 }..
25f00 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
25f10 44 4f 43 4b 49 4e 46 4f 5f 55 4e 44 4f 43 4b 45  DOCKINFO_UNDOCKE
25f20 44 20 3d 20 30 78 31 20 7d 0d 0a 65 6e 75 6d 20  D = 0x1 }..enum 
25f30 3a 20 75 69 6e 74 20 7b 20 44 4f 43 4b 49 4e 46  : uint { DOCKINF
25f40 4f 5f 44 4f 43 4b 45 44 20 3d 20 30 78 32 20 7d  O_DOCKED = 0x2 }
25f50 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
25f60 44 4f 43 4b 49 4e 46 4f 5f 55 53 45 52 5f 53 55  DOCKINFO_USER_SU
25f70 50 50 4c 49 45 44 20 3d 20 30 78 34 20 7d 0d 0a  PPLIED = 0x4 }..
25f80 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 44 4f  enum : uint { DO
25f90 43 4b 49 4e 46 4f 5f 55 53 45 52 5f 55 4e 44 4f  CKINFO_USER_UNDO
25fa0 43 4b 45 44 20 3d 20 44 4f 43 4b 49 4e 46 4f 5f  CKED = DOCKINFO_
25fb0 55 53 45 52 5f 53 55 50 50 4c 49 45 44 20 7c 20  USER_SUPPLIED | 
25fc0 44 4f 43 4b 49 4e 46 4f 5f 55 4e 44 4f 43 4b 45  DOCKINFO_UNDOCKE
25fd0 44 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  D }..enum : uint
25fe0 20 7b 20 44 4f 43 4b 49 4e 46 4f 5f 55 53 45 52   { DOCKINFO_USER
25ff0 5f 44 4f 43 4b 45 44 20 3d 20 44 4f 43 4b 49 4e  _DOCKED = DOCKIN
26000 46 4f 5f 55 53 45 52 5f 53 55 50 50 4c 49 45 44  FO_USER_SUPPLIED
26010 20 7c 20 44 4f 43 4b 49 4e 46 4f 5f 44 4f 43 4b   | DOCKINFO_DOCK
26020 45 44 20 7d 0d 0a 0d 0a 73 74 72 75 63 74 20 74  ED }....struct t
26030 61 67 48 57 5f 50 52 4f 46 49 4c 45 5f 49 4e 46  agHW_PROFILE_INF
26040 4f 41 20 7b 0d 0a 20 20 44 57 4f 52 44 20 64 77  OA {..  DWORD dw
26050 44 6f 63 6b 49 6e 66 6f 3b 0d 0a 20 20 43 48 41  DockInfo;..  CHA
26060 52 20 73 7a 48 77 50 72 6f 66 69 6c 65 47 75 69  R szHwProfileGui
26070 64 5b 48 57 5f 50 52 4f 46 49 4c 45 5f 47 55 49  d[HW_PROFILE_GUI
26080 44 4c 45 4e 5d 3b 0d 0a 20 20 43 48 41 52 20 73  DLEN];..  CHAR s
26090 7a 48 77 50 72 6f 66 69 6c 65 4e 61 6d 65 5b 4d  zHwProfileName[M
260a0 41 58 5f 50 52 4f 46 49 4c 45 5f 4c 45 4e 5d 3b  AX_PROFILE_LEN];
260b0 0d 0a 7d 0d 0a 61 6c 69 61 73 20 74 61 67 48 57  ..}..alias tagHW
260c0 5f 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 41 20 48  _PROFILE_INFOA H
260d0 57 5f 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 41 3b  W_PROFILE_INFOA;
260e0 0d 0a 61 6c 69 61 73 20 74 61 67 48 57 5f 50 52  ..alias tagHW_PR
260f0 4f 46 49 4c 45 5f 49 4e 46 4f 41 2a 20 4c 50 48  OFILE_INFOA* LPH
26100 57 5f 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 41 3b  W_PROFILE_INFOA;
26110 0d 0a 0d 0a 73 74 72 75 63 74 20 74 61 67 48 57  ....struct tagHW
26120 5f 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 57 20 7b  _PROFILE_INFOW {
26130 0d 0a 20 20 44 57 4f 52 44 20 64 77 44 6f 63 6b  ..  DWORD dwDock
26140 49 6e 66 6f 3b 0d 0a 20 20 57 43 48 41 52 20 73  Info;..  WCHAR s
26150 7a 48 77 50 72 6f 66 69 6c 65 47 75 69 64 5b 48  zHwProfileGuid[H
26160 57 5f 50 52 4f 46 49 4c 45 5f 47 55 49 44 4c 45  W_PROFILE_GUIDLE
26170 4e 5d 3b 0d 0a 20 20 57 43 48 41 52 20 73 7a 48  N];..  WCHAR szH
26180 77 50 72 6f 66 69 6c 65 4e 61 6d 65 5b 4d 41 58  wProfileName[MAX
26190 5f 50 52 4f 46 49 4c 45 5f 4c 45 4e 5d 3b 0d 0a  _PROFILE_LEN];..
261a0 7d 0d 0a 61 6c 69 61 73 20 74 61 67 48 57 5f 50  }..alias tagHW_P
261b0 52 4f 46 49 4c 45 5f 49 4e 46 4f 57 20 48 57 5f  ROFILE_INFOW HW_
261c0 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 57 3b 0d 0a  PROFILE_INFOW;..
261d0 61 6c 69 61 73 20 74 61 67 48 57 5f 50 52 4f 46  alias tagHW_PROF
261e0 49 4c 45 5f 49 4e 46 4f 57 2a 20 4c 50 48 57 5f  ILE_INFOW* LPHW_
261f0 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 57 3b 0d 0a  PROFILE_INFOW;..
26200 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
26210 4f 44 45 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20  ODE..// .....// 
26220 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 48 57 5f  #else..alias HW_
26230 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 41 20 48 57  PROFILE_INFOA HW
26240 5f 50 52 4f 46 49 4c 45 5f 49 4e 46 4f 3b 0d 0a  _PROFILE_INFO;..
26250 61 6c 69 61 73 20 4c 50 48 57 5f 50 52 4f 46 49  alias LPHW_PROFI
26260 4c 45 5f 49 4e 46 4f 41 20 4c 50 48 57 5f 50 52  LE_INFOA LPHW_PR
26270 4f 46 49 4c 45 5f 49 4e 46 4f 3b 0d 0a 2f 2f 20  OFILE_INFO;..// 
26280 23 65 6e 64 69 66 20 2f 2f 20 55 4e 49 43 4f 44  #endif // UNICOD
26290 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  E....extern(Wind
262a0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
262b0 20 47 65 74 43 75 72 72 65 6e 74 48 77 50 72 6f   GetCurrentHwPro
262c0 66 69 6c 65 41 28 0d 0a 20 20 4c 50 48 57 5f 50  fileA(..  LPHW_P
262d0 52 4f 46 49 4c 45 5f 49 4e 46 4f 41 20 6c 70 48  ROFILE_INFOA lpH
262e0 77 50 72 6f 66 69 6c 65 49 6e 66 6f 29 3b 0d 0a  wProfileInfo);..
262f0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
26300 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 43  export BOOL GetC
26310 75 72 72 65 6e 74 48 77 50 72 6f 66 69 6c 65 57  urrentHwProfileW
26320 28 0d 0a 20 20 4c 50 48 57 5f 50 52 4f 46 49 4c  (..  LPHW_PROFIL
26330 45 5f 49 4e 46 4f 57 20 6c 70 48 77 50 72 6f 66  E_INFOW lpHwProf
26340 69 6c 65 49 6e 66 6f 29 3b 0d 0a 2f 2f 20 23 69  ileInfo);..// #i
26350 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f  fdef UNICODE..//
26360 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d   #.....// #else.
26370 0a 61 6c 69 61 73 20 47 65 74 43 75 72 72 65 6e  .alias GetCurren
26380 74 48 77 50 72 6f 66 69 6c 65 41 20 47 65 74 43  tHwProfileA GetC
26390 75 72 72 65 6e 74 48 77 50 72 6f 66 69 6c 65 3b  urrentHwProfile;
263a0 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
263b0 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 65 6e 64  UNICODE..// #end
263c0 69 66 20 2f 2a 20 5f 57 49 4e 33 32 5f 57 49 4e  if /* _WIN32_WIN
263d0 4e 54 20 3e 3d 20 30 78 30 34 30 30 20 2a 2f 0d  NT >= 0x0400 */.
263e0 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
263f0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 51  s) export BOOL Q
26400 75 65 72 79 50 65 72 66 6f 72 6d 61 6e 63 65 43  ueryPerformanceC
26410 6f 75 6e 74 65 72 28 0d 0a 20 20 4c 41 52 47 45  ounter(..  LARGE
26420 5f 49 4e 54 45 47 45 52 20 2a 6c 70 50 65 72 66  _INTEGER *lpPerf
26430 6f 72 6d 61 6e 63 65 43 6f 75 6e 74 29 3b 0d 0a  ormanceCount);..
26440 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
26450 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 51 75  ) export BOOL Qu
26460 65 72 79 50 65 72 66 6f 72 6d 61 6e 63 65 46 72  eryPerformanceFr
26470 65 71 75 65 6e 63 79 28 0d 0a 20 20 4c 41 52 47  equency(..  LARG
26480 45 5f 49 4e 54 45 47 45 52 20 2a 6c 70 46 72 65  E_INTEGER *lpFre
26490 71 75 65 6e 63 79 29 3b 0d 0a 0d 0a 65 78 74 65  quency);....exte
264a0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
264b0 72 74 20 42 4f 4f 4c 20 47 65 74 56 65 72 73 69  rt BOOL GetVersi
264c0 6f 6e 45 78 41 28 0d 0a 20 20 4c 50 4f 53 56 45  onExA(..  LPOSVE
264d0 52 53 49 4f 4e 49 4e 46 4f 41 20 6c 70 56 65 72  RSIONINFOA lpVer
264e0 73 69 6f 6e 49 6e 66 6f 72 6d 61 74 69 6f 6e 29  sionInformation)
264f0 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ;..extern(Window
26500 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47  s) export BOOL G
26510 65 74 56 65 72 73 69 6f 6e 45 78 57 28 0d 0a 20  etVersionExW(.. 
26520 20 4c 50 4f 53 56 45 52 53 49 4f 4e 49 4e 46 4f   LPOSVERSIONINFO
26530 57 20 6c 70 56 65 72 73 69 6f 6e 49 6e 66 6f 72  W lpVersionInfor
26540 6d 61 74 69 6f 6e 29 3b 0d 0a 2f 2f 20 23 69 66  mation);..// #if
26550 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
26560 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
26570 61 6c 69 61 73 20 47 65 74 56 65 72 73 69 6f 6e  alias GetVersion
26580 45 78 41 20 47 65 74 56 65 72 73 69 6f 6e 45 78  ExA GetVersionEx
26590 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
265a0 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65  !UNICODE....exte
265b0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
265c0 72 74 20 42 4f 4f 4c 20 56 65 72 69 66 79 56 65  rt BOOL VerifyVe
265d0 72 73 69 6f 6e 49 6e 66 6f 41 28 0d 0a 20 20 4c  rsionInfoA(..  L
265e0 50 4f 53 56 45 52 53 49 4f 4e 49 4e 46 4f 45 58  POSVERSIONINFOEX
265f0 41 20 6c 70 56 65 72 73 69 6f 6e 49 6e 66 6f 72  A lpVersionInfor
26600 6d 61 74 69 6f 6e 2c 0d 0a 20 20 44 57 4f 52 44  mation,..  DWORD
26610 20 64 77 54 79 70 65 4d 61 73 6b 2c 0d 0a 20 20   dwTypeMask,..  
26620 44 57 4f 52 44 4c 4f 4e 47 20 64 77 6c 43 6f 6e  DWORDLONG dwlCon
26630 64 69 74 69 6f 6e 4d 61 73 6b 29 3b 0d 0a 65 78  ditionMask);..ex
26640 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
26650 70 6f 72 74 20 42 4f 4f 4c 20 56 65 72 69 66 79  port BOOL Verify
26660 56 65 72 73 69 6f 6e 49 6e 66 6f 57 28 0d 0a 20  VersionInfoW(.. 
26670 20 4c 50 4f 53 56 45 52 53 49 4f 4e 49 4e 46 4f   LPOSVERSIONINFO
26680 45 58 57 20 6c 70 56 65 72 73 69 6f 6e 49 6e 66  EXW lpVersionInf
26690 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 44 57 4f  ormation,..  DWO
266a0 52 44 20 64 77 54 79 70 65 4d 61 73 6b 2c 0d 0a  RD dwTypeMask,..
266b0 20 20 44 57 4f 52 44 4c 4f 4e 47 20 64 77 6c 43    DWORDLONG dwlC
266c0 6f 6e 64 69 74 69 6f 6e 4d 61 73 6b 29 3b 0d 0a  onditionMask);..
266d0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
266e0 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
266f0 65 6c 73 65 0d 0a 61 6c 69 61 73 20 56 65 72 69  else..alias Veri
26700 66 79 56 65 72 73 69 6f 6e 49 6e 66 6f 41 20 56  fyVersionInfoA V
26710 65 72 69 66 79 56 65 72 73 69 6f 6e 49 6e 66 6f  erifyVersionInfo
26720 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
26730 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 69 6d 70 6f  !UNICODE....impo
26740 72 74 20 77 69 6e 33 32 2e 61 6e 73 69 2e 77 69  rt win32.ansi.wi
26750 6e 65 72 72 6f 72 3b 0d 0a 0d 0a 65 6e 75 6d 20  nerror;....enum 
26760 3a 20 75 69 6e 74 20 7b 20 54 43 5f 4e 4f 52 4d  : uint { TC_NORM
26770 41 4c 20 3d 20 30 20 7d 0d 0a 65 6e 75 6d 20 3a  AL = 0 }..enum :
26780 20 75 69 6e 74 20 7b 20 54 43 5f 48 41 52 44 45   uint { TC_HARDE
26790 52 52 20 3d 20 31 20 7d 0d 0a 65 6e 75 6d 20 3a  RR = 1 }..enum :
267a0 20 75 69 6e 74 20 7b 20 54 43 5f 47 50 5f 54 52   uint { TC_GP_TR
267b0 41 50 20 3d 20 32 20 7d 0d 0a 65 6e 75 6d 20 3a  AP = 2 }..enum :
267c0 20 75 69 6e 74 20 7b 20 54 43 5f 53 49 47 4e 41   uint { TC_SIGNA
267d0 4c 20 3d 20 33 20 7d 0d 0a 0d 0a 2f 2f 20 23 69  L = 3 }....// #i
267e0 66 28 57 49 4e 56 45 52 20 3e 3d 20 30 78 30 34  f(WINVER >= 0x04
267f0 30 30 29 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69  00)....enum : ui
26800 6e 74 20 7b 20 41 43 5f 4c 49 4e 45 5f 4f 46 46  nt { AC_LINE_OFF
26810 4c 49 4e 45 20 3d 20 30 78 30 30 20 7d 0d 0a 65  LINE = 0x00 }..e
26820 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41 43 5f  num : uint { AC_
26830 4c 49 4e 45 5f 4f 4e 4c 49 4e 45 20 3d 20 30 78  LINE_ONLINE = 0x
26840 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  01 }..enum : uin
26850 74 20 7b 20 41 43 5f 4c 49 4e 45 5f 42 41 43 4b  t { AC_LINE_BACK
26860 55 50 5f 50 4f 57 45 52 20 3d 20 30 78 30 32 20  UP_POWER = 0x02 
26870 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
26880 20 41 43 5f 4c 49 4e 45 5f 55 4e 4b 4e 4f 57 4e   AC_LINE_UNKNOWN
26890 20 3d 20 30 78 46 46 20 7d 0d 0a 0d 0a 65 6e 75   = 0xFF }....enu
268a0 6d 20 3a 20 75 69 6e 74 20 7b 20 42 41 54 54 45  m : uint { BATTE
268b0 52 59 5f 46 4c 41 47 5f 48 49 47 48 20 3d 20 30  RY_FLAG_HIGH = 0
268c0 78 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  x01 }..enum : ui
268d0 6e 74 20 7b 20 42 41 54 54 45 52 59 5f 46 4c 41  nt { BATTERY_FLA
268e0 47 5f 4c 4f 57 20 3d 20 30 78 30 32 20 7d 0d 0a  G_LOW = 0x02 }..
268f0 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 42 41  enum : uint { BA
26900 54 54 45 52 59 5f 46 4c 41 47 5f 43 52 49 54 49  TTERY_FLAG_CRITI
26910 43 41 4c 20 3d 20 30 78 30 34 20 7d 0d 0a 65 6e  CAL = 0x04 }..en
26920 75 6d 20 3a 20 75 69 6e 74 20 7b 20 42 41 54 54  um : uint { BATT
26930 45 52 59 5f 46 4c 41 47 5f 43 48 41 52 47 49 4e  ERY_FLAG_CHARGIN
26940 47 20 3d 20 30 78 30 38 20 7d 0d 0a 65 6e 75 6d  G = 0x08 }..enum
26950 20 3a 20 75 69 6e 74 20 7b 20 42 41 54 54 45 52   : uint { BATTER
26960 59 5f 46 4c 41 47 5f 4e 4f 5f 42 41 54 54 45 52  Y_FLAG_NO_BATTER
26970 59 20 3d 20 30 78 38 30 20 7d 0d 0a 65 6e 75 6d  Y = 0x80 }..enum
26980 20 3a 20 75 69 6e 74 20 7b 20 42 41 54 54 45 52   : uint { BATTER
26990 59 5f 46 4c 41 47 5f 55 4e 4b 4e 4f 57 4e 20 3d  Y_FLAG_UNKNOWN =
269a0 20 30 78 46 46 20 7d 0d 0a 0d 0a 65 6e 75 6d 20   0xFF }....enum 
269b0 3a 20 75 69 6e 74 20 7b 20 42 41 54 54 45 52 59  : uint { BATTERY
269c0 5f 50 45 52 43 45 4e 54 41 47 45 5f 55 4e 4b 4e  _PERCENTAGE_UNKN
269d0 4f 57 4e 20 3d 20 30 78 46 46 20 7d 0d 0a 0d 0a  OWN = 0xFF }....
269e0 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 42 41  enum : uint { BA
269f0 54 54 45 52 59 5f 4c 49 46 45 5f 55 4e 4b 4e 4f  TTERY_LIFE_UNKNO
26a00 57 4e 20 3d 20 30 78 46 46 46 46 46 46 46 46 20  WN = 0xFFFFFFFF 
26a10 7d 0d 0a 0d 0a 73 74 72 75 63 74 20 5f 53 59 53  }....struct _SYS
26a20 54 45 4d 5f 50 4f 57 45 52 5f 53 54 41 54 55 53  TEM_POWER_STATUS
26a30 20 7b 0d 0a 20 20 42 59 54 45 20 41 43 4c 69 6e   {..  BYTE ACLin
26a40 65 53 74 61 74 75 73 3b 0d 0a 20 20 42 59 54 45  eStatus;..  BYTE
26a50 20 42 61 74 74 65 72 79 46 6c 61 67 3b 0d 0a 20   BatteryFlag;.. 
26a60 20 42 59 54 45 20 42 61 74 74 65 72 79 4c 69 66   BYTE BatteryLif
26a70 65 50 65 72 63 65 6e 74 3b 0d 0a 20 20 42 59 54  ePercent;..  BYT
26a80 45 20 52 65 73 65 72 76 65 64 31 3b 0d 0a 20 20  E Reserved1;..  
26a90 44 57 4f 52 44 20 42 61 74 74 65 72 79 4c 69 66  DWORD BatteryLif
26aa0 65 54 69 6d 65 3b 0d 0a 20 20 44 57 4f 52 44 20  eTime;..  DWORD 
26ab0 42 61 74 74 65 72 79 46 75 6c 6c 4c 69 66 65 54  BatteryFullLifeT
26ac0 69 6d 65 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 5f  ime;..}..alias _
26ad0 53 59 53 54 45 4d 5f 50 4f 57 45 52 5f 53 54 41  SYSTEM_POWER_STA
26ae0 54 55 53 20 53 59 53 54 45 4d 5f 50 4f 57 45 52  TUS SYSTEM_POWER
26af0 5f 53 54 41 54 55 53 3b 0d 0a 61 6c 69 61 73 20  _STATUS;..alias 
26b00 5f 53 59 53 54 45 4d 5f 50 4f 57 45 52 5f 53 54  _SYSTEM_POWER_ST
26b10 41 54 55 53 2a 20 4c 50 53 59 53 54 45 4d 5f 50  ATUS* LPSYSTEM_P
26b20 4f 57 45 52 5f 53 54 41 54 55 53 3b 0d 0a 0d 0a  OWER_STATUS;....
26b30 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
26b40 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 53  export BOOL GetS
26b50 79 73 74 65 6d 50 6f 77 65 72 53 74 61 74 75 73  ystemPowerStatus
26b60 28 0d 0a 20 20 4c 50 53 59 53 54 45 4d 5f 50 4f  (..  LPSYSTEM_PO
26b70 57 45 52 5f 53 54 41 54 55 53 20 6c 70 53 79 73  WER_STATUS lpSys
26b80 74 65 6d 50 6f 77 65 72 53 74 61 74 75 73 29 3b  temPowerStatus);
26b90 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
26ba0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
26bb0 53 65 74 53 79 73 74 65 6d 50 6f 77 65 72 53 74  SetSystemPowerSt
26bc0 61 74 65 28 0d 0a 20 20 42 4f 4f 4c 20 66 53 75  ate(..  BOOL fSu
26bd0 73 70 65 6e 64 2c 0d 0a 20 20 42 4f 4f 4c 20 66  spend,..  BOOL f
26be0 46 6f 72 63 65 29 3b 0d 0a 0d 0a 2f 2f 20 23 65  Force);....// #e
26bf0 6e 64 69 66 20 2f 2a 20 57 49 4e 56 45 52 20 3e  ndif /* WINVER >
26c00 3d 20 30 78 30 34 30 30 20 2a 2f 0d 0a 0d 0a 2f  = 0x0400 */..../
26c10 2f 20 23 69 66 20 28 5f 57 49 4e 33 32 5f 57 49  / #if (_WIN32_WI
26c20 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 0d 0a  NNT >= 0x0500)..
26c30 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
26c40 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 6c  ) export BOOL Al
26c50 6c 6f 63 61 74 65 55 73 65 72 50 68 79 73 69 63  locateUserPhysic
26c60 61 6c 50 61 67 65 73 28 0d 0a 20 20 48 41 4e 44  alPages(..  HAND
26c70 4c 45 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20  LE hProcess,..  
26c80 50 55 4c 4f 4e 47 5f 50 54 52 20 4e 75 6d 62 65  PULONG_PTR Numbe
26c90 72 4f 66 50 61 67 65 73 2c 0d 0a 20 20 50 55 4c  rOfPages,..  PUL
26ca0 4f 4e 47 5f 50 54 52 20 50 61 67 65 41 72 72 61  ONG_PTR PageArra
26cb0 79 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  y);....extern(Wi
26cc0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
26cd0 4f 4c 20 46 72 65 65 55 73 65 72 50 68 79 73 69  OL FreeUserPhysi
26ce0 63 61 6c 50 61 67 65 73 28 0d 0a 20 20 48 41 4e  calPages(..  HAN
26cf0 44 4c 45 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20  DLE hProcess,.. 
26d00 20 50 55 4c 4f 4e 47 5f 50 54 52 20 4e 75 6d 62   PULONG_PTR Numb
26d10 65 72 4f 66 50 61 67 65 73 2c 0d 0a 20 20 50 55  erOfPages,..  PU
26d20 4c 4f 4e 47 5f 50 54 52 20 50 61 67 65 41 72 72  LONG_PTR PageArr
26d30 61 79 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  ay);....extern(W
26d40 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
26d50 4f 4f 4c 20 4d 61 70 55 73 65 72 50 68 79 73 69  OOL MapUserPhysi
26d60 63 61 6c 50 61 67 65 73 28 0d 0a 20 20 50 56 4f  calPages(..  PVO
26d70 49 44 20 56 69 72 74 75 61 6c 41 64 64 72 65 73  ID VirtualAddres
26d80 73 2c 0d 0a 20 20 55 4c 4f 4e 47 5f 50 54 52 20  s,..  ULONG_PTR 
26d90 4e 75 6d 62 65 72 4f 66 50 61 67 65 73 2c 0d 0a  NumberOfPages,..
26da0 20 20 50 55 4c 4f 4e 47 5f 50 54 52 20 50 61 67    PULONG_PTR Pag
26db0 65 41 72 72 61 79 20 29 3b 0d 0a 0d 0a 65 78 74  eArray );....ext
26dc0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
26dd0 6f 72 74 20 42 4f 4f 4c 20 4d 61 70 55 73 65 72  ort BOOL MapUser
26de0 50 68 79 73 69 63 61 6c 50 61 67 65 73 53 63 61  PhysicalPagesSca
26df0 74 74 65 72 28 0d 0a 20 20 50 56 4f 49 44 20 2a  tter(..  PVOID *
26e00 56 69 72 74 75 61 6c 41 64 64 72 65 73 73 65 73  VirtualAddresses
26e10 2c 0d 0a 20 20 55 4c 4f 4e 47 5f 50 54 52 20 4e  ,..  ULONG_PTR N
26e20 75 6d 62 65 72 4f 66 50 61 67 65 73 2c 0d 0a 20  umberOfPages,.. 
26e30 20 50 55 4c 4f 4e 47 5f 50 54 52 20 50 61 67 65   PULONG_PTR Page
26e40 41 72 72 61 79 20 29 3b 0d 0a 0d 0a 65 78 74 65  Array );....exte
26e50 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
26e60 72 74 20 48 41 4e 44 4c 45 20 43 72 65 61 74 65  rt HANDLE Create
26e70 4a 6f 62 4f 62 6a 65 63 74 41 28 0d 0a 20 20 4c  JobObjectA(..  L
26e80 50 53 45 43 55 52 49 54 59 5f 41 54 54 52 49 42  PSECURITY_ATTRIB
26e90 55 54 45 53 20 6c 70 4a 6f 62 41 74 74 72 69 62  UTES lpJobAttrib
26ea0 75 74 65 73 2c 0d 0a 20 20 4c 50 43 53 54 52 20  utes,..  LPCSTR 
26eb0 6c 70 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e  lpName);..extern
26ec0 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
26ed0 20 48 41 4e 44 4c 45 20 43 72 65 61 74 65 4a 6f   HANDLE CreateJo
26ee0 62 4f 62 6a 65 63 74 57 28 0d 0a 20 20 4c 50 53  bObjectW(..  LPS
26ef0 45 43 55 52 49 54 59 5f 41 54 54 52 49 42 55 54  ECURITY_ATTRIBUT
26f00 45 53 20 6c 70 4a 6f 62 41 74 74 72 69 62 75 74  ES lpJobAttribut
26f10 65 73 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  es,..  LPCWSTR l
26f20 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  pName);..// #ifd
26f30 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
26f40 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
26f50 6c 69 61 73 20 43 72 65 61 74 65 4a 6f 62 4f 62  lias CreateJobOb
26f60 6a 65 63 74 41 20 43 72 65 61 74 65 4a 6f 62 4f  jectA CreateJobO
26f70 62 6a 65 63 74 3b 0d 0a 2f 2f 20 23 65 6e 64 69  bject;..// #endi
26f80 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
26f90 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
26fa0 20 65 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 4f   export HANDLE O
26fb0 70 65 6e 4a 6f 62 4f 62 6a 65 63 74 41 28 0d 0a  penJobObjectA(..
26fc0 20 20 44 57 4f 52 44 20 64 77 44 65 73 69 72 65    DWORD dwDesire
26fd0 64 41 63 63 65 73 73 2c 0d 0a 20 20 42 4f 4f 4c  dAccess,..  BOOL
26fe0 20 62 49 6e 68 65 72 69 74 48 61 6e 64 6c 65 2c   bInheritHandle,
26ff0 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4e 61 6d  ..  LPCSTR lpNam
27000 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  e);..extern(Wind
27010 6f 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44  ows) export HAND
27020 4c 45 20 4f 70 65 6e 4a 6f 62 4f 62 6a 65 63 74  LE OpenJobObject
27030 57 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 44 65  W(..  DWORD dwDe
27040 73 69 72 65 64 41 63 63 65 73 73 2c 0d 0a 20 20  siredAccess,..  
27050 42 4f 4f 4c 20 62 49 6e 68 65 72 69 74 48 61 6e  BOOL bInheritHan
27060 64 6c 65 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20  dle,..  LPCWSTR 
27070 6c 70 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66  lpName);..// #if
27080 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20  def UNICODE..// 
27090 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  #.....// #else..
270a0 61 6c 69 61 73 20 4f 70 65 6e 4a 6f 62 4f 62 6a  alias OpenJobObj
270b0 65 63 74 41 20 4f 70 65 6e 4a 6f 62 4f 62 6a 65  ectA OpenJobObje
270c0 63 74 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  ct;..// #endif /
270d0 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
270e0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
270f0 70 6f 72 74 20 42 4f 4f 4c 20 41 73 73 69 67 6e  port BOOL Assign
27100 50 72 6f 63 65 73 73 54 6f 4a 6f 62 4f 62 6a 65  ProcessToJobObje
27110 63 74 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 4a  ct(..  HANDLE hJ
27120 6f 62 2c 0d 0a 20 20 48 41 4e 44 4c 45 20 68 50  ob,..  HANDLE hP
27130 72 6f 63 65 73 73 29 3b 0d 0a 0d 0a 65 78 74 65  rocess);....exte
27140 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
27150 72 74 20 42 4f 4f 4c 20 54 65 72 6d 69 6e 61 74  rt BOOL Terminat
27160 65 4a 6f 62 4f 62 6a 65 63 74 28 0d 0a 20 20 48  eJobObject(..  H
27170 41 4e 44 4c 45 20 68 4a 6f 62 2c 0d 0a 20 20 55  ANDLE hJob,..  U
27180 49 4e 54 20 75 45 78 69 74 43 6f 64 65 29 3b 0d  INT uExitCode);.
27190 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
271a0 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 51  s) export BOOL Q
271b0 75 65 72 79 49 6e 66 6f 72 6d 61 74 69 6f 6e 4a  ueryInformationJ
271c0 6f 62 4f 62 6a 65 63 74 28 0d 0a 20 20 48 41 4e  obObject(..  HAN
271d0 44 4c 45 20 68 4a 6f 62 2c 0d 0a 20 20 4a 4f 42  DLE hJob,..  JOB
271e0 4f 42 4a 45 43 54 49 4e 46 4f 43 4c 41 53 53 20  OBJECTINFOCLASS 
271f0 4a 6f 62 4f 62 6a 65 63 74 49 6e 66 6f 72 6d 61  JobObjectInforma
27200 74 69 6f 6e 43 6c 61 73 73 2c 0d 0a 20 20 4c 50  tionClass,..  LP
27210 56 4f 49 44 20 6c 70 4a 6f 62 4f 62 6a 65 63 74  VOID lpJobObject
27220 49 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20  Information,..  
27230 44 57 4f 52 44 20 63 62 4a 6f 62 4f 62 6a 65 63  DWORD cbJobObjec
27240 74 49 6e 66 6f 72 6d 61 74 69 6f 6e 4c 65 6e 67  tInformationLeng
27250 74 68 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  th,..  LPDWORD l
27260 70 52 65 74 75 72 6e 4c 65 6e 67 74 68 29 3b 0d  pReturnLength);.
27270 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
27280 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 53  s) export BOOL S
27290 65 74 49 6e 66 6f 72 6d 61 74 69 6f 6e 4a 6f 62  etInformationJob
272a0 4f 62 6a 65 63 74 28 0d 0a 20 20 48 41 4e 44 4c  Object(..  HANDL
272b0 45 20 68 4a 6f 62 2c 0d 0a 20 20 4a 4f 42 4f 42  E hJob,..  JOBOB
272c0 4a 45 43 54 49 4e 46 4f 43 4c 41 53 53 20 4a 6f  JECTINFOCLASS Jo
272d0 62 4f 62 6a 65 63 74 49 6e 66 6f 72 6d 61 74 69  bObjectInformati
272e0 6f 6e 43 6c 61 73 73 2c 0d 0a 20 20 4c 50 56 4f  onClass,..  LPVO
272f0 49 44 20 6c 70 4a 6f 62 4f 62 6a 65 63 74 49 6e  ID lpJobObjectIn
27300 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 44 57  formation,..  DW
27310 4f 52 44 20 63 62 4a 6f 62 4f 62 6a 65 63 74 49  ORD cbJobObjectI
27320 6e 66 6f 72 6d 61 74 69 6f 6e 4c 65 6e 67 74 68  nformationLength
27330 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
27340 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
27350 4c 20 49 73 50 72 6f 63 65 73 73 49 6e 4a 6f 62  L IsProcessInJob
27360 28 0d 0a 20 20 48 41 4e 44 4c 45 20 50 72 6f 63  (..  HANDLE Proc
27370 65 73 73 48 61 6e 64 6c 65 2c 0d 0a 20 20 48 41  essHandle,..  HA
27380 4e 44 4c 45 20 4a 6f 62 48 61 6e 64 6c 65 2c 0d  NDLE JobHandle,.
27390 0a 20 20 50 42 4f 4f 4c 20 52 65 73 75 6c 74 29  .  PBOOL Result)
273a0 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  ;....extern(Wind
273b0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
273c0 20 43 72 65 61 74 65 4a 6f 62 53 65 74 28 0d 0a   CreateJobSet(..
273d0 20 20 55 4c 4f 4e 47 20 4e 75 6d 4a 6f 62 2c 0d    ULONG NumJob,.
273e0 0a 20 20 50 4a 4f 42 5f 53 45 54 5f 41 52 52 41  .  PJOB_SET_ARRA
273f0 59 20 55 73 65 72 4a 6f 62 53 65 74 2c 0d 0a 20  Y UserJobSet,.. 
27400 20 55 4c 4f 4e 47 20 46 6c 61 67 73 29 3b 0d 0a   ULONG Flags);..
27410 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
27420 29 20 65 78 70 6f 72 74 20 50 56 4f 49 44 20 41  ) export PVOID A
27430 64 64 56 65 63 74 6f 72 65 64 45 78 63 65 70 74  ddVectoredExcept
27440 69 6f 6e 48 61 6e 64 6c 65 72 28 0d 0a 20 20 55  ionHandler(..  U
27450 4c 4f 4e 47 20 46 69 72 73 74 48 61 6e 64 6c 65  LONG FirstHandle
27460 72 2c 0d 0a 20 20 50 56 45 43 54 4f 52 45 44 5f  r,..  PVECTORED_
27470 45 58 43 45 50 54 49 4f 4e 5f 48 41 4e 44 4c 45  EXCEPTION_HANDLE
27480 52 20 56 65 63 74 6f 72 65 64 48 61 6e 64 6c 65  R VectoredHandle
27490 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  r);....extern(Wi
274a0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 55 4c  ndows) export UL
274b0 4f 4e 47 20 52 65 6d 6f 76 65 56 65 63 74 6f 72  ONG RemoveVector
274c0 65 64 45 78 63 65 70 74 69 6f 6e 48 61 6e 64 6c  edExceptionHandl
274d0 65 72 28 0d 0a 20 20 50 56 4f 49 44 20 56 65 63  er(..  PVOID Vec
274e0 74 6f 72 65 64 48 61 6e 64 6c 65 72 48 61 6e 64  toredHandlerHand
274f0 6c 65 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  le);....extern(W
27500 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 48  indows) export H
27510 41 4e 44 4c 45 20 46 69 6e 64 46 69 72 73 74 56  ANDLE FindFirstV
27520 6f 6c 75 6d 65 41 28 0d 0a 20 20 4c 50 53 54 52  olumeA(..  LPSTR
27530 20 6c 70 73 7a 56 6f 6c 75 6d 65 4e 61 6d 65 2c   lpszVolumeName,
27540 0d 0a 20 20 44 57 4f 52 44 20 63 63 68 42 75 66  ..  DWORD cchBuf
27550 66 65 72 4c 65 6e 67 74 68 29 3b 0d 0a 65 78 74  ferLength);..ext
27560 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
27570 6f 72 74 20 48 41 4e 44 4c 45 20 46 69 6e 64 46  ort HANDLE FindF
27580 69 72 73 74 56 6f 6c 75 6d 65 57 28 0d 0a 20 20  irstVolumeW(..  
27590 4c 50 57 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d  LPWSTR lpszVolum
275a0 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20  eName,..  DWORD 
275b0 63 63 68 42 75 66 66 65 72 4c 65 6e 67 74 68 29  cchBufferLength)
275c0 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
275d0 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
275e0 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46  / #else..alias F
275f0 69 6e 64 46 69 72 73 74 56 6f 6c 75 6d 65 41 20  indFirstVolumeA 
27600 46 69 6e 64 46 69 72 73 74 56 6f 6c 75 6d 65 3b  FindFirstVolume;
27610 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
27620 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
27630 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
27640 74 20 42 4f 4f 4c 20 46 69 6e 64 4e 65 78 74 56  t BOOL FindNextV
27650 6f 6c 75 6d 65 41 28 0d 0a 20 20 48 41 4e 44 4c  olumeA(..  HANDL
27660 45 20 68 46 69 6e 64 56 6f 6c 75 6d 65 2c 0d 0a  E hFindVolume,..
27670 20 20 4c 50 53 54 52 20 6c 70 73 7a 56 6f 6c 75    LPSTR lpszVolu
27680 6d 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  meName,..  DWORD
27690 20 63 63 68 42 75 66 66 65 72 4c 65 6e 67 74 68   cchBufferLength
276a0 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
276b0 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
276c0 46 69 6e 64 4e 65 78 74 56 6f 6c 75 6d 65 57 28  FindNextVolumeW(
276d0 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6e 64  ..  HANDLE hFind
276e0 56 6f 6c 75 6d 65 2c 0d 0a 20 20 4c 50 57 53 54  Volume,..  LPWST
276f0 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 4e 61 6d 65  R lpszVolumeName
27700 2c 0d 0a 20 20 44 57 4f 52 44 20 63 63 68 42 75  ,..  DWORD cchBu
27710 66 66 65 72 4c 65 6e 67 74 68 29 3b 0d 0a 2f 2f  fferLength);..//
27720 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
27730 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c  .// #.....// #el
27740 73 65 0d 0a 61 6c 69 61 73 20 46 69 6e 64 4e 65  se..alias FindNe
27750 78 74 56 6f 6c 75 6d 65 41 20 46 69 6e 64 4e 65  xtVolumeA FindNe
27760 78 74 56 6f 6c 75 6d 65 3b 0d 0a 2f 2f 20 23 65  xtVolume;..// #e
27770 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
27780 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
27790 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
277a0 46 69 6e 64 56 6f 6c 75 6d 65 43 6c 6f 73 65 28  FindVolumeClose(
277b0 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69 6e 64  ..  HANDLE hFind
277c0 56 6f 6c 75 6d 65 29 3b 0d 0a 0d 0a 65 78 74 65  Volume);....exte
277d0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
277e0 72 74 20 48 41 4e 44 4c 45 20 46 69 6e 64 46 69  rt HANDLE FindFi
277f0 72 73 74 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f  rstVolumeMountPo
27800 69 6e 74 41 28 0d 0a 20 20 4c 50 43 53 54 52 20  intA(..  LPCSTR 
27810 6c 70 73 7a 52 6f 6f 74 50 61 74 68 4e 61 6d 65  lpszRootPathName
27820 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 73 7a 56  ,..  LPSTR lpszV
27830 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74 2c  olumeMountPoint,
27840 0d 0a 20 20 44 57 4f 52 44 20 63 63 68 42 75 66  ..  DWORD cchBuf
27850 66 65 72 4c 65 6e 67 74 68 29 3b 0d 0a 65 78 74  ferLength);..ext
27860 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
27870 6f 72 74 20 48 41 4e 44 4c 45 20 46 69 6e 64 46  ort HANDLE FindF
27880 69 72 73 74 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50  irstVolumeMountP
27890 6f 69 6e 74 57 28 0d 0a 20 20 4c 50 43 57 53 54  ointW(..  LPCWST
278a0 52 20 6c 70 73 7a 52 6f 6f 74 50 61 74 68 4e 61  R lpszRootPathNa
278b0 6d 65 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70  me,..  LPWSTR lp
278c0 73 7a 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69  szVolumeMountPoi
278d0 6e 74 2c 0d 0a 20 20 44 57 4f 52 44 20 63 63 68  nt,..  DWORD cch
278e0 42 75 66 66 65 72 4c 65 6e 67 74 68 29 3b 0d 0a  BufferLength);..
278f0 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
27900 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
27910 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46 69 6e 64  else..alias Find
27920 46 69 72 73 74 56 6f 6c 75 6d 65 4d 6f 75 6e 74  FirstVolumeMount
27930 50 6f 69 6e 74 41 20 46 69 6e 64 46 69 72 73 74  PointA FindFirst
27940 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74  VolumeMountPoint
27950 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
27960 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65  !UNICODE....exte
27970 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
27980 72 74 20 42 4f 4f 4c 20 46 69 6e 64 4e 65 78 74  rt BOOL FindNext
27990 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74  VolumeMountPoint
279a0 41 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46 69  A(..  HANDLE hFi
279b0 6e 64 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69  ndVolumeMountPoi
279c0 6e 74 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 73  nt,..  LPSTR lps
279d0 7a 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e  zVolumeMountPoin
279e0 74 2c 0d 0a 20 20 44 57 4f 52 44 20 63 63 68 42  t,..  DWORD cchB
279f0 75 66 66 65 72 4c 65 6e 67 74 68 29 3b 0d 0a 65  ufferLength);..e
27a00 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
27a10 78 70 6f 72 74 20 42 4f 4f 4c 20 46 69 6e 64 4e  xport BOOL FindN
27a20 65 78 74 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f  extVolumeMountPo
27a30 69 6e 74 57 28 0d 0a 20 20 48 41 4e 44 4c 45 20  intW(..  HANDLE 
27a40 68 46 69 6e 64 56 6f 6c 75 6d 65 4d 6f 75 6e 74  hFindVolumeMount
27a50 50 6f 69 6e 74 2c 0d 0a 20 20 4c 50 57 53 54 52  Point,..  LPWSTR
27a60 20 6c 70 73 7a 56 6f 6c 75 6d 65 4d 6f 75 6e 74   lpszVolumeMount
27a70 50 6f 69 6e 74 2c 0d 0a 20 20 44 57 4f 52 44 20  Point,..  DWORD 
27a80 63 63 68 42 75 66 66 65 72 4c 65 6e 67 74 68 29  cchBufferLength)
27a90 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
27aa0 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  CODE..// #...../
27ab0 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 46  / #else..alias F
27ac0 69 6e 64 4e 65 78 74 56 6f 6c 75 6d 65 4d 6f 75  indNextVolumeMou
27ad0 6e 74 50 6f 69 6e 74 41 20 46 69 6e 64 4e 65 78  ntPointA FindNex
27ae0 74 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e  tVolumeMountPoin
27af0 74 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f  t;..// #endif //
27b00 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74   !UNICODE....ext
27b10 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
27b20 6f 72 74 20 42 4f 4f 4c 20 46 69 6e 64 56 6f 6c  ort BOOL FindVol
27b30 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74 43 6c 6f  umeMountPointClo
27b40 73 65 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68 46  se(..  HANDLE hF
27b50 69 6e 64 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f  indVolumeMountPo
27b60 69 6e 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  int);....extern(
27b70 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
27b80 42 4f 4f 4c 20 53 65 74 56 6f 6c 75 6d 65 4d 6f  BOOL SetVolumeMo
27b90 75 6e 74 50 6f 69 6e 74 41 28 0d 0a 20 20 4c 50  untPointA(..  LP
27ba0 43 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 4d  CSTR lpszVolumeM
27bb0 6f 75 6e 74 50 6f 69 6e 74 2c 0d 0a 20 20 4c 50  ountPoint,..  LP
27bc0 43 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 4e  CSTR lpszVolumeN
27bd0 61 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ame);..extern(Wi
27be0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
27bf0 4f 4c 20 53 65 74 56 6f 6c 75 6d 65 4d 6f 75 6e  OL SetVolumeMoun
27c00 74 50 6f 69 6e 74 57 28 0d 0a 20 20 4c 50 43 57  tPointW(..  LPCW
27c10 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 4d 6f  STR lpszVolumeMo
27c20 75 6e 74 50 6f 69 6e 74 2c 0d 0a 20 20 4c 50 43  untPoint,..  LPC
27c30 57 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 4e  WSTR lpszVolumeN
27c40 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ame);..// #ifdef
27c50 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e   UNICODE..// #..
27c60 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69  ...// #else..ali
27c70 61 73 20 53 65 74 56 6f 6c 75 6d 65 4d 6f 75 6e  as SetVolumeMoun
27c80 74 50 6f 69 6e 74 41 20 53 65 74 56 6f 6c 75 6d  tPointA SetVolum
27c90 65 4d 6f 75 6e 74 50 6f 69 6e 74 3b 0d 0a 2f 2f  eMountPoint;..//
27ca0 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
27cb0 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
27cc0 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f  ndows) export BO
27cd0 4f 4c 20 44 65 6c 65 74 65 56 6f 6c 75 6d 65 4d  OL DeleteVolumeM
27ce0 6f 75 6e 74 50 6f 69 6e 74 41 28 0d 0a 20 20 4c  ountPointA(..  L
27cf0 50 43 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65  PCSTR lpszVolume
27d00 4d 6f 75 6e 74 50 6f 69 6e 74 29 3b 0d 0a 65 78  MountPoint);..ex
27d10 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
27d20 70 6f 72 74 20 42 4f 4f 4c 20 44 65 6c 65 74 65  port BOOL Delete
27d30 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74  VolumeMountPoint
27d40 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  W(..  LPCWSTR lp
27d50 73 7a 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69  szVolumeMountPoi
27d60 6e 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  nt);..// #ifdef 
27d70 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
27d80 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
27d90 73 20 44 65 6c 65 74 65 56 6f 6c 75 6d 65 4d 6f  s DeleteVolumeMo
27da0 75 6e 74 50 6f 69 6e 74 41 20 44 65 6c 65 74 65  untPointA Delete
27db0 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74  VolumeMountPoint
27dc0 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20  ;..// #endif // 
27dd0 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65  !UNICODE....exte
27de0 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
27df0 72 74 20 42 4f 4f 4c 20 47 65 74 56 6f 6c 75 6d  rt BOOL GetVolum
27e00 65 4e 61 6d 65 46 6f 72 56 6f 6c 75 6d 65 4d 6f  eNameForVolumeMo
27e10 75 6e 74 50 6f 69 6e 74 41 28 0d 0a 20 20 4c 50  untPointA(..  LP
27e20 43 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 4d  CSTR lpszVolumeM
27e30 6f 75 6e 74 50 6f 69 6e 74 2c 0d 0a 20 20 4c 50  ountPoint,..  LP
27e40 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 4e 61  STR lpszVolumeNa
27e50 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20 63 63 68  me,..  DWORD cch
27e60 42 75 66 66 65 72 4c 65 6e 67 74 68 29 3b 0d 0a  BufferLength);..
27e70 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
27e80 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 56  export BOOL GetV
27e90 6f 6c 75 6d 65 4e 61 6d 65 46 6f 72 56 6f 6c 75  olumeNameForVolu
27ea0 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74 57 28 0d 0a  meMountPointW(..
27eb0 20 20 4c 50 43 57 53 54 52 20 6c 70 73 7a 56 6f    LPCWSTR lpszVo
27ec0 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69 6e 74 2c 0d  lumeMountPoint,.
27ed0 0a 20 20 4c 50 57 53 54 52 20 6c 70 73 7a 56 6f  .  LPWSTR lpszVo
27ee0 6c 75 6d 65 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f  lumeName,..  DWO
27ef0 52 44 20 63 63 68 42 75 66 66 65 72 4c 65 6e 67  RD cchBufferLeng
27f00 74 68 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  th);..// #ifdef 
27f10 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
27f20 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
27f30 73 20 47 65 74 56 6f 6c 75 6d 65 4e 61 6d 65 46  s GetVolumeNameF
27f40 6f 72 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50 6f 69  orVolumeMountPoi
27f50 6e 74 41 20 47 65 74 56 6f 6c 75 6d 65 4e 61 6d  ntA GetVolumeNam
27f60 65 46 6f 72 56 6f 6c 75 6d 65 4d 6f 75 6e 74 50  eForVolumeMountP
27f70 6f 69 6e 74 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  oint;..// #endif
27f80 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
27f90 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
27fa0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 56  export BOOL GetV
27fb0 6f 6c 75 6d 65 50 61 74 68 4e 61 6d 65 41 28 0d  olumePathNameA(.
27fc0 0a 20 20 4c 50 43 53 54 52 20 6c 70 73 7a 46 69  .  LPCSTR lpszFi
27fd0 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 54 52  leName,..  LPSTR
27fe0 20 6c 70 73 7a 56 6f 6c 75 6d 65 50 61 74 68 4e   lpszVolumePathN
27ff0 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20 63 63  ame,..  DWORD cc
28000 68 42 75 66 66 65 72 4c 65 6e 67 74 68 29 3b 0d  hBufferLength);.
28010 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
28020 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74   export BOOL Get
28030 56 6f 6c 75 6d 65 50 61 74 68 4e 61 6d 65 57 28  VolumePathNameW(
28040 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 73 7a  ..  LPCWSTR lpsz
28050 46 69 6c 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57  FileName,..  LPW
28060 53 54 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 50 61  STR lpszVolumePa
28070 74 68 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  thName,..  DWORD
28080 20 63 63 68 42 75 66 66 65 72 4c 65 6e 67 74 68   cchBufferLength
28090 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
280a0 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  ICODE..// #.....
280b0 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20  // #else..alias 
280c0 47 65 74 56 6f 6c 75 6d 65 50 61 74 68 4e 61 6d  GetVolumePathNam
280d0 65 41 20 47 65 74 56 6f 6c 75 6d 65 50 61 74 68  eA GetVolumePath
280e0 4e 61 6d 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66  Name;..// #endif
280f0 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
28100 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
28110 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 56  export BOOL GetV
28120 6f 6c 75 6d 65 50 61 74 68 4e 61 6d 65 73 46 6f  olumePathNamesFo
28130 72 56 6f 6c 75 6d 65 4e 61 6d 65 41 28 0d 0a 20  rVolumeNameA(.. 
28140 20 4c 50 43 53 54 52 20 6c 70 73 7a 56 6f 6c 75   LPCSTR lpszVolu
28150 6d 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 54 52  meName,..  LPSTR
28160 20 6c 70 73 7a 56 6f 6c 75 6d 65 50 61 74 68 4e   lpszVolumePathN
28170 61 6d 65 73 2c 0d 0a 20 20 44 57 4f 52 44 20 63  ames,..  DWORD c
28180 63 68 42 75 66 66 65 72 4c 65 6e 67 74 68 2c 0d  chBufferLength,.
28190 0a 20 20 50 44 57 4f 52 44 20 6c 70 63 63 68 52  .  PDWORD lpcchR
281a0 65 74 75 72 6e 4c 65 6e 67 74 68 29 3b 0d 0a 65  eturnLength);..e
281b0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
281c0 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 56 6f  xport BOOL GetVo
281d0 6c 75 6d 65 50 61 74 68 4e 61 6d 65 73 46 6f 72  lumePathNamesFor
281e0 56 6f 6c 75 6d 65 4e 61 6d 65 57 28 0d 0a 20 20  VolumeNameW(..  
281f0 4c 50 43 57 53 54 52 20 6c 70 73 7a 56 6f 6c 75  LPCWSTR lpszVolu
28200 6d 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53 54  meName,..  LPWST
28210 52 20 6c 70 73 7a 56 6f 6c 75 6d 65 50 61 74 68  R lpszVolumePath
28220 4e 61 6d 65 73 2c 0d 0a 20 20 44 57 4f 52 44 20  Names,..  DWORD 
28230 63 63 68 42 75 66 66 65 72 4c 65 6e 67 74 68 2c  cchBufferLength,
28240 0d 0a 20 20 50 44 57 4f 52 44 20 6c 70 63 63 68  ..  PDWORD lpcch
28250 52 65 74 75 72 6e 4c 65 6e 67 74 68 29 3b 0d 0a  ReturnLength);..
28260 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44  // #ifdef UNICOD
28270 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23  E..// #.....// #
28280 65 6c 73 65 0d 0a 61 6c 69 61 73 20 47 65 74 56  else..alias GetV
28290 6f 6c 75 6d 65 50 61 74 68 4e 61 6d 65 73 46 6f  olumePathNamesFo
282a0 72 56 6f 6c 75 6d 65 4e 61 6d 65 41 20 47 65 74  rVolumeNameA Get
282b0 56 6f 6c 75 6d 65 50 61 74 68 4e 61 6d 65 73 46  VolumePathNamesF
282c0 6f 72 56 6f 6c 75 6d 65 4e 61 6d 65 3b 0d 0a 2f  orVolumeName;../
282d0 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
282e0 43 4f 44 45 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69  CODE....// #endi
282f0 66 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f 57 49  f....// #if (_WI
28300 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30  N32_WINNT >= 0x0
28310 35 30 30 29 20 7c 7c 20 28 5f 57 49 4e 33 32 5f  500) || (_WIN32_
28320 46 55 53 49 4f 4e 20 3e 3d 20 30 78 30 31 30 30  FUSION >= 0x0100
28330 29 20 7c 7c 20 49 53 4f 4c 41 54 49 4f 4e 5f 41  ) || ISOLATION_A
28340 57 41 52 45 5f 45 4e 41 42 4c 45 44 0d 0a 0d 0a  WARE_ENABLED....
28350 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41 43  enum : uint { AC
28360 54 43 54 58 5f 46 4c 41 47 5f 50 52 4f 43 45 53  TCTX_FLAG_PROCES
28370 53 4f 52 5f 41 52 43 48 49 54 45 43 54 55 52 45  SOR_ARCHITECTURE
28380 5f 56 41 4c 49 44 20 3d 20 30 78 30 30 30 30 30  _VALID = 0x00000
28390 30 30 31 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  001 }..enum : ui
283a0 6e 74 20 7b 20 41 43 54 43 54 58 5f 46 4c 41 47  nt { ACTCTX_FLAG
283b0 5f 4c 41 4e 47 49 44 5f 56 41 4c 49 44 20 3d 20  _LANGID_VALID = 
283c0 30 78 30 30 30 30 30 30 30 32 20 7d 0d 0a 65 6e  0x00000002 }..en
283d0 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41 43 54 43  um : uint { ACTC
283e0 54 58 5f 46 4c 41 47 5f 41 53 53 45 4d 42 4c 59  TX_FLAG_ASSEMBLY
283f0 5f 44 49 52 45 43 54 4f 52 59 5f 56 41 4c 49 44  _DIRECTORY_VALID
28400 20 3d 20 30 78 30 30 30 30 30 30 30 34 20 7d 0d   = 0x00000004 }.
28410 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41  .enum : uint { A
28420 43 54 43 54 58 5f 46 4c 41 47 5f 52 45 53 4f 55  CTCTX_FLAG_RESOU
28430 52 43 45 5f 4e 41 4d 45 5f 56 41 4c 49 44 20 3d  RCE_NAME_VALID =
28440 20 30 78 30 30 30 30 30 30 30 38 20 7d 0d 0a 65   0x00000008 }..e
28450 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41 43 54  num : uint { ACT
28460 43 54 58 5f 46 4c 41 47 5f 53 45 54 5f 50 52 4f  CTX_FLAG_SET_PRO
28470 43 45 53 53 5f 44 45 46 41 55 4c 54 20 3d 20 30  CESS_DEFAULT = 0
28480 78 30 30 30 30 30 30 31 30 20 7d 0d 0a 65 6e 75  x00000010 }..enu
28490 6d 20 3a 20 75 69 6e 74 20 7b 20 41 43 54 43 54  m : uint { ACTCT
284a0 58 5f 46 4c 41 47 5f 41 50 50 4c 49 43 41 54 49  X_FLAG_APPLICATI
284b0 4f 4e 5f 4e 41 4d 45 5f 56 41 4c 49 44 20 3d 20  ON_NAME_VALID = 
284c0 30 78 30 30 30 30 30 30 32 30 20 7d 0d 0a 65 6e  0x00000020 }..en
284d0 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41 43 54 43  um : uint { ACTC
284e0 54 58 5f 46 4c 41 47 5f 53 4f 55 52 43 45 5f 49  TX_FLAG_SOURCE_I
284f0 53 5f 41 53 53 45 4d 42 4c 59 52 45 46 20 3d 20  S_ASSEMBLYREF = 
28500 30 78 30 30 30 30 30 30 34 30 20 7d 0d 0a 65 6e  0x00000040 }..en
28510 75 6d 20 3a 20 75 69 6e 74 20 7b 20 41 43 54 43  um : uint { ACTC
28520 54 58 5f 46 4c 41 47 5f 48 4d 4f 44 55 4c 45 5f  TX_FLAG_HMODULE_
28530 56 41 4c 49 44 20 3d 20 30 78 30 30 30 30 30 30  VALID = 0x000000
28540 38 30 20 7d 0d 0a 0d 0a 73 74 72 75 63 74 20 74  80 }....struct t
28550 61 67 41 43 54 43 54 58 41 20 7b 0d 0a 20 20 55  agACTCTXA {..  U
28560 4c 4f 4e 47 20 63 62 53 69 7a 65 3b 0d 0a 20 20  LONG cbSize;..  
28570 44 57 4f 52 44 20 64 77 46 6c 61 67 73 3b 0d 0a  DWORD dwFlags;..
28580 20 20 4c 50 43 53 54 52 20 6c 70 53 6f 75 72 63    LPCSTR lpSourc
28590 65 3b 0d 0a 20 20 55 53 48 4f 52 54 20 77 50 72  e;..  USHORT wPr
285a0 6f 63 65 73 73 6f 72 41 72 63 68 69 74 65 63 74  ocessorArchitect
285b0 75 72 65 3b 0d 0a 20 20 4c 41 4e 47 49 44 20 77  ure;..  LANGID w
285c0 4c 61 6e 67 49 64 3b 0d 0a 20 20 4c 50 43 53 54  LangId;..  LPCST
285d0 52 20 6c 70 41 73 73 65 6d 62 6c 79 44 69 72 65  R lpAssemblyDire
285e0 63 74 6f 72 79 3b 0d 0a 20 20 4c 50 43 53 54 52  ctory;..  LPCSTR
285f0 20 6c 70 52 65 73 6f 75 72 63 65 4e 61 6d 65 3b   lpResourceName;
28600 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 41 70 70  ..  LPCSTR lpApp
28610 6c 69 63 61 74 69 6f 6e 4e 61 6d 65 3b 0d 0a 20  licationName;.. 
28620 20 48 4d 4f 44 55 4c 45 20 68 4d 6f 64 75 6c 65   HMODULE hModule
28630 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 74 61 67 41  ;..}..alias tagA
28640 43 54 43 54 58 41 20 41 43 54 43 54 58 41 3b 0d  CTCTXA ACTCTXA;.
28650 0a 61 6c 69 61 73 20 74 61 67 41 43 54 43 54 58  .alias tagACTCTX
28660 41 2a 20 50 41 43 54 43 54 58 41 3b 0d 0a 0d 0a  A* PACTCTXA;....
28670 73 74 72 75 63 74 20 74 61 67 41 43 54 43 54 58  struct tagACTCTX
28680 57 20 7b 0d 0a 20 20 55 4c 4f 4e 47 20 63 62 53  W {..  ULONG cbS
28690 69 7a 65 3b 0d 0a 20 20 44 57 4f 52 44 20 64 77  ize;..  DWORD dw
286a0 46 6c 61 67 73 3b 0d 0a 20 20 4c 50 43 57 53 54  Flags;..  LPCWST
286b0 52 20 6c 70 53 6f 75 72 63 65 3b 0d 0a 20 20 55  R lpSource;..  U
286c0 53 48 4f 52 54 20 77 50 72 6f 63 65 73 73 6f 72  SHORT wProcessor
286d0 41 72 63 68 69 74 65 63 74 75 72 65 3b 0d 0a 20  Architecture;.. 
286e0 20 4c 41 4e 47 49 44 20 77 4c 61 6e 67 49 64 3b   LANGID wLangId;
286f0 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 41 73  ..  LPCWSTR lpAs
28700 73 65 6d 62 6c 79 44 69 72 65 63 74 6f 72 79 3b  semblyDirectory;
28710 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 52 65  ..  LPCWSTR lpRe
28720 73 6f 75 72 63 65 4e 61 6d 65 3b 0d 0a 20 20 4c  sourceName;..  L
28730 50 43 57 53 54 52 20 6c 70 41 70 70 6c 69 63 61  PCWSTR lpApplica
28740 74 69 6f 6e 4e 61 6d 65 3b 0d 0a 20 20 48 4d 4f  tionName;..  HMO
28750 44 55 4c 45 20 68 4d 6f 64 75 6c 65 3b 0d 0a 7d  DULE hModule;..}
28760 0d 0a 61 6c 69 61 73 20 74 61 67 41 43 54 43 54  ..alias tagACTCT
28770 58 57 20 41 43 54 43 54 58 57 3b 0d 0a 61 6c 69  XW ACTCTXW;..ali
28780 61 73 20 74 61 67 41 43 54 43 54 58 57 2a 20 50  as tagACTCTXW* P
28790 41 43 54 43 54 58 57 3b 0d 0a 0d 0a 2f 2f 20 23  ACTCTXW;....// #
287a0 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f  ifdef UNICODE../
287b0 2f 20 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d  / .....// #else.
287c0 0a 2f 2f 20 73 6b 69 70 20 74 79 70 65 64 65 66  .// skip typedef
287d0 20 41 43 54 43 54 58 41 20 41 43 54 43 54 58 3b   ACTCTXA ACTCTX;
287e0 0d 0a 61 6c 69 61 73 20 50 41 43 54 43 54 58 41  ..alias PACTCTXA
287f0 20 50 41 43 54 43 54 58 3b 0d 0a 2f 2f 20 23 65   PACTCTX;..// #e
28800 6e 64 69 66 20 2f 2f 20 55 4e 49 43 4f 44 45 0d  ndif // UNICODE.
28810 0a 0d 0a 61 6c 69 61 73 20 41 43 54 43 54 58 41  ...alias ACTCTXA
28820 2a 20 50 43 41 43 54 43 54 58 41 3b 0d 0a 61 6c  * PCACTCTXA;..al
28830 69 61 73 20 41 43 54 43 54 58 57 2a 20 50 43 41  ias ACTCTXW* PCA
28840 43 54 43 54 58 57 3b 0d 0a 2f 2f 20 23 69 66 64  CTCTXW;..// #ifd
28850 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 2e  ef UNICODE..// .
28860 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f  ....// #else..//
28870 20 73 6b 69 70 20 74 79 70 65 64 65 66 20 41 43   skip typedef AC
28880 54 43 54 58 41 20 41 43 54 43 54 58 3b 0d 0a 61  TCTXA ACTCTX;..a
28890 6c 69 61 73 20 50 43 41 43 54 43 54 58 41 20 50  lias PCACTCTXA P
288a0 43 41 43 54 43 54 58 3b 0d 0a 2f 2f 20 23 65 6e  CACTCTX;..// #en
288b0 64 69 66 20 2f 2f 20 55 4e 49 43 4f 44 45 0d 0a  dif // UNICODE..
288c0 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 0d 0a 2f  ..// #endif..../
288d0 2f 20 23 69 66 20 28 5f 57 49 4e 33 32 5f 57 49  / #if (_WIN32_WI
288e0 4e 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 20 7c  NNT >= 0x0500) |
288f0 7c 20 28 5f 57 49 4e 33 32 5f 46 55 53 49 4f 4e  | (_WIN32_FUSION
28900 20 3e 3d 20 30 78 30 31 30 30 29 0d 0a 0d 0a 65   >= 0x0100)....e
28910 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
28920 78 70 6f 72 74 20 48 41 4e 44 4c 45 20 43 72 65  xport HANDLE Cre
28930 61 74 65 41 63 74 43 74 78 41 28 0d 0a 20 20 50  ateActCtxA(..  P
28940 43 41 43 54 43 54 58 41 20 70 41 63 74 43 74 78  CACTCTXA pActCtx
28950 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
28960 77 73 29 20 65 78 70 6f 72 74 20 48 41 4e 44 4c  ws) export HANDL
28970 45 20 43 72 65 61 74 65 41 63 74 43 74 78 57 28  E CreateActCtxW(
28980 0d 0a 20 20 50 43 41 43 54 43 54 58 57 20 70 41  ..  PCACTCTXW pA
28990 63 74 43 74 78 29 3b 0d 0a 2f 2f 20 23 69 66 64  ctCtx);..// #ifd
289a0 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23  ef UNICODE..// #
289b0 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61  .....// #else..a
289c0 6c 69 61 73 20 43 72 65 61 74 65 41 63 74 43 74  lias CreateActCt
289d0 78 41 20 43 72 65 61 74 65 41 63 74 43 74 78 3b  xA CreateActCtx;
289e0 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
289f0 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
28a00 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
28a10 74 20 56 4f 49 44 20 41 64 64 52 65 66 41 63 74  t VOID AddRefAct
28a20 43 74 78 28 0d 0a 20 20 48 41 4e 44 4c 45 20 68  Ctx(..  HANDLE h
28a30 41 63 74 43 74 78 29 3b 0d 0a 0d 0a 65 78 74 65  ActCtx);....exte
28a40 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
28a50 72 74 20 56 4f 49 44 20 52 65 6c 65 61 73 65 41  rt VOID ReleaseA
28a60 63 74 43 74 78 28 0d 0a 20 20 48 41 4e 44 4c 45  ctCtx(..  HANDLE
28a70 20 68 41 63 74 43 74 78 29 3b 0d 0a 0d 0a 65 78   hActCtx);....ex
28a80 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
28a90 70 6f 72 74 20 42 4f 4f 4c 20 5a 6f 6d 62 69 66  port BOOL Zombif
28aa0 79 41 63 74 43 74 78 28 0d 0a 20 20 48 41 4e 44  yActCtx(..  HAND
28ab0 4c 45 20 68 41 63 74 43 74 78 29 3b 0d 0a 0d 0a  LE hActCtx);....
28ac0 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
28ad0 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 63 74 69  export BOOL Acti
28ae0 76 61 74 65 41 63 74 43 74 78 28 0d 0a 20 20 48  vateActCtx(..  H
28af0 41 4e 44 4c 45 20 68 41 63 74 43 74 78 2c 0d 0a  ANDLE hActCtx,..
28b00 20 20 55 4c 4f 4e 47 5f 50 54 52 20 2a 6c 70 43    ULONG_PTR *lpC
28b10 6f 6f 6b 69 65 29 3b 0d 0a 0d 0a 65 6e 75 6d 20  ookie);....enum 
28b20 3a 20 75 69 6e 74 20 7b 20 44 45 41 43 54 49 56  : uint { DEACTIV
28b30 41 54 45 5f 41 43 54 43 54 58 5f 46 4c 41 47 5f  ATE_ACTCTX_FLAG_
28b40 46 4f 52 43 45 5f 45 41 52 4c 59 5f 44 45 41 43  FORCE_EARLY_DEAC
28b50 54 49 56 41 54 49 4f 4e 20 3d 20 30 78 30 30 30  TIVATION = 0x000
28b60 30 30 30 30 31 20 7d 0d 0a 0d 0a 65 78 74 65 72  00001 }....exter
28b70 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
28b80 74 20 42 4f 4f 4c 20 44 65 61 63 74 69 76 61 74  t BOOL Deactivat
28b90 65 41 63 74 43 74 78 28 0d 0a 20 20 44 57 4f 52  eActCtx(..  DWOR
28ba0 44 20 64 77 46 6c 61 67 73 2c 0d 0a 20 20 55 4c  D dwFlags,..  UL
28bb0 4f 4e 47 5f 50 54 52 20 75 6c 43 6f 6f 6b 69 65  ONG_PTR ulCookie
28bc0 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
28bd0 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
28be0 4c 20 47 65 74 43 75 72 72 65 6e 74 41 63 74 43  L GetCurrentActC
28bf0 74 78 28 0d 0a 20 20 48 41 4e 44 4c 45 20 2a 6c  tx(..  HANDLE *l
28c00 70 68 41 63 74 43 74 78 29 3b 0d 0a 0d 0a 2f 2f  phActCtx);....//
28c10 20 23 65 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23 69   #endif....// #i
28c20 66 20 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  f (_WIN32_WINNT 
28c30 3e 3d 20 30 78 30 35 30 30 29 20 7c 7c 20 28 5f  >= 0x0500) || (_
28c40 57 49 4e 33 32 5f 46 55 53 49 4f 4e 20 3e 3d 20  WIN32_FUSION >= 
28c50 30 78 30 31 30 30 29 20 7c 7c 20 49 53 4f 4c 41  0x0100) || ISOLA
28c60 54 49 4f 4e 5f 41 57 41 52 45 5f 45 4e 41 42 4c  TION_AWARE_ENABL
28c70 45 44 0d 0a 0d 0a 73 74 72 75 63 74 20 74 61 67  ED....struct tag
28c80 41 43 54 43 54 58 5f 53 45 43 54 49 4f 4e 5f 4b  ACTCTX_SECTION_K
28c90 45 59 45 44 5f 44 41 54 41 20 7b 0d 0a 20 20 55  EYED_DATA {..  U
28ca0 4c 4f 4e 47 20 63 62 53 69 7a 65 3b 0d 0a 20 20  LONG cbSize;..  
28cb0 55 4c 4f 4e 47 20 75 6c 44 61 74 61 46 6f 72 6d  ULONG ulDataForm
28cc0 61 74 56 65 72 73 69 6f 6e 3b 0d 0a 20 20 50 56  atVersion;..  PV
28cd0 4f 49 44 20 6c 70 44 61 74 61 3b 0d 0a 20 20 55  OID lpData;..  U
28ce0 4c 4f 4e 47 20 75 6c 4c 65 6e 67 74 68 3b 0d 0a  LONG ulLength;..
28cf0 20 20 50 56 4f 49 44 20 6c 70 53 65 63 74 69 6f    PVOID lpSectio
28d00 6e 47 6c 6f 62 61 6c 44 61 74 61 3b 0d 0a 20 20  nGlobalData;..  
28d10 55 4c 4f 4e 47 20 75 6c 53 65 63 74 69 6f 6e 47  ULONG ulSectionG
28d20 6c 6f 62 61 6c 44 61 74 61 4c 65 6e 67 74 68 3b  lobalDataLength;
28d30 0d 0a 20 20 50 56 4f 49 44 20 6c 70 53 65 63 74  ..  PVOID lpSect
28d40 69 6f 6e 42 61 73 65 3b 0d 0a 20 20 55 4c 4f 4e  ionBase;..  ULON
28d50 47 20 75 6c 53 65 63 74 69 6f 6e 54 6f 74 61 6c  G ulSectionTotal
28d60 4c 65 6e 67 74 68 3b 0d 0a 20 20 48 41 4e 44 4c  Length;..  HANDL
28d70 45 20 68 41 63 74 43 74 78 3b 0d 0a 20 20 55 4c  E hActCtx;..  UL
28d80 4f 4e 47 20 75 6c 41 73 73 65 6d 62 6c 79 52 6f  ONG ulAssemblyRo
28d90 73 74 65 72 49 6e 64 65 78 3b 0d 0a 7d 0d 0a 61  sterIndex;..}..a
28da0 6c 69 61 73 20 74 61 67 41 43 54 43 54 58 5f 53  lias tagACTCTX_S
28db0 45 43 54 49 4f 4e 5f 4b 45 59 45 44 5f 44 41 54  ECTION_KEYED_DAT
28dc0 41 20 41 43 54 43 54 58 5f 53 45 43 54 49 4f 4e  A ACTCTX_SECTION
28dd0 5f 4b 45 59 45 44 5f 44 41 54 41 3b 0d 0a 61 6c  _KEYED_DATA;..al
28de0 69 61 73 20 74 61 67 41 43 54 43 54 58 5f 53 45  ias tagACTCTX_SE
28df0 43 54 49 4f 4e 5f 4b 45 59 45 44 5f 44 41 54 41  CTION_KEYED_DATA
28e00 2a 20 50 41 43 54 43 54 58 5f 53 45 43 54 49 4f  * PACTCTX_SECTIO
28e10 4e 5f 4b 45 59 45 44 5f 44 41 54 41 3b 0d 0a 0d  N_KEYED_DATA;...
28e20 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 46  .enum : uint { F
28e30 49 4e 44 5f 41 43 54 43 54 58 5f 53 45 43 54 49  IND_ACTCTX_SECTI
28e40 4f 4e 5f 4b 45 59 5f 52 45 54 55 52 4e 5f 48 41  ON_KEY_RETURN_HA
28e50 43 54 43 54 58 20 3d 20 30 78 30 30 30 30 30 30  CTCTX = 0x000000
28e60 30 31 20 7d 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69  01 }....// #endi
28e70 66 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f 57 49  f....// #if (_WI
28e80 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30 78 30  N32_WINNT >= 0x0
28e90 35 30 30 29 20 7c 7c 20 28 5f 57 49 4e 33 32 5f  500) || (_WIN32_
28ea0 46 55 53 49 4f 4e 20 3e 3d 20 30 78 30 31 30 30  FUSION >= 0x0100
28eb0 29 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  )....extern(Wind
28ec0 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
28ed0 20 46 69 6e 64 41 63 74 43 74 78 53 65 63 74 69   FindActCtxSecti
28ee0 6f 6e 53 74 72 69 6e 67 41 28 0d 0a 20 20 44 57  onStringA(..  DW
28ef0 4f 52 44 20 64 77 46 6c 61 67 73 2c 0d 0a 20 20  ORD dwFlags,..  
28f00 47 55 49 44 20 2a 6c 70 45 78 74 65 6e 73 69 6f  GUID *lpExtensio
28f10 6e 47 75 69 64 2c 0d 0a 20 20 55 4c 4f 4e 47 20  nGuid,..  ULONG 
28f20 75 6c 53 65 63 74 69 6f 6e 49 64 2c 0d 0a 20 20  ulSectionId,..  
28f30 4c 50 43 53 54 52 20 6c 70 53 74 72 69 6e 67 54  LPCSTR lpStringT
28f40 6f 46 69 6e 64 2c 0d 0a 20 20 50 41 43 54 43 54  oFind,..  PACTCT
28f50 58 5f 53 45 43 54 49 4f 4e 5f 4b 45 59 45 44 5f  X_SECTION_KEYED_
28f60 44 41 54 41 20 52 65 74 75 72 6e 65 64 44 61 74  DATA ReturnedDat
28f70 61 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  a);..extern(Wind
28f80 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c  ows) export BOOL
28f90 20 46 69 6e 64 41 63 74 43 74 78 53 65 63 74 69   FindActCtxSecti
28fa0 6f 6e 53 74 72 69 6e 67 57 28 0d 0a 20 20 44 57  onStringW(..  DW
28fb0 4f 52 44 20 64 77 46 6c 61 67 73 2c 0d 0a 20 20  ORD dwFlags,..  
28fc0 47 55 49 44 20 2a 6c 70 45 78 74 65 6e 73 69 6f  GUID *lpExtensio
28fd0 6e 47 75 69 64 2c 0d 0a 20 20 55 4c 4f 4e 47 20  nGuid,..  ULONG 
28fe0 75 6c 53 65 63 74 69 6f 6e 49 64 2c 0d 0a 20 20  ulSectionId,..  
28ff0 4c 50 43 57 53 54 52 20 6c 70 53 74 72 69 6e 67  LPCWSTR lpString
29000 54 6f 46 69 6e 64 2c 0d 0a 20 20 50 41 43 54 43  ToFind,..  PACTC
29010 54 58 5f 53 45 43 54 49 4f 4e 5f 4b 45 59 45 44  TX_SECTION_KEYED
29020 5f 44 41 54 41 20 52 65 74 75 72 6e 65 64 44 61  _DATA ReturnedDa
29030 74 61 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  ta);..// #ifdef 
29040 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e  UNICODE..// #...
29050 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61  ..// #else..alia
29060 73 20 46 69 6e 64 41 63 74 43 74 78 53 65 63 74  s FindActCtxSect
29070 69 6f 6e 53 74 72 69 6e 67 41 20 46 69 6e 64 41  ionStringA FindA
29080 63 74 43 74 78 53 65 63 74 69 6f 6e 53 74 72 69  ctCtxSectionStri
29090 6e 67 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  ng;..// #endif /
290a0 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78  / !UNICODE....ex
290b0 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
290c0 70 6f 72 74 20 42 4f 4f 4c 20 46 69 6e 64 41 63  port BOOL FindAc
290d0 74 43 74 78 53 65 63 74 69 6f 6e 47 75 69 64 28  tCtxSectionGuid(
290e0 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 6c 61 67  ..  DWORD dwFlag
290f0 73 2c 0d 0a 20 20 47 55 49 44 20 2a 6c 70 45 78  s,..  GUID *lpEx
29100 74 65 6e 73 69 6f 6e 47 75 69 64 2c 0d 0a 20 20  tensionGuid,..  
29110 55 4c 4f 4e 47 20 75 6c 53 65 63 74 69 6f 6e 49  ULONG ulSectionI
29120 64 2c 0d 0a 20 20 47 55 49 44 20 2a 6c 70 47 75  d,..  GUID *lpGu
29130 69 64 54 6f 46 69 6e 64 2c 0d 0a 20 20 50 41 43  idToFind,..  PAC
29140 54 43 54 58 5f 53 45 43 54 49 4f 4e 5f 4b 45 59  TCTX_SECTION_KEY
29150 45 44 5f 44 41 54 41 20 52 65 74 75 72 6e 65 64  ED_DATA Returned
29160 44 61 74 61 29 3b 0d 0a 0d 0a 2f 2f 20 23 65 6e  Data);....// #en
29170 64 69 66 0d 0a 0d 0a 2f 2f 20 23 69 66 20 28 5f  dif....// #if (_
29180 57 49 4e 33 32 5f 57 49 4e 4e 54 20 3e 3d 20 30  WIN32_WINNT >= 0
29190 78 30 35 30 30 29 20 7c 7c 20 28 5f 57 49 4e 33  x0500) || (_WIN3
291a0 32 5f 46 55 53 49 4f 4e 20 3e 3d 20 30 78 30 31  2_FUSION >= 0x01
291b0 30 30 29 20 7c 7c 20 49 53 4f 4c 41 54 49 4f 4e  00) || ISOLATION
291c0 5f 41 57 41 52 45 5f 45 4e 41 42 4c 45 44 0d 0a  _AWARE_ENABLED..
291d0 0d 0a 2f 2f 20 23 69 66 20 21 64 65 66 69 6e 65  ..// #if !define
291e0 64 28 52 43 5f 49 4e 56 4f 4b 45 44 29 20 2f 2a  d(RC_INVOKED) /*
291f0 20 52 43 20 63 6f 6d 70 6c 61 69 6e 73 20 61 62   RC complains ab
29200 6f 75 74 20 6c 6f 6e 67 20 73 79 6d 62 6f 6c 73  out long symbols
29210 20 69 6e 20 23 69 66 73 20 2a 2f 0d 0a 2f 2f 20   in #ifs */..// 
29220 23 69 66 20 21 64 65 66 69 6e 65 64 28 41 43 54  #if !defined(ACT
29230 49 56 41 54 49 4f 4e 5f 43 4f 4e 54 45 58 54 5f  IVATION_CONTEXT_
29240 42 41 53 49 43 5f 49 4e 46 4f 52 4d 41 54 49 4f  BASIC_INFORMATIO
29250 4e 5f 44 45 46 49 4e 45 44 29 0d 0a 0d 0a 2f 2f  N_DEFINED)....//
29260 20 2e 2e 2e 0d 0a 0d 0a 2f 2f 20 2e 2e 2e 0d 0a   .......// .....
29270 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 0d 0a 2f 2f 20  ..// #.......// 
29280 23 65 6e 64 69 66 20 2f 2f 20 21 64 65 66 69 6e  #endif // !defin
29290 65 64 28 41 43 54 49 56 41 54 49 4f 4e 5f 43 4f  ed(ACTIVATION_CO
292a0 4e 54 45 58 54 5f 42 41 53 49 43 5f 49 4e 46 4f  NTEXT_BASIC_INFO
292b0 52 4d 41 54 49 4f 4e 5f 44 45 46 49 4e 45 44 29  RMATION_DEFINED)
292c0 0d 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 0d 0a 65  ..// #endif....e
292d0 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 51 55 45  num : uint { QUE
292e0 52 59 5f 41 43 54 43 54 58 5f 46 4c 41 47 5f 55  RY_ACTCTX_FLAG_U
292f0 53 45 5f 41 43 54 49 56 45 5f 41 43 54 43 54 58  SE_ACTIVE_ACTCTX
29300 20 3d 20 30 78 30 30 30 30 30 30 30 34 20 7d 0d   = 0x00000004 }.
29310 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 51  .enum : uint { Q
29320 55 45 52 59 5f 41 43 54 43 54 58 5f 46 4c 41 47  UERY_ACTCTX_FLAG
29330 5f 41 43 54 43 54 58 5f 49 53 5f 48 4d 4f 44 55  _ACTCTX_IS_HMODU
29340 4c 45 20 3d 20 30 78 30 30 30 30 30 30 30 38 20  LE = 0x00000008 
29350 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
29360 20 51 55 45 52 59 5f 41 43 54 43 54 58 5f 46 4c   QUERY_ACTCTX_FL
29370 41 47 5f 41 43 54 43 54 58 5f 49 53 5f 41 44 44  AG_ACTCTX_IS_ADD
29380 52 45 53 53 20 3d 20 30 78 30 30 30 30 30 30 31  RESS = 0x0000001
29390 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
293a0 20 7b 20 51 55 45 52 59 5f 41 43 54 43 54 58 5f   { QUERY_ACTCTX_
293b0 46 4c 41 47 5f 4e 4f 5f 41 44 44 52 45 46 20 3d  FLAG_NO_ADDREF =
293c0 20 30 78 38 30 30 30 30 30 30 30 20 7d 0d 0a 0d   0x80000000 }...
293d0 0a 2f 2f 20 23 65 6e 64 69 66 0d 0a 0d 0a 2f 2f  .// #endif....//
293e0 20 23 69 66 20 28 5f 57 49 4e 33 32 5f 57 49 4e   #if (_WIN32_WIN
293f0 4e 54 20 3e 3d 20 30 78 30 35 30 30 29 20 7c 7c  NT >= 0x0500) ||
29400 20 28 5f 57 49 4e 33 32 5f 46 55 53 49 4f 4e 20   (_WIN32_FUSION 
29410 3e 3d 20 30 78 30 31 30 30 29 0d 0a 0d 0a 65 78  >= 0x0100)....ex
29420 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
29430 70 6f 72 74 20 42 4f 4f 4c 20 51 75 65 72 79 41  port BOOL QueryA
29440 63 74 43 74 78 57 28 0d 0a 20 20 44 57 4f 52 44  ctCtxW(..  DWORD
29450 20 64 77 46 6c 61 67 73 2c 0d 0a 20 20 48 41 4e   dwFlags,..  HAN
29460 44 4c 45 20 68 41 63 74 43 74 78 2c 0d 0a 20 20  DLE hActCtx,..  
29470 50 56 4f 49 44 20 70 76 53 75 62 49 6e 73 74 61  PVOID pvSubInsta
29480 6e 63 65 2c 0d 0a 20 20 55 4c 4f 4e 47 20 75 6c  nce,..  ULONG ul
29490 49 6e 66 6f 43 6c 61 73 73 2c 0d 0a 20 20 50 56  InfoClass,..  PV
294a0 4f 49 44 20 70 76 42 75 66 66 65 72 2c 0d 0a 20  OID pvBuffer,.. 
294b0 20 53 49 5a 45 5f 54 20 63 62 42 75 66 66 65 72   SIZE_T cbBuffer
294c0 20 2c 0d 0a 20 20 53 49 5a 45 5f 54 20 2a 70 63   ,..  SIZE_T *pc
294d0 62 57 72 69 74 74 65 6e 4f 72 52 65 71 75 69 72  bWrittenOrRequir
294e0 65 64 20 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  ed );....extern(
294f0 57 69 6e 64 6f 77 73 29 20 61 6c 69 61 73 20 42  Windows) alias B
29500 4f 4f 4c 20 66 75 6e 63 74 69 6f 6e 28 20 20 44  OOL function(  D
29510 57 4f 52 44 20 64 77 46 6c 61 67 73 2c 20 20 48  WORD dwFlags,  H
29520 41 4e 44 4c 45 20 68 41 63 74 43 74 78 2c 20 20  ANDLE hActCtx,  
29530 50 56 4f 49 44 20 70 76 53 75 62 49 6e 73 74 61  PVOID pvSubInsta
29540 6e 63 65 2c 20 20 55 4c 4f 4e 47 20 75 6c 49 6e  nce,  ULONG ulIn
29550 66 6f 43 6c 61 73 73 2c 20 20 50 56 4f 49 44 20  foClass,  PVOID 
29560 70 76 42 75 66 66 65 72 2c 20 20 53 49 5a 45 5f  pvBuffer,  SIZE_
29570 54 20 63 62 42 75 66 66 65 72 20 2c 20 20 53 49  T cbBuffer ,  SI
29580 5a 45 5f 54 20 2a 70 63 62 57 72 69 74 74 65 6e  ZE_T *pcbWritten
29590 4f 72 52 65 71 75 69 72 65 64 20 20 29 20 50 51  OrRequired  ) PQ
295a0 55 45 52 59 41 43 54 43 54 58 57 5f 46 55 4e 43  UERYACTCTXW_FUNC
295b0 3b 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  ;....// #endif /
295c0 2f 20 28 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  / (_WIN32_WINNT 
295d0 3e 20 30 78 30 35 30 30 29 20 7c 7c 20 28 5f 57  > 0x0500) || (_W
295e0 49 4e 33 32 5f 46 55 53 49 4f 4e 20 3e 3d 20 30  IN32_FUSION >= 0
295f0 78 30 31 30 30 29 0d 0a 0d 0a 65 78 74 65 72 6e  x0100)....extern
29600 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
29610 20 42 4f 4f 4c 20 50 72 6f 63 65 73 73 49 64 54   BOOL ProcessIdT
29620 6f 53 65 73 73 69 6f 6e 49 64 28 0d 0a 20 20 44  oSessionId(..  D
29630 57 4f 52 44 20 64 77 50 72 6f 63 65 73 73 49 64  WORD dwProcessId
29640 2c 0d 0a 20 20 44 57 4f 52 44 20 2a 70 53 65 73  ,..  DWORD *pSes
29650 73 69 6f 6e 49 64 29 3b 0d 0a 0d 0a 2f 2f 20 23  sionId);....// #
29660 69 66 20 5f 57 49 4e 33 32 5f 57 49 4e 4e 54 20  if _WIN32_WINNT 
29670 3e 3d 20 30 78 30 35 30 31 0d 0a 0d 0a 65 78 74  >= 0x0501....ext
29680 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
29690 6f 72 74 20 44 57 4f 52 44 20 57 54 53 47 65 74  ort DWORD WTSGet
296a0 41 63 74 69 76 65 43 6f 6e 73 6f 6c 65 53 65 73  ActiveConsoleSes
296b0 73 69 6f 6e 49 64 28 29 3b 0d 0a 0d 0a 65 78 74  sionId();....ext
296c0 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
296d0 6f 72 74 20 42 4f 4f 4c 20 49 73 57 6f 77 36 34  ort BOOL IsWow64
296e0 50 72 6f 63 65 73 73 28 0d 0a 20 20 48 41 4e 44  Process(..  HAND
296f0 4c 45 20 68 50 72 6f 63 65 73 73 2c 0d 0a 20 20  LE hProcess,..  
29700 50 42 4f 4f 4c 20 57 6f 77 36 34 50 72 6f 63 65  PBOOL Wow64Proce
29710 73 73 29 3b 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69  ss);....// #endi
29720 66 20 2f 2f 20 28 5f 57 49 4e 33 32 5f 57 49 4e  f // (_WIN32_WIN
29730 4e 54 20 3e 3d 20 30 78 30 35 30 31 29 0d 0a 0d  NT >= 0x0501)...
29740 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
29750 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74   export BOOL Get
29760 4e 75 6d 61 48 69 67 68 65 73 74 4e 6f 64 65 4e  NumaHighestNodeN
29770 75 6d 62 65 72 28 0d 0a 20 20 50 55 4c 4f 4e 47  umber(..  PULONG
29780 20 48 69 67 68 65 73 74 4e 6f 64 65 4e 75 6d 62   HighestNodeNumb
29790 65 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  er);....extern(W
297a0 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
297b0 4f 4f 4c 20 47 65 74 4e 75 6d 61 50 72 6f 63 65  OOL GetNumaProce
297c0 73 73 6f 72 4e 6f 64 65 28 0d 0a 20 20 55 43 48  ssorNode(..  UCH
297d0 41 52 20 50 72 6f 63 65 73 73 6f 72 2c 0d 0a 20  AR Processor,.. 
297e0 20 50 55 43 48 41 52 20 4e 6f 64 65 4e 75 6d 62   PUCHAR NodeNumb
297f0 65 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  er);....extern(W
29800 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
29810 4f 4f 4c 20 47 65 74 4e 75 6d 61 4e 6f 64 65 50  OOL GetNumaNodeP
29820 72 6f 63 65 73 73 6f 72 4d 61 73 6b 28 0d 0a 20  rocessorMask(.. 
29830 20 55 43 48 41 52 20 4e 6f 64 65 2c 0d 0a 20 20   UCHAR Node,..  
29840 50 55 4c 4f 4e 47 4c 4f 4e 47 20 50 72 6f 63 65  PULONGLONG Proce
29850 73 73 6f 72 4d 61 73 6b 29 3b 0d 0a 0d 0a 65 78  ssorMask);....ex
29860 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
29870 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 4e 75 6d  port BOOL GetNum
29880 61 50 72 6f 63 65 73 73 6f 72 4d 61 70 28 0d 0a  aProcessorMap(..
29890 20 20 50 53 59 53 54 45 4d 5f 4e 55 4d 41 5f 49    PSYSTEM_NUMA_I
298a0 4e 46 4f 52 4d 41 54 49 4f 4e 20 4d 61 70 2c 0d  NFORMATION Map,.
298b0 0a 20 20 55 4c 4f 4e 47 20 4c 65 6e 67 74 68 2c  .  ULONG Length,
298c0 0d 0a 20 20 50 55 4c 4f 4e 47 20 52 65 74 75 72  ..  PULONG Retur
298d0 6e 65 64 4c 65 6e 67 74 68 29 3b 0d 0a 0d 0a 65  nedLength);....e
298e0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
298f0 78 70 6f 72 74 20 42 4f 4f 4c 20 47 65 74 4e 75  xport BOOL GetNu
29900 6d 61 41 76 61 69 6c 61 62 6c 65 4d 65 6d 6f 72  maAvailableMemor
29910 79 28 0d 0a 20 20 50 53 59 53 54 45 4d 5f 4e 55  y(..  PSYSTEM_NU
29920 4d 41 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 4d  MA_INFORMATION M
29930 65 6d 6f 72 79 2c 0d 0a 20 20 55 4c 4f 4e 47 20  emory,..  ULONG 
29940 4c 65 6e 67 74 68 2c 0d 0a 20 20 50 55 4c 4f 4e  Length,..  PULON
29950 47 20 52 65 74 75 72 6e 65 64 4c 65 6e 67 74 68  G ReturnedLength
29960 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
29970 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f  dows) export BOO
29980 4c 20 47 65 74 4e 75 6d 61 41 76 61 69 6c 61 62  L GetNumaAvailab
29990 6c 65 4d 65 6d 6f 72 79 4e 6f 64 65 28 0d 0a 20  leMemoryNode(.. 
299a0 20 55 43 48 41 52 20 4e 6f 64 65 2c 0d 0a 20 20   UCHAR Node,..  
299b0 50 55 4c 4f 4e 47 4c 4f 4e 47 20 41 76 61 69 6c  PULONGLONG Avail
299c0 61 62 6c 65 42 79 74 65 73 29 3b 0d 0a 0d 0a 65  ableBytes);....e
299d0 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
299e0 78 70 6f 72 74 20 55 4c 4f 4e 47 4c 4f 4e 47 20  xport ULONGLONG 
299f0 4e 75 6d 61 56 69 72 74 75 61 6c 51 75 65 72 79  NumaVirtualQuery
29a00 4e 6f 64 65 28 0d 0a 20 20 55 4c 4f 4e 47 20 4e  Node(..  ULONG N
29a10 75 6d 62 65 72 4f 66 52 61 6e 67 65 73 2c 0d 0a  umberOfRanges,..
29a20 20 20 50 55 4c 4f 4e 47 5f 50 54 52 20 52 61 6e    PULONG_PTR Ran
29a30 67 65 4c 69 73 74 2c 0d 0a 20 20 50 55 4c 4f 4e  geList,..  PULON
29a40 47 5f 50 54 52 20 56 69 72 74 75 61 6c 50 61 67  G_PTR VirtualPag
29a50 65 41 6e 64 4e 6f 64 65 2c 0d 0a 20 20 53 49 5a  eAndNode,..  SIZ
29a60 45 5f 54 20 4d 61 78 69 6d 75 6d 4f 75 74 70 75  E_T MaximumOutpu
29a70 74 4c 65 6e 67 74 68 29 3b 0d 0a 0d 0a 2f 2f 20  tLength);....// 
29a80 23 69 66 20 21 64 65 66 69 6e 65 64 28 52 43 5f  #if !defined(RC_
29a90 49 4e 56 4f 4b 45 44 29 20 2f 2a 20 52 43 20 63  INVOKED) /* RC c
29aa0 6f 6d 70 6c 61 69 6e 73 20 61 62 6f 75 74 20 6c  omplains about l
29ab0 6f 6e 67 20 73 79 6d 62 6f 6c 73 20 69 6e 20 23  ong symbols in #
29ac0 69 66 73 20 2a 2f 0d 0a 2f 2f 20 23 69 66 20 49  ifs */..// #if I
29ad0 53 4f 4c 41 54 49 4f 4e 5f 41 57 41 52 45 5f 45  SOLATION_AWARE_E
29ae0 4e 41 42 4c 45 44 0d 0a 2f 2f 20 23 2e 2e 2e 0d  NABLED..// #....
29af0 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a 20 49 53  .// #endif /* IS
29b00 4f 4c 41 54 49 4f 4e 5f 41 57 41 52 45 5f 45 4e  OLATION_AWARE_EN
29b10 41 42 4c 45 44 20 2a 2f 0d 0a 2f 2f 20 23 65 6e  ABLED */..// #en
29b20 64 69 66 20 2f 2a 20 52 43 20 2a 2f 0d 0a 0d 0a  dif /* RC */....
29b30 2f 2f 20 23 69 66 64 65 66 20 5f 5f 63 70 6c 75  // #ifdef __cplu
29b40 73 70 6c 75 73 0d 0a 2f 2f 20 7d 0d 0a 2f 2f 20  splus..// }..// 
29b50 23 65 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23 65 6e  #endif....// #en
29b60 64 69 66 20 2f 2f 20 5f 57 49 4e 42 41 53 45 5f  dif // _WINBASE_
29b70 0d 0a 0d 0a                                      ....