1 module win32.winreg;
2
3 // Translated from Microsoft Platform SDK August 2001 Edition
4 // by Y.Tomino (demoonlit@inter7.jp)
5
6 import win32.winnt, win32.winbase;
7
8 // #ifndef _WINREG_
9 // #define _WINREG_
10
11 // #ifdef _MAC
12 // #...
13 // #endif
14
15 // #ifdef __cplusplus
16 // extern "C" {
17 // #endif
18
19 // #ifndef WINVER
20 // #...
21 // #endif /* !WINVER */
22
23 alias ACCESS_MASK REGSAM;
24
25 const HKEY HKEY_CLASSES_ROOT = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000000) ;
26 const HKEY HKEY_CURRENT_USER = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000001) ;
27 const HKEY HKEY_LOCAL_MACHINE = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000002) ;
28 const HKEY HKEY_USERS = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000003) ;
29 const HKEY HKEY_PERFORMANCE_DATA = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000004) ;
30 const HKEY HKEY_PERFORMANCE_TEXT = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000050) ;
31 const HKEY HKEY_PERFORMANCE_NLSTEXT = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000060) ;
32 // #if(WINVER >= 0x0400)
33 const HKEY HKEY_CURRENT_CONFIG = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000005) ;
34 const HKEY HKEY_DYN_DATA = cast(HKEY)cast(ULONG_PTR)(cast(LONG)0x80000006) ;
35
36 // #ifndef _PROVIDER_STRUCTS_DEFINED
37 // #define _PROVIDER_STRUCTS_DEFINED
38
39 enum : uint { PROVIDER_KEEPS_VALUE_LENGTH = 0x1 }
40 struct val_context {
41 int valuelen;
42 LPVOID value_context;
43 LPVOID val_buff_ptr;
44 }
45
46 alias val_context* PVALCONTEXT;
47
48 struct pvalueA {
49 LPSTR pv_valuename;
50 int pv_valuelen;
51 LPVOID pv_value_context;
52 DWORD pv_type;
53 }
54 alias pvalueA PVALUEA;
55 alias pvalueA* PPVALUEA;
56
57 struct pvalueW {
58 LPWSTR pv_valuename;
59 int pv_valuelen;
60 LPVOID pv_value_context;
61 DWORD pv_type;
62 }
63 alias pvalueW PVALUEW;
64 alias pvalueW* PPVALUEW;
65
66 // #ifdef UNICODE
67 alias PVALUEW PVALUE;
68 alias PPVALUEW PPVALUE;
69 // #else
70 // ...
71 // #endif // UNICODE
72
73 // typedef DWORD _cdecl QUERYHANDLER (LPVOID keycontext, PVALCONTEXT val_list, DWORD num_vals, LPVOID outputbuffer, DWORD FAR *total_outlen, DWORD input_blen);
74
75 extern(Windows) alias DWORD function(LPVOID keycontext, PVALCONTEXT val_list, DWORD num_vals, LPVOID outputbuffer, DWORD* total_outlen, DWORD input_blen) PQUERYHANDLER;
76
77 struct provider_info {
78 PQUERYHANDLER pi_R0_1val;
79 PQUERYHANDLER pi_R0_allvals;
80 PQUERYHANDLER pi_R3_1val;
81 PQUERYHANDLER pi_R3_allvals;
82 DWORD pi_flags;
83 LPVOID pi_key_context;
84 }
85 alias provider_info REG_PROVIDER;
86
87 alias provider_info* PPROVIDER;
88
89 struct value_entA {
90 LPSTR ve_valuename;
91 DWORD ve_valuelen;
92 DWORD_PTR ve_valueptr;
93 DWORD ve_type;
94 }
95 alias value_entA VALENTA;
96 alias value_entA* PVALENTA;
97
98 struct value_entW {
99 LPWSTR ve_valuename;
100 DWORD ve_valuelen;
101 DWORD_PTR ve_valueptr;
102 DWORD ve_type;
103 }
104 alias value_entW VALENTW;
105 alias value_entW* PVALENTW;
106
107 // #ifdef UNICODE
108 alias VALENTW VALENT;
109 alias PVALENTW PVALENT;
110 // #else
111 // ...
112 // #endif // UNICODE
113
114 // #endif // not(_PROVIDER_STRUCTS_DEFINED)
115
116 // #endif /* WINVER >= 0x0400 */
117
118 alias NULL WIN31_CLASS;
119
120 extern(Windows) export LONG RegCloseKey(
121 HKEY hKey);
122
123 extern(Windows) export LONG RegOverridePredefKey(
124 HKEY hKey,
125 HKEY hNewHKey);
126
127 extern(Windows) export LONG RegOpenUserClassesRoot(
128 HANDLE hToken,
129 DWORD dwOptions,
130 REGSAM samDesired,
131 PHKEY phkResult);
132
133 extern(Windows) export LONG RegOpenCurrentUser(
134 REGSAM samDesired,
135 PHKEY phkResult);
136
137 extern(Windows) export LONG RegDisablePredefinedCache();
138
139 extern(Windows) export LONG RegConnectRegistryA(
140 LPCSTR lpMachineName,
141 HKEY hKey,
142 PHKEY phkResult);
143 extern(Windows) export LONG RegConnectRegistryW(
144 LPCWSTR lpMachineName,
145 HKEY hKey,
146 PHKEY phkResult);
147 // #ifdef UNICODE
148 alias RegConnectRegistryW RegConnectRegistry;
149 // #else
150 // #...
151 // #endif // !UNICODE
152
153 extern(Windows) export LONG RegCreateKeyA(
154 HKEY hKey,
155 LPCSTR lpSubKey,
156 PHKEY phkResult);
157 extern(Windows) export LONG RegCreateKeyW(
158 HKEY hKey,
159 LPCWSTR lpSubKey,
160 PHKEY phkResult);
161 // #ifdef UNICODE
162 alias RegCreateKeyW RegCreateKey;
163 // #else
164 // #...
165 // #endif // !UNICODE
166
167 extern(Windows) export LONG RegCreateKeyExA(
168 HKEY hKey,
169 LPCSTR lpSubKey,
170 DWORD Reserved,
171 LPSTR lpClass,
172 DWORD dwOptions,
173 REGSAM samDesired,
174 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
175 PHKEY phkResult,
176 LPDWORD lpdwDisposition);
177 extern(Windows) export LONG RegCreateKeyExW(
178 HKEY hKey,
179 LPCWSTR lpSubKey,
180 DWORD Reserved,
181 LPWSTR lpClass,
182 DWORD dwOptions,
183 REGSAM samDesired,
184 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
185 PHKEY phkResult,
186 LPDWORD lpdwDisposition);
187 // #ifdef UNICODE
188 alias RegCreateKeyExW RegCreateKeyEx;
189 // #else
190 // #...
191 // #endif // !UNICODE
192
193 extern(Windows) export LONG RegDeleteKeyA(
194 HKEY hKey,
195 LPCSTR lpSubKey);
196 extern(Windows) export LONG RegDeleteKeyW(
197 HKEY hKey,
198 LPCWSTR lpSubKey);
199 // #ifdef UNICODE
200 alias RegDeleteKeyW RegDeleteKey;
201 // #else
202 // #...
203 // #endif // !UNICODE
204
205 extern(Windows) export LONG RegDeleteValueA(
206 HKEY hKey,
207 LPCSTR lpValueName);
208 extern(Windows) export LONG RegDeleteValueW(
209 HKEY hKey,
210 LPCWSTR lpValueName);
211 // #ifdef UNICODE
212 alias RegDeleteValueW RegDeleteValue;
213 // #else
214 // #...
215 // #endif // !UNICODE
216
217 extern(Windows) export LONG RegEnumKeyA(
218 HKEY hKey,
219 DWORD dwIndex,
220 LPSTR lpName,
221 DWORD cbName);
222 extern(Windows) export LONG RegEnumKeyW(
223 HKEY hKey,
224 DWORD dwIndex,
225 LPWSTR lpName,
226 DWORD cbName);
227 // #ifdef UNICODE
228 alias RegEnumKeyW RegEnumKey;
229 // #else
230 // #...
231 // #endif // !UNICODE
232
233 extern(Windows) export LONG RegEnumKeyExA(
234 HKEY hKey,
235 DWORD dwIndex,
236 LPSTR lpName,
237 LPDWORD lpcbName,
238 LPDWORD lpReserved,
239 LPSTR lpClass,
240 LPDWORD lpcbClass,
241 PFILETIME lpftLastWriteTime);
242 extern(Windows) export LONG RegEnumKeyExW(
243 HKEY hKey,
244 DWORD dwIndex,
245 LPWSTR lpName,
246 LPDWORD lpcbName,
247 LPDWORD lpReserved,
248 LPWSTR lpClass,
249 LPDWORD lpcbClass,
250 PFILETIME lpftLastWriteTime);
251 // #ifdef UNICODE
252 alias RegEnumKeyExW RegEnumKeyEx;
253 // #else
254 // #...
255 // #endif // !UNICODE
256
257 extern(Windows) export LONG RegEnumValueA(
258 HKEY hKey,
259 DWORD dwIndex,
260 LPSTR lpValueName,
261 LPDWORD lpcbValueName,
262 LPDWORD lpReserved,
263 LPDWORD lpType,
264 LPBYTE lpData,
265 LPDWORD lpcbData);
266 extern(Windows) export LONG RegEnumValueW(
267 HKEY hKey,
268 DWORD dwIndex,
269 LPWSTR lpValueName,
270 LPDWORD lpcbValueName,
271 LPDWORD lpReserved,
272 LPDWORD lpType,
273 LPBYTE lpData,
274 LPDWORD lpcbData);
275 // #ifdef UNICODE
276 alias RegEnumValueW RegEnumValue;
277 // #else
278 // #...
279 // #endif // !UNICODE
280
281 extern(Windows) export LONG RegFlushKey(
282 HKEY hKey);
283
284 extern(Windows) export LONG RegGetKeySecurity(
285 HKEY hKey,
286 SECURITY_INFORMATION SecurityInformation,
287 PSECURITY_DESCRIPTOR pSecurityDescriptor,
288 LPDWORD lpcbSecurityDescriptor);
289
290 extern(Windows) export LONG RegLoadKeyA(
291 HKEY hKey,
292 LPCSTR lpSubKey,
293 LPCSTR lpFile);
294 extern(Windows) export LONG RegLoadKeyW(
295 HKEY hKey,
296 LPCWSTR lpSubKey,
297 LPCWSTR lpFile);
298 // #ifdef UNICODE
299 alias RegLoadKeyW RegLoadKey;
300 // #else
301 // #...
302 // #endif // !UNICODE
303
304 extern(Windows) export LONG RegNotifyChangeKeyValue(
305 HKEY hKey,
306 BOOL bWatchSubtree,
307 DWORD dwNotifyFilter,
308 HANDLE hEvent,
309 BOOL fAsynchronus);
310
311 extern(Windows) export LONG RegOpenKeyA(
312 HKEY hKey,
313 LPCSTR lpSubKey,
314 PHKEY phkResult);
315 extern(Windows) export LONG RegOpenKeyW(
316 HKEY hKey,
317 LPCWSTR lpSubKey,
318 PHKEY phkResult);
319 // #ifdef UNICODE
320 alias RegOpenKeyW RegOpenKey;
321 // #else
322 // #...
323 // #endif // !UNICODE
324
325 extern(Windows) export LONG RegOpenKeyExA(
326 HKEY hKey,
327 LPCSTR lpSubKey,
328 DWORD ulOptions,
329 REGSAM samDesired,
330 PHKEY phkResult);
331 extern(Windows) export LONG RegOpenKeyExW(
332 HKEY hKey,
333 LPCWSTR lpSubKey,
334 DWORD ulOptions,
335 REGSAM samDesired,
336 PHKEY phkResult);
337 // #ifdef UNICODE
338 alias RegOpenKeyExW RegOpenKeyEx;
339 // #else
340 // #...
341 // #endif // !UNICODE
342
343 extern(Windows) export LONG RegQueryInfoKeyA(
344 HKEY hKey,
345 LPSTR lpClass,
346 LPDWORD lpcbClass,
347 LPDWORD lpReserved,
348 LPDWORD lpcSubKeys,
349 LPDWORD lpcbMaxSubKeyLen,
350 LPDWORD lpcbMaxClassLen,
351 LPDWORD lpcValues,
352 LPDWORD lpcbMaxValueNameLen,
353 LPDWORD lpcbMaxValueLen,
354 LPDWORD lpcbSecurityDescriptor,
355 PFILETIME lpftLastWriteTime);
356 extern(Windows) export LONG RegQueryInfoKeyW(
357 HKEY hKey,
358 LPWSTR lpClass,
359 LPDWORD lpcbClass,
360 LPDWORD lpReserved,
361 LPDWORD lpcSubKeys,
362 LPDWORD lpcbMaxSubKeyLen,
363 LPDWORD lpcbMaxClassLen,
364 LPDWORD lpcValues,
365 LPDWORD lpcbMaxValueNameLen,
366 LPDWORD lpcbMaxValueLen,
367 LPDWORD lpcbSecurityDescriptor,
368 PFILETIME lpftLastWriteTime);
369 // #ifdef UNICODE
370 alias RegQueryInfoKeyW RegQueryInfoKey;
371 // #else
372 // #...
373 // #endif // !UNICODE
374
375 extern(Windows) export LONG RegQueryValueA(
376 HKEY hKey,
377 LPCSTR lpSubKey,
378 LPSTR lpValue,
379 PLONG lpcbValue);
380 extern(Windows) export LONG RegQueryValueW(
381 HKEY hKey,
382 LPCWSTR lpSubKey,
383 LPWSTR lpValue,
384 PLONG lpcbValue);
385 // #ifdef UNICODE
386 alias RegQueryValueW RegQueryValue;
387 // #else
388 // #...
389 // #endif // !UNICODE
390
391 // #if(WINVER >= 0x0400)
392 extern(Windows) export LONG RegQueryMultipleValuesA(
393 HKEY hKey,
394 PVALENTA val_list,
395 DWORD num_vals,
396 LPSTR lpValueBuf,
397 LPDWORD ldwTotsize);
398 extern(Windows) export LONG RegQueryMultipleValuesW(
399 HKEY hKey,
400 PVALENTW val_list,
401 DWORD num_vals,
402 LPWSTR lpValueBuf,
403 LPDWORD ldwTotsize);
404 // #ifdef UNICODE
405 alias RegQueryMultipleValuesW RegQueryMultipleValues;
406 // #else
407 // #...
408 // #endif // !UNICODE
409 // #endif /* WINVER >= 0x0400 */
410
411 extern(Windows) export LONG RegQueryValueExA(
412 HKEY hKey,
413 LPCSTR lpValueName,
414 LPDWORD lpReserved,
415 LPDWORD lpType,
416 LPBYTE lpData,
417 LPDWORD lpcbData);
418 extern(Windows) export LONG RegQueryValueExW(
419 HKEY hKey,
420 LPCWSTR lpValueName,
421 LPDWORD lpReserved,
422 LPDWORD lpType,
423 LPBYTE lpData,
424 LPDWORD lpcbData);
425 // #ifdef UNICODE
426 alias RegQueryValueExW RegQueryValueEx;
427 // #else
428 // #...
429 // #endif // !UNICODE
430
431 extern(Windows) export LONG RegReplaceKeyA(
432 HKEY hKey,
433 LPCSTR lpSubKey,
434 LPCSTR lpNewFile,
435 LPCSTR lpOldFile);
436 extern(Windows) export LONG RegReplaceKeyW(
437 HKEY hKey,
438 LPCWSTR lpSubKey,
439 LPCWSTR lpNewFile,
440 LPCWSTR lpOldFile);
441 // #ifdef UNICODE
442 alias RegReplaceKeyW RegReplaceKey;
443 // #else
444 // #...
445 // #endif // !UNICODE
446
447 extern(Windows) export LONG RegRestoreKeyA(
448 HKEY hKey,
449 LPCSTR lpFile,
450 DWORD dwFlags);
451 extern(Windows) export LONG RegRestoreKeyW(
452 HKEY hKey,
453 LPCWSTR lpFile,
454 DWORD dwFlags);
455 // #ifdef UNICODE
456 alias RegRestoreKeyW RegRestoreKey;
457 // #else
458 // #...
459 // #endif // !UNICODE
460
461 extern(Windows) export LONG RegSaveKeyA(
462 HKEY hKey,
463 LPCSTR lpFile,
464 LPSECURITY_ATTRIBUTES lpSecurityAttributes);
465 extern(Windows) export LONG RegSaveKeyW(
466 HKEY hKey,
467 LPCWSTR lpFile,
468 LPSECURITY_ATTRIBUTES lpSecurityAttributes);
469 // #ifdef UNICODE
470 alias RegSaveKeyW RegSaveKey;
471 // #else
472 // #...
473 // #endif // !UNICODE
474
475 extern(Windows) export LONG RegSetKeySecurity(
476 HKEY hKey,
477 SECURITY_INFORMATION SecurityInformation,
478 PSECURITY_DESCRIPTOR pSecurityDescriptor);
479
480 extern(Windows) export LONG RegSetValueA(
481 HKEY hKey,
482 LPCSTR lpSubKey,
483 DWORD dwType,
484 LPCSTR lpData,
485 DWORD cbData);
486 extern(Windows) export LONG RegSetValueW(
487 HKEY hKey,
488 LPCWSTR lpSubKey,
489 DWORD dwType,
490 LPCWSTR lpData,
491 DWORD cbData);
492 // #ifdef UNICODE
493 alias RegSetValueW RegSetValue;
494 // #else
495 // #...
496 // #endif // !UNICODE
497
498 extern(Windows) export LONG RegSetValueExA(
499 HKEY hKey,
500 LPCSTR lpValueName,
501 DWORD Reserved,
502 DWORD dwType,
503 BYTE* lpData,
504 DWORD cbData);
505 extern(Windows) export LONG RegSetValueExW(
506 HKEY hKey,
507 LPCWSTR lpValueName,
508 DWORD Reserved,
509 DWORD dwType,
510 BYTE* lpData,
511 DWORD cbData);
512 // #ifdef UNICODE
513 alias RegSetValueExW RegSetValueEx;
514 // #else
515 // #...
516 // #endif // !UNICODE
517
518 extern(Windows) export LONG RegUnLoadKeyA(
519 HKEY hKey,
520 LPCSTR lpSubKey);
521 extern(Windows) export LONG RegUnLoadKeyW(
522 HKEY hKey,
523 LPCWSTR lpSubKey);
524 // #ifdef UNICODE
525 alias RegUnLoadKeyW RegUnLoadKey;
526 // #else
527 // #...
528 // #endif // !UNICODE
529
530 extern(Windows) export BOOL InitiateSystemShutdownA(
531 LPSTR lpMachineName,
532 LPSTR lpMessage,
533 DWORD dwTimeout,
534 BOOL bForceAppsClosed,
535 BOOL bRebootAfterShutdown);
536 extern(Windows) export BOOL InitiateSystemShutdownW(
537 LPWSTR lpMachineName,
538 LPWSTR lpMessage,
539 DWORD dwTimeout,
540 BOOL bForceAppsClosed,
541 BOOL bRebootAfterShutdown);
542 // #ifdef UNICODE
543 alias InitiateSystemShutdownW InitiateSystemShutdown;
544 // #else
545 // #...
546 // #endif // !UNICODE
547
548 extern(Windows) export BOOL AbortSystemShutdownA(
549 LPSTR lpMachineName);
550 extern(Windows) export BOOL AbortSystemShutdownW(
551 LPWSTR lpMachineName);
552 // #ifdef UNICODE
553 alias AbortSystemShutdownW AbortSystemShutdown;
554 // #else
555 // #...
556 // #endif // !UNICODE
557
558 // inline #include <reason.h>
559 // ----
560
561 // #if !defined SENTINEL_Reason
562 // # define SENTINEL_Reason
563
564 enum : uint { SHTDN_REASON_FLAG_COMMENT_REQUIRED = 0x01000000 }
565 enum : uint { SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = 0x02000000 }
566 enum : uint { SHTDN_REASON_FLAG_CLEAN_UI = 0x04000000 }
567 enum : uint { SHTDN_REASON_FLAG_DIRTY_UI = 0x08000000 }
568
569 enum : uint { SHTDN_REASON_FLAG_USER_DEFINED = 0x40000000 }
570 enum : uint { SHTDN_REASON_FLAG_PLANNED = 0x80000000 }
571
572 enum : uint { SHTDN_REASON_MAJOR_OTHER = 0x00000000 }
573 enum : uint { SHTDN_REASON_MAJOR_NONE = 0x00000000 }
574 enum : uint { SHTDN_REASON_MAJOR_HARDWARE = 0x00010000 }
575 enum : uint { SHTDN_REASON_MAJOR_OPERATINGSYSTEM = 0x00020000 }
576 enum : uint { SHTDN_REASON_MAJOR_SOFTWARE = 0x00030000 }
577 enum : uint { SHTDN_REASON_MAJOR_APPLICATION = 0x00040000 }
578 enum : uint { SHTDN_REASON_MAJOR_SYSTEM = 0x00050000 }
579 enum : uint { SHTDN_REASON_MAJOR_POWER = 0x00060000 }
580
581 enum : uint { SHTDN_REASON_MINOR_OTHER = 0x00000000 }
582 enum : uint { SHTDN_REASON_MINOR_NONE = 0x000000ff }
583 enum : uint { SHTDN_REASON_MINOR_MAINTENANCE = 0x00000001 }
584 enum : uint { SHTDN_REASON_MINOR_INSTALLATION = 0x00000002 }
585 enum : uint { SHTDN_REASON_MINOR_UPGRADE = 0x00000003 }
586 enum : uint { SHTDN_REASON_MINOR_RECONFIG = 0x00000004 }
587 enum : uint { SHTDN_REASON_MINOR_HUNG = 0x00000005 }
588 enum : uint { SHTDN_REASON_MINOR_UNSTABLE = 0x00000006 }
589 enum : uint { SHTDN_REASON_MINOR_DISK = 0x00000007 }
590 enum : uint { SHTDN_REASON_MINOR_PROCESSOR = 0x00000008 }
591 enum : uint { SHTDN_REASON_MINOR_NETWORKCARD = 0x00000009 }
592 enum : uint { SHTDN_REASON_MINOR_POWER_SUPPLY = 0x0000000a }
593 enum : uint { SHTDN_REASON_MINOR_CORDUNPLUGGED = 0x0000000b }
594 enum : uint { SHTDN_REASON_MINOR_ENVIRONMENT = 0x0000000c }
595 enum : uint { SHTDN_REASON_MINOR_HARDWARE_DRIVER = 0x0000000d }
596 enum : uint { SHTDN_REASON_MINOR_OTHERDRIVER = 0x0000000e }
597 enum : uint { SHTDN_REASON_MINOR_BLUESCREEN = 0x0000000F }
598
599 alias SHTDN_REASON_MINOR_NONE SHTDN_REASON_UNKNOWN;
600
601 enum : uint { SHTDN_REASON_VALID_BIT_MASK = 0xc0ffffff }
602
603 enum : uint { PCLEANUI = SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_CLEAN_UI }
604 enum : uint { UCLEANUI = SHTDN_REASON_FLAG_CLEAN_UI }
605 enum : uint { UDIRTYUI = SHTDN_REASON_FLAG_DIRTY_UI }
606
607 enum : uint { MAX_REASON_NAME_LEN = 64 }
608 enum : uint { MAX_REASON_DESC_LEN = 256 }
609 enum : uint { MAX_REASON_BUGID_LEN = 32 }
610 enum : uint { MAX_REASON_COMMENT_LEN = 4096 }
611
612 // #endif // !defined SENTINEL_Reason
613 // ----
614
615 enum : uint { REASON_SWINSTALL = SHTDN_REASON_MAJOR_SOFTWARE | SHTDN_REASON_MINOR_INSTALLATION }
616 enum : uint { REASON_HWINSTALL = SHTDN_REASON_MAJOR_HARDWARE | SHTDN_REASON_MINOR_INSTALLATION }
617 enum : uint { REASON_SERVICEHANG = SHTDN_REASON_MAJOR_SOFTWARE | SHTDN_REASON_MINOR_HUNG }
618 enum : uint { REASON_UNSTABLE = SHTDN_REASON_MAJOR_SYSTEM | SHTDN_REASON_MINOR_UNSTABLE }
619 enum : uint { REASON_SWHWRECONF = SHTDN_REASON_MAJOR_SOFTWARE | SHTDN_REASON_MINOR_RECONFIG }
620 enum : uint { REASON_OTHER = SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER }
621 alias SHTDN_REASON_UNKNOWN REASON_UNKNOWN;
622 alias SHTDN_REASON_FLAG_PLANNED REASON_PLANNED_FLAG;
623
624 extern(Windows) export BOOL InitiateSystemShutdownExA(
625 LPSTR lpMachineName,
626 LPSTR lpMessage,
627 DWORD dwTimeout,
628 BOOL bForceAppsClosed,
629 BOOL bRebootAfterShutdown,
630 DWORD dwReason);
631 extern(Windows) export BOOL InitiateSystemShutdownExW(
632 LPWSTR lpMachineName,
633 LPWSTR lpMessage,
634 DWORD dwTimeout,
635 BOOL bForceAppsClosed,
636 BOOL bRebootAfterShutdown,
637 DWORD dwReason);
638 // #ifdef UNICODE
639 alias InitiateSystemShutdownExW InitiateSystemShutdownEx;
640 // #else
641 // #...
642 // #endif // !UNICODE
643
644 extern(Windows) export LONG RegSaveKeyExA(
645 HKEY hKey,
646 LPCSTR lpFile,
647 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
648 DWORD Flags);
649 extern(Windows) export LONG RegSaveKeyExW(
650 HKEY hKey,
651 LPCWSTR lpFile,
652 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
653 DWORD Flags);
654 // #ifdef UNICODE
655 alias RegSaveKeyExW RegSaveKeyEx;
656 // #else
657 // #...
658 // #endif // !UNICODE
659
660 extern(Windows) export LONG Wow64Win32ApiEntry(
661 DWORD dwFuncNumber,
662 DWORD dwFlag,
663 DWORD dwRes);
664
665 // #ifdef __cplusplus
666 // }
667 // #endif
668
669 // #endif // _WINREG_
670