Source code of Windows XP (NT5)
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.

505 lines
10 KiB

  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects ;both
  2. ;both
  3. Copyright (c) Microsoft Corporation. All rights reserved. ;both
  4. ;both
  5. Module Name: ;both
  6. ;both
  7. Winreg.h
  8. Winregp.h ;internal_NT
  9. ;both
  10. Abstract: ;both
  11. ;both
  12. This module contains the function prototypes and constant, type and ;both
  13. structure definitions for the Windows 32-Bit Registry API. ;both
  14. ;both
  15. --*/ ;both
  16. #ifndef _WINREG_
  17. #define _WINREG_
  18. #ifndef _WINREGP_ ;internal_NT
  19. #define _WINREGP_ ;internal_NT
  20. #ifdef _MAC
  21. #include <macwin32.h>
  22. #endif
  23. ;begin_both
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. ;end_both
  28. #ifndef WINVER ;public_win40
  29. #define WINVER 0x0500 // version 5.0 ;public_win40
  30. #endif /* !WINVER */ ;public_win40
  31. //
  32. // Requested Key access mask type.
  33. //
  34. typedef ACCESS_MASK REGSAM;
  35. //
  36. // Reserved Key Handles.
  37. //
  38. #define HKEY_CLASSES_ROOT (( HKEY ) (ULONG_PTR)((LONG)0x80000000) )
  39. #define HKEY_CURRENT_USER (( HKEY ) (ULONG_PTR)((LONG)0x80000001) )
  40. #define HKEY_LOCAL_MACHINE (( HKEY ) (ULONG_PTR)((LONG)0x80000002) )
  41. #define HKEY_USERS (( HKEY ) (ULONG_PTR)((LONG)0x80000003) )
  42. #define HKEY_PERFORMANCE_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000004) )
  43. #define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000050) )
  44. #define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000060) )
  45. ;begin_winver_400
  46. #define HKEY_CURRENT_CONFIG (( HKEY ) (ULONG_PTR)((LONG)0x80000005) )
  47. #define HKEY_DYN_DATA (( HKEY ) (ULONG_PTR)((LONG)0x80000006) )
  48. /*NOINC*/
  49. #ifndef _PROVIDER_STRUCTS_DEFINED
  50. #define _PROVIDER_STRUCTS_DEFINED
  51. #define PROVIDER_KEEPS_VALUE_LENGTH 0x1
  52. struct val_context {
  53. int valuelen; // the total length of this value
  54. LPVOID value_context; // provider's context
  55. LPVOID val_buff_ptr; // where in the ouput buffer the value is.
  56. };
  57. typedef struct val_context FAR *PVALCONTEXT;
  58. typedef struct pvalue% { // Provider supplied value/context.
  59. LPTSTR% pv_valuename; // The value name pointer
  60. int pv_valuelen;
  61. LPVOID pv_value_context;
  62. DWORD pv_type;
  63. }PVALUE%, FAR *PPVALUE%;
  64. typedef
  65. DWORD _cdecl
  66. QUERYHANDLER (LPVOID keycontext, PVALCONTEXT val_list, DWORD num_vals,
  67. LPVOID outputbuffer, DWORD FAR *total_outlen, DWORD input_blen);
  68. typedef QUERYHANDLER FAR *PQUERYHANDLER;
  69. typedef struct provider_info {
  70. PQUERYHANDLER pi_R0_1val;
  71. PQUERYHANDLER pi_R0_allvals;
  72. PQUERYHANDLER pi_R3_1val;
  73. PQUERYHANDLER pi_R3_allvals;
  74. DWORD pi_flags; // capability flags (none defined yet).
  75. LPVOID pi_key_context;
  76. }REG_PROVIDER;
  77. typedef struct provider_info FAR *PPROVIDER;
  78. typedef struct value_ent% {
  79. LPTSTR% ve_valuename;
  80. DWORD ve_valuelen;
  81. DWORD_PTR ve_valueptr;
  82. DWORD ve_type;
  83. }VALENT%, FAR *PVALENT%;
  84. #endif // not(_PROVIDER_STRUCTS_DEFINED)
  85. /*INC*/
  86. ;end_winver_400
  87. //
  88. // Default values for parameters that do not exist in the Win 3.1
  89. // compatible APIs.
  90. //
  91. #define WIN31_CLASS NULL
  92. //
  93. // API Prototypes.
  94. //
  95. WINADVAPI
  96. LONG
  97. APIENTRY
  98. RegCloseKey (
  99. IN HKEY hKey
  100. );
  101. WINADVAPI
  102. LONG
  103. APIENTRY
  104. RegOverridePredefKey (
  105. IN HKEY hKey,
  106. IN HKEY hNewHKey
  107. );
  108. WINADVAPI
  109. LONG
  110. APIENTRY
  111. RegOpenUserClassesRoot(
  112. HANDLE hToken,
  113. DWORD dwOptions,
  114. REGSAM samDesired,
  115. PHKEY phkResult
  116. );
  117. WINADVAPI
  118. LONG
  119. APIENTRY
  120. RegOpenCurrentUser(
  121. REGSAM samDesired,
  122. PHKEY phkResult
  123. );
  124. WINADVAPI
  125. LONG
  126. APIENTRY
  127. RegDisablePredefinedCache(
  128. );
  129. WINADVAPI
  130. LONG
  131. APIENTRY
  132. RegConnectRegistry% (
  133. IN LPCTSTR% lpMachineName,
  134. IN HKEY hKey,
  135. OUT PHKEY phkResult
  136. );
  137. WINADVAPI
  138. LONG
  139. APIENTRY
  140. RegCreateKey% (
  141. IN HKEY hKey,
  142. IN LPCTSTR% lpSubKey,
  143. OUT PHKEY phkResult
  144. );
  145. WINADVAPI
  146. LONG
  147. APIENTRY
  148. RegCreateKeyEx% (
  149. IN HKEY hKey,
  150. IN LPCTSTR% lpSubKey,
  151. IN DWORD Reserved,
  152. IN LPTSTR% lpClass,
  153. IN DWORD dwOptions,
  154. IN REGSAM samDesired,
  155. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  156. OUT PHKEY phkResult,
  157. OUT LPDWORD lpdwDisposition
  158. );
  159. WINADVAPI
  160. LONG
  161. APIENTRY
  162. RegDeleteKey% (
  163. IN HKEY hKey,
  164. IN LPCTSTR% lpSubKey
  165. );
  166. WINADVAPI
  167. LONG
  168. APIENTRY
  169. RegDeleteValue% (
  170. IN HKEY hKey,
  171. IN LPCTSTR% lpValueName
  172. );
  173. WINADVAPI
  174. LONG
  175. APIENTRY
  176. RegEnumKey% (
  177. IN HKEY hKey,
  178. IN DWORD dwIndex,
  179. OUT LPTSTR% lpName,
  180. IN DWORD cbName
  181. );
  182. WINADVAPI
  183. LONG
  184. APIENTRY
  185. RegEnumKeyEx% (
  186. IN HKEY hKey,
  187. IN DWORD dwIndex,
  188. OUT LPTSTR% lpName,
  189. IN OUT LPDWORD lpcbName,
  190. IN LPDWORD lpReserved,
  191. IN OUT LPTSTR% lpClass,
  192. IN OUT LPDWORD lpcbClass,
  193. OUT PFILETIME lpftLastWriteTime
  194. );
  195. WINADVAPI
  196. LONG
  197. APIENTRY
  198. RegEnumValue% (
  199. IN HKEY hKey,
  200. IN DWORD dwIndex,
  201. OUT LPTSTR% lpValueName,
  202. IN OUT LPDWORD lpcbValueName,
  203. IN LPDWORD lpReserved,
  204. OUT LPDWORD lpType,
  205. OUT LPBYTE lpData,
  206. IN OUT LPDWORD lpcbData
  207. );
  208. WINADVAPI
  209. LONG
  210. APIENTRY
  211. RegFlushKey (
  212. IN HKEY hKey
  213. );
  214. WINADVAPI
  215. LONG
  216. APIENTRY
  217. RegGetKeySecurity (
  218. IN HKEY hKey,
  219. IN SECURITY_INFORMATION SecurityInformation,
  220. OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  221. IN OUT LPDWORD lpcbSecurityDescriptor
  222. );
  223. WINADVAPI
  224. LONG
  225. APIENTRY
  226. RegLoadKey% (
  227. IN HKEY hKey,
  228. IN LPCTSTR% lpSubKey,
  229. IN LPCTSTR% lpFile
  230. );
  231. WINADVAPI
  232. LONG
  233. APIENTRY
  234. RegNotifyChangeKeyValue (
  235. IN HKEY hKey,
  236. IN BOOL bWatchSubtree,
  237. IN DWORD dwNotifyFilter,
  238. IN HANDLE hEvent,
  239. IN BOOL fAsynchronus
  240. );
  241. WINADVAPI
  242. LONG
  243. APIENTRY
  244. RegOpenKey% (
  245. IN HKEY hKey,
  246. IN LPCTSTR% lpSubKey,
  247. OUT PHKEY phkResult
  248. );
  249. WINADVAPI
  250. LONG
  251. APIENTRY
  252. RegOpenKeyEx% (
  253. IN HKEY hKey,
  254. IN LPCTSTR% lpSubKey,
  255. IN DWORD ulOptions,
  256. IN REGSAM samDesired,
  257. OUT PHKEY phkResult
  258. );
  259. WINADVAPI
  260. LONG
  261. APIENTRY
  262. RegQueryInfoKey% (
  263. IN HKEY hKey,
  264. OUT LPTSTR% lpClass,
  265. IN OUT LPDWORD lpcbClass,
  266. IN LPDWORD lpReserved,
  267. OUT LPDWORD lpcSubKeys,
  268. OUT LPDWORD lpcbMaxSubKeyLen,
  269. OUT LPDWORD lpcbMaxClassLen,
  270. OUT LPDWORD lpcValues,
  271. OUT LPDWORD lpcbMaxValueNameLen,
  272. OUT LPDWORD lpcbMaxValueLen,
  273. OUT LPDWORD lpcbSecurityDescriptor,
  274. OUT PFILETIME lpftLastWriteTime
  275. );
  276. WINADVAPI
  277. LONG
  278. APIENTRY
  279. RegQueryValue% (
  280. IN HKEY hKey,
  281. IN LPCTSTR% lpSubKey,
  282. OUT LPTSTR% lpValue,
  283. IN OUT PLONG lpcbValue
  284. );
  285. ;begin_winver_400
  286. WINADVAPI
  287. LONG
  288. APIENTRY
  289. RegQueryMultipleValues% (
  290. IN HKEY hKey,
  291. OUT PVALENT% val_list,
  292. IN DWORD num_vals,
  293. OUT LPTSTR% lpValueBuf,
  294. IN OUT LPDWORD ldwTotsize
  295. );
  296. ;end_winver_400
  297. WINADVAPI
  298. LONG
  299. APIENTRY
  300. RegQueryValueEx% (
  301. IN HKEY hKey,
  302. IN LPCTSTR% lpValueName,
  303. IN LPDWORD lpReserved,
  304. OUT LPDWORD lpType,
  305. IN OUT LPBYTE lpData,
  306. IN OUT LPDWORD lpcbData
  307. );
  308. WINADVAPI
  309. LONG
  310. APIENTRY
  311. RegReplaceKey% (
  312. IN HKEY hKey,
  313. IN LPCTSTR% lpSubKey,
  314. IN LPCTSTR% lpNewFile,
  315. IN LPCTSTR% lpOldFile
  316. );
  317. WINADVAPI
  318. LONG
  319. APIENTRY
  320. RegRestoreKey% (
  321. IN HKEY hKey,
  322. IN LPCTSTR% lpFile,
  323. IN DWORD dwFlags
  324. );
  325. WINADVAPI
  326. LONG
  327. APIENTRY
  328. RegSaveKey% (
  329. IN HKEY hKey,
  330. IN LPCTSTR% lpFile,
  331. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes
  332. );
  333. WINADVAPI
  334. LONG
  335. APIENTRY
  336. RegSetKeySecurity (
  337. IN HKEY hKey,
  338. IN SECURITY_INFORMATION SecurityInformation,
  339. IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  340. );
  341. WINADVAPI
  342. LONG
  343. APIENTRY
  344. RegSetValue% (
  345. IN HKEY hKey,
  346. IN LPCTSTR% lpSubKey,
  347. IN DWORD dwType,
  348. IN LPCTSTR% lpData,
  349. IN DWORD cbData
  350. );
  351. WINADVAPI
  352. LONG
  353. APIENTRY
  354. RegSetValueEx% (
  355. IN HKEY hKey,
  356. IN LPCTSTR% lpValueName,
  357. IN DWORD Reserved,
  358. IN DWORD dwType,
  359. IN CONST BYTE* lpData,
  360. IN DWORD cbData
  361. );
  362. WINADVAPI
  363. LONG
  364. APIENTRY
  365. RegUnLoadKey% (
  366. IN HKEY hKey,
  367. IN LPCTSTR% lpSubKey
  368. );
  369. //
  370. // Remoteable System Shutdown APIs
  371. //
  372. WINADVAPI
  373. BOOL
  374. APIENTRY
  375. InitiateSystemShutdown%(
  376. IN LPTSTR% lpMachineName,
  377. IN LPTSTR% lpMessage,
  378. IN DWORD dwTimeout,
  379. IN BOOL bForceAppsClosed,
  380. IN BOOL bRebootAfterShutdown
  381. );
  382. WINADVAPI
  383. BOOL
  384. APIENTRY
  385. AbortSystemShutdown%(
  386. IN LPTSTR% lpMachineName
  387. );
  388. //
  389. // defines for InitiateSystemShutdownEx reason codes
  390. //
  391. #include <reason.h> // get the public reasons
  392. //
  393. // Then for Historical reasons support some old symbols, internal only
  394. #define REASON_SWINSTALL SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_INSTALLATION
  395. #define REASON_HWINSTALL SHTDN_REASON_MAJOR_HARDWARE|SHTDN_REASON_MINOR_INSTALLATION
  396. #define REASON_SERVICEHANG SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_HUNG
  397. #define REASON_UNSTABLE SHTDN_REASON_MAJOR_SYSTEM|SHTDN_REASON_MINOR_UNSTABLE
  398. #define REASON_SWHWRECONF SHTDN_REASON_MAJOR_SOFTWARE|SHTDN_REASON_MINOR_RECONFIG
  399. #define REASON_OTHER SHTDN_REASON_MAJOR_OTHER|SHTDN_REASON_MINOR_OTHER
  400. #define REASON_UNKNOWN SHTDN_REASON_UNKNOWN
  401. #define REASON_PLANNED_FLAG SHTDN_REASON_FLAG_PLANNED
  402. WINADVAPI
  403. BOOL
  404. APIENTRY
  405. InitiateSystemShutdownEx%(
  406. IN LPTSTR% lpMachineName,
  407. IN LPTSTR% lpMessage,
  408. IN DWORD dwTimeout,
  409. IN BOOL bForceAppsClosed,
  410. IN BOOL bRebootAfterShutdown,
  411. IN DWORD dwReason
  412. );
  413. WINADVAPI
  414. LONG
  415. APIENTRY
  416. RegSaveKeyEx% (
  417. IN HKEY hKey,
  418. IN LPCTSTR% lpFile,
  419. IN LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  420. IN DWORD Flags
  421. );
  422. WINADVAPI
  423. LONG
  424. APIENTRY
  425. Wow64Win32ApiEntry (
  426. DWORD dwFuncNumber,
  427. DWORD dwFlag,
  428. DWORD dwRes
  429. );
  430. ;begin_both
  431. #ifdef __cplusplus
  432. }
  433. #endif
  434. ;end_both
  435. #endif // _WINREGP_ ;internal_NT
  436. #endif // _WINREG_