home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / WINREG.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  10.8 KB  |  626 lines

  1. /*++ BUILD Version: 0001    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1991 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     Winreg.h
  8.  
  9. Abstract:
  10.  
  11.     This module contains the function prototypes and constant, type and
  12.     structure definitions for the Windows 32-Bit Registry API.
  13.  
  14. Author:
  15.  
  16.     David J. Gilman (davegi) 07-Nov-1991
  17.  
  18. --*/
  19.  
  20. #ifndef __WINREG_H
  21. #define __WINREG_H
  22.  
  23. #ifndef __WINBASE_H
  24. #include <winbase.h>
  25. #endif
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30.  
  31. //
  32. // Requested Key access mask type.
  33. //
  34.  
  35. typedef ACCESS_MASK REGSAM;
  36.  
  37. //
  38. // Type definitions.
  39. //
  40.  
  41. DECLARE_HANDLE(HKEY);
  42. typedef HKEY *PHKEY;
  43.  
  44. //
  45. // Reserved Key Handles.
  46. //
  47.  
  48. #define HKEY_CLASSES_ROOT           (( HKEY ) 0x80000000 )
  49. #define HKEY_CURRENT_USER           (( HKEY ) 0x80000001 )
  50. #define HKEY_LOCAL_MACHINE          (( HKEY ) 0x80000002 )
  51. #define HKEY_USERS                  (( HKEY ) 0x80000003 )
  52. #define HKEY_PERFORMANCE_DATA       (( HKEY ) 0x80000004 )
  53.  
  54. //
  55. // Default values for parameters that do not exist in the Win 3.1
  56. // compatible APIs.
  57. //
  58.  
  59. #define WIN31_CLASS                 NULL
  60.  
  61. //
  62. // API Prototypes.
  63. //
  64.  
  65.  
  66. LONG
  67. APIENTRY
  68. RegCloseKey (
  69.     HKEY hKey
  70.     );
  71.  
  72. LONG
  73. APIENTRY
  74. RegConnectRegistryA (
  75.     LPSTR lpMachineName,
  76.     HKEY hKey,
  77.     PHKEY phkResult
  78.     );
  79. LONG
  80. APIENTRY
  81. RegConnectRegistryW (
  82.     LPWSTR lpMachineName,
  83.     HKEY hKey,
  84.     PHKEY phkResult
  85.     );
  86. #ifdef UNICODE
  87. #define RegConnectRegistry  RegConnectRegistryW
  88. #else
  89. #define RegConnectRegistry  RegConnectRegistryA
  90. #endif // !UNICODE
  91.  
  92. LONG
  93. APIENTRY
  94. RegCreateKeyA (
  95.     HKEY hKey,
  96.     LPCSTR lpSubKey,
  97.     PHKEY phkResult
  98.     );
  99. LONG
  100. APIENTRY
  101. RegCreateKeyW (
  102.     HKEY hKey,
  103.     LPCWSTR lpSubKey,
  104.     PHKEY phkResult
  105.     );
  106. #ifdef UNICODE
  107. #define RegCreateKey  RegCreateKeyW
  108. #else
  109. #define RegCreateKey  RegCreateKeyA
  110. #endif // !UNICODE
  111.  
  112. LONG
  113. APIENTRY
  114. RegCreateKeyExA (
  115.     HKEY hKey,
  116.     LPCSTR lpSubKey,
  117.     DWORD Reserved,
  118.     LPSTR lpClass,
  119.     DWORD dwOptions,
  120.     REGSAM samDesired,
  121.     LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  122.     PHKEY phkResult,
  123.     LPDWORD lpdwDisposition
  124.     );
  125. LONG
  126. APIENTRY
  127. RegCreateKeyExW (
  128.     HKEY hKey,
  129.     LPCWSTR lpSubKey,
  130.     DWORD Reserved,
  131.     LPWSTR lpClass,
  132.     DWORD dwOptions,
  133.     REGSAM samDesired,
  134.     LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  135.     PHKEY phkResult,
  136.     LPDWORD lpdwDisposition
  137.     );
  138. #ifdef UNICODE
  139. #define RegCreateKeyEx  RegCreateKeyExW
  140. #else
  141. #define RegCreateKeyEx  RegCreateKeyExA
  142. #endif // !UNICODE
  143.  
  144. LONG
  145. APIENTRY
  146. RegDeleteKeyA (
  147.     HKEY hKey,
  148.     LPCSTR lpSubKey
  149.     );
  150. LONG
  151. APIENTRY
  152. RegDeleteKeyW (
  153.     HKEY hKey,
  154.     LPCWSTR lpSubKey
  155.     );
  156. #ifdef UNICODE
  157. #define RegDeleteKey  RegDeleteKeyW
  158. #else
  159. #define RegDeleteKey  RegDeleteKeyA
  160. #endif // !UNICODE
  161.  
  162. LONG
  163. APIENTRY
  164. RegDeleteValueA (
  165.     HKEY hKey,
  166.     LPSTR lpValueName
  167.     );
  168. LONG
  169. APIENTRY
  170. RegDeleteValueW (
  171.     HKEY hKey,
  172.     LPWSTR lpValueName
  173.     );
  174. #ifdef UNICODE
  175. #define RegDeleteValue  RegDeleteValueW
  176. #else
  177. #define RegDeleteValue  RegDeleteValueA
  178. #endif // !UNICODE
  179.  
  180. LONG
  181. APIENTRY
  182. RegEnumKeyA (
  183.     HKEY hKey,
  184.     DWORD dwIndex,
  185.     LPSTR lpName,
  186.     DWORD cbName
  187.     );
  188. LONG
  189. APIENTRY
  190. RegEnumKeyW (
  191.     HKEY hKey,
  192.     DWORD dwIndex,
  193.     LPWSTR lpName,
  194.     DWORD cbName
  195.     );
  196. #ifdef UNICODE
  197. #define RegEnumKey  RegEnumKeyW
  198. #else
  199. #define RegEnumKey  RegEnumKeyA
  200. #endif // !UNICODE
  201.  
  202. LONG
  203. APIENTRY
  204. RegEnumKeyExA (
  205.     HKEY hKey,
  206.     DWORD dwIndex,
  207.     LPSTR lpName,
  208.     LPDWORD lpcbName,
  209.     LPDWORD lpReserved,
  210.     LPSTR lpClass,
  211.     LPDWORD lpcbClass,
  212.     PFILETIME lpftLastWriteTime
  213.     );
  214. LONG
  215. APIENTRY
  216. RegEnumKeyExW (
  217.     HKEY hKey,
  218.     DWORD dwIndex,
  219.     LPWSTR lpName,
  220.     LPDWORD lpcbName,
  221.     LPDWORD lpReserved,
  222.     LPWSTR lpClass,
  223.     LPDWORD lpcbClass,
  224.     PFILETIME lpftLastWriteTime
  225.     );
  226. #ifdef UNICODE
  227. #define RegEnumKeyEx  RegEnumKeyExW
  228. #else
  229. #define RegEnumKeyEx  RegEnumKeyExA
  230. #endif // !UNICODE
  231.  
  232. LONG
  233. APIENTRY
  234. RegEnumValueA (
  235.     HKEY hKey,
  236.     DWORD dwIndex,
  237.     LPSTR lpValueName,
  238.     LPDWORD lpcbValueName,
  239.     LPDWORD lpReserved,
  240.     LPDWORD lpType,
  241.     LPBYTE lpData,
  242.     LPDWORD lpcbData
  243.     );
  244. LONG
  245. APIENTRY
  246. RegEnumValueW (
  247.     HKEY hKey,
  248.     DWORD dwIndex,
  249.     LPWSTR lpValueName,
  250.     LPDWORD lpcbValueName,
  251.     LPDWORD lpReserved,
  252.     LPDWORD lpType,
  253.     LPBYTE lpData,
  254.     LPDWORD lpcbData
  255.     );
  256. #ifdef UNICODE
  257. #define RegEnumValue  RegEnumValueW
  258. #else
  259. #define RegEnumValue  RegEnumValueA
  260. #endif // !UNICODE
  261.  
  262. LONG
  263. APIENTRY
  264. RegFlushKey (
  265.     HKEY hKey
  266.     );
  267.  
  268. LONG
  269. APIENTRY
  270. RegGetKeySecurity (
  271.     HKEY hKey,
  272.     SECURITY_INFORMATION SecurityInformation,
  273.     PSECURITY_DESCRIPTOR pSecurityDescriptor,
  274.     LPDWORD lpcbSecurityDescriptor
  275.     );
  276.  
  277. LONG
  278. APIENTRY
  279. RegLoadKeyA (
  280.     HKEY    hKey,
  281.     LPCSTR  lpSubKey,
  282.     LPCSTR  lpFile
  283.     );
  284. LONG
  285. APIENTRY
  286. RegLoadKeyW (
  287.     HKEY    hKey,
  288.     LPCWSTR  lpSubKey,
  289.     LPCWSTR  lpFile
  290.     );
  291. #ifdef UNICODE
  292. #define RegLoadKey  RegLoadKeyW
  293. #else
  294. #define RegLoadKey  RegLoadKeyA
  295. #endif // !UNICODE
  296.  
  297. LONG
  298. APIENTRY
  299. RegNotifyChangeKeyValue (
  300.     HKEY hKey,
  301.     BOOL bWatchSubtree,
  302.     DWORD dwNotifyFilter,
  303.     HANDLE hEvent,
  304.     BOOL fAsynchronus
  305.     );
  306.  
  307. LONG
  308. APIENTRY
  309. RegOpenKeyA (
  310.     HKEY hKey,
  311.     LPCSTR lpSubKey,
  312.     PHKEY phkResult
  313.     );
  314. LONG
  315. APIENTRY
  316. RegOpenKeyW (
  317.     HKEY hKey,
  318.     LPCWSTR lpSubKey,
  319.     PHKEY phkResult
  320.     );
  321. #ifdef UNICODE
  322. #define RegOpenKey  RegOpenKeyW
  323. #else
  324. #define RegOpenKey  RegOpenKeyA
  325. #endif // !UNICODE
  326.  
  327. LONG
  328. APIENTRY
  329. RegOpenKeyExA (
  330.     HKEY hKey,
  331.     LPCSTR lpSubKey,
  332.     DWORD ulOptions,
  333.     REGSAM samDesired,
  334.     PHKEY phkResult
  335.     );
  336. LONG
  337. APIENTRY
  338. RegOpenKeyExW (
  339.     HKEY hKey,
  340.     LPCWSTR lpSubKey,
  341.     DWORD ulOptions,
  342.     REGSAM samDesired,
  343.     PHKEY phkResult
  344.     );
  345. #ifdef UNICODE
  346. #define RegOpenKeyEx  RegOpenKeyExW
  347. #else
  348. #define RegOpenKeyEx  RegOpenKeyExA
  349. #endif // !UNICODE
  350.  
  351. LONG
  352. APIENTRY
  353. RegQueryInfoKeyA (
  354.     HKEY hKey,
  355.     LPSTR lpClass,
  356.     LPDWORD lpcbClass,
  357.     LPDWORD lpReserved,
  358.     LPDWORD lpcSubKeys,
  359.     LPDWORD lpcbMaxSubKeyLen,
  360.     LPDWORD lpcbMaxClassLen,
  361.     LPDWORD lpcValues,
  362.     LPDWORD lpcbMaxValueNameLen,
  363.     LPDWORD lpcbMaxValueLen,
  364.     LPDWORD lpcbSecurityDescriptor,
  365.     PFILETIME lpftLastWriteTime
  366.     );
  367. LONG
  368. APIENTRY
  369. RegQueryInfoKeyW (
  370.     HKEY hKey,
  371.     LPWSTR lpClass,
  372.     LPDWORD lpcbClass,
  373.     LPDWORD lpReserved,
  374.     LPDWORD lpcSubKeys,
  375.     LPDWORD lpcbMaxSubKeyLen,
  376.     LPDWORD lpcbMaxClassLen,
  377.     LPDWORD lpcValues,
  378.     LPDWORD lpcbMaxValueNameLen,
  379.     LPDWORD lpcbMaxValueLen,
  380.     LPDWORD lpcbSecurityDescriptor,
  381.     PFILETIME lpftLastWriteTime
  382.     );
  383. #ifdef UNICODE
  384. #define RegQueryInfoKey  RegQueryInfoKeyW
  385. #else
  386. #define RegQueryInfoKey  RegQueryInfoKeyA
  387. #endif // !UNICODE
  388.  
  389. LONG
  390. APIENTRY
  391. RegQueryValueA (
  392.     HKEY hKey,
  393.     LPCSTR lpSubKey,
  394.     LPSTR lpValue,
  395.     PLONG   lpcbValue
  396.     );
  397. LONG
  398. APIENTRY
  399. RegQueryValueW (
  400.     HKEY hKey,
  401.     LPCWSTR lpSubKey,
  402.     LPWSTR lpValue,
  403.     PLONG   lpcbValue
  404.     );
  405. #ifdef UNICODE
  406. #define RegQueryValue  RegQueryValueW
  407. #else
  408. #define RegQueryValue  RegQueryValueA
  409. #endif // !UNICODE
  410.  
  411. LONG
  412. APIENTRY
  413. RegQueryValueExA (
  414.     HKEY hKey,
  415.     LPSTR lpValueName,
  416.     LPDWORD lpReserved,
  417.     LPDWORD lpType,
  418.     LPBYTE lpData,
  419.     LPDWORD lpcbData
  420.     );
  421. LONG
  422. APIENTRY
  423. RegQueryValueExW (
  424.     HKEY hKey,
  425.     LPWSTR lpValueName,
  426.     LPDWORD lpReserved,
  427.     LPDWORD lpType,
  428.     LPBYTE lpData,
  429.     LPDWORD lpcbData
  430.     );
  431. #ifdef UNICODE
  432. #define RegQueryValueEx  RegQueryValueExW
  433. #else
  434. #define RegQueryValueEx  RegQueryValueExA
  435. #endif // !UNICODE
  436.  
  437. LONG
  438. APIENTRY
  439. RegReplaceKeyA (
  440.     HKEY     hKey,
  441.     LPCSTR  lpSubKey,
  442.     LPCSTR  lpNewFile,
  443.     LPCSTR  lpOldFile
  444.     );
  445. LONG
  446. APIENTRY
  447. RegReplaceKeyW (
  448.     HKEY     hKey,
  449.     LPCWSTR  lpSubKey,
  450.     LPCWSTR  lpNewFile,
  451.     LPCWSTR  lpOldFile
  452.     );
  453. #ifdef UNICODE
  454. #define RegReplaceKey  RegReplaceKeyW
  455. #else
  456. #define RegReplaceKey  RegReplaceKeyA
  457. #endif // !UNICODE
  458.  
  459. LONG
  460. APIENTRY
  461. RegRestoreKeyA (
  462.     HKEY hKey,
  463.     LPCSTR lpFile,
  464.     DWORD   dwFlags
  465.     );
  466. LONG
  467. APIENTRY
  468. RegRestoreKeyW (
  469.     HKEY hKey,
  470.     LPCWSTR lpFile,
  471.     DWORD   dwFlags
  472.     );
  473. #ifdef UNICODE
  474. #define RegRestoreKey  RegRestoreKeyW
  475. #else
  476. #define RegRestoreKey  RegRestoreKeyA
  477. #endif // !UNICODE
  478.  
  479. LONG
  480. APIENTRY
  481. RegSaveKeyA (
  482.     HKEY hKey,
  483.     LPCSTR lpFile,
  484.     LPSECURITY_ATTRIBUTES lpSecurityAttributes
  485.     );
  486. LONG
  487. APIENTRY
  488. RegSaveKeyW (
  489.     HKEY hKey,
  490.     LPCWSTR lpFile,
  491.     LPSECURITY_ATTRIBUTES lpSecurityAttributes
  492.     );
  493. #ifdef UNICODE
  494. #define RegSaveKey  RegSaveKeyW
  495. #else
  496. #define RegSaveKey  RegSaveKeyA
  497. #endif // !UNICODE
  498.  
  499. LONG
  500. APIENTRY
  501. RegSetKeySecurity (
  502.     HKEY hKey,
  503.     SECURITY_INFORMATION SecurityInformation,
  504.     PSECURITY_DESCRIPTOR pSecurityDescriptor
  505.     );
  506.  
  507. LONG
  508. APIENTRY
  509. RegSetValueA (
  510.     HKEY hKey,
  511.     LPCSTR lpSubKey,
  512.     DWORD dwType,
  513.     LPCSTR lpData,
  514.     DWORD cbData
  515.     );
  516. LONG
  517. APIENTRY
  518. RegSetValueW (
  519.     HKEY hKey,
  520.     LPCWSTR lpSubKey,
  521.     DWORD dwType,
  522.     LPCWSTR lpData,
  523.     DWORD cbData
  524.     );
  525. #ifdef UNICODE
  526. #define RegSetValue  RegSetValueW
  527. #else
  528. #define RegSetValue  RegSetValueA
  529. #endif // !UNICODE
  530.  
  531.  
  532. LONG
  533. APIENTRY
  534. RegSetValueExA (
  535.     HKEY hKey,
  536.     LPCSTR lpValueName,
  537.     DWORD Reserved,
  538.     DWORD dwType,
  539.     CONST BYTE* lpData,
  540.     DWORD cbData
  541.     );
  542. LONG
  543. APIENTRY
  544. RegSetValueExW (
  545.     HKEY hKey,
  546.     LPCWSTR lpValueName,
  547.     DWORD Reserved,
  548.     DWORD dwType,
  549.     CONST BYTE* lpData,
  550.     DWORD cbData
  551.     );
  552. #ifdef UNICODE
  553. #define RegSetValueEx  RegSetValueExW
  554. #else
  555. #define RegSetValueEx  RegSetValueExA
  556. #endif // !UNICODE
  557.  
  558. LONG
  559. APIENTRY
  560. RegUnLoadKeyA (
  561.     HKEY    hKey,
  562.     LPCSTR lpSubKey
  563.     );
  564. LONG
  565. APIENTRY
  566. RegUnLoadKeyW (
  567.     HKEY    hKey,
  568.     LPCWSTR lpSubKey
  569.     );
  570. #ifdef UNICODE
  571. #define RegUnLoadKey  RegUnLoadKeyW
  572. #else
  573. #define RegUnLoadKey  RegUnLoadKeyA
  574. #endif // !UNICODE
  575.  
  576. //
  577. // Remoteable System Shutdown APIs
  578. //
  579.  
  580. BOOL
  581. APIENTRY
  582. InitiateSystemShutdownA(
  583.     LPSTR lpMachineName,
  584.     LPSTR lpMessage,
  585.     DWORD dwTimeout,
  586.     BOOL bForceAppsClosed,
  587.     BOOL bRebootAfterShutdown
  588.     );
  589. BOOL
  590. APIENTRY
  591. InitiateSystemShutdownW(
  592.     LPWSTR lpMachineName,
  593.     LPWSTR lpMessage,
  594.     DWORD dwTimeout,
  595.     BOOL bForceAppsClosed,
  596.     BOOL bRebootAfterShutdown
  597.     );
  598. #ifdef UNICODE
  599. #define InitiateSystemShutdown  InitiateSystemShutdownW
  600. #else
  601. #define InitiateSystemShutdown  InitiateSystemShutdownA
  602. #endif // !UNICODE
  603.  
  604.  
  605. BOOL
  606. APIENTRY
  607. AbortSystemShutdownA(
  608.     LPSTR lpMachineName
  609.     );
  610. BOOL
  611. APIENTRY
  612. AbortSystemShutdownW(
  613.     LPWSTR lpMachineName
  614.     );
  615. #ifdef UNICODE
  616. #define AbortSystemShutdown  AbortSystemShutdownW
  617. #else
  618. #define AbortSystemShutdown  AbortSystemShutdownA
  619. #endif // !UNICODE
  620.  
  621. #ifdef __cplusplus
  622. }
  623. #endif
  624.  
  625. #endif // _WINREG_
  626.