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 72 65 67 3b 0d 0a 0d 0a 2f 2f 20 i.winreg;....//
0020: 54 72 61 6e 73 6c 61 74 65 64 20 66 72 6f 6d 20 Translated from
0030: 4d 69 63 72 6f 73 6f 66 74 20 50 6c 61 74 66 6f Microsoft Platfo
0040: 72 6d 20 53 44 4b 20 41 75 67 75 73 74 20 32 30 rm SDK August 20
0050: 30 31 20 45 64 69 74 69 6f 6e 0d 0a 2f 2f 20 62 01 Edition..// b
0060: 79 20 59 2e 54 6f 6d 69 6e 6f 20 28 64 65 6d 6f y Y.Tomino (demo
0070: 6f 6e 6c 69 74 40 69 6e 74 65 72 37 2e 6a 70 29 onlit@inter7.jp)
0080: 0d 0a 0d 0a 69 6d 70 6f 72 74 20 77 69 6e 33 32 ....import win32
0090: 2e 61 6e 73 69 2e 77 69 6e 6e 74 2c 20 77 69 6e .ansi.winnt, win
00a0: 33 32 2e 61 6e 73 69 2e 77 69 6e 62 61 73 65 3b 32.ansi.winbase;
00b0: 0d 0a 0d 0a 2f 2f 20 23 69 66 6e 64 65 66 20 5f ....// #ifndef _
00c0: 57 49 4e 52 45 47 5f 0d 0a 2f 2f 20 23 64 65 66 WINREG_..// #def
00d0: 69 6e 65 20 5f 57 49 4e 52 45 47 5f 0d 0a 0d 0a ine _WINREG_....
00e0: 2f 2f 20 23 69 66 64 65 66 20 5f 4d 41 43 0d 0a // #ifdef _MAC..
00f0: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 // #.....// #end
0100: 69 66 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65 66 20 if....// #ifdef
0110: 5f 5f 63 70 6c 75 73 70 6c 75 73 0d 0a 2f 2f 20 __cplusplus..//
0120: 65 78 74 65 72 6e 20 22 43 22 20 7b 0d 0a 2f 2f extern "C" {..//
0130: 20 23 65 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23 69 #endif....// #i
0140: 66 6e 64 65 66 20 57 49 4e 56 45 52 0d 0a 2f 2f fndef WINVER..//
0150: 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6e 64 69 66 #.....// #endif
0160: 20 2f 2a 20 21 57 49 4e 56 45 52 20 2a 2f 0d 0a /* !WINVER */..
0170: 0d 0a 61 6c 69 61 73 20 41 43 43 45 53 53 5f 4d ..alias ACCESS_M
0180: 41 53 4b 20 52 45 47 53 41 4d 3b 0d 0a 0d 0a 63 ASK REGSAM;....c
0190: 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45 59 5f 43 onst HKEY HKEY_C
01a0: 4c 41 53 53 45 53 5f 52 4f 4f 54 20 3d 20 63 61 LASSES_ROOT = ca
01b0: 73 74 28 48 4b 45 59 29 63 61 73 74 28 55 4c 4f st(HKEY)cast(ULO
01c0: 4e 47 5f 50 54 52 29 28 63 61 73 74 28 4c 4f 4e NG_PTR)(cast(LON
01d0: 47 29 30 78 38 30 30 30 30 30 30 30 29 20 3b 0d G)0x80000000) ;.
01e0: 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45 59 .const HKEY HKEY
01f0: 5f 43 55 52 52 45 4e 54 5f 55 53 45 52 20 3d 20 _CURRENT_USER =
0200: 63 61 73 74 28 48 4b 45 59 29 63 61 73 74 28 55 cast(HKEY)cast(U
0210: 4c 4f 4e 47 5f 50 54 52 29 28 63 61 73 74 28 4c LONG_PTR)(cast(L
0220: 4f 4e 47 29 30 78 38 30 30 30 30 30 30 31 29 20 ONG)0x80000001)
0230: 3b 0d 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b ;..const HKEY HK
0240: 45 59 5f 4c 4f 43 41 4c 5f 4d 41 43 48 49 4e 45 EY_LOCAL_MACHINE
0250: 20 3d 20 63 61 73 74 28 48 4b 45 59 29 63 61 73 = cast(HKEY)cas
0260: 74 28 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61 73 t(ULONG_PTR)(cas
0270: 74 28 4c 4f 4e 47 29 30 78 38 30 30 30 30 30 30 t(LONG)0x8000000
0280: 32 29 20 3b 0d 0a 63 6f 6e 73 74 20 48 4b 45 59 2) ;..const HKEY
0290: 20 48 4b 45 59 5f 55 53 45 52 53 20 3d 20 63 61 HKEY_USERS = ca
02a0: 73 74 28 48 4b 45 59 29 63 61 73 74 28 55 4c 4f st(HKEY)cast(ULO
02b0: 4e 47 5f 50 54 52 29 28 63 61 73 74 28 4c 4f 4e NG_PTR)(cast(LON
02c0: 47 29 30 78 38 30 30 30 30 30 30 33 29 20 3b 0d G)0x80000003) ;.
02d0: 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45 59 .const HKEY HKEY
02e0: 5f 50 45 52 46 4f 52 4d 41 4e 43 45 5f 44 41 54 _PERFORMANCE_DAT
02f0: 41 20 3d 20 63 61 73 74 28 48 4b 45 59 29 63 61 A = cast(HKEY)ca
0300: 73 74 28 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61 st(ULONG_PTR)(ca
0310: 73 74 28 4c 4f 4e 47 29 30 78 38 30 30 30 30 30 st(LONG)0x800000
0320: 30 34 29 20 3b 0d 0a 63 6f 6e 73 74 20 48 4b 45 04) ;..const HKE
0330: 59 20 48 4b 45 59 5f 50 45 52 46 4f 52 4d 41 4e Y HKEY_PERFORMAN
0340: 43 45 5f 54 45 58 54 20 3d 20 63 61 73 74 28 48 CE_TEXT = cast(H
0350: 4b 45 59 29 63 61 73 74 28 55 4c 4f 4e 47 5f 50 KEY)cast(ULONG_P
0360: 54 52 29 28 63 61 73 74 28 4c 4f 4e 47 29 30 78 TR)(cast(LONG)0x
0370: 38 30 30 30 30 30 35 30 29 20 3b 0d 0a 63 6f 6e 80000050) ;..con
0380: 73 74 20 48 4b 45 59 20 48 4b 45 59 5f 50 45 52 st HKEY HKEY_PER
0390: 46 4f 52 4d 41 4e 43 45 5f 4e 4c 53 54 45 58 54 FORMANCE_NLSTEXT
03a0: 20 3d 20 63 61 73 74 28 48 4b 45 59 29 63 61 73 = cast(HKEY)cas
03b0: 74 28 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61 73 t(ULONG_PTR)(cas
03c0: 74 28 4c 4f 4e 47 29 30 78 38 30 30 30 30 30 36 t(LONG)0x8000006
03d0: 30 29 20 3b 0d 0a 2f 2f 20 23 69 66 28 57 49 4e 0) ;..// #if(WIN
03e0: 56 45 52 20 3e 3d 20 30 78 30 34 30 30 29 0d 0a VER >= 0x0400)..
03f0: 63 6f 6e 73 74 20 48 4b 45 59 20 48 4b 45 59 5f const HKEY HKEY_
0400: 43 55 52 52 45 4e 54 5f 43 4f 4e 46 49 47 20 3d CURRENT_CONFIG =
0410: 20 63 61 73 74 28 48 4b 45 59 29 63 61 73 74 28 cast(HKEY)cast(
0420: 55 4c 4f 4e 47 5f 50 54 52 29 28 63 61 73 74 28 ULONG_PTR)(cast(
0430: 4c 4f 4e 47 29 30 78 38 30 30 30 30 30 30 35 29 LONG)0x80000005)
0440: 20 3b 0d 0a 63 6f 6e 73 74 20 48 4b 45 59 20 48 ;..const HKEY H
0450: 4b 45 59 5f 44 59 4e 5f 44 41 54 41 20 3d 20 63 KEY_DYN_DATA = c
0460: 61 73 74 28 48 4b 45 59 29 63 61 73 74 28 55 4c ast(HKEY)cast(UL
0470: 4f 4e 47 5f 50 54 52 29 28 63 61 73 74 28 4c 4f ONG_PTR)(cast(LO
0480: 4e 47 29 30 78 38 30 30 30 30 30 30 36 29 20 3b NG)0x80000006) ;
0490: 0d 0a 0d 0a 2f 2f 20 23 69 66 6e 64 65 66 20 5f ....// #ifndef _
04a0: 50 52 4f 56 49 44 45 52 5f 53 54 52 55 43 54 53 PROVIDER_STRUCTS
04b0: 5f 44 45 46 49 4e 45 44 0d 0a 2f 2f 20 23 64 65 _DEFINED..// #de
04c0: 66 69 6e 65 20 5f 50 52 4f 56 49 44 45 52 5f 53 fine _PROVIDER_S
04d0: 54 52 55 43 54 53 5f 44 45 46 49 4e 45 44 0d 0a TRUCTS_DEFINED..
04e0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 ..enum : uint {
04f0: 50 52 4f 56 49 44 45 52 5f 4b 45 45 50 53 5f 56 PROVIDER_KEEPS_V
0500: 41 4c 55 45 5f 4c 45 4e 47 54 48 20 3d 20 30 78 ALUE_LENGTH = 0x
0510: 31 20 7d 0d 0a 73 74 72 75 63 74 20 76 61 6c 5f 1 }..struct val_
0520: 63 6f 6e 74 65 78 74 20 7b 0d 0a 20 20 69 6e 74 context {.. int
0530: 20 76 61 6c 75 65 6c 65 6e 3b 0d 0a 20 20 4c 50 valuelen;.. LP
0540: 56 4f 49 44 20 76 61 6c 75 65 5f 63 6f 6e 74 65 VOID value_conte
0550: 78 74 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 76 61 xt;.. LPVOID va
0560: 6c 5f 62 75 66 66 5f 70 74 72 3b 0d 0a 7d 0d 0a l_buff_ptr;..}..
0570: 0d 0a 61 6c 69 61 73 20 76 61 6c 5f 63 6f 6e 74 ..alias val_cont
0580: 65 78 74 2a 20 50 56 41 4c 43 4f 4e 54 45 58 54 ext* PVALCONTEXT
0590: 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 70 76 61 6c ;....struct pval
05a0: 75 65 41 20 7b 0d 0a 20 20 4c 50 53 54 52 20 70 ueA {.. LPSTR p
05b0: 76 5f 76 61 6c 75 65 6e 61 6d 65 3b 0d 0a 20 20 v_valuename;..
05c0: 69 6e 74 20 70 76 5f 76 61 6c 75 65 6c 65 6e 3b int pv_valuelen;
05d0: 0d 0a 20 20 4c 50 56 4f 49 44 20 70 76 5f 76 61 .. LPVOID pv_va
05e0: 6c 75 65 5f 63 6f 6e 74 65 78 74 3b 0d 0a 20 20 lue_context;..
05f0: 44 57 4f 52 44 20 70 76 5f 74 79 70 65 3b 0d 0a DWORD pv_type;..
0600: 7d 0d 0a 61 6c 69 61 73 20 70 76 61 6c 75 65 41 }..alias pvalueA
0610: 20 50 56 41 4c 55 45 41 3b 0d 0a 61 6c 69 61 73 PVALUEA;..alias
0620: 20 70 76 61 6c 75 65 41 2a 20 50 50 56 41 4c 55 pvalueA* PPVALU
0630: 45 41 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 70 76 EA;....struct pv
0640: 61 6c 75 65 57 20 7b 0d 0a 20 20 4c 50 57 53 54 alueW {.. LPWST
0650: 52 20 70 76 5f 76 61 6c 75 65 6e 61 6d 65 3b 0d R pv_valuename;.
0660: 0a 20 20 69 6e 74 20 70 76 5f 76 61 6c 75 65 6c . int pv_valuel
0670: 65 6e 3b 0d 0a 20 20 4c 50 56 4f 49 44 20 70 76 en;.. LPVOID pv
0680: 5f 76 61 6c 75 65 5f 63 6f 6e 74 65 78 74 3b 0d _value_context;.
0690: 0a 20 20 44 57 4f 52 44 20 70 76 5f 74 79 70 65 . DWORD pv_type
06a0: 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 70 76 61 6c ;..}..alias pval
06b0: 75 65 57 20 50 56 41 4c 55 45 57 3b 0d 0a 61 6c ueW PVALUEW;..al
06c0: 69 61 73 20 70 76 61 6c 75 65 57 2a 20 50 50 56 ias pvalueW* PPV
06d0: 41 4c 55 45 57 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 ALUEW;....// #if
06e0: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 def UNICODE..//
06f0: 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 .....// #else..a
0700: 6c 69 61 73 20 50 56 41 4c 55 45 41 20 50 56 41 lias PVALUEA PVA
0710: 4c 55 45 3b 0d 0a 61 6c 69 61 73 20 50 50 56 41 LUE;..alias PPVA
0720: 4c 55 45 41 20 50 50 56 41 4c 55 45 3b 0d 0a 2f LUEA PPVALUE;../
0730: 2f 20 23 65 6e 64 69 66 20 2f 2f 20 55 4e 49 43 / #endif // UNIC
0740: 4f 44 45 0d 0a 0d 0a 2f 2f 20 74 79 70 65 64 65 ODE....// typede
0750: 66 20 44 57 4f 52 44 20 5f 63 64 65 63 6c 20 51 f DWORD _cdecl Q
0760: 55 45 52 59 48 41 4e 44 4c 45 52 20 28 4c 50 56 UERYHANDLER (LPV
0770: 4f 49 44 20 6b 65 79 63 6f 6e 74 65 78 74 2c 20 OID keycontext,
0780: 50 56 41 4c 43 4f 4e 54 45 58 54 20 76 61 6c 5f PVALCONTEXT val_
0790: 6c 69 73 74 2c 20 44 57 4f 52 44 20 6e 75 6d 5f list, DWORD num_
07a0: 76 61 6c 73 2c 20 4c 50 56 4f 49 44 20 6f 75 74 vals, LPVOID out
07b0: 70 75 74 62 75 66 66 65 72 2c 20 44 57 4f 52 44 putbuffer, DWORD
07c0: 20 46 41 52 20 2a 74 6f 74 61 6c 5f 6f 75 74 6c FAR *total_outl
07d0: 65 6e 2c 20 44 57 4f 52 44 20 69 6e 70 75 74 5f en, DWORD input_
07e0: 62 6c 65 6e 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e blen);....extern
07f0: 28 57 69 6e 64 6f 77 73 29 20 61 6c 69 61 73 20 (Windows) alias
0800: 44 57 4f 52 44 20 66 75 6e 63 74 69 6f 6e 28 4c DWORD function(L
0810: 50 56 4f 49 44 20 6b 65 79 63 6f 6e 74 65 78 74 PVOID keycontext
0820: 2c 20 50 56 41 4c 43 4f 4e 54 45 58 54 20 76 61 , PVALCONTEXT va
0830: 6c 5f 6c 69 73 74 2c 20 44 57 4f 52 44 20 6e 75 l_list, DWORD nu
0840: 6d 5f 76 61 6c 73 2c 20 4c 50 56 4f 49 44 20 6f m_vals, LPVOID o
0850: 75 74 70 75 74 62 75 66 66 65 72 2c 20 44 57 4f utputbuffer, DWO
0860: 52 44 2a 20 74 6f 74 61 6c 5f 6f 75 74 6c 65 6e RD* total_outlen
0870: 2c 20 44 57 4f 52 44 20 69 6e 70 75 74 5f 62 6c , DWORD input_bl
0880: 65 6e 29 20 50 51 55 45 52 59 48 41 4e 44 4c 45 en) PQUERYHANDLE
0890: 52 3b 0d 0a 0d 0a 73 74 72 75 63 74 20 70 72 6f R;....struct pro
08a0: 76 69 64 65 72 5f 69 6e 66 6f 20 7b 0d 0a 20 20 vider_info {..
08b0: 50 51 55 45 52 59 48 41 4e 44 4c 45 52 20 70 69 PQUERYHANDLER pi
08c0: 5f 52 30 5f 31 76 61 6c 3b 0d 0a 20 20 50 51 55 _R0_1val;.. PQU
08d0: 45 52 59 48 41 4e 44 4c 45 52 20 70 69 5f 52 30 ERYHANDLER pi_R0
08e0: 5f 61 6c 6c 76 61 6c 73 3b 0d 0a 20 20 50 51 55 _allvals;.. PQU
08f0: 45 52 59 48 41 4e 44 4c 45 52 20 70 69 5f 52 33 ERYHANDLER pi_R3
0900: 5f 31 76 61 6c 3b 0d 0a 20 20 50 51 55 45 52 59 _1val;.. PQUERY
0910: 48 41 4e 44 4c 45 52 20 70 69 5f 52 33 5f 61 6c HANDLER pi_R3_al
0920: 6c 76 61 6c 73 3b 0d 0a 20 20 44 57 4f 52 44 20 lvals;.. DWORD
0930: 70 69 5f 66 6c 61 67 73 3b 0d 0a 20 20 4c 50 56 pi_flags;.. LPV
0940: 4f 49 44 20 70 69 5f 6b 65 79 5f 63 6f 6e 74 65 OID pi_key_conte
0950: 78 74 3b 0d 0a 7d 0d 0a 61 6c 69 61 73 20 70 72 xt;..}..alias pr
0960: 6f 76 69 64 65 72 5f 69 6e 66 6f 20 52 45 47 5f ovider_info REG_
0970: 50 52 4f 56 49 44 45 52 3b 0d 0a 0d 0a 61 6c 69 PROVIDER;....ali
0980: 61 73 20 70 72 6f 76 69 64 65 72 5f 69 6e 66 6f as provider_info
0990: 2a 20 50 50 52 4f 56 49 44 45 52 3b 0d 0a 0d 0a * PPROVIDER;....
09a0: 73 74 72 75 63 74 20 76 61 6c 75 65 5f 65 6e 74 struct value_ent
09b0: 41 20 7b 0d 0a 20 20 4c 50 53 54 52 20 76 65 5f A {.. LPSTR ve_
09c0: 76 61 6c 75 65 6e 61 6d 65 3b 0d 0a 20 20 44 57 valuename;.. DW
09d0: 4f 52 44 20 76 65 5f 76 61 6c 75 65 6c 65 6e 3b ORD ve_valuelen;
09e0: 0d 0a 20 20 44 57 4f 52 44 5f 50 54 52 20 76 65 .. DWORD_PTR ve
09f0: 5f 76 61 6c 75 65 70 74 72 3b 0d 0a 20 20 44 57 _valueptr;.. DW
0a00: 4f 52 44 20 76 65 5f 74 79 70 65 3b 0d 0a 7d 0d ORD ve_type;..}.
0a10: 0a 61 6c 69 61 73 20 76 61 6c 75 65 5f 65 6e 74 .alias value_ent
0a20: 41 20 56 41 4c 45 4e 54 41 3b 0d 0a 61 6c 69 61 A VALENTA;..alia
0a30: 73 20 76 61 6c 75 65 5f 65 6e 74 41 2a 20 50 56 s value_entA* PV
0a40: 41 4c 45 4e 54 41 3b 0d 0a 0d 0a 73 74 72 75 63 ALENTA;....struc
0a50: 74 20 76 61 6c 75 65 5f 65 6e 74 57 20 7b 0d 0a t value_entW {..
0a60: 20 20 4c 50 57 53 54 52 20 76 65 5f 76 61 6c 75 LPWSTR ve_valu
0a70: 65 6e 61 6d 65 3b 0d 0a 20 20 44 57 4f 52 44 20 ename;.. DWORD
0a80: 76 65 5f 76 61 6c 75 65 6c 65 6e 3b 0d 0a 20 20 ve_valuelen;..
0a90: 44 57 4f 52 44 5f 50 54 52 20 76 65 5f 76 61 6c DWORD_PTR ve_val
0aa0: 75 65 70 74 72 3b 0d 0a 20 20 44 57 4f 52 44 20 ueptr;.. DWORD
0ab0: 76 65 5f 74 79 70 65 3b 0d 0a 7d 0d 0a 61 6c 69 ve_type;..}..ali
0ac0: 61 73 20 76 61 6c 75 65 5f 65 6e 74 57 20 56 41 as value_entW VA
0ad0: 4c 45 4e 54 57 3b 0d 0a 61 6c 69 61 73 20 76 61 LENTW;..alias va
0ae0: 6c 75 65 5f 65 6e 74 57 2a 20 50 56 41 4c 45 4e lue_entW* PVALEN
0af0: 54 57 3b 0d 0a 0d 0a 2f 2f 20 23 69 66 64 65 66 TW;....// #ifdef
0b00: 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 2e 2e 2e UNICODE..// ...
0b10: 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 ..// #else..alia
0b20: 73 20 56 41 4c 45 4e 54 41 20 56 41 4c 45 4e 54 s VALENTA VALENT
0b30: 3b 0d 0a 61 6c 69 61 73 20 50 56 41 4c 45 4e 54 ;..alias PVALENT
0b40: 41 20 50 56 41 4c 45 4e 54 3b 0d 0a 2f 2f 20 23 A PVALENT;..// #
0b50: 65 6e 64 69 66 20 2f 2f 20 55 4e 49 43 4f 44 45 endif // UNICODE
0b60: 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f ....// #endif //
0b70: 20 6e 6f 74 28 5f 50 52 4f 56 49 44 45 52 5f 53 not(_PROVIDER_S
0b80: 54 52 55 43 54 53 5f 44 45 46 49 4e 45 44 29 0d TRUCTS_DEFINED).
0b90: 0a 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2a 20 ...// #endif /*
0ba0: 57 49 4e 56 45 52 20 3e 3d 20 30 78 30 34 30 30 WINVER >= 0x0400
0bb0: 20 2a 2f 0d 0a 0d 0a 61 6c 69 61 73 20 4e 55 4c */....alias NUL
0bc0: 4c 20 57 49 4e 33 31 5f 43 4c 41 53 53 3b 0d 0a L WIN31_CLASS;..
0bd0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 ..extern(Windows
0be0: 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 ) export LONG Re
0bf0: 67 43 6c 6f 73 65 4b 65 79 28 0d 0a 20 20 48 4b gCloseKey(.. HK
0c00: 45 59 20 68 4b 65 79 29 3b 0d 0a 0d 0a 65 78 74 EY hKey);....ext
0c10: 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 ern(Windows) exp
0c20: 6f 72 74 20 4c 4f 4e 47 20 52 65 67 4f 76 65 72 ort LONG RegOver
0c30: 72 69 64 65 50 72 65 64 65 66 4b 65 79 28 0d 0a ridePredefKey(..
0c40: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 HKEY hKey,..
0c50: 48 4b 45 59 20 68 4e 65 77 48 4b 65 79 29 3b 0d HKEY hNewHKey);.
0c60: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 ...extern(Window
0c70: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 s) export LONG R
0c80: 65 67 4f 70 65 6e 55 73 65 72 43 6c 61 73 73 65 egOpenUserClasse
0c90: 73 52 6f 6f 74 28 0d 0a 20 20 48 41 4e 44 4c 45 sRoot(.. HANDLE
0ca0: 20 68 54 6f 6b 65 6e 2c 0d 0a 20 20 44 57 4f 52 hToken,.. DWOR
0cb0: 44 20 64 77 4f 70 74 69 6f 6e 73 2c 0d 0a 20 20 D dwOptions,..
0cc0: 52 45 47 53 41 4d 20 73 61 6d 44 65 73 69 72 65 REGSAM samDesire
0cd0: 64 2c 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 d,.. PHKEY phkR
0ce0: 65 73 75 6c 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 esult);....exter
0cf0: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 n(Windows) expor
0d00: 74 20 4c 4f 4e 47 20 52 65 67 4f 70 65 6e 43 75 t LONG RegOpenCu
0d10: 72 72 65 6e 74 55 73 65 72 28 0d 0a 20 20 52 45 rrentUser(.. RE
0d20: 47 53 41 4d 20 73 61 6d 44 65 73 69 72 65 64 2c GSAM samDesired,
0d30: 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 65 73 .. PHKEY phkRes
0d40: 75 6c 74 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 ult);....extern(
0d50: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 Windows) export
0d60: 4c 4f 4e 47 20 52 65 67 44 69 73 61 62 6c 65 50 LONG RegDisableP
0d70: 72 65 64 65 66 69 6e 65 64 43 61 63 68 65 28 29 redefinedCache()
0d80: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 ;....extern(Wind
0d90: 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 ows) export LONG
0da0: 20 52 65 67 43 6f 6e 6e 65 63 74 52 65 67 69 73 RegConnectRegis
0db0: 74 72 79 41 28 0d 0a 20 20 4c 50 43 53 54 52 20 tryA(.. LPCSTR
0dc0: 6c 70 4d 61 63 68 69 6e 65 4e 61 6d 65 2c 0d 0a lpMachineName,..
0dd0: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 HKEY hKey,..
0de0: 50 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74 29 PHKEY phkResult)
0df0: 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 ;..extern(Window
0e00: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 s) export LONG R
0e10: 65 67 43 6f 6e 6e 65 63 74 52 65 67 69 73 74 72 egConnectRegistr
0e20: 79 57 28 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c yW(.. LPCWSTR l
0e30: 70 4d 61 63 68 69 6e 65 4e 61 6d 65 2c 0d 0a 20 pMachineName,..
0e40: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 50 HKEY hKey,.. P
0e50: 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74 29 3b HKEY phkResult);
0e60: 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 ..// #ifdef UNIC
0e70: 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f ODE..// #.....//
0e80: 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 52 65 #else..alias Re
0e90: 67 43 6f 6e 6e 65 63 74 52 65 67 69 73 74 72 79 gConnectRegistry
0ea0: 41 20 52 65 67 43 6f 6e 6e 65 63 74 52 65 67 69 A RegConnectRegi
0eb0: 73 74 72 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 stry;..// #endif
0ec0: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a // !UNICODE....
0ed0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 extern(Windows)
0ee0: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 43 export LONG RegC
0ef0: 72 65 61 74 65 4b 65 79 41 28 0d 0a 20 20 48 4b reateKeyA(.. HK
0f00: 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 EY hKey,.. LPCS
0f10: 54 52 20 6c 70 53 75 62 4b 65 79 2c 0d 0a 20 20 TR lpSubKey,..
0f20: 50 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74 29 PHKEY phkResult)
0f30: 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 ;..extern(Window
0f40: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 s) export LONG R
0f50: 65 67 43 72 65 61 74 65 4b 65 79 57 28 0d 0a 20 egCreateKeyW(..
0f60: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c HKEY hKey,.. L
0f70: 50 43 57 53 54 52 20 6c 70 53 75 62 4b 65 79 2c PCWSTR lpSubKey,
0f80: 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 65 73 .. PHKEY phkRes
0f90: 75 6c 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 ult);..// #ifdef
0fa0: 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e UNICODE..// #..
0fb0: 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 ...// #else..ali
0fc0: 61 73 20 52 65 67 43 72 65 61 74 65 4b 65 79 41 as RegCreateKeyA
0fd0: 20 52 65 67 43 72 65 61 74 65 4b 65 79 3b 0d 0a RegCreateKey;..
0fe0: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e // #endif // !UN
0ff0: 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 ICODE....extern(
1000: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 Windows) export
1010: 4c 4f 4e 47 20 52 65 67 43 72 65 61 74 65 4b 65 LONG RegCreateKe
1020: 79 45 78 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b yExA(.. HKEY hK
1030: 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 ey,.. LPCSTR lp
1040: 53 75 62 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 44 SubKey,.. DWORD
1050: 20 52 65 73 65 72 76 65 64 2c 0d 0a 20 20 4c 50 Reserved,.. LP
1060: 53 54 52 20 6c 70 43 6c 61 73 73 2c 0d 0a 20 20 STR lpClass,..
1070: 44 57 4f 52 44 20 64 77 4f 70 74 69 6f 6e 73 2c DWORD dwOptions,
1080: 0d 0a 20 20 52 45 47 53 41 4d 20 73 61 6d 44 65 .. REGSAM samDe
1090: 73 69 72 65 64 2c 0d 0a 20 20 4c 50 53 45 43 55 sired,.. LPSECU
10a0: 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53 20 RITY_ATTRIBUTES
10b0: 6c 70 53 65 63 75 72 69 74 79 41 74 74 72 69 62 lpSecurityAttrib
10c0: 75 74 65 73 2c 0d 0a 20 20 50 48 4b 45 59 20 70 utes,.. PHKEY p
10d0: 68 6b 52 65 73 75 6c 74 2c 0d 0a 20 20 4c 50 44 hkResult,.. LPD
10e0: 57 4f 52 44 20 6c 70 64 77 44 69 73 70 6f 73 69 WORD lpdwDisposi
10f0: 74 69 6f 6e 29 3b 0d 0a 65 78 74 65 72 6e 28 57 tion);..extern(W
1100: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c indows) export L
1110: 4f 4e 47 20 52 65 67 43 72 65 61 74 65 4b 65 79 ONG RegCreateKey
1120: 45 78 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 ExW(.. HKEY hKe
1130: 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 y,.. LPCWSTR lp
1140: 53 75 62 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 44 SubKey,.. DWORD
1150: 20 52 65 73 65 72 76 65 64 2c 0d 0a 20 20 4c 50 Reserved,.. LP
1160: 57 53 54 52 20 6c 70 43 6c 61 73 73 2c 0d 0a 20 WSTR lpClass,..
1170: 20 44 57 4f 52 44 20 64 77 4f 70 74 69 6f 6e 73 DWORD dwOptions
1180: 2c 0d 0a 20 20 52 45 47 53 41 4d 20 73 61 6d 44 ,.. REGSAM samD
1190: 65 73 69 72 65 64 2c 0d 0a 20 20 4c 50 53 45 43 esired,.. LPSEC
11a0: 55 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53 URITY_ATTRIBUTES
11b0: 20 6c 70 53 65 63 75 72 69 74 79 41 74 74 72 69 lpSecurityAttri
11c0: 62 75 74 65 73 2c 0d 0a 20 20 50 48 4b 45 59 20 butes,.. PHKEY
11d0: 70 68 6b 52 65 73 75 6c 74 2c 0d 0a 20 20 4c 50 phkResult,.. LP
11e0: 44 57 4f 52 44 20 6c 70 64 77 44 69 73 70 6f 73 DWORD lpdwDispos
11f0: 69 74 69 6f 6e 29 3b 0d 0a 2f 2f 20 23 69 66 64 ition);..// #ifd
1200: 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 ef UNICODE..// #
1210: 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 .....// #else..a
1220: 6c 69 61 73 20 52 65 67 43 72 65 61 74 65 4b 65 lias RegCreateKe
1230: 79 45 78 41 20 52 65 67 43 72 65 61 74 65 4b 65 yExA RegCreateKe
1240: 79 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 yEx;..// #endif
1250: 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 // !UNICODE....e
1260: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 xtern(Windows) e
1270: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 44 65 xport LONG RegDe
1280: 6c 65 74 65 4b 65 79 41 28 0d 0a 20 20 48 4b 45 leteKeyA(.. HKE
1290: 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 Y hKey,.. LPCST
12a0: 52 20 6c 70 53 75 62 4b 65 79 29 3b 0d 0a 65 78 R lpSubKey);..ex
12b0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 tern(Windows) ex
12c0: 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 44 65 6c port LONG RegDel
12d0: 65 74 65 4b 65 79 57 28 0d 0a 20 20 48 4b 45 59 eteKeyW(.. HKEY
12e0: 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 hKey,.. LPCWST
12f0: 52 20 6c 70 53 75 62 4b 65 79 29 3b 0d 0a 2f 2f R lpSubKey);..//
1300: 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d #ifdef UNICODE.
1310: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c .// #.....// #el
1320: 73 65 0d 0a 61 6c 69 61 73 20 52 65 67 44 65 6c se..alias RegDel
1330: 65 74 65 4b 65 79 41 20 52 65 67 44 65 6c 65 74 eteKeyA RegDelet
1340: 65 4b 65 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 eKey;..// #endif
1350: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a // !UNICODE....
1360: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 extern(Windows)
1370: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 44 export LONG RegD
1380: 65 6c 65 74 65 56 61 6c 75 65 41 28 0d 0a 20 20 eleteValueA(..
1390: 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 HKEY hKey,.. LP
13a0: 43 53 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d 65 CSTR lpValueName
13b0: 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f );..extern(Windo
13c0: 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 ws) export LONG
13d0: 52 65 67 44 65 6c 65 74 65 56 61 6c 75 65 57 28 RegDeleteValueW(
13e0: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a .. HKEY hKey,..
13f0: 20 20 4c 50 43 57 53 54 52 20 6c 70 56 61 6c 75 LPCWSTR lpValu
1400: 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 eName);..// #ifd
1410: 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 ef UNICODE..// #
1420: 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 .....// #else..a
1430: 6c 69 61 73 20 52 65 67 44 65 6c 65 74 65 56 61 lias RegDeleteVa
1440: 6c 75 65 41 20 52 65 67 44 65 6c 65 74 65 56 61 lueA RegDeleteVa
1450: 6c 75 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 lue;..// #endif
1460: 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 // !UNICODE....e
1470: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 xtern(Windows) e
1480: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 45 6e xport LONG RegEn
1490: 75 6d 4b 65 79 41 28 0d 0a 20 20 48 4b 45 59 20 umKeyA(.. HKEY
14a0: 68 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 44 20 64 hKey,.. DWORD d
14b0: 77 49 6e 64 65 78 2c 0d 0a 20 20 4c 50 53 54 52 wIndex,.. LPSTR
14c0: 20 6c 70 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 lpName,.. DWOR
14d0: 44 20 63 62 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 D cbName);..exte
14e0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f rn(Windows) expo
14f0: 72 74 20 4c 4f 4e 47 20 52 65 67 45 6e 75 6d 4b rt LONG RegEnumK
1500: 65 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 eyW(.. HKEY hKe
1510: 79 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 49 6e y,.. DWORD dwIn
1520: 64 65 78 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c dex,.. LPWSTR l
1530: 70 4e 61 6d 65 2c 0d 0a 20 20 44 57 4f 52 44 20 pName,.. DWORD
1540: 63 62 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 cbName);..// #if
1550: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 def UNICODE..//
1560: 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a #.....// #else..
1570: 61 6c 69 61 73 20 52 65 67 45 6e 75 6d 4b 65 79 alias RegEnumKey
1580: 41 20 52 65 67 45 6e 75 6d 4b 65 79 3b 0d 0a 2f A RegEnumKey;../
1590: 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 / #endif // !UNI
15a0: 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 CODE....extern(W
15b0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c indows) export L
15c0: 4f 4e 47 20 52 65 67 45 6e 75 6d 4b 65 79 45 78 ONG RegEnumKeyEx
15d0: 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c A(.. HKEY hKey,
15e0: 0d 0a 20 20 44 57 4f 52 44 20 64 77 49 6e 64 65 .. DWORD dwInde
15f0: 78 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 4e 61 x,.. LPSTR lpNa
1600: 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c me,.. LPDWORD l
1610: 70 63 62 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 57 pcbName,.. LPDW
1620: 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64 2c 0d ORD lpReserved,.
1630: 0a 20 20 4c 50 53 54 52 20 6c 70 43 6c 61 73 73 . LPSTR lpClass
1640: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 ,.. LPDWORD lpc
1650: 62 43 6c 61 73 73 2c 0d 0a 20 20 50 46 49 4c 45 bClass,.. PFILE
1660: 54 49 4d 45 20 6c 70 66 74 4c 61 73 74 57 72 69 TIME lpftLastWri
1670: 74 65 54 69 6d 65 29 3b 0d 0a 65 78 74 65 72 6e teTime);..extern
1680: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 (Windows) export
1690: 20 4c 4f 4e 47 20 52 65 67 45 6e 75 6d 4b 65 79 LONG RegEnumKey
16a0: 45 78 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 ExW(.. HKEY hKe
16b0: 79 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 49 6e y,.. DWORD dwIn
16c0: 64 65 78 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c dex,.. LPWSTR l
16d0: 70 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 pName,.. LPDWOR
16e0: 44 20 6c 70 63 62 4e 61 6d 65 2c 0d 0a 20 20 4c D lpcbName,.. L
16f0: 50 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 PDWORD lpReserve
1700: 64 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 43 d,.. LPWSTR lpC
1710: 6c 61 73 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 lass,.. LPDWORD
1720: 20 6c 70 63 62 43 6c 61 73 73 2c 0d 0a 20 20 50 lpcbClass,.. P
1730: 46 49 4c 45 54 49 4d 45 20 6c 70 66 74 4c 61 73 FILETIME lpftLas
1740: 74 57 72 69 74 65 54 69 6d 65 29 3b 0d 0a 2f 2f tWriteTime);..//
1750: 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d #ifdef UNICODE.
1760: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c .// #.....// #el
1770: 73 65 0d 0a 61 6c 69 61 73 20 52 65 67 45 6e 75 se..alias RegEnu
1780: 6d 4b 65 79 45 78 41 20 52 65 67 45 6e 75 6d 4b mKeyExA RegEnumK
1790: 65 79 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 eyEx;..// #endif
17a0: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a // !UNICODE....
17b0: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 extern(Windows)
17c0: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 45 export LONG RegE
17d0: 6e 75 6d 56 61 6c 75 65 41 28 0d 0a 20 20 48 4b numValueA(.. HK
17e0: 45 59 20 68 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 EY hKey,.. DWOR
17f0: 44 20 64 77 49 6e 64 65 78 2c 0d 0a 20 20 4c 50 D dwIndex,.. LP
1800: 53 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d 65 2c STR lpValueName,
1810: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62 .. LPDWORD lpcb
1820: 56 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 ValueName,.. LP
1830: 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64 DWORD lpReserved
1840: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 54 ,.. LPDWORD lpT
1850: 79 70 65 2c 0d 0a 20 20 4c 50 42 59 54 45 20 6c ype,.. LPBYTE l
1860: 70 44 61 74 61 2c 0d 0a 20 20 4c 50 44 57 4f 52 pData,.. LPDWOR
1870: 44 20 6c 70 63 62 44 61 74 61 29 3b 0d 0a 65 78 D lpcbData);..ex
1880: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 tern(Windows) ex
1890: 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 45 6e 75 port LONG RegEnu
18a0: 6d 56 61 6c 75 65 57 28 0d 0a 20 20 48 4b 45 59 mValueW(.. HKEY
18b0: 20 68 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 44 20 hKey,.. DWORD
18c0: 64 77 49 6e 64 65 78 2c 0d 0a 20 20 4c 50 57 53 dwIndex,.. LPWS
18d0: 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d 65 2c 0d TR lpValueName,.
18e0: 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62 56 . LPDWORD lpcbV
18f0: 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 44 alueName,.. LPD
1900: 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64 2c WORD lpReserved,
1910: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 54 79 .. LPDWORD lpTy
1920: 70 65 2c 0d 0a 20 20 4c 50 42 59 54 45 20 6c 70 pe,.. LPBYTE lp
1930: 44 61 74 61 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 Data,.. LPDWORD
1940: 20 6c 70 63 62 44 61 74 61 29 3b 0d 0a 2f 2f 20 lpcbData);..//
1950: 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a #ifdef UNICODE..
1960: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 // #.....// #els
1970: 65 0d 0a 61 6c 69 61 73 20 52 65 67 45 6e 75 6d e..alias RegEnum
1980: 56 61 6c 75 65 41 20 52 65 67 45 6e 75 6d 56 61 ValueA RegEnumVa
1990: 6c 75 65 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 lue;..// #endif
19a0: 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 // !UNICODE....e
19b0: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 xtern(Windows) e
19c0: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 46 6c xport LONG RegFl
19d0: 75 73 68 4b 65 79 28 0d 0a 20 20 48 4b 45 59 20 ushKey(.. HKEY
19e0: 68 4b 65 79 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e hKey);....extern
19f0: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 (Windows) export
1a00: 20 4c 4f 4e 47 20 52 65 67 47 65 74 4b 65 79 53 LONG RegGetKeyS
1a10: 65 63 75 72 69 74 79 28 0d 0a 20 20 48 4b 45 59 ecurity(.. HKEY
1a20: 20 68 4b 65 79 2c 0d 0a 20 20 53 45 43 55 52 49 hKey,.. SECURI
1a30: 54 59 5f 49 4e 46 4f 52 4d 41 54 49 4f 4e 20 53 TY_INFORMATION S
1a40: 65 63 75 72 69 74 79 49 6e 66 6f 72 6d 61 74 69 ecurityInformati
1a50: 6f 6e 2c 0d 0a 20 20 50 53 45 43 55 52 49 54 59 on,.. PSECURITY
1a60: 5f 44 45 53 43 52 49 50 54 4f 52 20 70 53 65 63 _DESCRIPTOR pSec
1a70: 75 72 69 74 79 44 65 73 63 72 69 70 74 6f 72 2c urityDescriptor,
1a80: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62 .. LPDWORD lpcb
1a90: 53 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74 SecurityDescript
1aa0: 6f 72 29 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 or);....extern(W
1ab0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c indows) export L
1ac0: 4f 4e 47 20 52 65 67 4c 6f 61 64 4b 65 79 41 28 ONG RegLoadKeyA(
1ad0: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a .. HKEY hKey,..
1ae0: 20 20 4c 50 43 53 54 52 20 6c 70 53 75 62 4b 65 LPCSTR lpSubKe
1af0: 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 y,.. LPCSTR lpF
1b00: 69 6c 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 ile);..extern(Wi
1b10: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f ndows) export LO
1b20: 4e 47 20 52 65 67 4c 6f 61 64 4b 65 79 57 28 0d NG RegLoadKeyW(.
1b30: 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 . HKEY hKey,..
1b40: 20 4c 50 43 57 53 54 52 20 6c 70 53 75 62 4b 65 LPCWSTR lpSubKe
1b50: 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 y,.. LPCWSTR lp
1b60: 46 69 6c 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 File);..// #ifde
1b70: 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e f UNICODE..// #.
1b80: 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c ....// #else..al
1b90: 69 61 73 20 52 65 67 4c 6f 61 64 4b 65 79 41 20 ias RegLoadKeyA
1ba0: 52 65 67 4c 6f 61 64 4b 65 79 3b 0d 0a 2f 2f 20 RegLoadKey;..//
1bb0: 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f #endif // !UNICO
1bc0: 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e DE....extern(Win
1bd0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e dows) export LON
1be0: 47 20 52 65 67 4e 6f 74 69 66 79 43 68 61 6e 67 G RegNotifyChang
1bf0: 65 4b 65 79 56 61 6c 75 65 28 0d 0a 20 20 48 4b eKeyValue(.. HK
1c00: 45 59 20 68 4b 65 79 2c 0d 0a 20 20 42 4f 4f 4c EY hKey,.. BOOL
1c10: 20 62 57 61 74 63 68 53 75 62 74 72 65 65 2c 0d bWatchSubtree,.
1c20: 0a 20 20 44 57 4f 52 44 20 64 77 4e 6f 74 69 66 . DWORD dwNotif
1c30: 79 46 69 6c 74 65 72 2c 0d 0a 20 20 48 41 4e 44 yFilter,.. HAND
1c40: 4c 45 20 68 45 76 65 6e 74 2c 0d 0a 20 20 42 4f LE hEvent,.. BO
1c50: 4f 4c 20 66 41 73 79 6e 63 68 72 6f 6e 75 73 29 OL fAsynchronus)
1c60: 3b 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 ;....extern(Wind
1c70: 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 ows) export LONG
1c80: 20 52 65 67 4f 70 65 6e 4b 65 79 41 28 0d 0a 20 RegOpenKeyA(..
1c90: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c HKEY hKey,.. L
1ca0: 50 43 53 54 52 20 6c 70 53 75 62 4b 65 79 2c 0d PCSTR lpSubKey,.
1cb0: 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 65 73 75 . PHKEY phkResu
1cc0: 6c 74 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e lt);..extern(Win
1cd0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e dows) export LON
1ce0: 47 20 52 65 67 4f 70 65 6e 4b 65 79 57 28 0d 0a G RegOpenKeyW(..
1cf0: 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 HKEY hKey,..
1d00: 4c 50 43 57 53 54 52 20 6c 70 53 75 62 4b 65 79 LPCWSTR lpSubKey
1d10: 2c 0d 0a 20 20 50 48 4b 45 59 20 70 68 6b 52 65 ,.. PHKEY phkRe
1d20: 73 75 6c 74 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 sult);..// #ifde
1d30: 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e f UNICODE..// #.
1d40: 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c ....// #else..al
1d50: 69 61 73 20 52 65 67 4f 70 65 6e 4b 65 79 41 20 ias RegOpenKeyA
1d60: 52 65 67 4f 70 65 6e 4b 65 79 3b 0d 0a 2f 2f 20 RegOpenKey;..//
1d70: 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f #endif // !UNICO
1d80: 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e DE....extern(Win
1d90: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e dows) export LON
1da0: 47 20 52 65 67 4f 70 65 6e 4b 65 79 45 78 41 28 G RegOpenKeyExA(
1db0: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a .. HKEY hKey,..
1dc0: 20 20 4c 50 43 53 54 52 20 6c 70 53 75 62 4b 65 LPCSTR lpSubKe
1dd0: 79 2c 0d 0a 20 20 44 57 4f 52 44 20 75 6c 4f 70 y,.. DWORD ulOp
1de0: 74 69 6f 6e 73 2c 0d 0a 20 20 52 45 47 53 41 4d tions,.. REGSAM
1df0: 20 73 61 6d 44 65 73 69 72 65 64 2c 0d 0a 20 20 samDesired,..
1e00: 50 48 4b 45 59 20 70 68 6b 52 65 73 75 6c 74 29 PHKEY phkResult)
1e10: 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 ;..extern(Window
1e20: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 s) export LONG R
1e30: 65 67 4f 70 65 6e 4b 65 79 45 78 57 28 0d 0a 20 egOpenKeyExW(..
1e40: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c HKEY hKey,.. L
1e50: 50 43 57 53 54 52 20 6c 70 53 75 62 4b 65 79 2c PCWSTR lpSubKey,
1e60: 0d 0a 20 20 44 57 4f 52 44 20 75 6c 4f 70 74 69 .. DWORD ulOpti
1e70: 6f 6e 73 2c 0d 0a 20 20 52 45 47 53 41 4d 20 73 ons,.. REGSAM s
1e80: 61 6d 44 65 73 69 72 65 64 2c 0d 0a 20 20 50 48 amDesired,.. PH
1e90: 4b 45 59 20 70 68 6b 52 65 73 75 6c 74 29 3b 0d KEY phkResult);.
1ea0: 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f .// #ifdef UNICO
1eb0: 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 DE..// #.....//
1ec0: 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 52 65 67 #else..alias Reg
1ed0: 4f 70 65 6e 4b 65 79 45 78 41 20 52 65 67 4f 70 OpenKeyExA RegOp
1ee0: 65 6e 4b 65 79 45 78 3b 0d 0a 2f 2f 20 23 65 6e enKeyEx;..// #en
1ef0: 64 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d dif // !UNICODE.
1f00: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 ...extern(Window
1f10: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 s) export LONG R
1f20: 65 67 51 75 65 72 79 49 6e 66 6f 4b 65 79 41 28 egQueryInfoKeyA(
1f30: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a .. HKEY hKey,..
1f40: 20 20 4c 50 53 54 52 20 6c 70 43 6c 61 73 73 2c LPSTR lpClass,
1f50: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62 .. LPDWORD lpcb
1f60: 43 6c 61 73 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 Class,.. LPDWOR
1f70: 44 20 6c 70 52 65 73 65 72 76 65 64 2c 0d 0a 20 D lpReserved,..
1f80: 20 4c 50 44 57 4f 52 44 20 6c 70 63 53 75 62 4b LPDWORD lpcSubK
1f90: 65 79 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 eys,.. LPDWORD
1fa0: 6c 70 63 62 4d 61 78 53 75 62 4b 65 79 4c 65 6e lpcbMaxSubKeyLen
1fb0: 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 ,.. LPDWORD lpc
1fc0: 62 4d 61 78 43 6c 61 73 73 4c 65 6e 2c 0d 0a 20 bMaxClassLen,..
1fd0: 20 4c 50 44 57 4f 52 44 20 6c 70 63 56 61 6c 75 LPDWORD lpcValu
1fe0: 65 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c es,.. LPDWORD l
1ff0: 70 63 62 4d 61 78 56 61 6c 75 65 4e 61 6d 65 4c pcbMaxValueNameL
2000: 65 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c en,.. LPDWORD l
2010: 70 63 62 4d 61 78 56 61 6c 75 65 4c 65 6e 2c 0d pcbMaxValueLen,.
2020: 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62 53 . LPDWORD lpcbS
2030: 65 63 75 72 69 74 79 44 65 73 63 72 69 70 74 6f ecurityDescripto
2040: 72 2c 0d 0a 20 20 50 46 49 4c 45 54 49 4d 45 20 r,.. PFILETIME
2050: 6c 70 66 74 4c 61 73 74 57 72 69 74 65 54 69 6d lpftLastWriteTim
2060: 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 e);..extern(Wind
2070: 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 ows) export LONG
2080: 20 52 65 67 51 75 65 72 79 49 6e 66 6f 4b 65 79 RegQueryInfoKey
2090: 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c W(.. HKEY hKey,
20a0: 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 43 6c 61 .. LPWSTR lpCla
20b0: 73 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c ss,.. LPDWORD l
20c0: 70 63 62 43 6c 61 73 73 2c 0d 0a 20 20 4c 50 44 pcbClass,.. LPD
20d0: 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 64 2c WORD lpReserved,
20e0: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 53 .. LPDWORD lpcS
20f0: 75 62 4b 65 79 73 2c 0d 0a 20 20 4c 50 44 57 4f ubKeys,.. LPDWO
2100: 52 44 20 6c 70 63 62 4d 61 78 53 75 62 4b 65 79 RD lpcbMaxSubKey
2110: 4c 65 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 Len,.. LPDWORD
2120: 6c 70 63 62 4d 61 78 43 6c 61 73 73 4c 65 6e 2c lpcbMaxClassLen,
2130: 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 56 .. LPDWORD lpcV
2140: 61 6c 75 65 73 2c 0d 0a 20 20 4c 50 44 57 4f 52 alues,.. LPDWOR
2150: 44 20 6c 70 63 62 4d 61 78 56 61 6c 75 65 4e 61 D lpcbMaxValueNa
2160: 6d 65 4c 65 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 meLen,.. LPDWOR
2170: 44 20 6c 70 63 62 4d 61 78 56 61 6c 75 65 4c 65 D lpcbMaxValueLe
2180: 6e 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 n,.. LPDWORD lp
2190: 63 62 53 65 63 75 72 69 74 79 44 65 73 63 72 69 cbSecurityDescri
21a0: 70 74 6f 72 2c 0d 0a 20 20 50 46 49 4c 45 54 49 ptor,.. PFILETI
21b0: 4d 45 20 6c 70 66 74 4c 61 73 74 57 72 69 74 65 ME lpftLastWrite
21c0: 54 69 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 Time);..// #ifde
21d0: 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e f UNICODE..// #.
21e0: 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c ....// #else..al
21f0: 69 61 73 20 52 65 67 51 75 65 72 79 49 6e 66 6f ias RegQueryInfo
2200: 4b 65 79 41 20 52 65 67 51 75 65 72 79 49 6e 66 KeyA RegQueryInf
2210: 6f 4b 65 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 oKey;..// #endif
2220: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a // !UNICODE....
2230: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 extern(Windows)
2240: 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 51 export LONG RegQ
2250: 75 65 72 79 56 61 6c 75 65 41 28 0d 0a 20 20 48 ueryValueA(.. H
2260: 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 KEY hKey,.. LPC
2270: 53 54 52 20 6c 70 53 75 62 4b 65 79 2c 0d 0a 20 STR lpSubKey,..
2280: 20 4c 50 53 54 52 20 6c 70 56 61 6c 75 65 2c 0d LPSTR lpValue,.
2290: 0a 20 20 50 4c 4f 4e 47 20 6c 70 63 62 56 61 6c . PLONG lpcbVal
22a0: 75 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e ue);..extern(Win
22b0: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e dows) export LON
22c0: 47 20 52 65 67 51 75 65 72 79 56 61 6c 75 65 57 G RegQueryValueW
22d0: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d (.. HKEY hKey,.
22e0: 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53 75 62 . LPCWSTR lpSub
22f0: 4b 65 79 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c Key,.. LPWSTR l
2300: 70 56 61 6c 75 65 2c 0d 0a 20 20 50 4c 4f 4e 47 pValue,.. PLONG
2310: 20 6c 70 63 62 56 61 6c 75 65 29 3b 0d 0a 2f 2f lpcbValue);..//
2320: 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d #ifdef UNICODE.
2330: 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c .// #.....// #el
2340: 73 65 0d 0a 61 6c 69 61 73 20 52 65 67 51 75 65 se..alias RegQue
2350: 72 79 56 61 6c 75 65 41 20 52 65 67 51 75 65 72 ryValueA RegQuer
2360: 79 56 61 6c 75 65 3b 0d 0a 2f 2f 20 23 65 6e 64 yValue;..// #end
2370: 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a if // !UNICODE..
2380: 0d 0a 2f 2f 20 23 69 66 28 57 49 4e 56 45 52 20 ..// #if(WINVER
2390: 3e 3d 20 30 78 30 34 30 30 29 0d 0a 65 78 74 65 >= 0x0400)..exte
23a0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f rn(Windows) expo
23b0: 72 74 20 4c 4f 4e 47 20 52 65 67 51 75 65 72 79 rt LONG RegQuery
23c0: 4d 75 6c 74 69 70 6c 65 56 61 6c 75 65 73 41 28 MultipleValuesA(
23d0: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a .. HKEY hKey,..
23e0: 20 20 50 56 41 4c 45 4e 54 41 20 76 61 6c 5f 6c PVALENTA val_l
23f0: 69 73 74 2c 0d 0a 20 20 44 57 4f 52 44 20 6e 75 ist,.. DWORD nu
2400: 6d 5f 76 61 6c 73 2c 0d 0a 20 20 4c 50 53 54 52 m_vals,.. LPSTR
2410: 20 6c 70 56 61 6c 75 65 42 75 66 2c 0d 0a 20 20 lpValueBuf,..
2420: 4c 50 44 57 4f 52 44 20 6c 64 77 54 6f 74 73 69 LPDWORD ldwTotsi
2430: 7a 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e ze);..extern(Win
2440: 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e dows) export LON
2450: 47 20 52 65 67 51 75 65 72 79 4d 75 6c 74 69 70 G RegQueryMultip
2460: 6c 65 56 61 6c 75 65 73 57 28 0d 0a 20 20 48 4b leValuesW(.. HK
2470: 45 59 20 68 4b 65 79 2c 0d 0a 20 20 50 56 41 4c EY hKey,.. PVAL
2480: 45 4e 54 57 20 76 61 6c 5f 6c 69 73 74 2c 0d 0a ENTW val_list,..
2490: 20 20 44 57 4f 52 44 20 6e 75 6d 5f 76 61 6c 73 DWORD num_vals
24a0: 2c 0d 0a 20 20 4c 50 57 53 54 52 20 6c 70 56 61 ,.. LPWSTR lpVa
24b0: 6c 75 65 42 75 66 2c 0d 0a 20 20 4c 50 44 57 4f lueBuf,.. LPDWO
24c0: 52 44 20 6c 64 77 54 6f 74 73 69 7a 65 29 3b 0d RD ldwTotsize);.
24d0: 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f .// #ifdef UNICO
24e0: 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 DE..// #.....//
24f0: 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 52 65 67 #else..alias Reg
2500: 51 75 65 72 79 4d 75 6c 74 69 70 6c 65 56 61 6c QueryMultipleVal
2510: 75 65 73 41 20 52 65 67 51 75 65 72 79 4d 75 6c uesA RegQueryMul
2520: 74 69 70 6c 65 56 61 6c 75 65 73 3b 0d 0a 2f 2f tipleValues;..//
2530: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 #endif // !UNIC
2540: 4f 44 45 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f ODE..// #endif /
2550: 2a 20 57 49 4e 56 45 52 20 3e 3d 20 30 78 30 34 * WINVER >= 0x04
2560: 30 30 20 2a 2f 0d 0a 0d 0a 65 78 74 65 72 6e 28 00 */....extern(
2570: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 Windows) export
2580: 4c 4f 4e 47 20 52 65 67 51 75 65 72 79 56 61 6c LONG RegQueryVal
2590: 75 65 45 78 41 28 0d 0a 20 20 48 4b 45 59 20 68 ueExA(.. HKEY h
25a0: 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c Key,.. LPCSTR l
25b0: 70 56 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20 20 4c pValueName,.. L
25c0: 50 44 57 4f 52 44 20 6c 70 52 65 73 65 72 76 65 PDWORD lpReserve
25d0: 64 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 d,.. LPDWORD lp
25e0: 54 79 70 65 2c 0d 0a 20 20 4c 50 42 59 54 45 20 Type,.. LPBYTE
25f0: 6c 70 44 61 74 61 2c 0d 0a 20 20 4c 50 44 57 4f lpData,.. LPDWO
2600: 52 44 20 6c 70 63 62 44 61 74 61 29 3b 0d 0a 65 RD lpcbData);..e
2610: 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 xtern(Windows) e
2620: 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 51 75 xport LONG RegQu
2630: 65 72 79 56 61 6c 75 65 45 78 57 28 0d 0a 20 20 eryValueExW(..
2640: 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 HKEY hKey,.. LP
2650: 43 57 53 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d CWSTR lpValueNam
2660: 65 2c 0d 0a 20 20 4c 50 44 57 4f 52 44 20 6c 70 e,.. LPDWORD lp
2670: 52 65 73 65 72 76 65 64 2c 0d 0a 20 20 4c 50 44 Reserved,.. LPD
2680: 57 4f 52 44 20 6c 70 54 79 70 65 2c 0d 0a 20 20 WORD lpType,..
2690: 4c 50 42 59 54 45 20 6c 70 44 61 74 61 2c 0d 0a LPBYTE lpData,..
26a0: 20 20 4c 50 44 57 4f 52 44 20 6c 70 63 62 44 61 LPDWORD lpcbDa
26b0: 74 61 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 ta);..// #ifdef
26c0: 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e UNICODE..// #...
26d0: 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 ..// #else..alia
26e0: 73 20 52 65 67 51 75 65 72 79 56 61 6c 75 65 45 s RegQueryValueE
26f0: 78 41 20 52 65 67 51 75 65 72 79 56 61 6c 75 65 xA RegQueryValue
2700: 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f Ex;..// #endif /
2710: 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 / !UNICODE....ex
2720: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 tern(Windows) ex
2730: 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 52 65 70 port LONG RegRep
2740: 6c 61 63 65 4b 65 79 41 28 0d 0a 20 20 48 4b 45 laceKeyA(.. HKE
2750: 59 20 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 Y hKey,.. LPCST
2760: 52 20 6c 70 53 75 62 4b 65 79 2c 0d 0a 20 20 4c R lpSubKey,.. L
2770: 50 43 53 54 52 20 6c 70 4e 65 77 46 69 6c 65 2c PCSTR lpNewFile,
2780: 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 4f 6c 64 .. LPCSTR lpOld
2790: 46 69 6c 65 29 3b 0d 0a 65 78 74 65 72 6e 28 57 File);..extern(W
27a0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c indows) export L
27b0: 4f 4e 47 20 52 65 67 52 65 70 6c 61 63 65 4b 65 ONG RegReplaceKe
27c0: 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 yW(.. HKEY hKey
27d0: 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53 ,.. LPCWSTR lpS
27e0: 75 62 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 ubKey,.. LPCWST
27f0: 52 20 6c 70 4e 65 77 46 69 6c 65 2c 0d 0a 20 20 R lpNewFile,..
2800: 4c 50 43 57 53 54 52 20 6c 70 4f 6c 64 46 69 6c LPCWSTR lpOldFil
2810: 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 e);..// #ifdef U
2820: 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d NICODE..// #....
2830: 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 .// #else..alias
2840: 20 52 65 67 52 65 70 6c 61 63 65 4b 65 79 41 20 RegReplaceKeyA
2850: 52 65 67 52 65 70 6c 61 63 65 4b 65 79 3b 0d 0a RegReplaceKey;..
2860: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e // #endif // !UN
2870: 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 ICODE....extern(
2880: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 Windows) export
2890: 4c 4f 4e 47 20 52 65 67 52 65 73 74 6f 72 65 4b LONG RegRestoreK
28a0: 65 79 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 eyA(.. HKEY hKe
28b0: 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 y,.. LPCSTR lpF
28c0: 69 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 ile,.. DWORD dw
28d0: 46 6c 61 67 73 29 3b 0d 0a 65 78 74 65 72 6e 28 Flags);..extern(
28e0: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 Windows) export
28f0: 4c 4f 4e 47 20 52 65 67 52 65 73 74 6f 72 65 4b LONG RegRestoreK
2900: 65 79 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 eyW(.. HKEY hKe
2910: 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 y,.. LPCWSTR lp
2920: 46 69 6c 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 File,.. DWORD d
2930: 77 46 6c 61 67 73 29 3b 0d 0a 2f 2f 20 23 69 66 wFlags);..// #if
2940: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 def UNICODE..//
2950: 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a #.....// #else..
2960: 61 6c 69 61 73 20 52 65 67 52 65 73 74 6f 72 65 alias RegRestore
2970: 4b 65 79 41 20 52 65 67 52 65 73 74 6f 72 65 4b KeyA RegRestoreK
2980: 65 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 20 2f ey;..// #endif /
2990: 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 / !UNICODE....ex
29a0: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 tern(Windows) ex
29b0: 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 53 61 76 port LONG RegSav
29c0: 65 4b 65 79 41 28 0d 0a 20 20 48 4b 45 59 20 68 eKeyA(.. HKEY h
29d0: 4b 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c Key,.. LPCSTR l
29e0: 70 46 69 6c 65 2c 0d 0a 20 20 4c 50 53 45 43 55 pFile,.. LPSECU
29f0: 52 49 54 59 5f 41 54 54 52 49 42 55 54 45 53 20 RITY_ATTRIBUTES
2a00: 6c 70 53 65 63 75 72 69 74 79 41 74 74 72 69 62 lpSecurityAttrib
2a10: 75 74 65 73 29 3b 0d 0a 65 78 74 65 72 6e 28 57 utes);..extern(W
2a20: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c indows) export L
2a30: 4f 4e 47 20 52 65 67 53 61 76 65 4b 65 79 57 28 ONG RegSaveKeyW(
2a40: 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a .. HKEY hKey,..
2a50: 20 20 4c 50 43 57 53 54 52 20 6c 70 46 69 6c 65 LPCWSTR lpFile
2a60: 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f ,.. LPSECURITY_
2a70: 41 54 54 52 49 42 55 54 45 53 20 6c 70 53 65 63 ATTRIBUTES lpSec
2a80: 75 72 69 74 79 41 74 74 72 69 62 75 74 65 73 29 urityAttributes)
2a90: 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 ;..// #ifdef UNI
2aa0: 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f CODE..// #...../
2ab0: 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 52 / #else..alias R
2ac0: 65 67 53 61 76 65 4b 65 79 41 20 52 65 67 53 61 egSaveKeyA RegSa
2ad0: 76 65 4b 65 79 3b 0d 0a 2f 2f 20 23 65 6e 64 69 veKey;..// #endi
2ae0: 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d f // !UNICODE...
2af0: 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 .extern(Windows)
2b00: 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 export LONG Reg
2b10: 53 65 74 4b 65 79 53 65 63 75 72 69 74 79 28 0d SetKeySecurity(.
2b20: 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 . HKEY hKey,..
2b30: 20 53 45 43 55 52 49 54 59 5f 49 4e 46 4f 52 4d SECURITY_INFORM
2b40: 41 54 49 4f 4e 20 53 65 63 75 72 69 74 79 49 6e ATION SecurityIn
2b50: 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 50 53 formation,.. PS
2b60: 45 43 55 52 49 54 59 5f 44 45 53 43 52 49 50 54 ECURITY_DESCRIPT
2b70: 4f 52 20 70 53 65 63 75 72 69 74 79 44 65 73 63 OR pSecurityDesc
2b80: 72 69 70 74 6f 72 29 3b 0d 0a 0d 0a 65 78 74 65 riptor);....exte
2b90: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f rn(Windows) expo
2ba0: 72 74 20 4c 4f 4e 47 20 52 65 67 53 65 74 56 61 rt LONG RegSetVa
2bb0: 6c 75 65 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b lueA(.. HKEY hK
2bc0: 65 79 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 ey,.. LPCSTR lp
2bd0: 53 75 62 4b 65 79 2c 0d 0a 20 20 44 57 4f 52 44 SubKey,.. DWORD
2be0: 20 64 77 54 79 70 65 2c 0d 0a 20 20 4c 50 43 53 dwType,.. LPCS
2bf0: 54 52 20 6c 70 44 61 74 61 2c 0d 0a 20 20 44 57 TR lpData,.. DW
2c00: 4f 52 44 20 63 62 44 61 74 61 29 3b 0d 0a 65 78 ORD cbData);..ex
2c10: 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 tern(Windows) ex
2c20: 70 6f 72 74 20 4c 4f 4e 47 20 52 65 67 53 65 74 port LONG RegSet
2c30: 56 61 6c 75 65 57 28 0d 0a 20 20 48 4b 45 59 20 ValueW(.. HKEY
2c40: 68 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 hKey,.. LPCWSTR
2c50: 20 6c 70 53 75 62 4b 65 79 2c 0d 0a 20 20 44 57 lpSubKey,.. DW
2c60: 4f 52 44 20 64 77 54 79 70 65 2c 0d 0a 20 20 4c ORD dwType,.. L
2c70: 50 43 57 53 54 52 20 6c 70 44 61 74 61 2c 0d 0a PCWSTR lpData,..
2c80: 20 20 44 57 4f 52 44 20 63 62 44 61 74 61 29 3b DWORD cbData);
2c90: 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 ..// #ifdef UNIC
2ca0: 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f ODE..// #.....//
2cb0: 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 20 52 65 #else..alias Re
2cc0: 67 53 65 74 56 61 6c 75 65 41 20 52 65 67 53 65 gSetValueA RegSe
2cd0: 74 56 61 6c 75 65 3b 0d 0a 2f 2f 20 23 65 6e 64 tValue;..// #end
2ce0: 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a if // !UNICODE..
2cf0: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 ..extern(Windows
2d00: 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 65 ) export LONG Re
2d10: 67 53 65 74 56 61 6c 75 65 45 78 41 28 0d 0a 20 gSetValueExA(..
2d20: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c HKEY hKey,.. L
2d30: 50 43 53 54 52 20 6c 70 56 61 6c 75 65 4e 61 6d PCSTR lpValueNam
2d40: 65 2c 0d 0a 20 20 44 57 4f 52 44 20 52 65 73 65 e,.. DWORD Rese
2d50: 72 76 65 64 2c 0d 0a 20 20 44 57 4f 52 44 20 64 rved,.. DWORD d
2d60: 77 54 79 70 65 2c 0d 0a 20 20 42 59 54 45 2a 20 wType,.. BYTE*
2d70: 6c 70 44 61 74 61 2c 0d 0a 20 20 44 57 4f 52 44 lpData,.. DWORD
2d80: 20 63 62 44 61 74 61 29 3b 0d 0a 65 78 74 65 72 cbData);..exter
2d90: 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 n(Windows) expor
2da0: 74 20 4c 4f 4e 47 20 52 65 67 53 65 74 56 61 6c t LONG RegSetVal
2db0: 75 65 45 78 57 28 0d 0a 20 20 48 4b 45 59 20 68 ueExW(.. HKEY h
2dc0: 4b 65 79 2c 0d 0a 20 20 4c 50 43 57 53 54 52 20 Key,.. LPCWSTR
2dd0: 6c 70 56 61 6c 75 65 4e 61 6d 65 2c 0d 0a 20 20 lpValueName,..
2de0: 44 57 4f 52 44 20 52 65 73 65 72 76 65 64 2c 0d DWORD Reserved,.
2df0: 0a 20 20 44 57 4f 52 44 20 64 77 54 79 70 65 2c . DWORD dwType,
2e00: 0d 0a 20 20 42 59 54 45 2a 20 6c 70 44 61 74 61 .. BYTE* lpData
2e10: 2c 0d 0a 20 20 44 57 4f 52 44 20 63 62 44 61 74 ,.. DWORD cbDat
2e20: 61 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 66 20 55 a);..// #ifdef U
2e30: 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d NICODE..// #....
2e40: 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c 69 61 73 .// #else..alias
2e50: 20 52 65 67 53 65 74 56 61 6c 75 65 45 78 41 20 RegSetValueExA
2e60: 52 65 67 53 65 74 56 61 6c 75 65 45 78 3b 0d 0a RegSetValueEx;..
2e70: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e // #endif // !UN
2e80: 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 ICODE....extern(
2e90: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 Windows) export
2ea0: 4c 4f 4e 47 20 52 65 67 55 6e 4c 6f 61 64 4b 65 LONG RegUnLoadKe
2eb0: 79 41 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 yA(.. HKEY hKey
2ec0: 2c 0d 0a 20 20 4c 50 43 53 54 52 20 6c 70 53 75 ,.. LPCSTR lpSu
2ed0: 62 4b 65 79 29 3b 0d 0a 65 78 74 65 72 6e 28 57 bKey);..extern(W
2ee0: 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c indows) export L
2ef0: 4f 4e 47 20 52 65 67 55 6e 4c 6f 61 64 4b 65 79 ONG RegUnLoadKey
2f00: 57 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c W(.. HKEY hKey,
2f10: 0d 0a 20 20 4c 50 43 57 53 54 52 20 6c 70 53 75 .. LPCWSTR lpSu
2f20: 62 4b 65 79 29 3b 0d 0a 2f 2f 20 23 69 66 64 65 bKey);..// #ifde
2f30: 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 2e f UNICODE..// #.
2f40: 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 6c ....// #else..al
2f50: 69 61 73 20 52 65 67 55 6e 4c 6f 61 64 4b 65 79 ias RegUnLoadKey
2f60: 41 20 52 65 67 55 6e 4c 6f 61 64 4b 65 79 3b 0d A RegUnLoadKey;.
2f70: 0a 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 .// #endif // !U
2f80: 4e 49 43 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e NICODE....extern
2f90: 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 (Windows) export
2fa0: 20 42 4f 4f 4c 20 49 6e 69 74 69 61 74 65 53 79 BOOL InitiateSy
2fb0: 73 74 65 6d 53 68 75 74 64 6f 77 6e 41 28 0d 0a stemShutdownA(..
2fc0: 20 20 4c 50 53 54 52 20 6c 70 4d 61 63 68 69 6e LPSTR lpMachin
2fd0: 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 53 54 52 20 eName,.. LPSTR
2fe0: 6c 70 4d 65 73 73 61 67 65 2c 0d 0a 20 20 44 57 lpMessage,.. DW
2ff0: 4f 52 44 20 64 77 54 69 6d 65 6f 75 74 2c 0d 0a ORD dwTimeout,..
3000: 20 20 42 4f 4f 4c 20 62 46 6f 72 63 65 41 70 70 BOOL bForceApp
3010: 73 43 6c 6f 73 65 64 2c 0d 0a 20 20 42 4f 4f 4c sClosed,.. BOOL
3020: 20 62 52 65 62 6f 6f 74 41 66 74 65 72 53 68 75 bRebootAfterShu
3030: 74 64 6f 77 6e 29 3b 0d 0a 65 78 74 65 72 6e 28 tdown);..extern(
3040: 57 69 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 Windows) export
3050: 42 4f 4f 4c 20 49 6e 69 74 69 61 74 65 53 79 73 BOOL InitiateSys
3060: 74 65 6d 53 68 75 74 64 6f 77 6e 57 28 0d 0a 20 temShutdownW(..
3070: 20 4c 50 57 53 54 52 20 6c 70 4d 61 63 68 69 6e LPWSTR lpMachin
3080: 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53 54 52 eName,.. LPWSTR
3090: 20 6c 70 4d 65 73 73 61 67 65 2c 0d 0a 20 20 44 lpMessage,.. D
30a0: 57 4f 52 44 20 64 77 54 69 6d 65 6f 75 74 2c 0d WORD dwTimeout,.
30b0: 0a 20 20 42 4f 4f 4c 20 62 46 6f 72 63 65 41 70 . BOOL bForceAp
30c0: 70 73 43 6c 6f 73 65 64 2c 0d 0a 20 20 42 4f 4f psClosed,.. BOO
30d0: 4c 20 62 52 65 62 6f 6f 74 41 66 74 65 72 53 68 L bRebootAfterSh
30e0: 75 74 64 6f 77 6e 29 3b 0d 0a 2f 2f 20 23 69 66 utdown);..// #if
30f0: 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 def UNICODE..//
3100: 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a #.....// #else..
3110: 61 6c 69 61 73 20 49 6e 69 74 69 61 74 65 53 79 alias InitiateSy
3120: 73 74 65 6d 53 68 75 74 64 6f 77 6e 41 20 49 6e stemShutdownA In
3130: 69 74 69 61 74 65 53 79 73 74 65 6d 53 68 75 74 itiateSystemShut
3140: 64 6f 77 6e 3b 0d 0a 2f 2f 20 23 65 6e 64 69 66 down;..// #endif
3150: 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a 0d 0a // !UNICODE....
3160: 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 29 20 extern(Windows)
3170: 65 78 70 6f 72 74 20 42 4f 4f 4c 20 41 62 6f 72 export BOOL Abor
3180: 74 53 79 73 74 65 6d 53 68 75 74 64 6f 77 6e 41 tSystemShutdownA
3190: 28 0d 0a 20 20 4c 50 53 54 52 20 6c 70 4d 61 63 (.. LPSTR lpMac
31a0: 68 69 6e 65 4e 61 6d 65 29 3b 0d 0a 65 78 74 65 hineName);..exte
31b0: 72 6e 28 57 69 6e 64 6f 77 73 29 20 65 78 70 6f rn(Windows) expo
31c0: 72 74 20 42 4f 4f 4c 20 41 62 6f 72 74 53 79 73 rt BOOL AbortSys
31d0: 74 65 6d 53 68 75 74 64 6f 77 6e 57 28 0d 0a 20 temShutdownW(..
31e0: 20 4c 50 57 53 54 52 20 6c 70 4d 61 63 68 69 6e LPWSTR lpMachin
31f0: 65 4e 61 6d 65 29 3b 0d 0a 2f 2f 20 23 69 66 64 eName);..// #ifd
3200: 65 66 20 55 4e 49 43 4f 44 45 0d 0a 2f 2f 20 23 ef UNICODE..// #
3210: 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 65 0d 0a 61 .....// #else..a
3220: 6c 69 61 73 20 41 62 6f 72 74 53 79 73 74 65 6d lias AbortSystem
3230: 53 68 75 74 64 6f 77 6e 41 20 41 62 6f 72 74 53 ShutdownA AbortS
3240: 79 73 74 65 6d 53 68 75 74 64 6f 77 6e 3b 0d 0a ystemShutdown;..
3250: 2f 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e // #endif // !UN
3260: 49 43 4f 44 45 0d 0a 0d 0a 2f 2f 20 69 6e 6c 69 ICODE....// inli
3270: 6e 65 20 23 69 6e 63 6c 75 64 65 20 3c 72 65 61 ne #include <rea
3280: 73 6f 6e 2e 68 3e 0d 0a 2f 2f 20 2d 2d 2d 2d 0d son.h>..// ----.
3290: 0a 0d 0a 2f 2f 20 23 69 66 20 21 64 65 66 69 6e ...// #if !defin
32a0: 65 64 20 53 45 4e 54 49 4e 45 4c 5f 52 65 61 73 ed SENTINEL_Reas
32b0: 6f 6e 0d 0a 2f 2f 20 23 20 64 65 66 69 6e 65 20 on..// # define
32c0: 53 45 4e 54 49 4e 45 4c 5f 52 65 61 73 6f 6e 0d SENTINEL_Reason.
32d0: 0a 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b ...enum : uint {
32e0: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c SHTDN_REASON_FL
32f0: 41 47 5f 43 4f 4d 4d 45 4e 54 5f 52 45 51 55 49 AG_COMMENT_REQUI
3300: 52 45 44 20 3d 20 30 78 30 31 30 30 30 30 30 30 RED = 0x01000000
3310: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 }..enum : uint
3320: 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 { SHTDN_REASON_F
3330: 4c 41 47 5f 44 49 52 54 59 5f 50 52 4f 42 4c 45 LAG_DIRTY_PROBLE
3340: 4d 5f 49 44 5f 52 45 51 55 49 52 45 44 20 3d 20 M_ID_REQUIRED =
3350: 30 78 30 32 30 30 30 30 30 30 20 7d 0d 0a 65 6e 0x02000000 }..en
3360: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 um : uint { SHTD
3370: 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 47 5f 43 4c N_REASON_FLAG_CL
3380: 45 41 4e 5f 55 49 20 3d 20 30 78 30 34 30 30 30 EAN_UI = 0x04000
3390: 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 000 }..enum : ui
33a0: 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f nt { SHTDN_REASO
33b0: 4e 5f 46 4c 41 47 5f 44 49 52 54 59 5f 55 49 20 N_FLAG_DIRTY_UI
33c0: 3d 20 30 78 30 38 30 30 30 30 30 30 20 7d 0d 0a = 0x08000000 }..
33d0: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 ..enum : uint {
33e0: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 SHTDN_REASON_FLA
33f0: 47 5f 55 53 45 52 5f 44 45 46 49 4e 45 44 20 3d G_USER_DEFINED =
3400: 20 30 78 34 30 30 30 30 30 30 30 20 7d 0d 0a 65 0x40000000 }..e
3410: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 num : uint { SHT
3420: 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 47 5f 50 DN_REASON_FLAG_P
3430: 4c 41 4e 4e 45 44 20 3d 20 30 78 38 30 30 30 30 LANNED = 0x80000
3440: 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 000 }....enum :
3450: 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 uint { SHTDN_REA
3460: 53 4f 4e 5f 4d 41 4a 4f 52 5f 4f 54 48 45 52 20 SON_MAJOR_OTHER
3470: 3d 20 30 78 30 30 30 30 30 30 30 30 20 7d 0d 0a = 0x00000000 }..
3480: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 enum : uint { SH
3490: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f 52 TDN_REASON_MAJOR
34a0: 5f 4e 4f 4e 45 20 3d 20 30 78 30 30 30 30 30 30 _NONE = 0x000000
34b0: 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 00 }..enum : uin
34c0: 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e t { SHTDN_REASON
34d0: 5f 4d 41 4a 4f 52 5f 48 41 52 44 57 41 52 45 20 _MAJOR_HARDWARE
34e0: 3d 20 30 78 30 30 30 31 30 30 30 30 20 7d 0d 0a = 0x00010000 }..
34f0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 enum : uint { SH
3500: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f 52 TDN_REASON_MAJOR
3510: 5f 4f 50 45 52 41 54 49 4e 47 53 59 53 54 45 4d _OPERATINGSYSTEM
3520: 20 3d 20 30 78 30 30 30 32 30 30 30 30 20 7d 0d = 0x00020000 }.
3530: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 .enum : uint { S
3540: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f HTDN_REASON_MAJO
3550: 52 5f 53 4f 46 54 57 41 52 45 20 3d 20 30 78 30 R_SOFTWARE = 0x0
3560: 30 30 33 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 0030000 }..enum
3570: 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 : uint { SHTDN_R
3580: 45 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 41 50 50 4c EASON_MAJOR_APPL
3590: 49 43 41 54 49 4f 4e 20 3d 20 30 78 30 30 30 34 ICATION = 0x0004
35a0: 30 30 30 30 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 0000 }..enum : u
35b0: 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 int { SHTDN_REAS
35c0: 4f 4e 5f 4d 41 4a 4f 52 5f 53 59 53 54 45 4d 20 ON_MAJOR_SYSTEM
35d0: 3d 20 30 78 30 30 30 35 30 30 30 30 20 7d 0d 0a = 0x00050000 }..
35e0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 enum : uint { SH
35f0: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f 52 TDN_REASON_MAJOR
3600: 5f 50 4f 57 45 52 20 3d 20 30 78 30 30 30 36 30 _POWER = 0x00060
3610: 30 30 30 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 3a 20 000 }....enum :
3620: 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 uint { SHTDN_REA
3630: 53 4f 4e 5f 4d 49 4e 4f 52 5f 4f 54 48 45 52 20 SON_MINOR_OTHER
3640: 3d 20 30 78 30 30 30 30 30 30 30 30 20 7d 0d 0a = 0x00000000 }..
3650: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 enum : uint { SH
3660: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 TDN_REASON_MINOR
3670: 5f 4e 4f 4e 45 20 3d 20 30 78 30 30 30 30 30 30 _NONE = 0x000000
3680: 66 66 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e ff }..enum : uin
3690: 74 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e t { SHTDN_REASON
36a0: 5f 4d 49 4e 4f 52 5f 4d 41 49 4e 54 45 4e 41 4e _MINOR_MAINTENAN
36b0: 43 45 20 3d 20 30 78 30 30 30 30 30 30 30 31 20 CE = 0x00000001
36c0: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b }..enum : uint {
36d0: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 SHTDN_REASON_MI
36e0: 4e 4f 52 5f 49 4e 53 54 41 4c 4c 41 54 49 4f 4e NOR_INSTALLATION
36f0: 20 3d 20 30 78 30 30 30 30 30 30 30 32 20 7d 0d = 0x00000002 }.
3700: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 .enum : uint { S
3710: 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f HTDN_REASON_MINO
3720: 52 5f 55 50 47 52 41 44 45 20 3d 20 30 78 30 30 R_UPGRADE = 0x00
3730: 30 30 30 30 30 33 20 7d 0d 0a 65 6e 75 6d 20 3a 000003 }..enum :
3740: 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 uint { SHTDN_RE
3750: 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 52 45 43 4f 4e ASON_MINOR_RECON
3760: 46 49 47 20 3d 20 30 78 30 30 30 30 30 30 30 34 FIG = 0x00000004
3770: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 }..enum : uint
3780: 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d { SHTDN_REASON_M
3790: 49 4e 4f 52 5f 48 55 4e 47 20 3d 20 30 78 30 30 INOR_HUNG = 0x00
37a0: 30 30 30 30 30 35 20 7d 0d 0a 65 6e 75 6d 20 3a 000005 }..enum :
37b0: 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 uint { SHTDN_RE
37c0: 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 55 4e 53 54 41 ASON_MINOR_UNSTA
37d0: 42 4c 45 20 3d 20 30 78 30 30 30 30 30 30 30 36 BLE = 0x00000006
37e0: 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 }..enum : uint
37f0: 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d { SHTDN_REASON_M
3800: 49 4e 4f 52 5f 44 49 53 4b 20 3d 20 30 78 30 30 INOR_DISK = 0x00
3810: 30 30 30 30 30 37 20 7d 0d 0a 65 6e 75 6d 20 3a 000007 }..enum :
3820: 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 uint { SHTDN_RE
3830: 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 50 52 4f 43 45 ASON_MINOR_PROCE
3840: 53 53 4f 52 20 3d 20 30 78 30 30 30 30 30 30 30 SSOR = 0x0000000
3850: 38 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 8 }..enum : uint
3860: 20 7b 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f { SHTDN_REASON_
3870: 4d 49 4e 4f 52 5f 4e 45 54 57 4f 52 4b 43 41 52 MINOR_NETWORKCAR
3880: 44 20 3d 20 30 78 30 30 30 30 30 30 30 39 20 7d D = 0x00000009 }
3890: 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 ..enum : uint {
38a0: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e SHTDN_REASON_MIN
38b0: 4f 52 5f 50 4f 57 45 52 5f 53 55 50 50 4c 59 20 OR_POWER_SUPPLY
38c0: 3d 20 30 78 30 30 30 30 30 30 30 61 20 7d 0d 0a = 0x0000000a }..
38d0: 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 enum : uint { SH
38e0: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 TDN_REASON_MINOR
38f0: 5f 43 4f 52 44 55 4e 50 4c 55 47 47 45 44 20 3d _CORDUNPLUGGED =
3900: 20 30 78 30 30 30 30 30 30 30 62 20 7d 0d 0a 65 0x0000000b }..e
3910: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 num : uint { SHT
3920: 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f DN_REASON_MINOR_
3930: 45 4e 56 49 52 4f 4e 4d 45 4e 54 20 3d 20 30 78 ENVIRONMENT = 0x
3940: 30 30 30 30 30 30 30 63 20 7d 0d 0a 65 6e 75 6d 0000000c }..enum
3950: 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f : uint { SHTDN_
3960: 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 48 41 52 REASON_MINOR_HAR
3970: 44 57 41 52 45 5f 44 52 49 56 45 52 20 3d 20 30 DWARE_DRIVER = 0
3980: 78 30 30 30 30 30 30 30 64 20 7d 0d 0a 65 6e 75 x0000000d }..enu
3990: 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 44 4e m : uint { SHTDN
39a0: 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 4f 54 _REASON_MINOR_OT
39b0: 48 45 52 44 52 49 56 45 52 20 3d 20 30 78 30 30 HERDRIVER = 0x00
39c0: 30 30 30 30 30 65 20 7d 0d 0a 65 6e 75 6d 20 3a 00000e }..enum :
39d0: 20 75 69 6e 74 20 7b 20 53 48 54 44 4e 5f 52 45 uint { SHTDN_RE
39e0: 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 42 4c 55 45 53 ASON_MINOR_BLUES
39f0: 43 52 45 45 4e 20 3d 20 30 78 30 30 30 30 30 30 CREEN = 0x000000
3a00: 30 46 20 7d 0d 0a 0d 0a 61 6c 69 61 73 20 53 48 0F }....alias SH
3a10: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 TDN_REASON_MINOR
3a20: 5f 4e 4f 4e 45 20 53 48 54 44 4e 5f 52 45 41 53 _NONE SHTDN_REAS
3a30: 4f 4e 5f 55 4e 4b 4e 4f 57 4e 3b 0d 0a 0d 0a 65 ON_UNKNOWN;....e
3a40: 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 53 48 54 num : uint { SHT
3a50: 44 4e 5f 52 45 41 53 4f 4e 5f 56 41 4c 49 44 5f DN_REASON_VALID_
3a60: 42 49 54 5f 4d 41 53 4b 20 3d 20 30 78 63 30 66 BIT_MASK = 0xc0f
3a70: 66 66 66 66 66 20 7d 0d 0a 0d 0a 65 6e 75 6d 20 fffff }....enum
3a80: 3a 20 75 69 6e 74 20 7b 20 50 43 4c 45 41 4e 55 : uint { PCLEANU
3a90: 49 20 3d 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e I = SHTDN_REASON
3aa0: 5f 46 4c 41 47 5f 50 4c 41 4e 4e 45 44 20 7c 20 _FLAG_PLANNED |
3ab0: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 SHTDN_REASON_FLA
3ac0: 47 5f 43 4c 45 41 4e 5f 55 49 20 7d 0d 0a 65 6e G_CLEAN_UI }..en
3ad0: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 55 43 4c 45 um : uint { UCLE
3ae0: 41 4e 55 49 20 3d 20 53 48 54 44 4e 5f 52 45 41 ANUI = SHTDN_REA
3af0: 53 4f 4e 5f 46 4c 41 47 5f 43 4c 45 41 4e 5f 55 SON_FLAG_CLEAN_U
3b00: 49 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 I }..enum : uint
3b10: 20 7b 20 55 44 49 52 54 59 55 49 20 3d 20 53 48 { UDIRTYUI = SH
3b20: 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c 41 47 5f TDN_REASON_FLAG_
3b30: 44 49 52 54 59 5f 55 49 20 7d 0d 0a 0d 0a 65 6e DIRTY_UI }....en
3b40: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4d 41 58 5f um : uint { MAX_
3b50: 52 45 41 53 4f 4e 5f 4e 41 4d 45 5f 4c 45 4e 20 REASON_NAME_LEN
3b60: 3d 20 36 34 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 = 64 }..enum : u
3b70: 69 6e 74 20 7b 20 4d 41 58 5f 52 45 41 53 4f 4e int { MAX_REASON
3b80: 5f 44 45 53 43 5f 4c 45 4e 20 3d 20 32 35 36 20 _DESC_LEN = 256
3b90: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b }..enum : uint {
3ba0: 20 4d 41 58 5f 52 45 41 53 4f 4e 5f 42 55 47 49 MAX_REASON_BUGI
3bb0: 44 5f 4c 45 4e 20 3d 20 33 32 20 7d 0d 0a 65 6e D_LEN = 32 }..en
3bc0: 75 6d 20 3a 20 75 69 6e 74 20 7b 20 4d 41 58 5f um : uint { MAX_
3bd0: 52 45 41 53 4f 4e 5f 43 4f 4d 4d 45 4e 54 5f 4c REASON_COMMENT_L
3be0: 45 4e 20 3d 20 34 30 39 36 20 7d 0d 0a 0d 0a 2f EN = 4096 }..../
3bf0: 2f 20 23 65 6e 64 69 66 20 2f 2f 20 21 64 65 66 / #endif // !def
3c00: 69 6e 65 64 20 53 45 4e 54 49 4e 45 4c 5f 52 65 ined SENTINEL_Re
3c10: 61 73 6f 6e 0d 0a 2f 2f 20 2d 2d 2d 2d 0d 0a 0d ason..// ----...
3c20: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 52 .enum : uint { R
3c30: 45 41 53 4f 4e 5f 53 57 49 4e 53 54 41 4c 4c 20 EASON_SWINSTALL
3c40: 3d 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d = SHTDN_REASON_M
3c50: 41 4a 4f 52 5f 53 4f 46 54 57 41 52 45 20 7c 20 AJOR_SOFTWARE |
3c60: 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e SHTDN_REASON_MIN
3c70: 4f 52 5f 49 4e 53 54 41 4c 4c 41 54 49 4f 4e 20 OR_INSTALLATION
3c80: 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b }..enum : uint {
3c90: 20 52 45 41 53 4f 4e 5f 48 57 49 4e 53 54 41 4c REASON_HWINSTAL
3ca0: 4c 20 3d 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e L = SHTDN_REASON
3cb0: 5f 4d 41 4a 4f 52 5f 48 41 52 44 57 41 52 45 20 _MAJOR_HARDWARE
3cc0: 7c 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d | SHTDN_REASON_M
3cd0: 49 4e 4f 52 5f 49 4e 53 54 41 4c 4c 41 54 49 4f INOR_INSTALLATIO
3ce0: 4e 20 7d 0d 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 N }..enum : uint
3cf0: 20 7b 20 52 45 41 53 4f 4e 5f 53 45 52 56 49 43 { REASON_SERVIC
3d00: 45 48 41 4e 47 20 3d 20 53 48 54 44 4e 5f 52 45 EHANG = SHTDN_RE
3d10: 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 53 4f 46 54 57 ASON_MAJOR_SOFTW
3d20: 41 52 45 20 7c 20 53 48 54 44 4e 5f 52 45 41 53 ARE | SHTDN_REAS
3d30: 4f 4e 5f 4d 49 4e 4f 52 5f 48 55 4e 47 20 7d 0d ON_MINOR_HUNG }.
3d40: 0a 65 6e 75 6d 20 3a 20 75 69 6e 74 20 7b 20 52 .enum : uint { R
3d50: 45 41 53 4f 4e 5f 55 4e 53 54 41 42 4c 45 20 3d EASON_UNSTABLE =
3d60: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 SHTDN_REASON_MA
3d70: 4a 4f 52 5f 53 59 53 54 45 4d 20 7c 20 53 48 54 JOR_SYSTEM | SHT
3d80: 44 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f DN_REASON_MINOR_
3d90: 55 4e 53 54 41 42 4c 45 20 7d 0d 0a 65 6e 75 6d UNSTABLE }..enum
3da0: 20 3a 20 75 69 6e 74 20 7b 20 52 45 41 53 4f 4e : uint { REASON
3db0: 5f 53 57 48 57 52 45 43 4f 4e 46 20 3d 20 53 48 _SWHWRECONF = SH
3dc0: 54 44 4e 5f 52 45 41 53 4f 4e 5f 4d 41 4a 4f 52 TDN_REASON_MAJOR
3dd0: 5f 53 4f 46 54 57 41 52 45 20 7c 20 53 48 54 44 _SOFTWARE | SHTD
3de0: 4e 5f 52 45 41 53 4f 4e 5f 4d 49 4e 4f 52 5f 52 N_REASON_MINOR_R
3df0: 45 43 4f 4e 46 49 47 20 7d 0d 0a 65 6e 75 6d 20 ECONFIG }..enum
3e00: 3a 20 75 69 6e 74 20 7b 20 52 45 41 53 4f 4e 5f : uint { REASON_
3e10: 4f 54 48 45 52 20 3d 20 53 48 54 44 4e 5f 52 45 OTHER = SHTDN_RE
3e20: 41 53 4f 4e 5f 4d 41 4a 4f 52 5f 4f 54 48 45 52 ASON_MAJOR_OTHER
3e30: 20 7c 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f | SHTDN_REASON_
3e40: 4d 49 4e 4f 52 5f 4f 54 48 45 52 20 7d 0d 0a 61 MINOR_OTHER }..a
3e50: 6c 69 61 73 20 53 48 54 44 4e 5f 52 45 41 53 4f lias SHTDN_REASO
3e60: 4e 5f 55 4e 4b 4e 4f 57 4e 20 52 45 41 53 4f 4e N_UNKNOWN REASON
3e70: 5f 55 4e 4b 4e 4f 57 4e 3b 0d 0a 61 6c 69 61 73 _UNKNOWN;..alias
3e80: 20 53 48 54 44 4e 5f 52 45 41 53 4f 4e 5f 46 4c SHTDN_REASON_FL
3e90: 41 47 5f 50 4c 41 4e 4e 45 44 20 52 45 41 53 4f AG_PLANNED REASO
3ea0: 4e 5f 50 4c 41 4e 4e 45 44 5f 46 4c 41 47 3b 0d N_PLANNED_FLAG;.
3eb0: 0a 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 ...extern(Window
3ec0: 73 29 20 65 78 70 6f 72 74 20 42 4f 4f 4c 20 49 s) export BOOL I
3ed0: 6e 69 74 69 61 74 65 53 79 73 74 65 6d 53 68 75 nitiateSystemShu
3ee0: 74 64 6f 77 6e 45 78 41 28 0d 0a 20 20 4c 50 53 tdownExA(.. LPS
3ef0: 54 52 20 6c 70 4d 61 63 68 69 6e 65 4e 61 6d 65 TR lpMachineName
3f00: 2c 0d 0a 20 20 4c 50 53 54 52 20 6c 70 4d 65 73 ,.. LPSTR lpMes
3f10: 73 61 67 65 2c 0d 0a 20 20 44 57 4f 52 44 20 64 sage,.. DWORD d
3f20: 77 54 69 6d 65 6f 75 74 2c 0d 0a 20 20 42 4f 4f wTimeout,.. BOO
3f30: 4c 20 62 46 6f 72 63 65 41 70 70 73 43 6c 6f 73 L bForceAppsClos
3f40: 65 64 2c 0d 0a 20 20 42 4f 4f 4c 20 62 52 65 62 ed,.. BOOL bReb
3f50: 6f 6f 74 41 66 74 65 72 53 68 75 74 64 6f 77 6e ootAfterShutdown
3f60: 2c 0d 0a 20 20 44 57 4f 52 44 20 64 77 52 65 61 ,.. DWORD dwRea
3f70: 73 6f 6e 29 3b 0d 0a 65 78 74 65 72 6e 28 57 69 son);..extern(Wi
3f80: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 42 4f ndows) export BO
3f90: 4f 4c 20 49 6e 69 74 69 61 74 65 53 79 73 74 65 OL InitiateSyste
3fa0: 6d 53 68 75 74 64 6f 77 6e 45 78 57 28 0d 0a 20 mShutdownExW(..
3fb0: 20 4c 50 57 53 54 52 20 6c 70 4d 61 63 68 69 6e LPWSTR lpMachin
3fc0: 65 4e 61 6d 65 2c 0d 0a 20 20 4c 50 57 53 54 52 eName,.. LPWSTR
3fd0: 20 6c 70 4d 65 73 73 61 67 65 2c 0d 0a 20 20 44 lpMessage,.. D
3fe0: 57 4f 52 44 20 64 77 54 69 6d 65 6f 75 74 2c 0d WORD dwTimeout,.
3ff0: 0a 20 20 42 4f 4f 4c 20 62 46 6f 72 63 65 41 70 . BOOL bForceAp
4000: 70 73 43 6c 6f 73 65 64 2c 0d 0a 20 20 42 4f 4f psClosed,.. BOO
4010: 4c 20 62 52 65 62 6f 6f 74 41 66 74 65 72 53 68 L bRebootAfterSh
4020: 75 74 64 6f 77 6e 2c 0d 0a 20 20 44 57 4f 52 44 utdown,.. DWORD
4030: 20 64 77 52 65 61 73 6f 6e 29 3b 0d 0a 2f 2f 20 dwReason);..//
4040: 23 69 66 64 65 66 20 55 4e 49 43 4f 44 45 0d 0a #ifdef UNICODE..
4050: 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 65 6c 73 // #.....// #els
4060: 65 0d 0a 61 6c 69 61 73 20 49 6e 69 74 69 61 74 e..alias Initiat
4070: 65 53 79 73 74 65 6d 53 68 75 74 64 6f 77 6e 45 eSystemShutdownE
4080: 78 41 20 49 6e 69 74 69 61 74 65 53 79 73 74 65 xA InitiateSyste
4090: 6d 53 68 75 74 64 6f 77 6e 45 78 3b 0d 0a 2f 2f mShutdownEx;..//
40a0: 20 23 65 6e 64 69 66 20 2f 2f 20 21 55 4e 49 43 #endif // !UNIC
40b0: 4f 44 45 0d 0a 0d 0a 65 78 74 65 72 6e 28 57 69 ODE....extern(Wi
40c0: 6e 64 6f 77 73 29 20 65 78 70 6f 72 74 20 4c 4f ndows) export LO
40d0: 4e 47 20 52 65 67 53 61 76 65 4b 65 79 45 78 41 NG RegSaveKeyExA
40e0: 28 0d 0a 20 20 48 4b 45 59 20 68 4b 65 79 2c 0d (.. HKEY hKey,.
40f0: 0a 20 20 4c 50 43 53 54 52 20 6c 70 46 69 6c 65 . LPCSTR lpFile
4100: 2c 0d 0a 20 20 4c 50 53 45 43 55 52 49 54 59 5f ,.. LPSECURITY_
4110: 41 54 54 52 49 42 55 54 45 53 20 6c 70 53 65 63 ATTRIBUTES lpSec
4120: 75 72 69 74 79 41 74 74 72 69 62 75 74 65 73 2c urityAttributes,
4130: 0d 0a 20 20 44 57 4f 52 44 20 46 6c 61 67 73 29 .. DWORD Flags)
4140: 3b 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 ;..extern(Window
4150: 73 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 52 s) export LONG R
4160: 65 67 53 61 76 65 4b 65 79 45 78 57 28 0d 0a 20 egSaveKeyExW(..
4170: 20 48 4b 45 59 20 68 4b 65 79 2c 0d 0a 20 20 4c HKEY hKey,.. L
4180: 50 43 57 53 54 52 20 6c 70 46 69 6c 65 2c 0d 0a PCWSTR lpFile,..
4190: 20 20 4c 50 53 45 43 55 52 49 54 59 5f 41 54 54 LPSECURITY_ATT
41a0: 52 49 42 55 54 45 53 20 6c 70 53 65 63 75 72 69 RIBUTES lpSecuri
41b0: 74 79 41 74 74 72 69 62 75 74 65 73 2c 0d 0a 20 tyAttributes,..
41c0: 20 44 57 4f 52 44 20 46 6c 61 67 73 29 3b 0d 0a DWORD Flags);..
41d0: 2f 2f 20 23 69 66 64 65 66 20 55 4e 49 43 4f 44 // #ifdef UNICOD
41e0: 45 0d 0a 2f 2f 20 23 2e 2e 2e 0d 0a 2f 2f 20 23 E..// #.....// #
41f0: 65 6c 73 65 0d 0a 61 6c 69 61 73 20 52 65 67 53 else..alias RegS
4200: 61 76 65 4b 65 79 45 78 41 20 52 65 67 53 61 76 aveKeyExA RegSav
4210: 65 4b 65 79 45 78 3b 0d 0a 2f 2f 20 23 65 6e 64 eKeyEx;..// #end
4220: 69 66 20 2f 2f 20 21 55 4e 49 43 4f 44 45 0d 0a if // !UNICODE..
4230: 0d 0a 65 78 74 65 72 6e 28 57 69 6e 64 6f 77 73 ..extern(Windows
4240: 29 20 65 78 70 6f 72 74 20 4c 4f 4e 47 20 57 6f ) export LONG Wo
4250: 77 36 34 57 69 6e 33 32 41 70 69 45 6e 74 72 79 w64Win32ApiEntry
4260: 28 0d 0a 20 20 44 57 4f 52 44 20 64 77 46 75 6e (.. DWORD dwFun
4270: 63 4e 75 6d 62 65 72 2c 0d 0a 20 20 44 57 4f 52 cNumber,.. DWOR
4280: 44 20 64 77 46 6c 61 67 2c 0d 0a 20 20 44 57 4f D dwFlag,.. DWO
4290: 52 44 20 64 77 52 65 73 29 3b 0d 0a 0d 0a 2f 2f RD dwRes);....//
42a0: 20 23 69 66 64 65 66 20 5f 5f 63 70 6c 75 73 70 #ifdef __cplusp
42b0: 6c 75 73 0d 0a 2f 2f 20 7d 0d 0a 2f 2f 20 23 65 lus..// }..// #e
42c0: 6e 64 69 66 0d 0a 0d 0a 2f 2f 20 23 65 6e 64 69 ndif....// #endi
42d0: 66 20 2f 2f 20 5f 57 49 4e 52 45 47 5f 0d 0a 0d f // _WINREG_...
42e0: 0a .