Hex Artifact Content

Not logged in

Artifact 76d5fcec592c7fdf8f0289a6b5423229d34c49af:


0000: 6d 6f 64 75 6c 65 20 77 69 6e 33 32 2e 77 69 6e  module win32.win
0010: 72 65 67 3b 0d 0a 0d 0a 2f 2f 20 54 72 61 6e 73  reg;....// Trans
0020: 6c 61 74 65 64 20 66 72 6f 6d 20 4d 69 63 72 6f  lated from Micro
0030: 73 6f 66 74 20 50 6c 61 74 66 6f 72 6d 20 53 44  soft Platform SD
0040: 4b 20 41 75 67 75 73 74 20 32 30 30 31 20 45 64  K August 2001 Ed
0050: 69 74 69 6f 6e 0d 0a 2f 2f 20 62 79 20 59 2e 54  ition..// by Y.T
0060: 6f 6d 69 6e 6f 20 28 64 65 6d 6f 6f 6e 6c 69 74  omino (demoonlit
0070: 40 69 6e 74 65 72 37 2e 6a 70 29 0d 0a 0d 0a 69  @inter7.jp)....i
0080: 6d 70 6f 72 74 20 77 69 6e 33 32 2e 77 69 6e 6e  mport win32.winn
0090: 74 2c 20 77 69 6e 33 32 2e 77 69 6e 62 61 73 65  t, win32.winbase
00a0: 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 6e 64 65 66 20  ;....// #ifndef 
00b0: 5f 57 49 4e 52 45 47 5f 0d 0a 2f 2f 20 23 64 65  _WINREG_..// #de
00c0: 66 69 6e 65 20 5f 57 49 4e 52 45 47 5f 0d 0a 0d  fine _WINREG_...
00d0: 0a 2f 2f 20 23 69 66 64 65 66 20 5f 4d 41 43 0d  .// #ifdef _MAC.
00e0: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e  .// #.....// #en
00f0: 64 69 66 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65 66  dif....// #ifdef
0100: 20 5f 5f 63 70 6c 75 73 70 6c 75 73 0d 0a 2f 2f   __cplusplus..//
0110: 20 65 78 74 65 72 6e 20 22 43 22 20 7b 0d 0a 2f   extern "C" {../
0120: 2f 20 23 65 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23  / #endif....// #
0130: 69 66 6e 64 65 66 20 57 49 4e 56 45 52 0d 0a 2f  ifndef WINVER../
0140: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69  / #.....// #endi
0150: 66 20 2f 2a 20 21 57 49 4e 56 45 52 20 2a 2f 0d  f /* !WINVER */.
0160: 0a 0d 0a 61 6c 69 61 73 20 41 43 43 45 53 53 5f  ...alias ACCESS_
0170: 4d 41 53 4b 20 52 45 47 53 41 4d 3b 0d 0a 0d 0a  MASK REGSAM;....
0180: 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45 59 5f  const HKEY HKEY_
0190: 43 4c 41 53 53 45 53 5f 52 4f 4f 54 20 3d 20 63  CLASSES_ROOT = c
01a0: 61 73 74 28 48 4b 45 59 29 63 61 73 74 28 55 4c  ast(HKEY)cast(UL
01b0: 4f 4e 47 5f 50 54 52 29 28 63 61 73 74 28 4c 4f  ONG_PTR)(cast(LO
01c0: 4e 47 29 30 78 38 30 30 30 30 30 30 30 29 20 3b  NG)0x80000000) ;
01d0: 0d 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45  ..const HKEY HKE
01e0: 59 5f 43 55 52 52 45 4e 54 5f 55 53 45 52 20 3d  Y_CURRENT_USER =
01f0: 20 63 61 73 74 28 48 4b 45 59 29 63 61 73 74 28   cast(HKEY)cast(
0200: 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61 73 74 28  ULONG_PTR)(cast(
0210: 4c 4f 4e 47 29 30 78 38 30 30 30 30 30 30 31 29  LONG)0x80000001)
0220: 20 3b 0d 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48   ;..const HKEY H
0230: 4b 45 59 5f 4c 4f 43 41 4c 5f 4d 41 43 48 49 4e  KEY_LOCAL_MACHIN
0240: 45 20 3d 20 63 61 73 74 28 48 4b 45 59 29 63 61  E = cast(HKEY)ca
0250: 73 74 28 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61  st(ULONG_PTR)(ca
0260: 73 74 28 4c 4f 4e 47 29 30 78 38 30 30 30 30 30  st(LONG)0x800000
0270: 30 32 29 20 3b 0d 0a 63 6f 6e 73 74 20 48 4b 45  02) ;..const HKE
0280: 59 20 48 4b 45 59 5f 55 53 45 52 53 20 3d 20 63  Y HKEY_USERS = c
0290: 61 73 74 28 48 4b 45 59 29 63 61 73 74 28 55 4c  ast(HKEY)cast(UL
02a0: 4f 4e 47 5f 50 54 52 29 28 63 61 73 74 28 4c 4f  ONG_PTR)(cast(LO
02b0: 4e 47 29 30 78 38 30 30 30 30 30 30 33 29 20 3b  NG)0x80000003) ;
02c0: 0d 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45  ..const HKEY HKE
02d0: 59 5f 50 45 52 46 4f 52 4d 41 4e 43 45 5f 44 41  Y_PERFORMANCE_DA
02e0: 54 41 20 3d 20 63 61 73 74 28 48 4b 45 59 29 63  TA = cast(HKEY)c
02f0: 61 73 74 28 55 4c 4f 4e 47 5f 50 54 52 29 28 63  ast(ULONG_PTR)(c
0300: 61 73 74 28 4c 4f 4e 47 29 30 78 38 30 30 30 30  ast(LONG)0x80000
0310: 30 30 34 29 20 3b 0d 0a 63 6f 6e 73 74 20 48 4b  004) ;..const HK
0320: 45 59 20 48 4b 45 59 5f 50 45 52 46 4f 52 4d 41  EY HKEY_PERFORMA
0330: 4e 43 45 5f 54 45 58 54 20 3d 20 63 61 73 74 28  NCE_TEXT = cast(
0340: 48 4b 45 59 29 63 61 73 74 28 55 4c 4f 4e 47 5f  HKEY)cast(ULONG_
0350: 50 54 52 29 28 63 61 73 74 28 4c 4f 4e 47 29 30  PTR)(cast(LONG)0
0360: 78 38 30 30 30 30 30 35 30 29 20 3b 0d 0a 63 6f  x80000050) ;..co
0370: 6e 73 74 20 48 4b 45 59 20 48 4b 45 59 5f 50 45  nst HKEY HKEY_PE
0380: 52 46 4f 52 4d 41 4e 43 45 5f 4e 4c 53 54 45 58  RFORMANCE_NLSTEX
0390: 54 20 3d 20 63 61 73 74 28 48 4b 45 59 29 63 61  T = cast(HKEY)ca
03a0: 73 74 28 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61  st(ULONG_PTR)(ca
03b0: 73 74 28 4c 4f 4e 47 29 30 78 38 30 30 30 30 30  st(LONG)0x800000
03c0: 36 30 29 20 3b 0d 0a 2f 2f 20 23 69 66 28 57 49  60) ;..// #if(WI
03d0: 4e 56 45 52 20 3e 3d 20 30 78 30 34 30 30 29 0d  NVER >= 0x0400).
03e0: 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45 59  .const HKEY HKEY
03f0: 5f 43 55 52 52 45 4e 54 5f 43 4f 4e 46 49 47 20  _CURRENT_CONFIG 
0400: 3d 20 63 61 73 74 28 48 4b 45 59 29 63 61 73 74  = cast(HKEY)cast
0410: 28 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61 73 74  (ULONG_PTR)(cast
0420: 28 4c 4f 4e 47 29 30 78 38 30 30 30 30 30 30 35  (LONG)0x80000005
0430: 29 20 3b 0d 0a 63 6f 6e 73 74 20 48 4b 45 59 20  ) ;..const HKEY 
0440: 48 4b 45 59 5f 44 59 4e 5f 44 41 54 41 20 3d 20  HKEY_DYN_DATA = 
0450: 63 61 73 74 28 48 4b 45 59 29 63 61 73 74 28 55  cast(HKEY)cast(U
0460: 4c 4f 4e 47 5f 50 54 52 29 28 63 61 73 74 28 4c  LONG_PTR)(cast(L
0470: 4f 4e 47 29 30 78 38 30 30 30 30 30 30 36 29 20  ONG)0x80000006) 
0480: 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 6e 64 65 66 20  ;....// #ifndef 
0490: 5f 50 52 4f 56 49 44 45 52 5f 53 54 52 55 43 54  _PROVIDER_STRUCT
04a0: 53 5f 44 45 46 49 4e 45 44 0d 0a 2f 2f 20 23 64  S_DEFINED..// #d
04b0: 65 66 69 6e 65 20 5f 50 52 4f 56 49 44 45 52 5f  efine _PROVIDER_
04c0: 53 54 52 55 43 54 53 5f 44 45 46 49 4e 45 44 0d  STRUCTS_DEFINED.
04d0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
04e0: 20 50 52 4f 56 49 44 45 52 5f 4b 45 45 50 53 5f   PROVIDER_KEEPS_
04f0: 56 41 4c 55 45 5f 4c 45 4e 47 54 48 20 3d 20 30  VALUE_LENGTH = 0
0500: 78 31 20 7d 0d 0a 73 74 72 75 63 74 20 76 61 6c  x1 }..struct val
0510: 5f 63 6f 6e 74 65 78 74 20 7b 0d 0a 20 20 69 6e  _context {..  in
0520: 74 20 76 61 6c 75 65 6c 65 6e 3b 0d 0a 20 20 4c  t valuelen;..  L
0530: 50 56 4f 49 44 20 76 61 6c 75 65 5f 63 6f 6e 74  PVOID value_cont
0540: 65 78 74 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 76  ext;..  LPVOID v
0550: 61 6c 5f 62 75 66 66 5f 70 74 72 3b 0d 0a 7d 0d  al_buff_ptr;..}.
0560: 0a 0d 0a 61 6c 69 61 73 20 76 61 6c 5f 63 6f 6e  ...alias val_con
0570: 74 65 78 74 2a 20 50 56 41 4c 43 4f 4e 54 45 58  text* PVALCONTEX
0580: 54 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 70 76 61  T;....struct pva
0590: 6c 75 65 41 20 7b 0d 0a 20 20 4c 50 53 54 52 20  lueA {..  LPSTR 
05a0: 70 76 5f 76 61 6c 75 65 6e 61 6d 65 3b 0d 0a 20  pv_valuename;.. 
05b0: 20 69 6e 74 20 70 76 5f 76 61 6c 75 65 6c 65 6e   int pv_valuelen
05c0: 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 70 76 5f 76  ;..  LPVOID pv_v
05d0: 61 6c 75 65 5f 63 6f 6e 74 65 78 74 3b 0d 0a 20  alue_context;.. 
05e0: 20 44 57 4f 52 44 20 70 76 5f 74 79 70 65 3b 0d   DWORD pv_type;.
05f0: 0a 7d 0d 0a 61 6c 69 61 73 20 70 76 61 6c 75 65  .}..alias pvalue
0600: 41 20 50 56 41 4c 55 45 41 3b 0d 0a 61 6c 69 61  A PVALUEA;..alia
0610: 73 20 70 76 61 6c 75 65 41 2a 20 50 50 56 41 4c  s pvalueA* PPVAL
0620: 55 45 41 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 70  UEA;....struct p
0630: 76 61 6c 75 65 57 20 7b 0d 0a 20 20 4c 50 57 53  valueW {..  LPWS
0640: 54 52 20 70 76 5f 76 61 6c 75 65 6e 61 6d 65 3b  TR pv_valuename;
0650: 0d 0a 20 20 69 6e 74 20 70 76 5f 76 61 6c 75 65  ..  int pv_value
0660: 6c 65 6e 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 70  len;..  LPVOID p
0670: 76 5f 76 61 6c 75 65 5f 63 6f 6e 74 65 78 74 3b  v_value_context;
0680: 0d 0a 20 20 44 57 4f 52 44 20 70 76 5f 74 79 70  ..  DWORD pv_typ
0690: 65 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 70 76 61  e;..}..alias pva
06a0: 6c 75 65 57 20 50 56 41 4c 55 45 57 3b 0d 0a 61  lueW PVALUEW;..a
06b0: 6c 69 61 73 20 70 76 61 6c 75 65 57 2a 20 50 50  lias pvalueW* PP
06c0: 56 41 4c 55 45 57 3b 0d 0a 0d 0a 2f 2f 20 23 69  VALUEW;....// #i
06d0: 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c  fdef UNICODE..al
06e0: 69 61 73 20 50 56 41 4c 55 45 57 20 50 56 41 4c  ias PVALUEW PVAL
06f0: 55 45 3b 0d 0a 61 6c 69 61 73 20 50 50 56 41 4c  UE;..alias PPVAL
0700: 55 45 57 20 50 50 56 41 4c 55 45 3b 0d 0a 2f 2f  UEW PPVALUE;..//
0710: 20 23 65 6c 73 65 0d 0a 2f 2f 20 2e 2e 2e 0d 0a   #else..// .....
0720: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 55 4e 49  // #endif // UNI
0730: 43 4f 44 45 0d 0a 0d 0a 2f 2f 20 74 79 70 65 64  CODE....// typed
0740: 65 66 20 44 57 4f 52 44 20 5f 63 64 65 63 6c 20  ef DWORD _cdecl 
0750: 51 55 45 52 59 48 41 4e 44 4c 45 52 20 28 4c 50  QUERYHANDLER (LP
0760: 56 4f 49 44 20 6b 65 79 63 6f 6e 74 65 78 74 2c  VOID keycontext,
0770: 20 50 56 41 4c 43 4f 4e 54 45 58 54 20 76 61 6c   PVALCONTEXT val
0780: 5f 6c 69 73 74 2c 20 44 57 4f 52 44 20 6e 75 6d  _list, DWORD num
0790: 5f 76 61 6c 73 2c 20 4c 50 56 4f 49 44 20 6f 75  _vals, LPVOID ou
07a0: 74 70 75 74 62 75 66 66 65 72 2c 20 44 57 4f 52  tputbuffer, DWOR
07b0: 44 20 46 41 52 20 2a 74 6f 74 61 6c 5f 6f 75 74  D FAR *total_out
07c0: 6c 65 6e 2c 20 44 57 4f 52 44 20 69 6e 70 75 74  len, DWORD input
07d0: 5f 62 6c 65 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72  _blen);....exter
07e0: 6e 28 57 69 6e 64 6f 77 73 29 20 61 6c 69 61 73  n(Windows) alias
07f0: 20 44 57 4f 52 44 20 66 75 6e 63 74 69 6f 6e 28   DWORD function(
0800: 4c 50 56 4f 49 44 20 6b 65 79 63 6f 6e 74 65 78  LPVOID keycontex
0810: 74 2c 20 50 56 41 4c 43 4f 4e 54 45 58 54 20 76  t, PVALCONTEXT v
0820: 61 6c 5f 6c 69 73 74 2c 20 44 57 4f 52 44 20 6e  al_list, DWORD n
0830: 75 6d 5f 76 61 6c 73 2c 20 4c 50 56 4f 49 44 20  um_vals, LPVOID 
0840: 6f 75 74 70 75 74 62 75 66 66 65 72 2c 20 44 57  outputbuffer, DW
0850: 4f 52 44 2a 20 74 6f 74 61 6c 5f 6f 75 74 6c 65  ORD* total_outle
0860: 6e 2c 20 44 57 4f 52 44 20 69 6e 70 75 74 5f 62  n, DWORD input_b
0870: 6c 65 6e 29 20 50 51 55 45 52 59 48 41 4e 44 4c  len) PQUERYHANDL
0880: 45 52 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 70 72  ER;....struct pr
0890: 6f 76 69 64 65 72 5f 69 6e 66 6f 20 7b 0d 0a 20  ovider_info {.. 
08a0: 20 50 51 55 45 52 59 48 41 4e 44 4c 45 52 20 70   PQUERYHANDLER p
08b0: 69 5f 52 30 5f 31 76 61 6c 3b 0d 0a 20 20 50 51  i_R0_1val;..  PQ
08c0: 55 45 52 59 48 41 4e 44 4c 45 52 20 70 69 5f 52  UERYHANDLER pi_R
08d0: 30 5f 61 6c 6c 76 61 6c 73 3b 0d 0a 20 20 50 51  0_allvals;..  PQ
08e0: 55 45 52 59 48 41 4e 44 4c 45 52 20 70 69 5f 52  UERYHANDLER pi_R
08f0: 33 5f 31 76 61 6c 3b 0d 0a 20 20 50 51 55 45 52  3_1val;..  PQUER
0900: 59 48 41 4e 44 4c 45 52 20 70 69 5f 52 33 5f 61  YHANDLER pi_R3_a
0910: 6c 6c 76 61 6c 73 3b 0d 0a 20 20 44 57 4f 52 44  llvals;..  DWORD
0920: 20 70 69 5f 66 6c 61 67 73 3b 0d 0a 20 20 4c 50   pi_flags;..  LP
0930: 56 4f 49 44 20 70 69 5f 6b 65 79 5f 63 6f 6e 74  VOID pi_key_cont
0940: 65 78 74 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 70  ext;..}..alias p
0950: 72 6f 76 69 64 65 72 5f 69 6e 66 6f 20 52 45 47  rovider_info REG
0960: 5f 50 52 4f 56 49 44 45 52 3b 0d 0a 0d 0a 61 6c  _PROVIDER;....al
0970: 69 61 73 20 70 72 6f 76 69 64 65 72 5f 69 6e 66  ias provider_inf
0980: 6f 2a 20 50 50 52 4f 56 49 44 45 52 3b 0d 0a 0d  o* PPROVIDER;...
0990: 0a 73 74 72 75 63 74 20 76 61 6c 75 65 5f 65 6e  .struct value_en
09a0: 74 41 20 7b 0d 0a 20 20 4c 50 53 54 52 20 76 65  tA {..  LPSTR ve
09b0: 5f 76 61 6c 75 65 6e 61 6d 65 3b 0d 0a 20 20 44  _valuename;..  D
09c0: 57 4f 52 44 20 76 65 5f 76 61 6c 75 65 6c 65 6e  WORD ve_valuelen
09d0: 3b 0d 0a 20 20 44 57 4f 52 44 5f 50 54 52 20 76  ;..  DWORD_PTR v
09e0: 65 5f 76 61 6c 75 65 70 74 72 3b 0d 0a 20 20 44  e_valueptr;..  D
09f0: 57 4f 52 44 20 76 65 5f 74 79 70 65 3b 0d 0a 7d  WORD ve_type;..}
0a00: 0d 0a 61 6c 69 61 73 20 76 61 6c 75 65 5f 65 6e  ..alias value_en
0a10: 74 41 20 56 41 4c 45 4e 54 41 3b 0d 0a 61 6c 69  tA VALENTA;..ali
0a20: 61 73 20 76 61 6c 75 65 5f 65 6e 74 41 2a 20 50  as value_entA* P
0a30: 56 41 4c 45 4e 54 41 3b 0d 0a 0d 0a 73 74 72 75  VALENTA;....stru
0a40: 63 74 20 76 61 6c 75 65 5f 65 6e 74 57 20 7b 0d  ct value_entW {.
0a50: 0a 20 20 4c 50 57 53 54 52 20 76 65 5f 76 61 6c  .  LPWSTR ve_val
0a60: 75 65 6e 61 6d 65 3b 0d 0a 20 20 44 57 4f 52 44  uename;..  DWORD
0a70: 20 76 65 5f 76 61 6c 75 65 6c 65 6e 3b 0d 0a 20   ve_valuelen;.. 
0a80: 20 44 57 4f 52 44 5f 50 54 52 20 76 65 5f 76 61   DWORD_PTR ve_va
0a90: 6c 75 65 70 74 72 3b 0d 0a 20 20 44 57 4f 52 44  lueptr;..  DWORD
0aa0: 20 76 65 5f 74 79 70 65 3b 0d 0a 7d 0d 0a 61 6c   ve_type;..}..al
0ab0: 69 61 73 20 76 61 6c 75 65 5f 65 6e 74 57 20 56  ias value_entW V
0ac0: 41 4c 45 4e 54 57 3b 0d 0a 61 6c 69 61 73 20 76  ALENTW;..alias v
0ad0: 61 6c 75 65 5f 65 6e 74 57 2a 20 50 56 41 4c 45  alue_entW* PVALE
0ae0: 4e 54 57 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65  NTW;....// #ifde
0af0: 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61 73  f UNICODE..alias
0b00: 20 56 41 4c 45 4e 54 57 20 56 41 4c 45 4e 54 3b   VALENTW VALENT;
0b10: 0d 0a 61 6c 69 61 73 20 50 56 41 4c 45 4e 54 57  ..alias PVALENTW
0b20: 20 50 56 41 4c 45 4e 54 3b 0d 0a 2f 2f 20 23 65   PVALENT;..// #e
0b30: 6c 73 65 0d 0a 2f 2f 20 2e 2e 2e 0d 0a 2f 2f 20  lse..// .....// 
0b40: 23 65 6e 64 69 66 20 2f 2f 20 55 4e 49 43 4f 44  #endif // UNICOD
0b50: 45 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f  E....// #endif /
0b60: 2f 20 6e 6f 74 28 5f 50 52 4f 56 49 44 45 52 5f  / not(_PROVIDER_
0b70: 53 54 52 55 43 54 53 5f 44 45 46 49 4e 45 44 29  STRUCTS_DEFINED)
0b80: 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a  ....// #endif /*
0b90: 20 57 49 4e 56 45 52 20 3e 3d 20 30 78 30 34 30   WINVER >= 0x040
0ba0: 30 20 2a 2f 0d 0a 0d 0a 61 6c 69 61 73 20 4e 55  0 */....alias NU
0bb0: 4c 4c 20 57 49 4e 33 31 5f 43 4c 41 53 53 3b 0d  LL WIN31_CLASS;.
0bc0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
0bd0: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52  s) export LONG R
0be0: 65 67 43 6c 6f 73 65 4b 65 79 28 0d 0a 20 20 48  egCloseKey(..  H
0bf0: 4b 45 59 20 68 4b 65 79 29 3b 0d 0a 0d 0a 65 78  KEY hKey);....ex
0c00: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78  tern(Windows) ex
0c10: 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 4f 76 65  port LONG RegOve
0c20: 72 72 69 64 65 50 72 65 64 65 66 4b 65 79 28 0d  rridePredefKey(.
0c30: 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20  .  HKEY hKey,.. 
0c40: 20 48 4b 45 59 20 68 4e 65 77 48 4b 65 79 29 3b   HKEY hNewHKey);
0c50: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
0c60: 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20  ws) export LONG 
0c70: 52 65 67 4f 70 65 6e 55 73 65 72 43 6c 61 73 73  RegOpenUserClass
0c80: 65 73 52 6f 6f 74 28 0d 0a 20 20 48 41 4e 44 4c  esRoot(..  HANDL
0c90: 45 20 68 54 6f 6b 65 6e 2c 0d 0a 20 20 44 57 4f  E hToken,..  DWO
0ca0: 52 44 20 64 77 4f 70 74 69 6f 6e 73 2c 0d 0a 20  RD dwOptions,.. 
0cb0: 20 52 45 47 53 41 4d 20 73 61 6d 44 65 73 69 72   REGSAM samDesir
0cc0: 65 64 2c 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b  ed,..  PHKEY phk
0cd0: 52 65 73 75 6c 74 29 3b 0d 0a 0d 0a 65 78 74 65  Result);....exte
0ce0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
0cf0: 72 74 20 4c 4f 4e 47 20 52 65 67 4f 70 65 6e 43  rt LONG RegOpenC
0d00: 75 72 72 65 6e 74 55 73 65 72 28 0d 0a 20 20 52  urrentUser(..  R
0d10: 45 47 53 41 4d 20 73 61 6d 44 65 73 69 72 65 64  EGSAM samDesired
0d20: 2c 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 65  ,..  PHKEY phkRe
0d30: 73 75 6c 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e  sult);....extern
0d40: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
0d50: 20 4c 4f 4e 47 20 52 65 67 44 69 73 61 62 6c 65   LONG RegDisable
0d60: 50 72 65 64 65 66 69 6e 65 64 43 61 63 68 65 28  PredefinedCache(
0d70: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
0d80: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e  dows) export LON
0d90: 47 20 52 65 67 43 6f 6e 6e 65 63 74 52 65 67 69  G RegConnectRegi
0da0: 73 74 72 79 41 28 0d 0a 20 20 4c 50 43 53 54 52  stryA(..  LPCSTR
0db0: 20 6c 70 4d 61 63 68 69 6e 65 4e 61 6d 65 2c 0d   lpMachineName,.
0dc0: 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20  .  HKEY hKey,.. 
0dd0: 20 50 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74   PHKEY phkResult
0de0: 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
0df0: 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20  ws) export LONG 
0e00: 52 65 67 43 6f 6e 6e 65 63 74 52 65 67 69 73 74  RegConnectRegist
0e10: 72 79 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20  ryW(..  LPCWSTR 
0e20: 6c 70 4d 61 63 68 69 6e 65 4e 61 6d 65 2c 0d 0a  lpMachineName,..
0e30: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20    HKEY hKey,..  
0e40: 50 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74 29  PHKEY phkResult)
0e50: 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
0e60: 43 4f 44 45 0d 0a 61 6c 69 61 73 20 52 65 67 43  CODE..alias RegC
0e70: 6f 6e 6e 65 63 74 52 65 67 69 73 74 72 79 57 20  onnectRegistryW 
0e80: 52 65 67 43 6f 6e 6e 65 63 74 52 65 67 69 73 74  RegConnectRegist
0e90: 72 79 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f  ry;..// #else../
0ea0: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69  / #.....// #endi
0eb0: 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
0ec0: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
0ed0: 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67   export LONG Reg
0ee0: 43 72 65 61 74 65 4b 65 79 41 28 0d 0a 20 20 48  CreateKeyA(..  H
0ef0: 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43  KEY hKey,..  LPC
0f00: 53 54 52 20 6c 70 53 75 62 4b 65 79 2c 0d 0a 20  STR lpSubKey,.. 
0f10: 20 50 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74   PHKEY phkResult
0f20: 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
0f30: 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20  ws) export LONG 
0f40: 52 65 67 43 72 65 61 74 65 4b 65 79 57 28 0d 0a  RegCreateKeyW(..
0f50: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20    HKEY hKey,..  
0f60: 4c 50 43 57 53 54 52 20 6c 70 53 75 62 4b 65 79  LPCWSTR lpSubKey
0f70: 2c 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 65  ,..  PHKEY phkRe
0f80: 73 75 6c 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65  sult);..// #ifde
0f90: 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61 73  f UNICODE..alias
0fa0: 20 52 65 67 43 72 65 61 74 65 4b 65 79 57 20 52   RegCreateKeyW R
0fb0: 65 67 43 72 65 61 74 65 4b 65 79 3b 0d 0a 2f 2f  egCreateKey;..//
0fc0: 20 23 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d   #else..// #....
0fd0: 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
0fe0: 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
0ff0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
1000: 20 4c 4f 4e 47 20 52 65 67 43 72 65 61 74 65 4b   LONG RegCreateK
1010: 65 79 45 78 41 28 0d 0a 20 20 48 4b 45 59 20 68  eyExA(..  HKEY h
1020: 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  Key,..  LPCSTR l
1030: 70 53 75 62 4b 65 79 2c 0d 0a 20 20 44 57 4f 52  pSubKey,..  DWOR
1040: 44 20 52 65 73 65 72 76 65 64 2c 0d 0a 20 20 4c  D Reserved,..  L
1050: 50 53 54 52 20 6c 70 43 6c 61 73 73 2c 0d 0a 20  PSTR lpClass,.. 
1060: 20 44 57 4f 52 44 20 64 77 4f 70 74 69 6f 6e 73   DWORD dwOptions
1070: 2c 0d 0a 20 20 52 45 47 53 41 4d 20 73 61 6d 44  ,..  REGSAM samD
1080: 65 73 69 72 65 64 2c 0d 0a 20 20 4c 50 53 45 43  esired,..  LPSEC
1090: 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53  URITY_ATTRIBUTES
10a0: 20 6c 70 53 65 63 75 72 69 74 79 41 74 74 72 69   lpSecurityAttri
10b0: 62 75 74 65 73 2c 0d 0a 20 20 50 48 4b 45 59 20  butes,..  PHKEY 
10c0: 70 68 6b 52 65 73 75 6c 74 2c 0d 0a 20 20 4c 50  phkResult,..  LP
10d0: 44 57 4f 52 44 20 6c 70 64 77 44 69 73 70 6f 73  DWORD lpdwDispos
10e0: 69 74 69 6f 6e 29 3b 0d 0a 65 78 74 65 72 6e 28  ition);..extern(
10f0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1100: 4c 4f 4e 47 20 52 65 67 43 72 65 61 74 65 4b 65  LONG RegCreateKe
1110: 79 45 78 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b  yExW(..  HKEY hK
1120: 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  ey,..  LPCWSTR l
1130: 70 53 75 62 4b 65 79 2c 0d 0a 20 20 44 57 4f 52  pSubKey,..  DWOR
1140: 44 20 52 65 73 65 72 76 65 64 2c 0d 0a 20 20 4c  D Reserved,..  L
1150: 50 57 53 54 52 20 6c 70 43 6c 61 73 73 2c 0d 0a  PWSTR lpClass,..
1160: 20 20 44 57 4f 52 44 20 64 77 4f 70 74 69 6f 6e    DWORD dwOption
1170: 73 2c 0d 0a 20 20 52 45 47 53 41 4d 20 73 61 6d  s,..  REGSAM sam
1180: 44 65 73 69 72 65 64 2c 0d 0a 20 20 4c 50 53 45  Desired,..  LPSE
1190: 43 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45  CURITY_ATTRIBUTE
11a0: 53 20 6c 70 53 65 63 75 72 69 74 79 41 74 74 72  S lpSecurityAttr
11b0: 69 62 75 74 65 73 2c 0d 0a 20 20 50 48 4b 45 59  ibutes,..  PHKEY
11c0: 20 70 68 6b 52 65 73 75 6c 74 2c 0d 0a 20 20 4c   phkResult,..  L
11d0: 50 44 57 4f 52 44 20 6c 70 64 77 44 69 73 70 6f  PDWORD lpdwDispo
11e0: 73 69 74 69 6f 6e 29 3b 0d 0a 2f 2f 20 23 69 66  sition);..// #if
11f0: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69  def UNICODE..ali
1200: 61 73 20 52 65 67 43 72 65 61 74 65 4b 65 79 45  as RegCreateKeyE
1210: 78 57 20 52 65 67 43 72 65 61 74 65 4b 65 79 45  xW RegCreateKeyE
1220: 78 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f  x;..// #else..//
1230: 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66   #.....// #endif
1240: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
1250: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1260: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 44  export LONG RegD
1270: 65 6c 65 74 65 4b 65 79 41 28 0d 0a 20 20 48 4b  eleteKeyA(..  HK
1280: 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 53  EY hKey,..  LPCS
1290: 54 52 20 6c 70 53 75 62 4b 65 79 29 3b 0d 0a 65  TR lpSubKey);..e
12a0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
12b0: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 44 65  xport LONG RegDe
12c0: 6c 65 74 65 4b 65 79 57 28 0d 0a 20 20 48 4b 45  leteKeyW(..  HKE
12d0: 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53  Y hKey,..  LPCWS
12e0: 54 52 20 6c 70 53 75 62 4b 65 79 29 3b 0d 0a 2f  TR lpSubKey);../
12f0: 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
1300: 0d 0a 61 6c 69 61 73 20 52 65 67 44 65 6c 65 74  ..alias RegDelet
1310: 65 4b 65 79 57 20 52 65 67 44 65 6c 65 74 65 4b  eKeyW RegDeleteK
1320: 65 79 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f  ey;..// #else../
1330: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69  / #.....// #endi
1340: 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
1350: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
1360: 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67   export LONG Reg
1370: 44 65 6c 65 74 65 56 61 6c 75 65 41 28 0d 0a 20  DeleteValueA(.. 
1380: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c   HKEY hKey,..  L
1390: 50 43 53 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d  PCSTR lpValueNam
13a0: 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64  e);..extern(Wind
13b0: 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47  ows) export LONG
13c0: 20 52 65 67 44 65 6c 65 74 65 56 61 6c 75 65 57   RegDeleteValueW
13d0: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d  (..  HKEY hKey,.
13e0: 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 56 61 6c  .  LPCWSTR lpVal
13f0: 75 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66  ueName);..// #if
1400: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69  def UNICODE..ali
1410: 61 73 20 52 65 67 44 65 6c 65 74 65 56 61 6c 75  as RegDeleteValu
1420: 65 57 20 52 65 67 44 65 6c 65 74 65 56 61 6c 75  eW RegDeleteValu
1430: 65 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f  e;..// #else..//
1440: 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66   #.....// #endif
1450: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
1460: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
1470: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 45  export LONG RegE
1480: 6e 75 6d 4b 65 79 41 28 0d 0a 20 20 48 4b 45 59  numKeyA(..  HKEY
1490: 20 68 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 44 20   hKey,..  DWORD 
14a0: 64 77 49 6e 64 65 78 2c 0d 0a 20 20 4c 50 53 54  dwIndex,..  LPST
14b0: 52 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f  R lpName,..  DWO
14c0: 52 44 20 63 62 4e 61 6d 65 29 3b 0d 0a 65 78 74  RD cbName);..ext
14d0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
14e0: 6f 72 74 20 4c 4f 4e 47 20 52 65 67 45 6e 75 6d  ort LONG RegEnum
14f0: 4b 65 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b  KeyW(..  HKEY hK
1500: 65 79 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 49  ey,..  DWORD dwI
1510: 6e 64 65 78 2c 0d 0a 20 20 4c 50 57 53 54 52 20  ndex,..  LPWSTR 
1520: 6c 70 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44  lpName,..  DWORD
1530: 20 63 62 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69   cbName);..// #i
1540: 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c  fdef UNICODE..al
1550: 69 61 73 20 52 65 67 45 6e 75 6d 4b 65 79 57 20  ias RegEnumKeyW 
1560: 52 65 67 45 6e 75 6d 4b 65 79 3b 0d 0a 2f 2f 20  RegEnumKey;..// 
1570: 23 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a  #else..// #.....
1580: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e  // #endif // !UN
1590: 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28  ICODE....extern(
15a0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
15b0: 4c 4f 4e 47 20 52 65 67 45 6e 75 6d 4b 65 79 45  LONG RegEnumKeyE
15c0: 78 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79  xA(..  HKEY hKey
15d0: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 49 6e 64  ,..  DWORD dwInd
15e0: 65 78 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 4e  ex,..  LPSTR lpN
15f0: 61 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  ame,..  LPDWORD 
1600: 6c 70 63 62 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44  lpcbName,..  LPD
1610: 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64 2c  WORD lpReserved,
1620: 0d 0a 20 20 4c 50 53 54 52 20 6c 70 43 6c 61 73  ..  LPSTR lpClas
1630: 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70  s,..  LPDWORD lp
1640: 63 62 43 6c 61 73 73 2c 0d 0a 20 20 50 46 49 4c  cbClass,..  PFIL
1650: 45 54 49 4d 45 20 6c 70 66 74 4c 61 73 74 57 72  ETIME lpftLastWr
1660: 69 74 65 54 69 6d 65 29 3b 0d 0a 65 78 74 65 72  iteTime);..exter
1670: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
1680: 74 20 4c 4f 4e 47 20 52 65 67 45 6e 75 6d 4b 65  t LONG RegEnumKe
1690: 79 45 78 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b  yExW(..  HKEY hK
16a0: 65 79 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 49  ey,..  DWORD dwI
16b0: 6e 64 65 78 2c 0d 0a 20 20 4c 50 57 53 54 52 20  ndex,..  LPWSTR 
16c0: 6c 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f  lpName,..  LPDWO
16d0: 52 44 20 6c 70 63 62 4e 61 6d 65 2c 0d 0a 20 20  RD lpcbName,..  
16e0: 4c 50 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76  LPDWORD lpReserv
16f0: 65 64 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70  ed,..  LPWSTR lp
1700: 43 6c 61 73 73 2c 0d 0a 20 20 4c 50 44 57 4f 52  Class,..  LPDWOR
1710: 44 20 6c 70 63 62 43 6c 61 73 73 2c 0d 0a 20 20  D lpcbClass,..  
1720: 50 46 49 4c 45 54 49 4d 45 20 6c 70 66 74 4c 61  PFILETIME lpftLa
1730: 73 74 57 72 69 74 65 54 69 6d 65 29 3b 0d 0a 2f  stWriteTime);../
1740: 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
1750: 0d 0a 61 6c 69 61 73 20 52 65 67 45 6e 75 6d 4b  ..alias RegEnumK
1760: 65 79 45 78 57 20 52 65 67 45 6e 75 6d 4b 65 79  eyExW RegEnumKey
1770: 45 78 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f  Ex;..// #else../
1780: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69  / #.....// #endi
1790: 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
17a0: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
17b0: 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67   export LONG Reg
17c0: 45 6e 75 6d 56 61 6c 75 65 41 28 0d 0a 20 20 48  EnumValueA(..  H
17d0: 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 44 57 4f  KEY hKey,..  DWO
17e0: 52 44 20 64 77 49 6e 64 65 78 2c 0d 0a 20 20 4c  RD dwIndex,..  L
17f0: 50 53 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d 65  PSTR lpValueName
1800: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63  ,..  LPDWORD lpc
1810: 62 56 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20 20 4c  bValueName,..  L
1820: 50 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65  PDWORD lpReserve
1830: 64 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70  d,..  LPDWORD lp
1840: 54 79 70 65 2c 0d 0a 20 20 4c 50 42 59 54 45 20  Type,..  LPBYTE 
1850: 6c 70 44 61 74 61 2c 0d 0a 20 20 4c 50 44 57 4f  lpData,..  LPDWO
1860: 52 44 20 6c 70 63 62 44 61 74 61 29 3b 0d 0a 65  RD lpcbData);..e
1870: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
1880: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 45 6e  xport LONG RegEn
1890: 75 6d 56 61 6c 75 65 57 28 0d 0a 20 20 48 4b 45  umValueW(..  HKE
18a0: 59 20 68 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 44  Y hKey,..  DWORD
18b0: 20 64 77 49 6e 64 65 78 2c 0d 0a 20 20 4c 50 57   dwIndex,..  LPW
18c0: 53 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d 65 2c  STR lpValueName,
18d0: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62  ..  LPDWORD lpcb
18e0: 56 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50  ValueName,..  LP
18f0: 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64  DWORD lpReserved
1900: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 54  ,..  LPDWORD lpT
1910: 79 70 65 2c 0d 0a 20 20 4c 50 42 59 54 45 20 6c  ype,..  LPBYTE l
1920: 70 44 61 74 61 2c 0d 0a 20 20 4c 50 44 57 4f 52  pData,..  LPDWOR
1930: 44 20 6c 70 63 62 44 61 74 61 29 3b 0d 0a 2f 2f  D lpcbData);..//
1940: 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
1950: 0a 61 6c 69 61 73 20 52 65 67 45 6e 75 6d 56 61  .alias RegEnumVa
1960: 6c 75 65 57 20 52 65 67 45 6e 75 6d 56 61 6c 75  lueW RegEnumValu
1970: 65 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f  e;..// #else..//
1980: 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66   #.....// #endif
1990: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a   // !UNICODE....
19a0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
19b0: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 46  export LONG RegF
19c0: 6c 75 73 68 4b 65 79 28 0d 0a 20 20 48 4b 45 59  lushKey(..  HKEY
19d0: 20 68 4b 65 79 29 3b 0d 0a 0d 0a 65 78 74 65 72   hKey);....exter
19e0: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
19f0: 74 20 4c 4f 4e 47 20 52 65 67 47 65 74 4b 65 79  t LONG RegGetKey
1a00: 53 65 63 75 72 69 74 79 28 0d 0a 20 20 48 4b 45  Security(..  HKE
1a10: 59 20 68 4b 65 79 2c 0d 0a 20 20 53 45 43 55 52  Y hKey,..  SECUR
1a20: 49 54 59 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20  ITY_INFORMATION 
1a30: 53 65 63 75 72 69 74 79 49 6e 66 6f 72 6d 61 74  SecurityInformat
1a40: 69 6f 6e 2c 0d 0a 20 20 50 53 45 43 55 52 49 54  ion,..  PSECURIT
1a50: 59 5f 44 45 53 43 52 49 50 54 4f 52 20 70 53 65  Y_DESCRIPTOR pSe
1a60: 63 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72  curityDescriptor
1a70: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63  ,..  LPDWORD lpc
1a80: 62 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70  bSecurityDescrip
1a90: 74 6f 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28  tor);....extern(
1aa0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
1ab0: 4c 4f 4e 47 20 52 65 67 4c 6f 61 64 4b 65 79 41  LONG RegLoadKeyA
1ac0: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d  (..  HKEY hKey,.
1ad0: 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 75 62 4b  .  LPCSTR lpSubK
1ae0: 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  ey,..  LPCSTR lp
1af0: 46 69 6c 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57  File);..extern(W
1b00: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c  indows) export L
1b10: 4f 4e 47 20 52 65 67 4c 6f 61 64 4b 65 79 57 28  ONG RegLoadKeyW(
1b20: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a  ..  HKEY hKey,..
1b30: 20 20 4c 50 43 57 53 54 52 20 6c 70 53 75 62 4b    LPCWSTR lpSubK
1b40: 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  ey,..  LPCWSTR l
1b50: 70 46 69 6c 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  pFile);..// #ifd
1b60: 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61  ef UNICODE..alia
1b70: 73 20 52 65 67 4c 6f 61 64 4b 65 79 57 20 52 65  s RegLoadKeyW Re
1b80: 67 4c 6f 61 64 4b 65 79 3b 0d 0a 2f 2f 20 23 65  gLoadKey;..// #e
1b90: 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  lse..// #.....//
1ba0: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
1bb0: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
1bc0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f  ndows) export LO
1bd0: 4e 47 20 52 65 67 4e 6f 74 69 66 79 43 68 61 6e  NG RegNotifyChan
1be0: 67 65 4b 65 79 56 61 6c 75 65 28 0d 0a 20 20 48  geKeyValue(..  H
1bf0: 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 42 4f 4f  KEY hKey,..  BOO
1c00: 4c 20 62 57 61 74 63 68 53 75 62 74 72 65 65 2c  L bWatchSubtree,
1c10: 0d 0a 20 20 44 57 4f 52 44 20 64 77 4e 6f 74 69  ..  DWORD dwNoti
1c20: 66 79 46 69 6c 74 65 72 2c 0d 0a 20 20 48 41 4e  fyFilter,..  HAN
1c30: 44 4c 45 20 68 45 76 65 6e 74 2c 0d 0a 20 20 42  DLE hEvent,..  B
1c40: 4f 4f 4c 20 66 41 73 79 6e 63 68 72 6f 6e 75 73  OOL fAsynchronus
1c50: 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e  );....extern(Win
1c60: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e  dows) export LON
1c70: 47 20 52 65 67 4f 70 65 6e 4b 65 79 41 28 0d 0a  G RegOpenKeyA(..
1c80: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20    HKEY hKey,..  
1c90: 4c 50 43 53 54 52 20 6c 70 53 75 62 4b 65 79 2c  LPCSTR lpSubKey,
1ca0: 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 65 73  ..  PHKEY phkRes
1cb0: 75 6c 74 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ult);..extern(Wi
1cc0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f  ndows) export LO
1cd0: 4e 47 20 52 65 67 4f 70 65 6e 4b 65 79 57 28 0d  NG RegOpenKeyW(.
1ce0: 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20  .  HKEY hKey,.. 
1cf0: 20 4c 50 43 57 53 54 52 20 6c 70 53 75 62 4b 65   LPCWSTR lpSubKe
1d00: 79 2c 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52  y,..  PHKEY phkR
1d10: 65 73 75 6c 74 29 3b 0d 0a 2f 2f 20 23 69 66 64  esult);..// #ifd
1d20: 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61  ef UNICODE..alia
1d30: 73 20 52 65 67 4f 70 65 6e 4b 65 79 57 20 52 65  s RegOpenKeyW Re
1d40: 67 4f 70 65 6e 4b 65 79 3b 0d 0a 2f 2f 20 23 65  gOpenKey;..// #e
1d50: 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f  lse..// #.....//
1d60: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43   #endif // !UNIC
1d70: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69  ODE....extern(Wi
1d80: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f  ndows) export LO
1d90: 4e 47 20 52 65 67 4f 70 65 6e 4b 65 79 45 78 41  NG RegOpenKeyExA
1da0: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d  (..  HKEY hKey,.
1db0: 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 75 62 4b  .  LPCSTR lpSubK
1dc0: 65 79 2c 0d 0a 20 20 44 57 4f 52 44 20 75 6c 4f  ey,..  DWORD ulO
1dd0: 70 74 69 6f 6e 73 2c 0d 0a 20 20 52 45 47 53 41  ptions,..  REGSA
1de0: 4d 20 73 61 6d 44 65 73 69 72 65 64 2c 0d 0a 20  M samDesired,.. 
1df0: 20 50 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74   PHKEY phkResult
1e00: 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
1e10: 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20  ws) export LONG 
1e20: 52 65 67 4f 70 65 6e 4b 65 79 45 78 57 28 0d 0a  RegOpenKeyExW(..
1e30: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20    HKEY hKey,..  
1e40: 4c 50 43 57 53 54 52 20 6c 70 53 75 62 4b 65 79  LPCWSTR lpSubKey
1e50: 2c 0d 0a 20 20 44 57 4f 52 44 20 75 6c 4f 70 74  ,..  DWORD ulOpt
1e60: 69 6f 6e 73 2c 0d 0a 20 20 52 45 47 53 41 4d 20  ions,..  REGSAM 
1e70: 73 61 6d 44 65 73 69 72 65 64 2c 0d 0a 20 20 50  samDesired,..  P
1e80: 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74 29 3b  HKEY phkResult);
1e90: 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
1ea0: 4f 44 45 0d 0a 61 6c 69 61 73 20 52 65 67 4f 70  ODE..alias RegOp
1eb0: 65 6e 4b 65 79 45 78 57 20 52 65 67 4f 70 65 6e  enKeyExW RegOpen
1ec0: 4b 65 79 45 78 3b 0d 0a 2f 2f 20 23 65 6c 73 65  KeyEx;..// #else
1ed0: 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65  ..// #.....// #e
1ee0: 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45  ndif // !UNICODE
1ef0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
1f00: 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20  ws) export LONG 
1f10: 52 65 67 51 75 65 72 79 49 6e 66 6f 4b 65 79 41  RegQueryInfoKeyA
1f20: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d  (..  HKEY hKey,.
1f30: 0a 20 20 4c 50 53 54 52 20 6c 70 43 6c 61 73 73  .  LPSTR lpClass
1f40: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63  ,..  LPDWORD lpc
1f50: 62 43 6c 61 73 73 2c 0d 0a 20 20 4c 50 44 57 4f  bClass,..  LPDWO
1f60: 52 44 20 6c 70 52 65 73 65 72 76 65 64 2c 0d 0a  RD lpReserved,..
1f70: 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 53 75 62    LPDWORD lpcSub
1f80: 4b 65 79 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  Keys,..  LPDWORD
1f90: 20 6c 70 63 62 4d 61 78 53 75 62 4b 65 79 4c 65   lpcbMaxSubKeyLe
1fa0: 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70  n,..  LPDWORD lp
1fb0: 63 62 4d 61 78 43 6c 61 73 73 4c 65 6e 2c 0d 0a  cbMaxClassLen,..
1fc0: 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 56 61 6c    LPDWORD lpcVal
1fd0: 75 65 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  ues,..  LPDWORD 
1fe0: 6c 70 63 62 4d 61 78 56 61 6c 75 65 4e 61 6d 65  lpcbMaxValueName
1ff0: 4c 65 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  Len,..  LPDWORD 
2000: 6c 70 63 62 4d 61 78 56 61 6c 75 65 4c 65 6e 2c  lpcbMaxValueLen,
2010: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62  ..  LPDWORD lpcb
2020: 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74  SecurityDescript
2030: 6f 72 2c 0d 0a 20 20 50 46 49 4c 45 54 49 4d 45  or,..  PFILETIME
2040: 20 6c 70 66 74 4c 61 73 74 57 72 69 74 65 54 69   lpftLastWriteTi
2050: 6d 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e  me);..extern(Win
2060: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e  dows) export LON
2070: 47 20 52 65 67 51 75 65 72 79 49 6e 66 6f 4b 65  G RegQueryInfoKe
2080: 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79  yW(..  HKEY hKey
2090: 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 43 6c  ,..  LPWSTR lpCl
20a0: 61 73 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20  ass,..  LPDWORD 
20b0: 6c 70 63 62 43 6c 61 73 73 2c 0d 0a 20 20 4c 50  lpcbClass,..  LP
20c0: 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64  DWORD lpReserved
20d0: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63  ,..  LPDWORD lpc
20e0: 53 75 62 4b 65 79 73 2c 0d 0a 20 20 4c 50 44 57  SubKeys,..  LPDW
20f0: 4f 52 44 20 6c 70 63 62 4d 61 78 53 75 62 4b 65  ORD lpcbMaxSubKe
2100: 79 4c 65 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44  yLen,..  LPDWORD
2110: 20 6c 70 63 62 4d 61 78 43 6c 61 73 73 4c 65 6e   lpcbMaxClassLen
2120: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63  ,..  LPDWORD lpc
2130: 56 61 6c 75 65 73 2c 0d 0a 20 20 4c 50 44 57 4f  Values,..  LPDWO
2140: 52 44 20 6c 70 63 62 4d 61 78 56 61 6c 75 65 4e  RD lpcbMaxValueN
2150: 61 6d 65 4c 65 6e 2c 0d 0a 20 20 4c 50 44 57 4f  ameLen,..  LPDWO
2160: 52 44 20 6c 70 63 62 4d 61 78 56 61 6c 75 65 4c  RD lpcbMaxValueL
2170: 65 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  en,..  LPDWORD l
2180: 70 63 62 53 65 63 75 72 69 74 79 44 65 73 63 72  pcbSecurityDescr
2190: 69 70 74 6f 72 2c 0d 0a 20 20 50 46 49 4c 45 54  iptor,..  PFILET
21a0: 49 4d 45 20 6c 70 66 74 4c 61 73 74 57 72 69 74  IME lpftLastWrit
21b0: 65 54 69 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64  eTime);..// #ifd
21c0: 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61  ef UNICODE..alia
21d0: 73 20 52 65 67 51 75 65 72 79 49 6e 66 6f 4b 65  s RegQueryInfoKe
21e0: 79 57 20 52 65 67 51 75 65 72 79 49 6e 66 6f 4b  yW RegQueryInfoK
21f0: 65 79 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f  ey;..// #else../
2200: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69  / #.....// #endi
2210: 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
2220: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
2230: 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67   export LONG Reg
2240: 51 75 65 72 79 56 61 6c 75 65 41 28 0d 0a 20 20  QueryValueA(..  
2250: 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50  HKEY hKey,..  LP
2260: 43 53 54 52 20 6c 70 53 75 62 4b 65 79 2c 0d 0a  CSTR lpSubKey,..
2270: 20 20 4c 50 53 54 52 20 6c 70 56 61 6c 75 65 2c    LPSTR lpValue,
2280: 0d 0a 20 20 50 4c 4f 4e 47 20 6c 70 63 62 56 61  ..  PLONG lpcbVa
2290: 6c 75 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  lue);..extern(Wi
22a0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f  ndows) export LO
22b0: 4e 47 20 52 65 67 51 75 65 72 79 56 61 6c 75 65  NG RegQueryValue
22c0: 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c  W(..  HKEY hKey,
22d0: 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53 75  ..  LPCWSTR lpSu
22e0: 62 4b 65 79 2c 0d 0a 20 20 4c 50 57 53 54 52 20  bKey,..  LPWSTR 
22f0: 6c 70 56 61 6c 75 65 2c 0d 0a 20 20 50 4c 4f 4e  lpValue,..  PLON
2300: 47 20 6c 70 63 62 56 61 6c 75 65 29 3b 0d 0a 2f  G lpcbValue);../
2310: 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45  / #ifdef UNICODE
2320: 0d 0a 61 6c 69 61 73 20 52 65 67 51 75 65 72 79  ..alias RegQuery
2330: 56 61 6c 75 65 57 20 52 65 67 51 75 65 72 79 56  ValueW RegQueryV
2340: 61 6c 75 65 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d  alue;..// #else.
2350: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e  .// #.....// #en
2360: 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
2370: 0a 0d 0a 2f 2f 20 23 69 66 28 57 49 4e 56 45 52  ...// #if(WINVER
2380: 20 3e 3d 20 30 78 30 34 30 30 29 0d 0a 65 78 74   >= 0x0400)..ext
2390: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
23a0: 6f 72 74 20 4c 4f 4e 47 20 52 65 67 51 75 65 72  ort LONG RegQuer
23b0: 79 4d 75 6c 74 69 70 6c 65 56 61 6c 75 65 73 41  yMultipleValuesA
23c0: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d  (..  HKEY hKey,.
23d0: 0a 20 20 50 56 41 4c 45 4e 54 41 20 76 61 6c 5f  .  PVALENTA val_
23e0: 6c 69 73 74 2c 0d 0a 20 20 44 57 4f 52 44 20 6e  list,..  DWORD n
23f0: 75 6d 5f 76 61 6c 73 2c 0d 0a 20 20 4c 50 53 54  um_vals,..  LPST
2400: 52 20 6c 70 56 61 6c 75 65 42 75 66 2c 0d 0a 20  R lpValueBuf,.. 
2410: 20 4c 50 44 57 4f 52 44 20 6c 64 77 54 6f 74 73   LPDWORD ldwTots
2420: 69 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69  ize);..extern(Wi
2430: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f  ndows) export LO
2440: 4e 47 20 52 65 67 51 75 65 72 79 4d 75 6c 74 69  NG RegQueryMulti
2450: 70 6c 65 56 61 6c 75 65 73 57 28 0d 0a 20 20 48  pleValuesW(..  H
2460: 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 50 56 41  KEY hKey,..  PVA
2470: 4c 45 4e 54 57 20 76 61 6c 5f 6c 69 73 74 2c 0d  LENTW val_list,.
2480: 0a 20 20 44 57 4f 52 44 20 6e 75 6d 5f 76 61 6c  .  DWORD num_val
2490: 73 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 56  s,..  LPWSTR lpV
24a0: 61 6c 75 65 42 75 66 2c 0d 0a 20 20 4c 50 44 57  alueBuf,..  LPDW
24b0: 4f 52 44 20 6c 64 77 54 6f 74 73 69 7a 65 29 3b  ORD ldwTotsize);
24c0: 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43  ..// #ifdef UNIC
24d0: 4f 44 45 0d 0a 61 6c 69 61 73 20 52 65 67 51 75  ODE..alias RegQu
24e0: 65 72 79 4d 75 6c 74 69 70 6c 65 56 61 6c 75 65  eryMultipleValue
24f0: 73 57 20 52 65 67 51 75 65 72 79 4d 75 6c 74 69  sW RegQueryMulti
2500: 70 6c 65 56 61 6c 75 65 73 3b 0d 0a 2f 2f 20 23  pleValues;..// #
2510: 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  else..// #...../
2520: 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
2530: 43 4f 44 45 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  CODE..// #endif 
2540: 2f 2a 20 57 49 4e 56 45 52 20 3e 3d 20 30 78 30  /* WINVER >= 0x0
2550: 34 30 30 20 2a 2f 0d 0a 0d 0a 65 78 74 65 72 6e  400 */....extern
2560: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
2570: 20 4c 4f 4e 47 20 52 65 67 51 75 65 72 79 56 61   LONG RegQueryVa
2580: 6c 75 65 45 78 41 28 0d 0a 20 20 48 4b 45 59 20  lueExA(..  HKEY 
2590: 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20  hKey,..  LPCSTR 
25a0: 6c 70 56 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20 20  lpValueName,..  
25b0: 4c 50 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76  LPDWORD lpReserv
25c0: 65 64 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  ed,..  LPDWORD l
25d0: 70 54 79 70 65 2c 0d 0a 20 20 4c 50 42 59 54 45  pType,..  LPBYTE
25e0: 20 6c 70 44 61 74 61 2c 0d 0a 20 20 4c 50 44 57   lpData,..  LPDW
25f0: 4f 52 44 20 6c 70 63 62 44 61 74 61 29 3b 0d 0a  ORD lpcbData);..
2600: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20  extern(Windows) 
2610: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 51  export LONG RegQ
2620: 75 65 72 79 56 61 6c 75 65 45 78 57 28 0d 0a 20  ueryValueExW(.. 
2630: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c   HKEY hKey,..  L
2640: 50 43 57 53 54 52 20 6c 70 56 61 6c 75 65 4e 61  PCWSTR lpValueNa
2650: 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c  me,..  LPDWORD l
2660: 70 52 65 73 65 72 76 65 64 2c 0d 0a 20 20 4c 50  pReserved,..  LP
2670: 44 57 4f 52 44 20 6c 70 54 79 70 65 2c 0d 0a 20  DWORD lpType,.. 
2680: 20 4c 50 42 59 54 45 20 6c 70 44 61 74 61 2c 0d   LPBYTE lpData,.
2690: 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62 44  .  LPDWORD lpcbD
26a0: 61 74 61 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66  ata);..// #ifdef
26b0: 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61 73 20   UNICODE..alias 
26c0: 52 65 67 51 75 65 72 79 56 61 6c 75 65 45 78 57  RegQueryValueExW
26d0: 20 52 65 67 51 75 65 72 79 56 61 6c 75 65 45 78   RegQueryValueEx
26e0: 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20  ;..// #else..// 
26f0: 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  #.....// #endif 
2700: 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65  // !UNICODE....e
2710: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
2720: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 52 65  xport LONG RegRe
2730: 70 6c 61 63 65 4b 65 79 41 28 0d 0a 20 20 48 4b  placeKeyA(..  HK
2740: 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 53  EY hKey,..  LPCS
2750: 54 52 20 6c 70 53 75 62 4b 65 79 2c 0d 0a 20 20  TR lpSubKey,..  
2760: 4c 50 43 53 54 52 20 6c 70 4e 65 77 46 69 6c 65  LPCSTR lpNewFile
2770: 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4f 6c  ,..  LPCSTR lpOl
2780: 64 46 69 6c 65 29 3b 0d 0a 65 78 74 65 72 6e 28  dFile);..extern(
2790: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
27a0: 4c 4f 4e 47 20 52 65 67 52 65 70 6c 61 63 65 4b  LONG RegReplaceK
27b0: 65 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65  eyW(..  HKEY hKe
27c0: 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70  y,..  LPCWSTR lp
27d0: 53 75 62 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53  SubKey,..  LPCWS
27e0: 54 52 20 6c 70 4e 65 77 46 69 6c 65 2c 0d 0a 20  TR lpNewFile,.. 
27f0: 20 4c 50 43 57 53 54 52 20 6c 70 4f 6c 64 46 69   LPCWSTR lpOldFi
2800: 6c 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  le);..// #ifdef 
2810: 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61 73 20 52  UNICODE..alias R
2820: 65 67 52 65 70 6c 61 63 65 4b 65 79 57 20 52 65  egReplaceKeyW Re
2830: 67 52 65 70 6c 61 63 65 4b 65 79 3b 0d 0a 2f 2f  gReplaceKey;..//
2840: 20 23 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d   #else..// #....
2850: 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
2860: 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
2870: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
2880: 20 4c 4f 4e 47 20 52 65 67 52 65 73 74 6f 72 65   LONG RegRestore
2890: 4b 65 79 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b  KeyA(..  HKEY hK
28a0: 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70  ey,..  LPCSTR lp
28b0: 46 69 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64  File,..  DWORD d
28c0: 77 46 6c 61 67 73 29 3b 0d 0a 65 78 74 65 72 6e  wFlags);..extern
28d0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
28e0: 20 4c 4f 4e 47 20 52 65 67 52 65 73 74 6f 72 65   LONG RegRestore
28f0: 4b 65 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b  KeyW(..  HKEY hK
2900: 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c  ey,..  LPCWSTR l
2910: 70 46 69 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20  pFile,..  DWORD 
2920: 64 77 46 6c 61 67 73 29 3b 0d 0a 2f 2f 20 23 69  dwFlags);..// #i
2930: 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c  fdef UNICODE..al
2940: 69 61 73 20 52 65 67 52 65 73 74 6f 72 65 4b 65  ias RegRestoreKe
2950: 79 57 20 52 65 67 52 65 73 74 6f 72 65 4b 65 79  yW RegRestoreKey
2960: 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20  ;..// #else..// 
2970: 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66 20  #.....// #endif 
2980: 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65  // !UNICODE....e
2990: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
29a0: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 53 61  xport LONG RegSa
29b0: 76 65 4b 65 79 41 28 0d 0a 20 20 48 4b 45 59 20  veKeyA(..  HKEY 
29c0: 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20  hKey,..  LPCSTR 
29d0: 6c 70 46 69 6c 65 2c 0d 0a 20 20 4c 50 53 45 43  lpFile,..  LPSEC
29e0: 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53  URITY_ATTRIBUTES
29f0: 20 6c 70 53 65 63 75 72 69 74 79 41 74 74 72 69   lpSecurityAttri
2a00: 62 75 74 65 73 29 3b 0d 0a 65 78 74 65 72 6e 28  butes);..extern(
2a10: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
2a20: 4c 4f 4e 47 20 52 65 67 53 61 76 65 4b 65 79 57  LONG RegSaveKeyW
2a30: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d  (..  HKEY hKey,.
2a40: 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 46 69 6c  .  LPCWSTR lpFil
2a50: 65 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59  e,..  LPSECURITY
2a60: 5f 41 54 54 52 49 42 55 54 45 53 20 6c 70 53 65  _ATTRIBUTES lpSe
2a70: 63 75 72 69 74 79 41 74 74 72 69 62 75 74 65 73  curityAttributes
2a80: 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e  );..// #ifdef UN
2a90: 49 43 4f 44 45 0d 0a 61 6c 69 61 73 20 52 65 67  ICODE..alias Reg
2aa0: 53 61 76 65 4b 65 79 57 20 52 65 67 53 61 76 65  SaveKeyW RegSave
2ab0: 4b 65 79 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a  Key;..// #else..
2ac0: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64  // #.....// #end
2ad0: 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a  if // !UNICODE..
2ae0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73  ..extern(Windows
2af0: 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65  ) export LONG Re
2b00: 67 53 65 74 4b 65 79 53 65 63 75 72 69 74 79 28  gSetKeySecurity(
2b10: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a  ..  HKEY hKey,..
2b20: 20 20 53 45 43 55 52 49 54 59 5f 49 4e 46 4f 52    SECURITY_INFOR
2b30: 4d 41 54 49 4f 4e 20 53 65 63 75 72 69 74 79 49  MATION SecurityI
2b40: 6e 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 50  nformation,..  P
2b50: 53 45 43 55 52 49 54 59 5f 44 45 53 43 52 49 50  SECURITY_DESCRIP
2b60: 54 4f 52 20 70 53 65 63 75 72 69 74 79 44 65 73  TOR pSecurityDes
2b70: 63 72 69 70 74 6f 72 29 3b 0d 0a 0d 0a 65 78 74  criptor);....ext
2b80: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
2b90: 6f 72 74 20 4c 4f 4e 47 20 52 65 67 53 65 74 56  ort LONG RegSetV
2ba0: 61 6c 75 65 41 28 0d 0a 20 20 48 4b 45 59 20 68  alueA(..  HKEY h
2bb0: 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c  Key,..  LPCSTR l
2bc0: 70 53 75 62 4b 65 79 2c 0d 0a 20 20 44 57 4f 52  pSubKey,..  DWOR
2bd0: 44 20 64 77 54 79 70 65 2c 0d 0a 20 20 4c 50 43  D dwType,..  LPC
2be0: 53 54 52 20 6c 70 44 61 74 61 2c 0d 0a 20 20 44  STR lpData,..  D
2bf0: 57 4f 52 44 20 63 62 44 61 74 61 29 3b 0d 0a 65  WORD cbData);..e
2c00: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65  xtern(Windows) e
2c10: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 53 65  xport LONG RegSe
2c20: 74 56 61 6c 75 65 57 28 0d 0a 20 20 48 4b 45 59  tValueW(..  HKEY
2c30: 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54   hKey,..  LPCWST
2c40: 52 20 6c 70 53 75 62 4b 65 79 2c 0d 0a 20 20 44  R lpSubKey,..  D
2c50: 57 4f 52 44 20 64 77 54 79 70 65 2c 0d 0a 20 20  WORD dwType,..  
2c60: 4c 50 43 57 53 54 52 20 6c 70 44 61 74 61 2c 0d  LPCWSTR lpData,.
2c70: 0a 20 20 44 57 4f 52 44 20 63 62 44 61 74 61 29  .  DWORD cbData)
2c80: 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49  ;..// #ifdef UNI
2c90: 43 4f 44 45 0d 0a 61 6c 69 61 73 20 52 65 67 53  CODE..alias RegS
2ca0: 65 74 56 61 6c 75 65 57 20 52 65 67 53 65 74 56  etValueW RegSetV
2cb0: 61 6c 75 65 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d  alue;..// #else.
2cc0: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e  .// #.....// #en
2cd0: 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
2ce0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
2cf0: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52  s) export LONG R
2d00: 65 67 53 65 74 56 61 6c 75 65 45 78 41 28 0d 0a  egSetValueExA(..
2d10: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20    HKEY hKey,..  
2d20: 4c 50 43 53 54 52 20 6c 70 56 61 6c 75 65 4e 61  LPCSTR lpValueNa
2d30: 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20 52 65 73  me,..  DWORD Res
2d40: 65 72 76 65 64 2c 0d 0a 20 20 44 57 4f 52 44 20  erved,..  DWORD 
2d50: 64 77 54 79 70 65 2c 0d 0a 20 20 42 59 54 45 2a  dwType,..  BYTE*
2d60: 20 6c 70 44 61 74 61 2c 0d 0a 20 20 44 57 4f 52   lpData,..  DWOR
2d70: 44 20 63 62 44 61 74 61 29 3b 0d 0a 65 78 74 65  D cbData);..exte
2d80: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f  rn(Windows) expo
2d90: 72 74 20 4c 4f 4e 47 20 52 65 67 53 65 74 56 61  rt LONG RegSetVa
2da0: 6c 75 65 45 78 57 28 0d 0a 20 20 48 4b 45 59 20  lueExW(..  HKEY 
2db0: 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52  hKey,..  LPCWSTR
2dc0: 20 6c 70 56 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20   lpValueName,.. 
2dd0: 20 44 57 4f 52 44 20 52 65 73 65 72 76 65 64 2c   DWORD Reserved,
2de0: 0d 0a 20 20 44 57 4f 52 44 20 64 77 54 79 70 65  ..  DWORD dwType
2df0: 2c 0d 0a 20 20 42 59 54 45 2a 20 6c 70 44 61 74  ,..  BYTE* lpDat
2e00: 61 2c 0d 0a 20 20 44 57 4f 52 44 20 63 62 44 61  a,..  DWORD cbDa
2e10: 74 61 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20  ta);..// #ifdef 
2e20: 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61 73 20 52  UNICODE..alias R
2e30: 65 67 53 65 74 56 61 6c 75 65 45 78 57 20 52 65  egSetValueExW Re
2e40: 67 53 65 74 56 61 6c 75 65 45 78 3b 0d 0a 2f 2f  gSetValueEx;..//
2e50: 20 23 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d   #else..// #....
2e60: 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
2e70: 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e  NICODE....extern
2e80: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
2e90: 20 4c 4f 4e 47 20 52 65 67 55 6e 4c 6f 61 64 4b   LONG RegUnLoadK
2ea0: 65 79 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65  eyA(..  HKEY hKe
2eb0: 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 53  y,..  LPCSTR lpS
2ec0: 75 62 4b 65 79 29 3b 0d 0a 65 78 74 65 72 6e 28  ubKey);..extern(
2ed0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20  Windows) export 
2ee0: 4c 4f 4e 47 20 52 65 67 55 6e 4c 6f 61 64 4b 65  LONG RegUnLoadKe
2ef0: 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79  yW(..  HKEY hKey
2f00: 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53  ,..  LPCWSTR lpS
2f10: 75 62 4b 65 79 29 3b 0d 0a 2f 2f 20 23 69 66 64  ubKey);..// #ifd
2f20: 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69 61  ef UNICODE..alia
2f30: 73 20 52 65 67 55 6e 4c 6f 61 64 4b 65 79 57 20  s RegUnLoadKeyW 
2f40: 52 65 67 55 6e 4c 6f 61 64 4b 65 79 3b 0d 0a 2f  RegUnLoadKey;../
2f50: 2f 20 23 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e  / #else..// #...
2f60: 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21  ..// #endif // !
2f70: 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72  UNICODE....exter
2f80: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72  n(Windows) expor
2f90: 74 20 42 4f 4f 4c 20 49 6e 69 74 69 61 74 65 53  t BOOL InitiateS
2fa0: 79 73 74 65 6d 53 68 75 74 64 6f 77 6e 41 28 0d  ystemShutdownA(.
2fb0: 0a 20 20 4c 50 53 54 52 20 6c 70 4d 61 63 68 69  .  LPSTR lpMachi
2fc0: 6e 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 54 52  neName,..  LPSTR
2fd0: 20 6c 70 4d 65 73 73 61 67 65 2c 0d 0a 20 20 44   lpMessage,..  D
2fe0: 57 4f 52 44 20 64 77 54 69 6d 65 6f 75 74 2c 0d  WORD dwTimeout,.
2ff0: 0a 20 20 42 4f 4f 4c 20 62 46 6f 72 63 65 41 70  .  BOOL bForceAp
3000: 70 73 43 6c 6f 73 65 64 2c 0d 0a 20 20 42 4f 4f  psClosed,..  BOO
3010: 4c 20 62 52 65 62 6f 6f 74 41 66 74 65 72 53 68  L bRebootAfterSh
3020: 75 74 64 6f 77 6e 29 3b 0d 0a 65 78 74 65 72 6e  utdown);..extern
3030: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74  (Windows) export
3040: 20 42 4f 4f 4c 20 49 6e 69 74 69 61 74 65 53 79   BOOL InitiateSy
3050: 73 74 65 6d 53 68 75 74 64 6f 77 6e 57 28 0d 0a  stemShutdownW(..
3060: 20 20 4c 50 57 53 54 52 20 6c 70 4d 61 63 68 69    LPWSTR lpMachi
3070: 6e 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53 54  neName,..  LPWST
3080: 52 20 6c 70 4d 65 73 73 61 67 65 2c 0d 0a 20 20  R lpMessage,..  
3090: 44 57 4f 52 44 20 64 77 54 69 6d 65 6f 75 74 2c  DWORD dwTimeout,
30a0: 0d 0a 20 20 42 4f 4f 4c 20 62 46 6f 72 63 65 41  ..  BOOL bForceA
30b0: 70 70 73 43 6c 6f 73 65 64 2c 0d 0a 20 20 42 4f  ppsClosed,..  BO
30c0: 4f 4c 20 62 52 65 62 6f 6f 74 41 66 74 65 72 53  OL bRebootAfterS
30d0: 68 75 74 64 6f 77 6e 29 3b 0d 0a 2f 2f 20 23 69  hutdown);..// #i
30e0: 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c  fdef UNICODE..al
30f0: 69 61 73 20 49 6e 69 74 69 61 74 65 53 79 73 74  ias InitiateSyst
3100: 65 6d 53 68 75 74 64 6f 77 6e 57 20 49 6e 69 74  emShutdownW Init
3110: 69 61 74 65 53 79 73 74 65 6d 53 68 75 74 64 6f  iateSystemShutdo
3120: 77 6e 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 2f  wn;..// #else../
3130: 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69  / #.....// #endi
3140: 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d  f // !UNICODE...
3150: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29  .extern(Windows)
3160: 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 62 6f   export BOOL Abo
3170: 72 74 53 79 73 74 65 6d 53 68 75 74 64 6f 77 6e  rtSystemShutdown
3180: 41 28 0d 0a 20 20 4c 50 53 54 52 20 6c 70 4d 61  A(..  LPSTR lpMa
3190: 63 68 69 6e 65 4e 61 6d 65 29 3b 0d 0a 65 78 74  chineName);..ext
31a0: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70  ern(Windows) exp
31b0: 6f 72 74 20 42 4f 4f 4c 20 41 62 6f 72 74 53 79  ort BOOL AbortSy
31c0: 73 74 65 6d 53 68 75 74 64 6f 77 6e 57 28 0d 0a  stemShutdownW(..
31d0: 20 20 4c 50 57 53 54 52 20 6c 70 4d 61 63 68 69    LPWSTR lpMachi
31e0: 6e 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66  neName);..// #if
31f0: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 61 6c 69  def UNICODE..ali
3200: 61 73 20 41 62 6f 72 74 53 79 73 74 65 6d 53 68  as AbortSystemSh
3210: 75 74 64 6f 77 6e 57 20 41 62 6f 72 74 53 79 73  utdownW AbortSys
3220: 74 65 6d 53 68 75 74 64 6f 77 6e 3b 0d 0a 2f 2f  temShutdown;..//
3230: 20 23 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d   #else..// #....
3240: 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55  .// #endif // !U
3250: 4e 49 43 4f 44 45 0d 0a 0d 0a 2f 2f 20 69 6e 6c  NICODE....// inl
3260: 69 6e 65 20 23 69 6e 63 6c 75 64 65 20 3c 72 65  ine #include <re
3270: 61 73 6f 6e 2e 68 3e 0d 0a 2f 2f 20 2d 2d 2d 2d  ason.h>..// ----
3280: 0d 0a 0d 0a 2f 2f 20 23 69 66 20 21 64 65 66 69  ....// #if !defi
3290: 6e 65 64 20 53 45 4e 54 49 4e 45 4c 5f 52 65 61  ned SENTINEL_Rea
32a0: 73 6f 6e 0d 0a 2f 2f 20 23 20 64 65 66 69 6e 65  son..// # define
32b0: 20 53 45 4e 54 49 4e 45 4c 5f 52 65 61 73 6f 6e   SENTINEL_Reason
32c0: 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20  ....enum : uint 
32d0: 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46  { SHTDN_REASON_F
32e0: 4c 41 47 5f 43 4f 4d 4d 45 4e 54 5f 52 45 51 55  LAG_COMMENT_REQU
32f0: 49 52 45 44 20 3d 20 30 78 30 31 30 30 30 30 30  IRED = 0x0100000
3300: 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  0 }..enum : uint
3310: 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f   { SHTDN_REASON_
3320: 46 4c 41 47 5f 44 49 52 54 59 5f 50 52 4f 42 4c  FLAG_DIRTY_PROBL
3330: 45 4d 5f 49 44 5f 52 45 51 55 49 52 45 44 20 3d  EM_ID_REQUIRED =
3340: 20 30 78 30 32 30 30 30 30 30 30 20 7d 0d 0a 65   0x02000000 }..e
3350: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54  num : uint { SHT
3360: 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 47 5f 43  DN_REASON_FLAG_C
3370: 4c 45 41 4e 5f 55 49 20 3d 20 30 78 30 34 30 30  LEAN_UI = 0x0400
3380: 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75  0000 }..enum : u
3390: 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53  int { SHTDN_REAS
33a0: 4f 4e 5f 46 4c 41 47 5f 44 49 52 54 59 5f 55 49  ON_FLAG_DIRTY_UI
33b0: 20 3d 20 30 78 30 38 30 30 30 30 30 30 20 7d 0d   = 0x08000000 }.
33c0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  ...enum : uint {
33d0: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c   SHTDN_REASON_FL
33e0: 41 47 5f 55 53 45 52 5f 44 45 46 49 4e 45 44 20  AG_USER_DEFINED 
33f0: 3d 20 30 78 34 30 30 30 30 30 30 30 20 7d 0d 0a  = 0x40000000 }..
3400: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48  enum : uint { SH
3410: 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 47 5f  TDN_REASON_FLAG_
3420: 50 4c 41 4e 4e 45 44 20 3d 20 30 78 38 30 30 30  PLANNED = 0x8000
3430: 30 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a  0000 }....enum :
3440: 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45   uint { SHTDN_RE
3450: 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 4f 54 48 45 52  ASON_MAJOR_OTHER
3460: 20 3d 20 30 78 30 30 30 30 30 30 30 30 20 7d 0d   = 0x00000000 }.
3470: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53  .enum : uint { S
3480: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f  HTDN_REASON_MAJO
3490: 52 5f 4e 4f 4e 45 20 3d 20 30 78 30 30 30 30 30  R_NONE = 0x00000
34a0: 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  000 }..enum : ui
34b0: 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f  nt { SHTDN_REASO
34c0: 4e 5f 4d 41 4a 4f 52 5f 48 41 52 44 57 41 52 45  N_MAJOR_HARDWARE
34d0: 20 3d 20 30 78 30 30 30 31 30 30 30 30 20 7d 0d   = 0x00010000 }.
34e0: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53  .enum : uint { S
34f0: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f  HTDN_REASON_MAJO
3500: 52 5f 4f 50 45 52 41 54 49 4e 47 53 59 53 54 45  R_OPERATINGSYSTE
3510: 4d 20 3d 20 30 78 30 30 30 32 30 30 30 30 20 7d  M = 0x00020000 }
3520: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
3530: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a  SHTDN_REASON_MAJ
3540: 4f 52 5f 53 4f 46 54 57 41 52 45 20 3d 20 30 78  OR_SOFTWARE = 0x
3550: 30 30 30 33 30 30 30 30 20 7d 0d 0a 65 6e 75 6d  00030000 }..enum
3560: 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f   : uint { SHTDN_
3570: 52 45 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 41 50 50  REASON_MAJOR_APP
3580: 4c 49 43 41 54 49 4f 4e 20 3d 20 30 78 30 30 30  LICATION = 0x000
3590: 34 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20  40000 }..enum : 
35a0: 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41  uint { SHTDN_REA
35b0: 53 4f 4e 5f 4d 41 4a 4f 52 5f 53 59 53 54 45 4d  SON_MAJOR_SYSTEM
35c0: 20 3d 20 30 78 30 30 30 35 30 30 30 30 20 7d 0d   = 0x00050000 }.
35d0: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53  .enum : uint { S
35e0: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f  HTDN_REASON_MAJO
35f0: 52 5f 50 4f 57 45 52 20 3d 20 30 78 30 30 30 36  R_POWER = 0x0006
3600: 30 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a  0000 }....enum :
3610: 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45   uint { SHTDN_RE
3620: 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 4f 54 48 45 52  ASON_MINOR_OTHER
3630: 20 3d 20 30 78 30 30 30 30 30 30 30 30 20 7d 0d   = 0x00000000 }.
3640: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53  .enum : uint { S
3650: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f  HTDN_REASON_MINO
3660: 52 5f 4e 4f 4e 45 20 3d 20 30 78 30 30 30 30 30  R_NONE = 0x00000
3670: 30 66 66 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69  0ff }..enum : ui
3680: 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f  nt { SHTDN_REASO
3690: 4e 5f 4d 49 4e 4f 52 5f 4d 41 49 4e 54 45 4e 41  N_MINOR_MAINTENA
36a0: 4e 43 45 20 3d 20 30 78 30 30 30 30 30 30 30 31  NCE = 0x00000001
36b0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
36c0: 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d  { SHTDN_REASON_M
36d0: 49 4e 4f 52 5f 49 4e 53 54 41 4c 4c 41 54 49 4f  INOR_INSTALLATIO
36e0: 4e 20 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d  N = 0x00000002 }
36f0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
3700: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e  SHTDN_REASON_MIN
3710: 4f 52 5f 55 50 47 52 41 44 45 20 3d 20 30 78 30  OR_UPGRADE = 0x0
3720: 30 30 30 30 30 30 33 20 7d 0d 0a 65 6e 75 6d 20  0000003 }..enum 
3730: 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52  : uint { SHTDN_R
3740: 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 52 45 43 4f  EASON_MINOR_RECO
3750: 4e 46 49 47 20 3d 20 30 78 30 30 30 30 30 30 30  NFIG = 0x0000000
3760: 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  4 }..enum : uint
3770: 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f   { SHTDN_REASON_
3780: 4d 49 4e 4f 52 5f 48 55 4e 47 20 3d 20 30 78 30  MINOR_HUNG = 0x0
3790: 30 30 30 30 30 30 35 20 7d 0d 0a 65 6e 75 6d 20  0000005 }..enum 
37a0: 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52  : uint { SHTDN_R
37b0: 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 55 4e 53 54  EASON_MINOR_UNST
37c0: 41 42 4c 45 20 3d 20 30 78 30 30 30 30 30 30 30  ABLE = 0x0000000
37d0: 36 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74  6 }..enum : uint
37e0: 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f   { SHTDN_REASON_
37f0: 4d 49 4e 4f 52 5f 44 49 53 4b 20 3d 20 30 78 30  MINOR_DISK = 0x0
3800: 30 30 30 30 30 30 37 20 7d 0d 0a 65 6e 75 6d 20  0000007 }..enum 
3810: 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52  : uint { SHTDN_R
3820: 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 50 52 4f 43  EASON_MINOR_PROC
3830: 45 53 53 4f 52 20 3d 20 30 78 30 30 30 30 30 30  ESSOR = 0x000000
3840: 30 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  08 }..enum : uin
3850: 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e  t { SHTDN_REASON
3860: 5f 4d 49 4e 4f 52 5f 4e 45 54 57 4f 52 4b 43 41  _MINOR_NETWORKCA
3870: 52 44 20 3d 20 30 78 30 30 30 30 30 30 30 39 20  RD = 0x00000009 
3880: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b  }..enum : uint {
3890: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49   SHTDN_REASON_MI
38a0: 4e 4f 52 5f 50 4f 57 45 52 5f 53 55 50 50 4c 59  NOR_POWER_SUPPLY
38b0: 20 3d 20 30 78 30 30 30 30 30 30 30 61 20 7d 0d   = 0x0000000a }.
38c0: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53  .enum : uint { S
38d0: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f  HTDN_REASON_MINO
38e0: 52 5f 43 4f 52 44 55 4e 50 4c 55 47 47 45 44 20  R_CORDUNPLUGGED 
38f0: 3d 20 30 78 30 30 30 30 30 30 30 62 20 7d 0d 0a  = 0x0000000b }..
3900: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48  enum : uint { SH
3910: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52  TDN_REASON_MINOR
3920: 5f 45 4e 56 49 52 4f 4e 4d 45 4e 54 20 3d 20 30  _ENVIRONMENT = 0
3930: 78 30 30 30 30 30 30 30 63 20 7d 0d 0a 65 6e 75  x0000000c }..enu
3940: 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e  m : uint { SHTDN
3950: 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 48 41  _REASON_MINOR_HA
3960: 52 44 57 41 52 45 5f 44 52 49 56 45 52 20 3d 20  RDWARE_DRIVER = 
3970: 30 78 30 30 30 30 30 30 30 64 20 7d 0d 0a 65 6e  0x0000000d }..en
3980: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 44  um : uint { SHTD
3990: 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 4f  N_REASON_MINOR_O
39a0: 54 48 45 52 44 52 49 56 45 52 20 3d 20 30 78 30  THERDRIVER = 0x0
39b0: 30 30 30 30 30 30 65 20 7d 0d 0a 65 6e 75 6d 20  000000e }..enum 
39c0: 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52  : uint { SHTDN_R
39d0: 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 42 4c 55 45  EASON_MINOR_BLUE
39e0: 53 43 52 45 45 4e 20 3d 20 30 78 30 30 30 30 30  SCREEN = 0x00000
39f0: 30 30 46 20 7d 0d 0a 0d 0a 61 6c 69 61 73 20 53  00F }....alias S
3a00: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f  HTDN_REASON_MINO
3a10: 52 5f 4e 4f 4e 45 20 53 48 54 44 4e 5f 52 45 41  R_NONE SHTDN_REA
3a20: 53 4f 4e 5f 55 4e 4b 4e 4f 57 4e 3b 0d 0a 0d 0a  SON_UNKNOWN;....
3a30: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48  enum : uint { SH
3a40: 54 44 4e 5f 52 45 41 53 4f 4e 5f 56 41 4c 49 44  TDN_REASON_VALID
3a50: 5f 42 49 54 5f 4d 41 53 4b 20 3d 20 30 78 63 30  _BIT_MASK = 0xc0
3a60: 66 66 66 66 66 66 20 7d 0d 0a 0d 0a 65 6e 75 6d  ffffff }....enum
3a70: 20 3a 20 75 69 6e 74 20 7b 20 50 43 4c 45 41 4e   : uint { PCLEAN
3a80: 55 49 20 3d 20 53 48 54 44 4e 5f 52 45 41 53 4f  UI = SHTDN_REASO
3a90: 4e 5f 46 4c 41 47 5f 50 4c 41 4e 4e 45 44 20 7c  N_FLAG_PLANNED |
3aa0: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c   SHTDN_REASON_FL
3ab0: 41 47 5f 43 4c 45 41 4e 5f 55 49 20 7d 0d 0a 65  AG_CLEAN_UI }..e
3ac0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 55 43 4c  num : uint { UCL
3ad0: 45 41 4e 55 49 20 3d 20 53 48 54 44 4e 5f 52 45  EANUI = SHTDN_RE
3ae0: 41 53 4f 4e 5f 46 4c 41 47 5f 43 4c 45 41 4e 5f  ASON_FLAG_CLEAN_
3af0: 55 49 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  UI }..enum : uin
3b00: 74 20 7b 20 55 44 49 52 54 59 55 49 20 3d 20 53  t { UDIRTYUI = S
3b10: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 47  HTDN_REASON_FLAG
3b20: 5f 44 49 52 54 59 5f 55 49 20 7d 0d 0a 0d 0a 65  _DIRTY_UI }....e
3b30: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4d 41 58  num : uint { MAX
3b40: 5f 52 45 41 53 4f 4e 5f 4e 41 4d 45 5f 4c 45 4e  _REASON_NAME_LEN
3b50: 20 3d 20 36 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20   = 64 }..enum : 
3b60: 75 69 6e 74 20 7b 20 4d 41 58 5f 52 45 41 53 4f  uint { MAX_REASO
3b70: 4e 5f 44 45 53 43 5f 4c 45 4e 20 3d 20 32 35 36  N_DESC_LEN = 256
3b80: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
3b90: 7b 20 4d 41 58 5f 52 45 41 53 4f 4e 5f 42 55 47  { MAX_REASON_BUG
3ba0: 49 44 5f 4c 45 4e 20 3d 20 33 32 20 7d 0d 0a 65  ID_LEN = 32 }..e
3bb0: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4d 41 58  num : uint { MAX
3bc0: 5f 52 45 41 53 4f 4e 5f 43 4f 4d 4d 45 4e 54 5f  _REASON_COMMENT_
3bd0: 4c 45 4e 20 3d 20 34 30 39 36 20 7d 0d 0a 0d 0a  LEN = 4096 }....
3be0: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 64 65  // #endif // !de
3bf0: 66 69 6e 65 64 20 53 45 4e 54 49 4e 45 4c 5f 52  fined SENTINEL_R
3c00: 65 61 73 6f 6e 0d 0a 2f 2f 20 2d 2d 2d 2d 0d 0a  eason..// ----..
3c10: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
3c20: 52 45 41 53 4f 4e 5f 53 57 49 4e 53 54 41 4c 4c  REASON_SWINSTALL
3c30: 20 3d 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f   = SHTDN_REASON_
3c40: 4d 41 4a 4f 52 5f 53 4f 46 54 57 41 52 45 20 7c  MAJOR_SOFTWARE |
3c50: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49   SHTDN_REASON_MI
3c60: 4e 4f 52 5f 49 4e 53 54 41 4c 4c 41 54 49 4f 4e  NOR_INSTALLATION
3c70: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20   }..enum : uint 
3c80: 7b 20 52 45 41 53 4f 4e 5f 48 57 49 4e 53 54 41  { REASON_HWINSTA
3c90: 4c 4c 20 3d 20 53 48 54 44 4e 5f 52 45 41 53 4f  LL = SHTDN_REASO
3ca0: 4e 5f 4d 41 4a 4f 52 5f 48 41 52 44 57 41 52 45  N_MAJOR_HARDWARE
3cb0: 20 7c 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f   | SHTDN_REASON_
3cc0: 4d 49 4e 4f 52 5f 49 4e 53 54 41 4c 4c 41 54 49  MINOR_INSTALLATI
3cd0: 4f 4e 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e  ON }..enum : uin
3ce0: 74 20 7b 20 52 45 41 53 4f 4e 5f 53 45 52 56 49  t { REASON_SERVI
3cf0: 43 45 48 41 4e 47 20 3d 20 53 48 54 44 4e 5f 52  CEHANG = SHTDN_R
3d00: 45 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 53 4f 46 54  EASON_MAJOR_SOFT
3d10: 57 41 52 45 20 7c 20 53 48 54 44 4e 5f 52 45 41  WARE | SHTDN_REA
3d20: 53 4f 4e 5f 4d 49 4e 4f 52 5f 48 55 4e 47 20 7d  SON_MINOR_HUNG }
3d30: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20  ..enum : uint { 
3d40: 52 45 41 53 4f 4e 5f 55 4e 53 54 41 42 4c 45 20  REASON_UNSTABLE 
3d50: 3d 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d  = SHTDN_REASON_M
3d60: 41 4a 4f 52 5f 53 59 53 54 45 4d 20 7c 20 53 48  AJOR_SYSTEM | SH
3d70: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52  TDN_REASON_MINOR
3d80: 5f 55 4e 53 54 41 42 4c 45 20 7d 0d 0a 65 6e 75  _UNSTABLE }..enu
3d90: 6d 20 3a 20 75 69 6e 74 20 7b 20 52 45 41 53 4f  m : uint { REASO
3da0: 4e 5f 53 57 48 57 52 45 43 4f 4e 46 20 3d 20 53  N_SWHWRECONF = S
3db0: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f  HTDN_REASON_MAJO
3dc0: 52 5f 53 4f 46 54 57 41 52 45 20 7c 20 53 48 54  R_SOFTWARE | SHT
3dd0: 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f  DN_REASON_MINOR_
3de0: 52 45 43 4f 4e 46 49 47 20 7d 0d 0a 65 6e 75 6d  RECONFIG }..enum
3df0: 20 3a 20 75 69 6e 74 20 7b 20 52 45 41 53 4f 4e   : uint { REASON
3e00: 5f 4f 54 48 45 52 20 3d 20 53 48 54 44 4e 5f 52  _OTHER = SHTDN_R
3e10: 45 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 4f 54 48 45  EASON_MAJOR_OTHE
3e20: 52 20 7c 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e  R | SHTDN_REASON
3e30: 5f 4d 49 4e 4f 52 5f 4f 54 48 45 52 20 7d 0d 0a  _MINOR_OTHER }..
3e40: 61 6c 69 61 73 20 53 48 54 44 4e 5f 52 45 41 53  alias SHTDN_REAS
3e50: 4f 4e 5f 55 4e 4b 4e 4f 57 4e 20 52 45 41 53 4f  ON_UNKNOWN REASO
3e60: 4e 5f 55 4e 4b 4e 4f 57 4e 3b 0d 0a 61 6c 69 61  N_UNKNOWN;..alia
3e70: 73 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46  s SHTDN_REASON_F
3e80: 4c 41 47 5f 50 4c 41 4e 4e 45 44 20 52 45 41 53  LAG_PLANNED REAS
3e90: 4f 4e 5f 50 4c 41 4e 4e 45 44 5f 46 4c 41 47 3b  ON_PLANNED_FLAG;
3ea0: 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  ....extern(Windo
3eb0: 77 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20  ws) export BOOL 
3ec0: 49 6e 69 74 69 61 74 65 53 79 73 74 65 6d 53 68  InitiateSystemSh
3ed0: 75 74 64 6f 77 6e 45 78 41 28 0d 0a 20 20 4c 50  utdownExA(..  LP
3ee0: 53 54 52 20 6c 70 4d 61 63 68 69 6e 65 4e 61 6d  STR lpMachineNam
3ef0: 65 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 4d 65  e,..  LPSTR lpMe
3f00: 73 73 61 67 65 2c 0d 0a 20 20 44 57 4f 52 44 20  ssage,..  DWORD 
3f10: 64 77 54 69 6d 65 6f 75 74 2c 0d 0a 20 20 42 4f  dwTimeout,..  BO
3f20: 4f 4c 20 62 46 6f 72 63 65 41 70 70 73 43 6c 6f  OL bForceAppsClo
3f30: 73 65 64 2c 0d 0a 20 20 42 4f 4f 4c 20 62 52 65  sed,..  BOOL bRe
3f40: 62 6f 6f 74 41 66 74 65 72 53 68 75 74 64 6f 77  bootAfterShutdow
3f50: 6e 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 52 65  n,..  DWORD dwRe
3f60: 61 73 6f 6e 29 3b 0d 0a 65 78 74 65 72 6e 28 57  ason);..extern(W
3f70: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42  indows) export B
3f80: 4f 4f 4c 20 49 6e 69 74 69 61 74 65 53 79 73 74  OOL InitiateSyst
3f90: 65 6d 53 68 75 74 64 6f 77 6e 45 78 57 28 0d 0a  emShutdownExW(..
3fa0: 20 20 4c 50 57 53 54 52 20 6c 70 4d 61 63 68 69    LPWSTR lpMachi
3fb0: 6e 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53 54  neName,..  LPWST
3fc0: 52 20 6c 70 4d 65 73 73 61 67 65 2c 0d 0a 20 20  R lpMessage,..  
3fd0: 44 57 4f 52 44 20 64 77 54 69 6d 65 6f 75 74 2c  DWORD dwTimeout,
3fe0: 0d 0a 20 20 42 4f 4f 4c 20 62 46 6f 72 63 65 41  ..  BOOL bForceA
3ff0: 70 70 73 43 6c 6f 73 65 64 2c 0d 0a 20 20 42 4f  ppsClosed,..  BO
4000: 4f 4c 20 62 52 65 62 6f 6f 74 41 66 74 65 72 53  OL bRebootAfterS
4010: 68 75 74 64 6f 77 6e 2c 0d 0a 20 20 44 57 4f 52  hutdown,..  DWOR
4020: 44 20 64 77 52 65 61 73 6f 6e 29 3b 0d 0a 2f 2f  D dwReason);..//
4030: 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d   #ifdef UNICODE.
4040: 0a 61 6c 69 61 73 20 49 6e 69 74 69 61 74 65 53  .alias InitiateS
4050: 79 73 74 65 6d 53 68 75 74 64 6f 77 6e 45 78 57  ystemShutdownExW
4060: 20 49 6e 69 74 69 61 74 65 53 79 73 74 65 6d 53   InitiateSystemS
4070: 68 75 74 64 6f 77 6e 45 78 3b 0d 0a 2f 2f 20 23  hutdownEx;..// #
4080: 65 6c 73 65 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f  else..// #...../
4090: 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49  / #endif // !UNI
40a0: 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57  CODE....extern(W
40b0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c  indows) export L
40c0: 4f 4e 47 20 52 65 67 53 61 76 65 4b 65 79 45 78  ONG RegSaveKeyEx
40d0: 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c  A(..  HKEY hKey,
40e0: 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 69 6c  ..  LPCSTR lpFil
40f0: 65 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59  e,..  LPSECURITY
4100: 5f 41 54 54 52 49 42 55 54 45 53 20 6c 70 53 65  _ATTRIBUTES lpSe
4110: 63 75 72 69 74 79 41 74 74 72 69 62 75 74 65 73  curityAttributes
4120: 2c 0d 0a 20 20 44 57 4f 52 44 20 46 6c 61 67 73  ,..  DWORD Flags
4130: 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f  );..extern(Windo
4140: 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20  ws) export LONG 
4150: 52 65 67 53 61 76 65 4b 65 79 45 78 57 28 0d 0a  RegSaveKeyExW(..
4160: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20    HKEY hKey,..  
4170: 4c 50 43 57 53 54 52 20 6c 70 46 69 6c 65 2c 0d  LPCWSTR lpFile,.
4180: 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54  .  LPSECURITY_AT
4190: 54 52 49 42 55 54 45 53 20 6c 70 53 65 63 75 72  TRIBUTES lpSecur
41a0: 69 74 79 41 74 74 72 69 62 75 74 65 73 2c 0d 0a  ityAttributes,..
41b0: 20 20 44 57 4f 52 44 20 46 6c 61 67 73 29 3b 0d    DWORD Flags);.
41c0: 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f  .// #ifdef UNICO
41d0: 44 45 0d 0a 61 6c 69 61 73 20 52 65 67 53 61 76  DE..alias RegSav
41e0: 65 4b 65 79 45 78 57 20 52 65 67 53 61 76 65 4b  eKeyExW RegSaveK
41f0: 65 79 45 78 3b 0d 0a 2f 2f 20 23 65 6c 73 65 0d  eyEx;..// #else.
4200: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e  .// #.....// #en
4210: 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d  dif // !UNICODE.
4220: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77  ...extern(Window
4230: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 57  s) export LONG W
4240: 6f 77 36 34 57 69 6e 33 32 41 70 69 45 6e 74 72  ow64Win32ApiEntr
4250: 79 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 75  y(..  DWORD dwFu
4260: 6e 63 4e 75 6d 62 65 72 2c 0d 0a 20 20 44 57 4f  ncNumber,..  DWO
4270: 52 44 20 64 77 46 6c 61 67 2c 0d 0a 20 20 44 57  RD dwFlag,..  DW
4280: 4f 52 44 20 64 77 52 65 73 29 3b 0d 0a 0d 0a 2f  ORD dwRes);..../
4290: 2f 20 23 69 66 64 65 66 20 5f 5f 63 70 6c 75 73  / #ifdef __cplus
42a0: 70 6c 75 73 0d 0a 2f 2f 20 7d 0d 0a 2f 2f 20 23  plus..// }..// #
42b0: 65 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23 65 6e 64  endif....// #end
42c0: 69 66 20 2f 2f 20 5f 57 49 4e 52 45 47 5f 0d 0a  if // _WINREG_..
42d0: 0d 0a                                            ..