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.

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