Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

896 lines
18 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. Winreg.h
  5. Abstract:
  6. This module contains the function prototypes and constant, type and
  7. structure definitions for the Windows 32-Bit Registry API.
  8. --*/
  9. #ifndef _WINREG_
  10. #define _WINREG_
  11. #ifdef _MAC
  12. #include <macwin32.h>
  13. #endif
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #ifndef WINVER
  18. #define WINVER 0x0500 // version 5.0
  19. #endif /* !WINVER */
  20. //
  21. // Requested Key access mask type.
  22. //
  23. typedef ACCESS_MASK REGSAM;
  24. //
  25. // Reserved Key Handles.
  26. //
  27. #define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x80000000) )
  28. #define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x80000001) )
  29. #define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x80000002) )
  30. #define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x80000003) )
  31. #define HKEY_PERFORMANCE_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000004) )
  32. #define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000050) )
  33. #define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000060) )
  34. #if(WINVER >= 0x0400)
  35. #define HKEY_CURRENT_CONFIG (( HKEY ) (ULONG_PTR)((LONG)0x80000005) )
  36. #define HKEY_DYN_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000006) )
  37. /*NOINC*/
  38. #ifndef _PROVIDER_STRUCTS_DEFINED
  39. #define _PROVIDER_STRUCTS_DEFINED
  40. #define PROVIDER_KEEPS_VALUE_LENGTH 0x1
  41. struct val_context {
  42. int valuelen; // the total length of this value
  43. LPVOID value_context; // provider's context
  44. LPVOID val_buff_ptr; // where in the ouput buffer the value is.
  45. };
  46. typedef struct val_context FAR *PVALCONTEXT;
  47. typedef struct pvalueA { // Provider supplied value/context.
  48. LPSTR pv_valuename; // The value name pointer
  49. int pv_valuelen;
  50. LPVOID pv_value_context;
  51. DWORD pv_type;
  52. }PVALUEA, FAR *PPVALUEA;
  53. typedef struct pvalueW { // Provider supplied value/context.
  54. LPWSTR pv_valuename; // The value name pointer
  55. int pv_valuelen;
  56. LPVOID pv_value_context;
  57. DWORD pv_type;
  58. }PVALUEW, FAR *PPVALUEW;
  59. #ifdef UNICODE
  60. typedef PVALUEW PVALUE;
  61. typedef PPVALUEW PPVALUE;
  62. #else
  63. typedef PVALUEA PVALUE;
  64. typedef PPVALUEA PPVALUE;
  65. #endif // UNICODE
  66. typedef
  67. DWORD _cdecl
  68. QUERYHANDLER (LPVOID keycontext, PVALCONTEXT val_list, DWORD num_vals,
  69. LPVOID outputbuffer, DWORD FAR *total_outlen, DWORD input_blen);
  70. typedef QUERYHANDLER FAR *PQUERYHANDLER;
  71. typedef struct provider_info {
  72. PQUERYHANDLER pi_R0_1val;
  73. PQUERYHANDLER pi_R0_allvals;
  74. PQUERYHANDLER pi_R3_1val;
  75. PQUERYHANDLER pi_R3_allvals;
  76. DWORD pi_flags; // capability flags (none defined yet).
  77. LPVOID pi_key_context;
  78. }REG_PROVIDER;
  79. typedef struct provider_info FAR *PPROVIDER;
  80. typedef struct value_entA {
  81. LPSTR ve_valuename;
  82. DWORD ve_valuelen;
  83. DWORD_PTR ve_valueptr;
  84. DWORD ve_type;
  85. }VALENTA, FAR *PVALENTA;
  86. typedef struct value_entW {
  87. LPWSTR ve_valuename;
  88. DWORD ve_valuelen;
  89. DWORD_PTR ve_valueptr;
  90. DWORD ve_type;
  91. }VALENTW, FAR *PVALENTW;
  92. #ifdef UNICODE
  93. typedef VALENTW VALENT;
  94. typedef PVALENTW PVALENT;
  95. #else
  96. typedef VALENTA VALENT;
  97. typedef PVALENTA PVALENT;
  98. #endif // UNICODE
  99. #endif // not(_PROVIDER_STRUCTS_DEFINED)
  100. /*INC*/
  101. #endif /* WINVER >= 0x0400 */
  102. //
  103. // Default values for parameters that do not exist in the Win 3.1
  104. // compatible APIs.
  105. //
  106. #define WIN31_CLASS NULL
  107. //
  108. // API Prototypes.
  109. //
  110. WINADVAPI
  111. LONG
  112. APIENTRY
  113. RegCloseKey (
  114. IN HKEY hKey
  115. );
  116. WINADVAPI
  117. LONG
  118. APIENTRY
  119. RegOverridePredefKey (
  120. IN HKEY hKey,
  121. IN HKEY hNewHKey
  122. );
  123. WINADVAPI
  124. LONG
  125. APIENTRY
  126. RegOpenUserClassesRoot(
  127. HANDLE hToken,
  128. DWORD dwOptions,
  129. REGSAM samDesired,
  130. PHKEY phkResult
  131. );
  132. WINADVAPI
  133. LONG
  134. APIENTRY
  135. RegOpenCurrentUser(
  136. REGSAM samDesired,
  137. PHKEY phkResult
  138. );
  139. WINADVAPI
  140. LONG
  141. APIENTRY
  142. RegDisablePredefinedCache(
  143. );
  144. WINADVAPI
  145. LONG
  146. APIENTRY
  147. RegConnectRegistryA (
  148. IN LPCSTR lpMachineName,
  149. IN HKEY hKey,
  150. OUT PHKEY phkResult
  151. );
  152. WINADVAPI
  153. LONG
  154. APIENTRY
  155. RegConnectRegistryW (
  156. IN LPCWSTR lpMachineName,
  157. IN HKEY hKey,
  158. OUT PHKEY phkResult
  159. );
  160. #ifdef UNICODE
  161. #define RegConnectRegistry RegConnectRegistryW
  162. #else
  163. #define RegConnectRegistry RegConnectRegistryA
  164. #endif // !UNICODE
  165. WINADVAPI
  166. LONG
  167. APIENTRY
  168. RegCreateKeyA (
  169. IN HKEY hKey,
  170. IN LPCSTR lpSubKey,
  171. OUT PHKEY phkResult
  172. );
  173. WINADVAPI
  174. LONG
  175. APIENTRY
  176. RegCreateKeyW (
  177. IN HKEY hKey,
  178. IN LPCWSTR lpSubKey,
  179. OUT PHKEY phkResult
  180. );
  181. #ifdef UNICODE
  182. #define RegCreateKey RegCreateKeyW
  183. #else
  184. #define RegCreateKey RegCreateKeyA
  185. #endif // !UNICODE
  186. WINADVAPI
  187. LONG
  188. APIENTRY
  189. RegCreateKeyExA (
  190. IN HKEY hKey,
  191. IN LPCSTR lpSubKey,
  192. IN DWORD Reserved,
  193. IN LPSTR lpClass,
  194. IN DWORD dwOptions,
  195. IN REGSAM samDesired,
  196. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  197. OUT PHKEY phkResult,
  198. OUT LPDWORD lpdwDisposition
  199. );
  200. WINADVAPI
  201. LONG
  202. APIENTRY
  203. RegCreateKeyExW (
  204. IN HKEY hKey,
  205. IN LPCWSTR lpSubKey,
  206. IN DWORD Reserved,
  207. IN LPWSTR lpClass,
  208. IN DWORD dwOptions,
  209. IN REGSAM samDesired,
  210. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  211. OUT PHKEY phkResult,
  212. OUT LPDWORD lpdwDisposition
  213. );
  214. #ifdef UNICODE
  215. #define RegCreateKeyEx RegCreateKeyExW
  216. #else
  217. #define RegCreateKeyEx RegCreateKeyExA
  218. #endif // !UNICODE
  219. WINADVAPI
  220. LONG
  221. APIENTRY
  222. RegDeleteKeyA (
  223. IN HKEY hKey,
  224. IN LPCSTR lpSubKey
  225. );
  226. WINADVAPI
  227. LONG
  228. APIENTRY
  229. RegDeleteKeyW (
  230. IN HKEY hKey,
  231. IN LPCWSTR lpSubKey
  232. );
  233. #ifdef UNICODE
  234. #define RegDeleteKey RegDeleteKeyW
  235. #else
  236. #define RegDeleteKey RegDeleteKeyA
  237. #endif // !UNICODE
  238. WINADVAPI
  239. LONG
  240. APIENTRY
  241. RegDeleteValueA (
  242. IN HKEY hKey,
  243. IN LPCSTR lpValueName
  244. );
  245. WINADVAPI
  246. LONG
  247. APIENTRY
  248. RegDeleteValueW (
  249. IN HKEY hKey,
  250. IN LPCWSTR lpValueName
  251. );
  252. #ifdef UNICODE
  253. #define RegDeleteValue RegDeleteValueW
  254. #else
  255. #define RegDeleteValue RegDeleteValueA
  256. #endif // !UNICODE
  257. WINADVAPI
  258. LONG
  259. APIENTRY
  260. RegEnumKeyA (
  261. IN HKEY hKey,
  262. IN DWORD dwIndex,
  263. OUT LPSTR lpName,
  264. IN DWORD cbName
  265. );
  266. WINADVAPI
  267. LONG
  268. APIENTRY
  269. RegEnumKeyW (
  270. IN HKEY hKey,
  271. IN DWORD dwIndex,
  272. OUT LPWSTR lpName,
  273. IN DWORD cbName
  274. );
  275. #ifdef UNICODE
  276. #define RegEnumKey RegEnumKeyW
  277. #else
  278. #define RegEnumKey RegEnumKeyA
  279. #endif // !UNICODE
  280. WINADVAPI
  281. LONG
  282. APIENTRY
  283. RegEnumKeyExA (
  284. IN HKEY hKey,
  285. IN DWORD dwIndex,
  286. OUT LPSTR lpName,
  287. IN OUT LPDWORD lpcbName,
  288. IN LPDWORD lpReserved,
  289. IN OUT LPSTR lpClass,
  290. IN OUT LPDWORD lpcbClass,
  291. OUT PFILETIME lpftLastWriteTime
  292. );
  293. WINADVAPI
  294. LONG
  295. APIENTRY
  296. RegEnumKeyExW (
  297. IN HKEY hKey,
  298. IN DWORD dwIndex,
  299. OUT LPWSTR lpName,
  300. IN OUT LPDWORD lpcbName,
  301. IN LPDWORD lpReserved,
  302. IN OUT LPWSTR lpClass,
  303. IN OUT LPDWORD lpcbClass,
  304. OUT PFILETIME lpftLastWriteTime
  305. );
  306. #ifdef UNICODE
  307. #define RegEnumKeyEx RegEnumKeyExW
  308. #else
  309. #define RegEnumKeyEx RegEnumKeyExA
  310. #endif // !UNICODE
  311. WINADVAPI
  312. LONG
  313. APIENTRY
  314. RegEnumValueA (
  315. IN HKEY hKey,
  316. IN DWORD dwIndex,
  317. OUT LPSTR lpValueName,
  318. IN OUT LPDWORD lpcbValueName,
  319. IN LPDWORD lpReserved,
  320. OUT LPDWORD lpType,
  321. OUT LPBYTE lpData,
  322. IN OUT LPDWORD lpcbData
  323. );
  324. WINADVAPI
  325. LONG
  326. APIENTRY
  327. RegEnumValueW (
  328. IN HKEY hKey,
  329. IN DWORD dwIndex,
  330. OUT LPWSTR lpValueName,
  331. IN OUT LPDWORD lpcbValueName,
  332. IN LPDWORD lpReserved,
  333. OUT LPDWORD lpType,
  334. OUT LPBYTE lpData,
  335. IN OUT LPDWORD lpcbData
  336. );
  337. #ifdef UNICODE
  338. #define RegEnumValue RegEnumValueW
  339. #else
  340. #define RegEnumValue RegEnumValueA
  341. #endif // !UNICODE
  342. WINADVAPI
  343. LONG
  344. APIENTRY
  345. RegFlushKey (
  346. IN HKEY hKey
  347. );
  348. WINADVAPI
  349. LONG
  350. APIENTRY
  351. RegGetKeySecurity (
  352. IN HKEY hKey,
  353. IN SECURITY_INFORMATION SecurityInformation,
  354. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  355. IN OUT LPDWORD lpcbSecurityDescriptor
  356. );
  357. WINADVAPI
  358. LONG
  359. APIENTRY
  360. RegLoadKeyA (
  361. IN HKEY hKey,
  362. IN LPCSTR lpSubKey,
  363. IN LPCSTR lpFile
  364. );
  365. WINADVAPI
  366. LONG
  367. APIENTRY
  368. RegLoadKeyW (
  369. IN HKEY hKey,
  370. IN LPCWSTR lpSubKey,
  371. IN LPCWSTR lpFile
  372. );
  373. #ifdef UNICODE
  374. #define RegLoadKey RegLoadKeyW
  375. #else
  376. #define RegLoadKey RegLoadKeyA
  377. #endif // !UNICODE
  378. WINADVAPI
  379. LONG
  380. APIENTRY
  381. RegNotifyChangeKeyValue (
  382. IN HKEY hKey,
  383. IN BOOL bWatchSubtree,
  384. IN DWORD dwNotifyFilter,
  385. IN HANDLE hEvent,
  386. IN BOOL fAsynchronus
  387. );
  388. WINADVAPI
  389. LONG
  390. APIENTRY
  391. RegOpenKeyA (
  392. IN HKEY hKey,
  393. IN LPCSTR lpSubKey,
  394. OUT PHKEY phkResult
  395. );
  396. WINADVAPI
  397. LONG
  398. APIENTRY
  399. RegOpenKeyW (
  400. IN HKEY hKey,
  401. IN LPCWSTR lpSubKey,
  402. OUT PHKEY phkResult
  403. );
  404. #ifdef UNICODE
  405. #define RegOpenKey RegOpenKeyW
  406. #else
  407. #define RegOpenKey RegOpenKeyA
  408. #endif // !UNICODE
  409. WINADVAPI
  410. LONG
  411. APIENTRY
  412. RegOpenKeyExA (
  413. IN HKEY hKey,
  414. IN LPCSTR lpSubKey,
  415. IN DWORD ulOptions,
  416. IN REGSAM samDesired,
  417. OUT PHKEY phkResult
  418. );
  419. WINADVAPI
  420. LONG
  421. APIENTRY
  422. RegOpenKeyExW (
  423. IN HKEY hKey,
  424. IN LPCWSTR lpSubKey,
  425. IN DWORD ulOptions,
  426. IN REGSAM samDesired,
  427. OUT PHKEY phkResult
  428. );
  429. #ifdef UNICODE
  430. #define RegOpenKeyEx RegOpenKeyExW
  431. #else
  432. #define RegOpenKeyEx RegOpenKeyExA
  433. #endif // !UNICODE
  434. WINADVAPI
  435. LONG
  436. APIENTRY
  437. RegQueryInfoKeyA (
  438. IN HKEY hKey,
  439. OUT LPSTR lpClass,
  440. IN OUT LPDWORD lpcbClass,
  441. IN LPDWORD lpReserved,
  442. OUT LPDWORD lpcSubKeys,
  443. OUT LPDWORD lpcbMaxSubKeyLen,
  444. OUT LPDWORD lpcbMaxClassLen,
  445. OUT LPDWORD lpcValues,
  446. OUT LPDWORD lpcbMaxValueNameLen,
  447. OUT LPDWORD lpcbMaxValueLen,
  448. OUT LPDWORD lpcbSecurityDescriptor,
  449. OUT PFILETIME lpftLastWriteTime
  450. );
  451. WINADVAPI
  452. LONG
  453. APIENTRY
  454. RegQueryInfoKeyW (
  455. IN HKEY hKey,
  456. OUT LPWSTR lpClass,
  457. IN OUT LPDWORD lpcbClass,
  458. IN LPDWORD lpReserved,
  459. OUT LPDWORD lpcSubKeys,
  460. OUT LPDWORD lpcbMaxSubKeyLen,
  461. OUT LPDWORD lpcbMaxClassLen,
  462. OUT LPDWORD lpcValues,
  463. OUT LPDWORD lpcbMaxValueNameLen,
  464. OUT LPDWORD lpcbMaxValueLen,
  465. OUT LPDWORD lpcbSecurityDescriptor,
  466. OUT PFILETIME lpftLastWriteTime
  467. );
  468. #ifdef UNICODE
  469. #define RegQueryInfoKey RegQueryInfoKeyW
  470. #else
  471. #define RegQueryInfoKey RegQueryInfoKeyA
  472. #endif // !UNICODE
  473. WINADVAPI
  474. LONG
  475. APIENTRY
  476. RegQueryValueA (
  477. IN HKEY hKey,
  478. IN LPCSTR lpSubKey,
  479. OUT LPSTR lpValue,
  480. IN OUT PLONG lpcbValue
  481. );
  482. WINADVAPI
  483. LONG
  484. APIENTRY
  485. RegQueryValueW (
  486. IN HKEY hKey,
  487. IN LPCWSTR lpSubKey,
  488. OUT LPWSTR lpValue,
  489. IN OUT PLONG lpcbValue
  490. );
  491. #ifdef UNICODE
  492. #define RegQueryValue RegQueryValueW
  493. #else
  494. #define RegQueryValue RegQueryValueA
  495. #endif // !UNICODE
  496. #if(WINVER >= 0x0400)
  497. WINADVAPI
  498. LONG
  499. APIENTRY
  500. RegQueryMultipleValuesA (
  501. IN HKEY hKey,
  502. OUT PVALENTA val_list,
  503. IN DWORD num_vals,
  504. OUT LPSTR lpValueBuf,
  505. IN OUT LPDWORD ldwTotsize
  506. );
  507. WINADVAPI
  508. LONG
  509. APIENTRY
  510. RegQueryMultipleValuesW (
  511. IN HKEY hKey,
  512. OUT PVALENTW val_list,
  513. IN DWORD num_vals,
  514. OUT LPWSTR lpValueBuf,
  515. IN OUT LPDWORD ldwTotsize
  516. );
  517. #ifdef UNICODE
  518. #define RegQueryMultipleValues RegQueryMultipleValuesW
  519. #else
  520. #define RegQueryMultipleValues RegQueryMultipleValuesA
  521. #endif // !UNICODE
  522. #endif /* WINVER >= 0x0400 */
  523. WINADVAPI
  524. LONG
  525. APIENTRY
  526. RegQueryValueExA (
  527. IN HKEY hKey,
  528. IN LPCSTR lpValueName,
  529. IN LPDWORD lpReserved,
  530. OUT LPDWORD lpType,
  531. IN OUT LPBYTE lpData,
  532. IN OUT LPDWORD lpcbData
  533. );
  534. WINADVAPI
  535. LONG
  536. APIENTRY
  537. RegQueryValueExW (
  538. IN HKEY hKey,
  539. IN LPCWSTR lpValueName,
  540. IN LPDWORD lpReserved,
  541. OUT LPDWORD lpType,
  542. IN OUT LPBYTE lpData,
  543. IN OUT LPDWORD lpcbData
  544. );
  545. #ifdef UNICODE
  546. #define RegQueryValueEx RegQueryValueExW
  547. #else
  548. #define RegQueryValueEx RegQueryValueExA
  549. #endif // !UNICODE
  550. WINADVAPI
  551. LONG
  552. APIENTRY
  553. RegReplaceKeyA (
  554. IN HKEY hKey,
  555. IN LPCSTR lpSubKey,
  556. IN LPCSTR lpNewFile,
  557. IN LPCSTR lpOldFile
  558. );
  559. WINADVAPI
  560. LONG
  561. APIENTRY
  562. RegReplaceKeyW (
  563. IN HKEY hKey,
  564. IN LPCWSTR lpSubKey,
  565. IN LPCWSTR lpNewFile,
  566. IN LPCWSTR lpOldFile
  567. );
  568. #ifdef UNICODE
  569. #define RegReplaceKey RegReplaceKeyW
  570. #else
  571. #define RegReplaceKey RegReplaceKeyA
  572. #endif // !UNICODE
  573. WINADVAPI
  574. LONG
  575. APIENTRY
  576. RegRestoreKeyA (
  577. IN HKEY hKey,
  578. IN LPCSTR lpFile,
  579. IN DWORD dwFlags
  580. );
  581. WINADVAPI
  582. LONG
  583. APIENTRY
  584. RegRestoreKeyW (
  585. IN HKEY hKey,
  586. IN LPCWSTR lpFile,
  587. IN DWORD dwFlags
  588. );
  589. #ifdef UNICODE
  590. #define RegRestoreKey RegRestoreKeyW
  591. #else
  592. #define RegRestoreKey RegRestoreKeyA
  593. #endif // !UNICODE
  594. WINADVAPI
  595. LONG
  596. APIENTRY
  597. RegSaveKeyA (
  598. IN HKEY hKey,
  599. IN LPCSTR lpFile,
  600. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  601. );
  602. WINADVAPI
  603. LONG
  604. APIENTRY
  605. RegSaveKeyW (
  606. IN HKEY hKey,
  607. IN LPCWSTR lpFile,
  608. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  609. );
  610. #ifdef UNICODE
  611. #define RegSaveKey RegSaveKeyW
  612. #else
  613. #define RegSaveKey RegSaveKeyA
  614. #endif // !UNICODE
  615. WINADVAPI
  616. LONG
  617. APIENTRY
  618. RegSetKeySecurity (
  619. IN HKEY hKey,
  620. IN SECURITY_INFORMATION SecurityInformation,
  621. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  622. );
  623. WINADVAPI
  624. LONG
  625. APIENTRY
  626. RegSetValueA (
  627. IN HKEY hKey,
  628. IN LPCSTR lpSubKey,
  629. IN DWORD dwType,
  630. IN LPCSTR lpData,
  631. IN DWORD cbData
  632. );
  633. WINADVAPI
  634. LONG
  635. APIENTRY
  636. RegSetValueW (
  637. IN HKEY hKey,
  638. IN LPCWSTR lpSubKey,
  639. IN DWORD dwType,
  640. IN LPCWSTR lpData,
  641. IN DWORD cbData
  642. );
  643. #ifdef UNICODE
  644. #define RegSetValue RegSetValueW
  645. #else
  646. #define RegSetValue RegSetValueA
  647. #endif // !UNICODE
  648. WINADVAPI
  649. LONG
  650. APIENTRY
  651. RegSetValueExA (
  652. IN HKEY hKey,
  653. IN LPCSTR lpValueName,
  654. IN DWORD Reserved,
  655. IN DWORD dwType,
  656. IN CONST BYTE* lpData,
  657. IN DWORD cbData
  658. );
  659. WINADVAPI
  660. LONG
  661. APIENTRY
  662. RegSetValueExW (
  663. IN HKEY hKey,
  664. IN LPCWSTR lpValueName,
  665. IN DWORD Reserved,
  666. IN DWORD dwType,
  667. IN CONST BYTE* lpData,
  668. IN DWORD cbData
  669. );
  670. #ifdef UNICODE
  671. #define RegSetValueEx RegSetValueExW
  672. #else
  673. #define RegSetValueEx RegSetValueExA
  674. #endif // !UNICODE
  675. WINADVAPI
  676. LONG
  677. APIENTRY
  678. RegUnLoadKeyA (
  679. IN HKEY hKey,
  680. IN LPCSTR lpSubKey
  681. );
  682. WINADVAPI
  683. LONG
  684. APIENTRY
  685. RegUnLoadKeyW (
  686. IN HKEY hKey,
  687. IN LPCWSTR lpSubKey
  688. );
  689. #ifdef UNICODE
  690. #define RegUnLoadKey RegUnLoadKeyW
  691. #else
  692. #define RegUnLoadKey RegUnLoadKeyA
  693. #endif // !UNICODE
  694. //
  695. // Remoteable System Shutdown APIs
  696. //
  697. WINADVAPI
  698. BOOL
  699. APIENTRY
  700. InitiateSystemShutdownA(
  701. IN LPSTR lpMachineName,
  702. IN LPSTR lpMessage,
  703. IN DWORD dwTimeout,
  704. IN BOOL bForceAppsClosed,
  705. IN BOOL bRebootAfterShutdown
  706. );
  707. WINADVAPI
  708. BOOL
  709. APIENTRY
  710. InitiateSystemShutdownW(
  711. IN LPWSTR lpMachineName,
  712. IN LPWSTR lpMessage,
  713. IN DWORD dwTimeout,
  714. IN BOOL bForceAppsClosed,
  715. IN BOOL bRebootAfterShutdown
  716. );
  717. #ifdef UNICODE
  718. #define InitiateSystemShutdown InitiateSystemShutdownW
  719. #else
  720. #define InitiateSystemShutdown InitiateSystemShutdownA
  721. #endif // !UNICODE
  722. WINADVAPI
  723. BOOL
  724. APIENTRY
  725. AbortSystemShutdownA(
  726. IN LPSTR lpMachineName
  727. );
  728. WINADVAPI
  729. BOOL
  730. APIENTRY
  731. AbortSystemShutdownW(
  732. IN LPWSTR lpMachineName
  733. );
  734. #ifdef UNICODE
  735. #define AbortSystemShutdown AbortSystemShutdownW
  736. #else
  737. #define AbortSystemShutdown AbortSystemShutdownA
  738. #endif // !UNICODE
  739. //
  740. // defines for InitiateSystemShutdownEx reason codes
  741. //
  742. #include <reason.h> // get the public reasons
  743. //
  744. // Then for Historical reasons support some old symbols, internal only
  745. #define REASON_SWINSTALL SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_INSTALLATION
  746. #define REASON_HWINSTALL SHTDN_REASON_MAJOR_HARDWARE|SHTDN_REASON_MINOR_INSTALLATION
  747. #define REASON_SERVICEHANG SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_HUNG
  748. #define REASON_UNSTABLE SHTDN_REASON_MAJOR_SYSTEM|SHTDN_REASON_MINOR_UNSTABLE
  749. #define REASON_SWHWRECONF SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_RECONFIG
  750. #define REASON_OTHER SHTDN_REASON_MAJOR_OTHER|SHTDN_REASON_MINOR_OTHER
  751. #define REASON_UNKNOWN SHTDN_REASON_UNKNOWN
  752. #define REASON_LEGACY_API SHTDN_REASON_LEGACY_API
  753. #define REASON_PLANNED_FLAG SHTDN_REASON_FLAG_PLANNED
  754. //
  755. // MAX Shutdown TimeOut == 10 Years in seconds
  756. //
  757. #define MAX_SHUTDOWN_TIMEOUT (10*365*24*60*60)
  758. WINADVAPI
  759. BOOL
  760. APIENTRY
  761. InitiateSystemShutdownExA(
  762. IN LPSTR lpMachineName,
  763. IN LPSTR lpMessage,
  764. IN DWORD dwTimeout,
  765. IN BOOL bForceAppsClosed,
  766. IN BOOL bRebootAfterShutdown,
  767. IN DWORD dwReason
  768. );
  769. WINADVAPI
  770. BOOL
  771. APIENTRY
  772. InitiateSystemShutdownExW(
  773. IN LPWSTR lpMachineName,
  774. IN LPWSTR lpMessage,
  775. IN DWORD dwTimeout,
  776. IN BOOL bForceAppsClosed,
  777. IN BOOL bRebootAfterShutdown,
  778. IN DWORD dwReason
  779. );
  780. #ifdef UNICODE
  781. #define InitiateSystemShutdownEx InitiateSystemShutdownExW
  782. #else
  783. #define InitiateSystemShutdownEx InitiateSystemShutdownExA
  784. #endif // !UNICODE
  785. WINADVAPI
  786. LONG
  787. APIENTRY
  788. RegSaveKeyExA (
  789. IN HKEY hKey,
  790. IN LPCSTR lpFile,
  791. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  792. IN DWORD Flags
  793. );
  794. WINADVAPI
  795. LONG
  796. APIENTRY
  797. RegSaveKeyExW (
  798. IN HKEY hKey,
  799. IN LPCWSTR lpFile,
  800. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  801. IN DWORD Flags
  802. );
  803. #ifdef UNICODE
  804. #define RegSaveKeyEx RegSaveKeyExW
  805. #else
  806. #define RegSaveKeyEx RegSaveKeyExA
  807. #endif // !UNICODE
  808. WINADVAPI
  809. LONG
  810. APIENTRY
  811. Wow64Win32ApiEntry (
  812. DWORD dwFuncNumber,
  813. DWORD dwFlag,
  814. DWORD dwRes
  815. );
  816. #ifdef __cplusplus
  817. }
  818. #endif
  819. #endif // _WINREG_