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.

693 lines
20 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. reg.h
  5. Abstract:
  6. Implements macros to simplify the registry APIs and to track
  7. the resource allocations.
  8. Author:
  9. Jim Schmidt (jimschm) 24-Mar-1997
  10. Revision History:
  11. jimschm 09-Apr-1997 Expanded Get functionality
  12. --*/
  13. #pragma once
  14. #define HKEY_ROOT ((HKEY) 0X7FFFFFFF)
  15. BOOL
  16. RegInitialize (
  17. VOID
  18. );
  19. VOID
  20. RegTerminate (
  21. VOID
  22. );
  23. VOID
  24. RegInitializeCache (
  25. IN UINT InitialCacheSize
  26. );
  27. VOID
  28. RegTerminateCache (
  29. VOID
  30. );
  31. //
  32. // APIs to set access mode
  33. //
  34. REGSAM
  35. SetRegOpenAccessMode (
  36. REGSAM Mode
  37. );
  38. REGSAM
  39. GetRegOpenAccessMode (
  40. REGSAM Mode
  41. );
  42. REGSAM
  43. SetRegCreateAccessMode (
  44. REGSAM Mode
  45. );
  46. REGSAM
  47. GetRegCreateAccessMode (
  48. REGSAM Mode
  49. );
  50. //
  51. // Tracking of registry calls. These functions are completely
  52. // turned off for non-debug builds and are mapped to the standard
  53. // Win32 APIs via macro definitions.
  54. //
  55. //
  56. // The Track* API take the same params as the Reg* equivalents.
  57. // The Our* API also take the same params as the Reg* equivalents, but
  58. // the debug versions have two extra parameters, File and Line.
  59. //
  60. //
  61. // Use the Track* API set instead of the Reg* API set.
  62. //
  63. #ifndef DEBUG
  64. #define DumpOpenKeys()
  65. #define TrackedRegOpenKey RegOpenKey
  66. #define TrackedRegCreateKey RegCreateKey
  67. #define TrackedRegOpenKeyEx RegOpenKeyEx
  68. #define TrackedRegCreateKeyEx RegCreateKeyEx
  69. #define TrackedRegOpenKeyA RegOpenKeyA
  70. #define TrackedRegCreateKeyA RegCreateKeyA
  71. #define TrackedRegOpenKeyExA RegOpenKeyExA
  72. #define TrackedRegCreateKeyExA RegCreateKeyExA
  73. #define TrackedRegOpenKeyW RegOpenKeyW
  74. #define TrackedRegCreateKeyW RegCreateKeyW
  75. #define TrackedRegOpenKeyExW RegOpenKeyExW
  76. #define TrackedRegCreateKeyExW RegCreateKeyExW
  77. #define OurRegOpenKeyExA RegOpenKeyExA
  78. #define OurRegCreateKeyExA RegCreateKeyExA
  79. #define OurRegOpenRootKeyA(a,b)
  80. #define OurRegOpenRootKeyW(a,b)
  81. #define OurRegOpenKeyExW RegOpenKeyExW
  82. #define OurRegCreateKeyExW RegCreateKeyExW
  83. #define CloseRegKey RealCloseRegKey
  84. #define DEBUG_TRACKING_PARAMS
  85. #define DEBUG_TRACKING_ARGS
  86. #else
  87. extern DWORD g_DontCare;
  88. #define DEBUG_TRACKING_PARAMS ,PCSTR File,DWORD Line
  89. #define DEBUG_TRACKING_ARGS , File, Line
  90. VOID
  91. DumpOpenKeys (
  92. VOID
  93. );
  94. LONG
  95. OurRegOpenKeyExA (
  96. HKEY Key,
  97. PCSTR SubKey,
  98. DWORD Unused,
  99. REGSAM SamMask,
  100. PHKEY ResultPtr,
  101. PCSTR File,
  102. DWORD Line
  103. );
  104. LONG
  105. OurRegOpenKeyExW (
  106. HKEY Key,
  107. PCWSTR SubKey,
  108. DWORD Unused,
  109. REGSAM SamMask,
  110. PHKEY ResultPtr,
  111. PCSTR File,
  112. DWORD Line
  113. );
  114. LONG
  115. OurRegCreateKeyExA (
  116. HKEY Key,
  117. PCSTR SubKey,
  118. DWORD Reserved,
  119. PSTR Class,
  120. DWORD Options,
  121. REGSAM SamMask,
  122. PSECURITY_ATTRIBUTES SecurityAttribs,
  123. PHKEY ResultPtr,
  124. PDWORD DispositionPtr,
  125. PCSTR File,
  126. DWORD Line
  127. );
  128. LONG
  129. OurRegCreateKeyExW (
  130. HKEY Key,
  131. PCWSTR SubKey,
  132. DWORD Reserved,
  133. PWSTR Class,
  134. DWORD Options,
  135. REGSAM SamMask,
  136. PSECURITY_ATTRIBUTES SecurityAttribs,
  137. PHKEY ResultPtr,
  138. PDWORD DispositionPtr,
  139. PCSTR File,
  140. DWORD Line
  141. );
  142. VOID
  143. OurRegOpenRootKeyA (
  144. HKEY Key,
  145. PCSTR SubKey,
  146. PCSTR File,
  147. DWORD Line
  148. );
  149. VOID
  150. OurRegOpenRootKeyW (
  151. HKEY Key,
  152. PCWSTR SubKey,
  153. PCSTR File,
  154. DWORD Line
  155. );
  156. #ifdef UNICODE
  157. #define OurRegOpenRootKey OurRegOpenRootKeyW
  158. #else
  159. #define OurRegOpenRootKey OurRegOpenRootKeyA
  160. #endif
  161. LONG
  162. OurCloseRegKey (
  163. HKEY Key,
  164. PCSTR File,
  165. DWORD Line
  166. );
  167. #define CloseRegKey(k) OurCloseRegKey(k,__FILE__,__LINE__)
  168. #define TrackedRegOpenKeyEx(key,subkey,u,sam,res) OurRegOpenKeyEx(key,subkey,u,sam,res,__FILE__,__LINE__)
  169. #define TrackedRegCreateKeyEx(key,subkey,r,cls,options,sam,security,res,disp) OurRegCreateKeyEx(key,subkey,r,cls,options,sam,security,res,disp,__FILE__,__LINE__)
  170. #define TrackedRegOpenKey(k,sk,rp) OurRegOpenKeyEx(k,sk,0,KEY_ALL_ACCESS,rp,__FILE__,__LINE__)
  171. #define TrackedRegCreateKey(k,sk,rp) OurRegCreateKeyEx(k,sk,0,TEXT(""),0,KEY_ALL_ACCESS,NULL,rp,&g_DontCare,__FILE__,__LINE__)
  172. #define TrackedRegOpenKeyExA(key,subkey,u,sam,res) OurRegOpenKeyExA(key,subkey,u,sam,res,__FILE__,__LINE__)
  173. #define TrackedRegCreateKeyExA(key,subkey,r,cls,options,sam,security,res,disp) OurRegCreateKeyExA(key,subkey,r,cls,options,sam,security,res,disp,__FILE__,__LINE__)
  174. #define TrackedRegOpenKeyA(k,sk,rp) OurRegOpenKeyExA(k,sk,0,KEY_ALL_ACCESS,rp,__FILE__,__LINE__)
  175. #define TrackedRegCreateKeyA(k,sk,rp) OurRegCreateKeyExA(k,sk,0,TEXT(""),0,KEY_ALL_ACCESS,NULL,rp,&g_DontCare,__FILE__,__LINE__)
  176. #define TrackedRegOpenKeyExW(key,subkey,u,sam,res) OurRegOpenKeyExW(key,subkey,u,sam,res,__FILE__,__LINE__)
  177. #define TrackedRegCreateKeyExW(key,subkey,r,cls,options,sam,security,res,disp) OurRegCreateKeyExW(key,subkey,r,cls,options,sam,security,res,disp,__FILE__,__LINE__)
  178. #define TrackedRegOpenKeyW(k,sk,rp) OurRegOpenKeyExW(k,sk,0,KEY_ALL_ACCESS,rp,__FILE__,__LINE__)
  179. #define TrackedRegCreateKeyW(K,sk,rp) OurRegCreateKeyExW(k,sk,0,TEXT(""),0,KEY_ALL_ACCESS,NULL,rp,&g_DontCare,__FILE__,__LINE__)
  180. //
  181. // Undefine the real registry APIs -- using them will throw off the tracking
  182. //
  183. #undef RegOpenKey
  184. #undef RegCreateKey
  185. #undef RegOpenKeyEx
  186. #undef RegCreateKeyEx
  187. #define RegCloseKey USE_CloseRegKey
  188. #define RegOpenKeyA USE_TrackedRegOpenKeyA
  189. #define RegCreateKeyA USE_TrackedRegCreateKeyA
  190. #define RegOpenKeyExA USE_TrackedRegOpenKeyExA
  191. #define RegCreateKeyExA USE_TrackedRegCreateKeyExA
  192. #define RegOpenKeyW USE_TrackedRegOpenKeyw
  193. #define RegCreateKeyW USE_TrackedRegCreateKeyW
  194. #define RegOpenKeyExW USE_TrackedRegOpenKeyExW
  195. #define RegCreateKeyExW USE_TrackedRegCreateKeyExW
  196. #endif
  197. #ifdef UNICODE
  198. #define OurRegOpenKeyEx OurRegOpenKeyExW
  199. #define OurRegCreateKeyEx OurRegCreateKeyExW
  200. #else
  201. #define OurRegOpenKeyEx OurRegOpenKeyExA
  202. #define OurRegCreateKeyEx OurRegCreateKeyExA
  203. #endif
  204. PCSTR
  205. CreateEncodedRegistryStringExA (
  206. IN PCSTR Key,
  207. IN PCSTR Value, OPTIONAL
  208. IN BOOL Tree
  209. );
  210. PCWSTR
  211. CreateEncodedRegistryStringExW (
  212. IN PCWSTR Key,
  213. IN PCWSTR Value, OPTIONAL
  214. IN BOOL Tree
  215. );
  216. #define CreateEncodedRegistryStringA(k,v) CreateEncodedRegistryStringExA(k,v,TRUE)
  217. #define CreateEncodedRegistryStringW(k,v) CreateEncodedRegistryStringExW(k,v,TRUE)
  218. VOID
  219. FreeEncodedRegistryStringA (
  220. IN OUT PCSTR RegString
  221. );
  222. VOID
  223. FreeEncodedRegistryStringW (
  224. IN OUT PCWSTR RegString
  225. );
  226. BOOL
  227. DecodeRegistryStringA (
  228. IN PCSTR RegString,
  229. OUT PSTR KeyBuf, OPTIONAL
  230. OUT PSTR ValueBuf, OPTIONAL
  231. OUT PBOOL TreeFlag OPTIONAL
  232. );
  233. BOOL
  234. DecodeRegistryStringW (
  235. IN PCWSTR RegString,
  236. OUT PWSTR KeyBuf, OPTIONAL
  237. OUT PWSTR ValueBuf, OPTIONAL
  238. OUT PBOOL TreeFlag OPTIONAL
  239. );
  240. //
  241. // Versions that allow caller to specify allocator, and macro that uses
  242. // MemAllocWrapper
  243. //
  244. typedef PVOID (ALLOCATOR_PROTOTYPE)(DWORD Size);
  245. typedef ALLOCATOR_PROTOTYPE * ALLOCATOR;
  246. ALLOCATOR_PROTOTYPE MemAllocWrapper;
  247. typedef VOID (DEALLOCATOR_PROTOTYPE)(PCVOID Mem);
  248. typedef DEALLOCATOR_PROTOTYPE * DEALLOCATOR;
  249. DEALLOCATOR_PROTOTYPE MemFreeWrapper;
  250. BOOL
  251. GetRegValueTypeAndSizeA (
  252. IN HKEY Key,
  253. IN PCSTR ValueName,
  254. OUT PDWORD OutType, OPTIONAL
  255. OUT PDWORD Size OPTIONAL
  256. );
  257. BOOL
  258. GetRegValueTypeAndSizeW (
  259. IN HKEY Key,
  260. IN PCWSTR ValueName,
  261. OUT PDWORD OutType, OPTIONAL
  262. OUT PDWORD Size OPTIONAL
  263. );
  264. PBYTE
  265. GetRegValueData2A (
  266. IN HKEY hKey,
  267. IN PCSTR Value,
  268. IN ALLOCATOR Allocator,
  269. IN DEALLOCATOR Deallocator
  270. );
  271. #define GetRegValueDataA(key,valuename) TRACK_BEGIN(PBYTE, GetRegValueDataA)\
  272. GetRegValueData2A((key),(valuename),MemAllocWrapper,MemFreeWrapper)\
  273. TRACK_END()
  274. PBYTE
  275. GetRegValueData2W (
  276. IN HKEY hKey,
  277. IN PCWSTR Value,
  278. IN ALLOCATOR Allocator,
  279. IN DEALLOCATOR Deallocator
  280. );
  281. #define GetRegValueDataW(key,valuename) TRACK_BEGIN(PBYTE,GetRegValueDataW)\
  282. GetRegValueData2W((key),(valuename),MemAllocWrapper,MemFreeWrapper)\
  283. TRACK_END()
  284. PBYTE
  285. GetRegValueDataOfType2A (
  286. IN HKEY hKey,
  287. IN PCSTR Value,
  288. IN DWORD MustBeType,
  289. IN ALLOCATOR Allocator,
  290. IN DEALLOCATOR Deallocator
  291. );
  292. #define GetRegValueDataOfTypeA(key,valuename,type) TRACK_BEGIN(PBYTE, GetRegValueDataOfTypeA)\
  293. GetRegValueDataOfType2A((key),(valuename),(type),MemAllocWrapper,MemFreeWrapper)\
  294. TRACK_END()
  295. PBYTE
  296. GetRegValueDataOfType2W (
  297. IN HKEY hKey,
  298. IN PCWSTR Value,
  299. IN DWORD MustBeType,
  300. IN ALLOCATOR Allocator,
  301. IN DEALLOCATOR Deallocator
  302. );
  303. #define GetRegValueDataOfTypeW(key,valuename,type) TRACK_BEGIN(PBYTE, GetRegValueDataOfTypeW)\
  304. GetRegValueDataOfType2W((key),(valuename),(type),MemAllocWrapper,MemFreeWrapper)\
  305. TRACK_END()
  306. PBYTE
  307. GetRegKeyData2A (
  308. IN HKEY hKey,
  309. IN PCSTR SubKey,
  310. IN ALLOCATOR Allocator,
  311. IN DEALLOCATOR Deallocator
  312. );
  313. #define GetRegKeyDataA(key,subkey) TRACK_BEGIN(PBYTE, GetRegKeyDataA)\
  314. GetRegKeyData2A((key),(subkey),MemAllocWrapper,MemFreeWrapper)\
  315. TRACK_END()
  316. PBYTE
  317. GetRegKeyData2W (
  318. IN HKEY hKey,
  319. IN PCWSTR SubKey,
  320. IN ALLOCATOR Allocator,
  321. IN DEALLOCATOR Deallocator
  322. );
  323. #define GetRegKeyDataW(key,subkey) TRACK_BEGIN(PBYTE, GetRegKeyDataW)\
  324. GetRegKeyData2W((key),(subkey),MemAllocWrapper,MemFreeWrapper)\
  325. TRACK_END()
  326. PBYTE
  327. GetRegData2A (
  328. IN PCSTR KeyString,
  329. IN PCSTR ValueName,
  330. IN ALLOCATOR Allocator,
  331. IN DEALLOCATOR Deallocator
  332. );
  333. #define GetRegDataA(keystr,value) TRACK_BEGIN(PBYTE, GetRegDataA)\
  334. GetRegData2A((keystr),(value),MemAllocWrapper,MemFreeWrapper)\
  335. TRACK_END()
  336. PBYTE
  337. GetRegData2W (
  338. IN PCWSTR KeyString,
  339. IN PCWSTR ValueName,
  340. IN ALLOCATOR Allocator,
  341. IN DEALLOCATOR Deallocator
  342. );
  343. #define GetRegDataW(keystr,value) TRACK_BEGIN(PBYTE, GetRegDataW)\
  344. GetRegData2W((keystr),(value),MemAllocWrapper,MemFreeWrapper)\
  345. TRACK_END()
  346. BOOL
  347. GetRegSubkeysCount (
  348. IN HKEY ParentKey,
  349. OUT PDWORD SubKeyCount, OPTIONAL
  350. OUT PDWORD MaxSubKeyLen OPTIONAL
  351. );
  352. //
  353. // Reg key create & open
  354. //
  355. HKEY
  356. RealCreateRegKeyA (
  357. IN HKEY ParentKey,
  358. IN PCSTR NewKeyName
  359. DEBUG_TRACKING_PARAMS
  360. );
  361. HKEY
  362. RealCreateRegKeyW (
  363. IN HKEY ParentKey,
  364. IN PCWSTR NewKeyName
  365. DEBUG_TRACKING_PARAMS
  366. );
  367. HKEY
  368. RealCreateRegKeyStrA (
  369. IN PCSTR NewKeyName
  370. DEBUG_TRACKING_PARAMS
  371. );
  372. HKEY
  373. RealCreateRegKeyStrW (
  374. IN PCWSTR NewKeyName
  375. DEBUG_TRACKING_PARAMS
  376. );
  377. HKEY
  378. RealOpenRegKeyStrA (
  379. IN PCSTR RegKey
  380. DEBUG_TRACKING_PARAMS
  381. );
  382. HKEY
  383. RealOpenRegKeyStrW (
  384. IN PCWSTR RegKey
  385. DEBUG_TRACKING_PARAMS
  386. );
  387. HKEY
  388. RealOpenRegKeyA (
  389. IN HKEY ParentKey,
  390. IN PCSTR KeyToOpen
  391. DEBUG_TRACKING_PARAMS
  392. );
  393. HKEY
  394. RealOpenRegKeyW (
  395. IN HKEY ParentKey,
  396. IN PCWSTR KeyToOpen
  397. DEBUG_TRACKING_PARAMS
  398. );
  399. LONG
  400. RealCloseRegKey (
  401. IN HKEY Key
  402. );
  403. BOOL
  404. DeleteRegKeyStrA (
  405. IN PCSTR RegKey
  406. );
  407. BOOL
  408. DeleteRegKeyStrW (
  409. IN PCWSTR RegKey
  410. );
  411. BOOL
  412. DeleteEmptyRegKeyStrA (
  413. IN PCSTR RegKey
  414. );
  415. BOOL
  416. DeleteEmptyRegKeyStrW (
  417. IN PCWSTR RegKey
  418. );
  419. #ifdef DEBUG
  420. #define CreateRegKeyA(a,b) RealCreateRegKeyA(a,b,__FILE__,__LINE__)
  421. #define CreateRegKeyW(a,b) RealCreateRegKeyW(a,b,__FILE__,__LINE__)
  422. #define CreateRegKeyStrA(a) RealCreateRegKeyStrA(a,__FILE__,__LINE__)
  423. #define CreateRegKeyStrW(a) RealCreateRegKeyStrW(a,__FILE__,__LINE__)
  424. #define OpenRegKeyStrA(a) RealOpenRegKeyStrA(a,__FILE__,__LINE__)
  425. #define OpenRegKeyStrW(a) RealOpenRegKeyStrW(a,__FILE__,__LINE__)
  426. #define OpenRegKeyA(a,b) RealOpenRegKeyA(a,b,__FILE__,__LINE__)
  427. #define OpenRegKeyW(a,b) RealOpenRegKeyW(a,b,__FILE__,__LINE__)
  428. #else
  429. #define CreateRegKeyA RealCreateRegKeyA
  430. #define CreateRegKeyW RealCreateRegKeyW
  431. #define CreateRegKeyStrA RealCreateRegKeyStrA
  432. #define CreateRegKeyStrW RealCreateRegKeyStrW
  433. #define OpenRegKeyStrA RealOpenRegKeyStrA
  434. #define OpenRegKeyStrW RealOpenRegKeyStrW
  435. #define OpenRegKeyA RealOpenRegKeyA
  436. #define OpenRegKeyW RealOpenRegKeyW
  437. #endif
  438. //
  439. // Registry root functions
  440. //
  441. VOID
  442. SetRegRoot (
  443. IN HKEY Root
  444. );
  445. HKEY
  446. GetRegRoot (
  447. VOID
  448. );
  449. // Returns non-zero array offset to root, or zero if no root matches
  450. INT GetOffsetOfRootStringA (PCSTR RootString, PDWORD LengthPtr OPTIONAL);
  451. INT GetOffsetOfRootStringW (PCWSTR RootString, PDWORD LengthPtr OPTIONAL);
  452. // Returns non-zero array offset to root, or zero if no root matches
  453. INT GetOffsetOfRootKey (HKEY RootKey);
  454. // Given non-zero array offset to root, returns string or NULL if element
  455. // is out of bounds
  456. PCSTR GetRootStringFromOffsetA (INT i);
  457. PCWSTR GetRootStringFromOffsetW (INT i);
  458. // Given non-zero array offset to root, returns registry handle or NULL if
  459. // element is out of bounds
  460. HKEY GetRootKeyFromOffset (INT i);
  461. // Converts the root at the head of RegPath to an HKEY and gives the number
  462. // of characters occupied by the root string (including optional wack)
  463. HKEY ConvertRootStringToKeyA (PCSTR RegPath, PDWORD LengthPtr OPTIONAL);
  464. HKEY ConvertRootStringToKeyW (PCWSTR RegPath, PDWORD LengthPtr OPTIONAL);
  465. // Returns a pointer to a static string for the matching root, or NULL if
  466. // RegRoot does not point to a valid root
  467. PCSTR ConvertKeyToRootStringA (HKEY RegRoot);
  468. PCWSTR ConvertKeyToRootStringW (HKEY RegRoot);
  469. //
  470. // Macros
  471. //
  472. #define GetRegValueStringA(key,valuename) (PSTR) GetRegValueDataOfTypeA((key),(valuename),REG_SZ)
  473. #define GetRegValueBinaryA(key,valuename) (PBYTE) GetRegValueDataOfTypeA((key),(valuename),REG_BINARY)
  474. #define GetRegValueMultiSzA(key,valuename) (PSTR) GetRegValueDataOfTypeA((key),(valuename),REG_MULTISZ)
  475. #define GetRegValueDwordA(key,valuename) (PDWORD) GetRegValueDataOfTypeA((key),(valuename),REG_DWORD)
  476. #define GetRegValueStringW(key,valuename) (PWSTR) GetRegValueDataOfTypeW((key),(valuename),REG_SZ)
  477. #define GetRegValueBinaryW(key,valuename) (PBYTE) GetRegValueDataOfTypeW((key),(valuename),REG_BINARY)
  478. #define GetRegValueMultiSzW(key,valuename) (PWSTR) GetRegValueDataOfTypeW((key),(valuename),REG_MULTISZ)
  479. #define GetRegValueDwordW(key,valuename) (PDWORD) GetRegValueDataOfTypeW((key),(valuename),REG_DWORD)
  480. #define GetRegValueString2A(key,valuename,alloc,free) GetRegValueDataOfType2A((key),(valuename),REG_SZ,alloc,free)
  481. #define GetRegValueBinary2A(key,valuename,alloc,free) GetRegValueDataOfType2A((key),(valuename),REG_BINARY,alloc,free)
  482. #define GetRegValueMultiSz2A(key,valuename,alloc,free) GetRegValueDataOfType2A((key),(valuename),REG_MULTISZ,alloc,free)
  483. #define GetRegValueDword2A(key,valuename,alloc,free) GetRegValueDataOfType2A((key),(valuename),REG_DWORD,alloc,free)
  484. #define GetRegValueString2W(key,valuename,alloc,free) GetRegValueDataOfType2W((key),(valuename),REG_SZ,alloc,free)
  485. #define GetRegValueBinary2W(key,valuename,alloc,free) GetRegValueDataOfType2W((key),(valuename),REG_BINARY,alloc,free)
  486. #define GetRegValueMultiSz2W(key,valuename,alloc,free) GetRegValueDataOfType2W((key),(valuename),REG_MULTISZ,alloc,free)
  487. #define GetRegValueDword2W(key,valuename,alloc,free) GetRegValueDataOfType2W((key),(valuename),REG_DWORD,alloc,free)
  488. #ifdef UNICODE
  489. #define GetRegValueTypeAndSize GetRegValueTypeAndSizeW
  490. #define GetRegValueData GetRegValueDataW
  491. #define GetRegValueDataOfType GetRegValueDataOfTypeW
  492. #define GetRegKeyData GetRegKeyDataW
  493. #define GetRegValueData2 GetRegValueData2W
  494. #define GetRegValueDataOfType2 GetRegValueDataOfType2W
  495. #define GetRegKeyData2 GetRegKeyData2W
  496. #define GetRegValueString GetRegValueStringW
  497. #define GetRegValueBinary GetRegValueBinaryW
  498. #define GetRegValueMultiSz GetRegValueMultiSzW
  499. #define GetRegValueDword GetRegValueDwordW
  500. #define GetRegValueString2 GetRegValueString2W
  501. #define GetRegValueBinary2 GetRegValueBinary2W
  502. #define GetRegValueMultiSz2 GetRegValueMultiSz2W
  503. #define GetRegValueDword2 GetRegValueDword2W
  504. #define GetRegData2 GetRegData2W
  505. #define GetRegData GetRegDataW
  506. #define CreateRegKey CreateRegKeyW
  507. #define CreateRegKeyStr CreateRegKeyStrW
  508. #define OpenRegKey OpenRegKeyW
  509. #define OpenRegKeyStr OpenRegKeyStrW
  510. #define DeleteRegKeyStr DeleteRegKeyStrW
  511. #define DeleteEmptyRegKeyStr DeleteEmptyRegKeyStrW
  512. #define GetOffsetOfRootString GetOffsetOfRootStringW
  513. #define GetRootStringFromOffset GetRootStringFromOffsetW
  514. #define ConvertRootStringToKey ConvertRootStringToKeyW
  515. #define ConvertKeyToRootString ConvertKeyToRootStringW
  516. #define CreateEncodedRegistryString CreateEncodedRegistryStringW
  517. #define CreateEncodedRegistryStringEx CreateEncodedRegistryStringExW
  518. #define FreeEncodedRegistryString FreeEncodedRegistryStringW
  519. #define DecodeRegistryString DecodeRegistryStringW
  520. #else
  521. #define GetRegValueTypeAndSize GetRegValueTypeAndSizeA
  522. #define GetRegValueData GetRegValueDataA
  523. #define GetRegValueDataOfType GetRegValueDataOfTypeA
  524. #define GetRegKeyData GetRegKeyDataA
  525. #define GetRegValueData2 GetRegValueData2A
  526. #define GetRegValueDataOfType2 GetRegValueDataOfType2A
  527. #define GetRegKeyData2 GetRegKeyData2A
  528. #define GetRegValueString GetRegValueStringA
  529. #define GetRegValueBinary GetRegValueBinaryA
  530. #define GetRegValueMultiSz GetRegValueMultiSzA
  531. #define GetRegValueDword GetRegValueDwordA
  532. #define GetRegValueString2 GetRegValueString2A
  533. #define GetRegValueBinary2 GetRegValueBinary2A
  534. #define GetRegValueMultiSz2 GetRegValueMultiSz2A
  535. #define GetRegValueDword2 GetRegValueDword2A
  536. #define GetRegData2 GetRegData2A
  537. #define GetRegData GetRegDataA
  538. #define CreateRegKey CreateRegKeyA
  539. #define CreateRegKeyStr CreateRegKeyStrA
  540. #define OpenRegKey OpenRegKeyA
  541. #define OpenRegKeyStr OpenRegKeyStrA
  542. #define DeleteRegKeyStr DeleteRegKeyStrA
  543. #define DeleteEmptyRegKeyStr DeleteEmptyRegKeyStrA
  544. #define GetOffsetOfRootString GetOffsetOfRootStringA
  545. #define GetRootStringFromOffset GetRootStringFromOffsetA
  546. #define ConvertRootStringToKey ConvertRootStringToKeyA
  547. #define ConvertKeyToRootString ConvertKeyToRootStringA
  548. #define CreateEncodedRegistryString CreateEncodedRegistryStringA
  549. #define CreateEncodedRegistryStringEx CreateEncodedRegistryStringExA
  550. #define FreeEncodedRegistryString FreeEncodedRegistryStringA
  551. #define DecodeRegistryString DecodeRegistryStringA
  552. #endif