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.

1193 lines
36 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. memdb.h
  5. Abstract:
  6. Declares interfaces for memdb, the memory database. MemDb is
  7. used throughout the Win9x upgrade project to record OS state
  8. and to track operations on files and the registry.
  9. See common\memdb for implementation details.
  10. Author:
  11. Jim Schmidt (jimschm) 15-Nov-1996
  12. Revision History:
  13. mvander 13-Aug-1999 many changes
  14. jimschm 05-Apr-1999 MemDbGetStoredEndPatternValue
  15. jimschm 18-Jan-1999 Version APIs
  16. jimschm 23-Sep-1998 Proxy node capability
  17. jimschm 24-Jun-1998 MemDbMove capability
  18. jimschm 30-Oct-1997 Temporary hive capability
  19. jimschm 31-Jul-1997 Hashing for faster access
  20. jimschm 19-Mar-1997 Binary node capability
  21. jimschm 28-Feb-1997 Offset access capabilities
  22. jimschm 20-Dec-1996 Ex routines
  23. --*/
  24. #pragma once
  25. #define MEMDB_MAX 2048
  26. //
  27. // My net share flag, used to distinguish user-level security and
  28. // password-level security. When it is specified, user-level
  29. // security is enabled, and NetShares\<share>\ACL\<list> exists.
  30. //
  31. #define SHI50F_ACLS 0x1000
  32. //
  33. // Dataflags for enuming key data
  34. //
  35. #define DATAFLAG_INSTANCEMASK 0x03
  36. #define DATAFLAG_UNORDERED 0x04
  37. #define DATAFLAG_SINGLELINK 0x08
  38. #define DATAFLAG_DOUBLELINK 0x10
  39. #define DATAFLAG_BINARYMASK 0x1C
  40. #define DATAFLAG_VALUE 0x20
  41. #define DATAFLAG_FLAGS 0x40
  42. #define DATAFLAG_ALL (DATAFLAG_INSTANCEMASK|DATAFLAG_UNORDERED|DATAFLAG_SINGLELINK|DATAFLAG_DOUBLELINK|DATAFLAG_VALUE|DATAFLAG_FLAGS)
  43. //
  44. // Constant for MemDbKeyFromHandle
  45. //
  46. #define MEMDB_LAST_LEVEL 0xFFFFFFFF
  47. //
  48. // Types
  49. //
  50. typedef UINT KEYHANDLE;
  51. typedef UINT DATAHANDLE;
  52. typedef struct {
  53. BOOL Valid;
  54. BOOL Debug;
  55. UINT Version;
  56. BOOL CurrentVersion;
  57. } MEMDB_VERSION, *PMEMDB_VERSION;
  58. //
  59. // Flags for enumeration routines
  60. //
  61. #define ENUMFLAG_INSTANCEMASK 0x0003
  62. #define ENUMFLAG_UNORDERED 0x0004
  63. #define ENUMFLAG_SINGLELINK 0x0008
  64. #define ENUMFLAG_DOUBLELINK 0x0010
  65. #define ENUMFLAG_BINARYMASK 0x001C
  66. #define ENUMFLAG_VALUE 0x0020
  67. #define ENUMFLAG_FLAGS 0x0040
  68. #define ENUMFLAG_EMPTY 0x0080
  69. #define ENUMFLAG_ENDPOINTS 0x0100
  70. #define ENUMFLAG_NONENDPOINTS 0x0200
  71. #define ENUMFLAG_ALLDATA (ENUMFLAG_BINARYMASK|ENUMFLAG_VALUE|ENUMFLAG_FLAGS|ENUMFLAG_EMPTY)
  72. #define ENUMFLAG_ALLSEGMENTS (ENUMFLAG_ENDPOINTS|ENUMFLAG_NONENDPOINTS)
  73. #define ENUMFLAG_ALL (ENUMFLAG_ALLDATA|ENUMFLAG_ALLSEGMENTS)
  74. #define ENUMFLAG_NORMAL (ENUMFLAG_ALLDATA|ENUMFLAG_ENDPOINTS)
  75. #define ENUMLEVEL_LASTLEVEL 0xFFFFFFFF
  76. #define ENUMLEVEL_ALLLEVELS 0xFFFFFFFF
  77. typedef BOOL(MEMDB_PATTERNFINDW)(PCWSTR);
  78. typedef MEMDB_PATTERNFINDW * PMEMDB_PATTERNFINDW;
  79. typedef BOOL(MEMDB_PATTERNMATCHW)(PCVOID, PCWSTR);
  80. typedef MEMDB_PATTERNMATCHW * PMEMDB_PATTERNMATCHW;
  81. typedef struct {
  82. PMEMDB_PATTERNFINDW PatternFind;
  83. PMEMDB_PATTERNMATCHW PatternMatch;
  84. PCVOID Data;
  85. } MEMDB_PATTERNSTRUCTW, *PMEMDB_PATTERNSTRUCTW;
  86. typedef struct {
  87. WCHAR FullKeyName[MEMDB_MAX];
  88. WCHAR KeyName[MEMDB_MAX];
  89. UINT Value;
  90. UINT Flags;
  91. KEYHANDLE KeyHandle;
  92. BOOL EndPoint;
  93. // internally maintained members
  94. BYTE CurrentDatabaseIndex;
  95. BOOL EnumerationMode;
  96. UINT EnumFlags;
  97. PWSTR KeyNameCopy;
  98. PWSTR PatternCopy;
  99. PWSTR PatternPtr;
  100. PWSTR PatternEndPtr;
  101. UINT CurrentIndex;
  102. UINT BeginLevel; // 0-based first level of keys
  103. UINT EndLevel; // 0-based last level of keys
  104. UINT CurrentLevel; // 1-based level of keys
  105. GROWBUFFER TreeEnumBuffer;
  106. UINT TreeEnumLevel;
  107. MEMDB_PATTERNSTRUCTW PatternStruct;
  108. } MEMDB_ENUMW, *PMEMDB_ENUMW;
  109. typedef struct {
  110. CHAR FullKeyName[MEMDB_MAX];
  111. CHAR KeyName[MEMDB_MAX];
  112. UINT Value;
  113. UINT Flags;
  114. KEYHANDLE KeyHandle;
  115. BOOL EndPoint;
  116. // internally maintained members
  117. MEMDB_ENUMW UnicodeEnum;
  118. } MEMDB_ENUMA, *PMEMDB_ENUMA;
  119. //
  120. // Function prototypes
  121. //
  122. BOOL
  123. MemDbInitializeExA (
  124. IN PCSTR DatabasePath OPTIONAL
  125. );
  126. #define MemDbInitializeA() MemDbInitializeExA(NULL)
  127. BOOL
  128. MemDbInitializeExW (
  129. IN PCWSTR DatabasePath OPTIONAL
  130. );
  131. #define MemDbInitializeW() MemDbInitializeExW(NULL)
  132. VOID
  133. MemDbTerminateEx (
  134. IN BOOL EraseDatabasePath
  135. );
  136. #define MemDbTerminate() MemDbTerminateEx(FALSE)
  137. PVOID
  138. MemDbGetMemory (
  139. IN UINT Size
  140. );
  141. VOID
  142. MemDbReleaseMemory (
  143. IN PCVOID Memory
  144. );
  145. KEYHANDLE
  146. MemDbAddKeyA (
  147. IN PCSTR KeyName
  148. );
  149. KEYHANDLE
  150. MemDbAddKeyW (
  151. IN PCWSTR KeyName
  152. );
  153. KEYHANDLE
  154. MemDbSetKeyA (
  155. IN PCSTR KeyName
  156. );
  157. KEYHANDLE
  158. MemDbSetKeyW (
  159. IN PCWSTR KeyName
  160. );
  161. BOOL
  162. MemDbDeleteKeyA (
  163. IN PCSTR KeyName
  164. );
  165. BOOL
  166. MemDbDeleteKeyW (
  167. IN PCWSTR KeyName
  168. );
  169. BOOL
  170. MemDbDeleteKeyByHandle (
  171. IN KEYHANDLE KeyHandle
  172. );
  173. BOOL
  174. MemDbDeleteTreeA (
  175. IN PCSTR KeyName
  176. );
  177. BOOL
  178. MemDbDeleteTreeW (
  179. IN PCWSTR KeyName
  180. );
  181. PCSTR
  182. MemDbGetKeyFromHandleA (
  183. IN KEYHANDLE KeyHandle,
  184. IN UINT StartLevel
  185. );
  186. PCWSTR
  187. MemDbGetKeyFromHandleW (
  188. IN KEYHANDLE KeyHandle,
  189. IN UINT StartLevel
  190. );
  191. BOOL
  192. MemDbGetKeyFromHandleExA (
  193. IN KEYHANDLE KeyHandle,
  194. IN UINT StartLevel,
  195. IN OUT PGROWBUFFER Buffer OPTIONAL
  196. );
  197. BOOL
  198. MemDbGetKeyFromHandleExW (
  199. IN KEYHANDLE KeyHandle,
  200. IN UINT StartLevel,
  201. IN OUT PGROWBUFFER Buffer OPTIONAL
  202. );
  203. KEYHANDLE
  204. MemDbGetHandleFromKeyA (
  205. IN PCSTR KeyName
  206. );
  207. KEYHANDLE
  208. MemDbGetHandleFromKeyW (
  209. IN PCWSTR KeyName
  210. );
  211. KEYHANDLE
  212. MemDbSetValueAndFlagsExA (
  213. IN PCSTR KeyName,
  214. IN BOOL AlterValue,
  215. IN UINT Value,
  216. IN BOOL ReplaceFlags,
  217. IN UINT SetFlags,
  218. IN UINT ClearFlags
  219. );
  220. KEYHANDLE
  221. MemDbSetValueAndFlagsExW (
  222. IN PCWSTR KeyName,
  223. IN BOOL AlterValue,
  224. IN UINT Value,
  225. IN BOOL ReplaceFlags,
  226. IN UINT SetFlags,
  227. IN UINT ClearFlags
  228. );
  229. BOOL
  230. MemDbSetValueAndFlagsByHandleEx (
  231. IN KEYHANDLE KeyHandle,
  232. IN BOOL AlterValue,
  233. IN UINT Value,
  234. IN BOOL ReplaceFlags,
  235. IN UINT SetFlags,
  236. IN UINT ClearFlags
  237. );
  238. BOOL
  239. MemDbGetValueAndFlagsA (
  240. IN PCSTR KeyName,
  241. OUT PUINT Value,
  242. OUT PUINT Flags
  243. );
  244. BOOL
  245. MemDbGetValueAndFlagsW (
  246. IN PCWSTR KeyName,
  247. OUT PUINT Value,
  248. OUT PUINT Flags
  249. );
  250. BOOL
  251. MemDbGetValueAndFlagsByHandle (
  252. IN KEYHANDLE KeyHandle,
  253. OUT PUINT Value,
  254. OUT PUINT Flags
  255. );
  256. #define MemDbSetValueAndFlagsA(k,v,s,c) MemDbSetValueAndFlagsExA(k,TRUE,v,FALSE,s,c)
  257. #define MemDbSetValueAndFlagsW(k,v,s,c) MemDbSetValueAndFlagsExW(k,TRUE,v,FALSE,s,c)
  258. #define MemDbSetValueAndFlagsByHandle(h,v,s,c) MemDbSetValueAndFlagsByHandleEx(h,TRUE,v,FALSE,s,c)
  259. #define MemDbSetValueA(k,v) MemDbSetValueAndFlagsExA(k,TRUE,v,FALSE,0,0)
  260. #define MemDbSetValueW(k,v) MemDbSetValueAndFlagsExW(k,TRUE,v,FALSE,0,0)
  261. #define MemDbSetValueByHandle(h,v) MemDbSetValueAndFlagsByHandleEx(h,TRUE,v,FALSE,0,0)
  262. #define MemDbGetValueA(k,v) MemDbGetValueAndFlagsA(k,v,NULL)
  263. #define MemDbGetValueW(k,v) MemDbGetValueAndFlagsW(k,v,NULL)
  264. #define MemDbGetValueByHandle(h,v) MemDbGetValueAndFlagsByHandle(h,v,NULL)
  265. #define MemDbTestKeyA(k) MemDbGetValueAndFlagsA(k,NULL,NULL)
  266. #define MemDbTestKeyW(k) MemDbGetValueAndFlagsW(k,NULL,NULL)
  267. #define MemDbTestKeyByHandle(h) MemDbGetValueAndFlagsByHandle(h,NULL,NULL)
  268. #define MemDbSetFlagsA(k,s,c) MemDbSetValueAndFlagsExA(k,FALSE,0,FALSE,s,c)
  269. #define MemDbSetFlagsW(k,s,c) MemDbSetValueAndFlagsExW(k,FALSE,0,FALSE,s,c)
  270. #define MemDbSetFlagsByHandle(h,s,c) MemDbSetValueAndFlagsByHandleEx(h,FALSE,0,FALSE,s,c)
  271. #define MemDbReplaceFlagsA(k,f) MemDbSetValueAndFlagsExA(k,FALSE,0,TRUE,f,0)
  272. #define MemDbReplaceFlagsW(k,f) MemDbSetValueAndFlagsExW(k,FALSE,0,TRUE,f,0)
  273. #define MemDbReplaceFlagsByHandle(h,f) MemDbSetValueAndFlagsByHandleEx(h,FALSE,0,TRUE,f,0)
  274. #define MemDbGetFlagsA(k,f) MemDbGetValueAndFlagsA(k,NULL,f)
  275. #define MemDbGetFlagsW(k,f) MemDbGetValueAndFlagsW(k,NULL,f)
  276. #define MemDbGetFlagsByHandle(h,f) MemDbGetValueAndFlagsByHandle(h,NULL,f)
  277. DATAHANDLE
  278. MemDbAddDataA (
  279. IN PCSTR KeyName,
  280. IN BYTE Type,
  281. IN BYTE Instance,
  282. IN PCBYTE Data,
  283. IN UINT DataSize
  284. );
  285. DATAHANDLE
  286. MemDbAddDataW (
  287. IN PCWSTR KeyName,
  288. IN BYTE Type,
  289. IN BYTE Instance,
  290. IN PCBYTE Data,
  291. IN UINT DataSize
  292. );
  293. DATAHANDLE
  294. MemDbAddDataByKeyHandle (
  295. IN KEYHANDLE KeyHandle,
  296. IN BYTE Type,
  297. IN BYTE Instance,
  298. IN PCBYTE Data,
  299. IN UINT DataSize
  300. );
  301. DATAHANDLE
  302. MemDbSetDataA (
  303. IN PCSTR KeyName,
  304. IN BYTE Type,
  305. IN BYTE Instance,
  306. IN PCBYTE Data,
  307. IN UINT DataSize
  308. );
  309. DATAHANDLE
  310. MemDbSetDataW (
  311. IN PCWSTR KeyName,
  312. IN BYTE Type,
  313. IN BYTE Instance,
  314. IN PCBYTE Data,
  315. IN UINT DataSize
  316. );
  317. DATAHANDLE
  318. MemDbSetDataByDataHandle (
  319. IN DATAHANDLE DataHandle,
  320. IN PCBYTE Data,
  321. IN UINT DataSize
  322. );
  323. DATAHANDLE
  324. MemDbSetDataByKeyHandle (
  325. IN KEYHANDLE KeyHandle,
  326. IN BYTE Type,
  327. IN BYTE Instance,
  328. IN PCBYTE Data,
  329. IN UINT DataSize
  330. );
  331. DATAHANDLE
  332. MemDbGrowDataA (
  333. IN PCSTR KeyName,
  334. IN BYTE Type,
  335. IN BYTE Instance,
  336. IN PCBYTE Data,
  337. IN UINT DataSize
  338. );
  339. DATAHANDLE
  340. MemDbGrowDataW (
  341. IN PCWSTR KeyName,
  342. IN BYTE Type,
  343. IN BYTE Instance,
  344. IN PCBYTE Data,
  345. IN UINT DataSize
  346. );
  347. DATAHANDLE
  348. MemDbGrowDataByDataHandle (
  349. IN DATAHANDLE DataHandle,
  350. IN PCBYTE Data,
  351. IN UINT DataSize
  352. );
  353. DATAHANDLE
  354. MemDbGrowDataByKeyHandle (
  355. IN KEYHANDLE KeyHandle,
  356. IN BYTE Type,
  357. IN BYTE Instance,
  358. IN PCBYTE Data,
  359. IN UINT DataSize
  360. );
  361. DATAHANDLE
  362. MemDbGetDataHandleA (
  363. IN PCSTR KeyName,
  364. IN BYTE Type,
  365. IN BYTE Instance
  366. );
  367. DATAHANDLE
  368. MemDbGetDataHandleW (
  369. IN PCWSTR KeyName,
  370. IN BYTE Type,
  371. IN BYTE Instance
  372. );
  373. PBYTE
  374. MemDbGetDataA (
  375. IN PCSTR KeyName,
  376. IN BYTE Type,
  377. IN BYTE Instance,
  378. OUT PUINT DataSize OPTIONAL
  379. );
  380. PBYTE
  381. MemDbGetDataW (
  382. IN PCWSTR KeyName,
  383. IN BYTE Type,
  384. IN BYTE Instance,
  385. OUT PUINT DataSize OPTIONAL
  386. );
  387. BOOL
  388. MemDbGetDataExA (
  389. IN PCSTR KeyName,
  390. IN BYTE Type,
  391. IN BYTE Instance,
  392. IN OUT PGROWBUFFER Buffer, OPTIONAL
  393. OUT PUINT DataSize OPTIONAL
  394. );
  395. BOOL
  396. MemDbGetDataExW (
  397. IN PCWSTR KeyName,
  398. IN BYTE Type,
  399. IN BYTE Instance,
  400. IN OUT PGROWBUFFER Buffer, OPTIONAL
  401. OUT PUINT DataSize OPTIONAL
  402. );
  403. PBYTE
  404. MemDbGetDataByDataHandle (
  405. IN DATAHANDLE DataHandle,
  406. OUT PUINT DataSize OPTIONAL
  407. );
  408. BOOL
  409. MemDbGetDataByDataHandleEx (
  410. IN DATAHANDLE DataHandle,
  411. IN OUT PGROWBUFFER Buffer, OPTIONAL
  412. OUT PUINT DataSize OPTIONAL
  413. );
  414. PBYTE
  415. MemDbGetDataByKeyHandle (
  416. IN KEYHANDLE KeyHandle,
  417. IN BYTE Type,
  418. IN BYTE Instance,
  419. OUT PUINT DataSize OPTIONAL
  420. );
  421. BOOL
  422. MemDbGetDataByKeyHandleEx (
  423. IN KEYHANDLE KeyHandle,
  424. IN BYTE Type,
  425. IN BYTE Instance,
  426. IN OUT PGROWBUFFER Buffer, OPTIONAL
  427. OUT PUINT DataSize OPTIONAL
  428. );
  429. BOOL
  430. MemDbDeleteDataA (
  431. IN PCSTR KeyName,
  432. IN BYTE Type,
  433. IN BYTE Instance
  434. );
  435. BOOL
  436. MemDbDeleteDataW (
  437. IN PCWSTR KeyName,
  438. IN BYTE Type,
  439. IN BYTE Instance
  440. );
  441. BOOL
  442. MemDbDeleteDataByDataHandle (
  443. IN DATAHANDLE DataHandle
  444. );
  445. BOOL
  446. MemDbDeleteDataByKeyHandle (
  447. IN KEYHANDLE KeyHandle,
  448. IN BYTE Type,
  449. IN BYTE Instance
  450. );
  451. //
  452. // High-level BLOB functions
  453. //
  454. #define MemDbAddUnorderedBlobA(k,i,d,s) MemDbAddDataA(k,DATAFLAG_UNORDERED,i,d,s)
  455. #define MemDbAddUnorderedBlobW(k,i,d,s) MemDbAddDataW(k,DATAFLAG_UNORDERED,i,d,s)
  456. #define MemDbAddUnorderedBlobByKeyHandle(h,i,d,s) MemDbAddDataByKeyHandle(h,DATAFLAG_UNORDERED,i,d,s)
  457. #define MemDbSetUnorderedBlobA(k,i,d,s) MemDbSetDataA(k,DATAFLAG_UNORDERED,i,d,s)
  458. #define MemDbSetUnorderedBlobW(k,i,d,s) MemDbSetDataW(k,DATAFLAG_UNORDERED,i,d,s)
  459. #define MemDbSetUnorderedBlobByDataHandle(h,d,s) MemDbSetDataByDataHandle(h,d,s)
  460. #define MemDbSetUnorderedBlobByKeyHandle(h,i,d,s) MemDbSetDataByKeyHandle(h,DATAFLAG_UNORDERED,i,d,s)
  461. #define MemDbGrowUnorderedBlobA(k,i,d,s) MemDbGrowDataA(k,DATAFLAG_UNORDERED,i,d,s)
  462. #define MemDbGrowUnorderedBlobW(k,i,d,s) MemDbGrowDataW(k,DATAFLAG_UNORDERED,i,d,s)
  463. #define MemDbGrowUnorderedBlobByDataHandle(h,d,s) MemDbGrowDataByDataHandle(h,d,s)
  464. #define MemDbGrowUnorderedBlobByKeyHandle(h,i,d,s) MemDbGrowDataByKeyHandle(h,DATAFLAG_UNORDERED,i,d,s)
  465. #define MemDbGetUnorderedBlobHandleA(k,i) MemDbGetDataHandleA(k,DATAFLAG_UNORDERED,i)
  466. #define MemDbGetUnorderedBlobHandleW(k,i) MemDbGetDataHandleW(k,DATAFLAG_UNORDERED,i)
  467. #define MemDbGetUnorderedBlobA(k,i,s) MemDbGetDataA(k,DATAFLAG_UNORDERED,i,s)
  468. #define MemDbGetUnorderedBlobW(k,i,s) MemDbGetDataW(k,DATAFLAG_UNORDERED,i,s)
  469. #define MemDbGetUnorderedBlobExA(k,i,b,s) MemDbGetDataExA(k,DATAFLAG_UNORDERED,i,b,s)
  470. #define MemDbGetUnorderedBlobExW(k,i,b,s) MemDbGetDataExW(k,DATAFLAG_UNORDERED,i,b,s)
  471. #define MemDbGetUnorderedBlobByDataHandle(h,s) MemDbGetDataByDataHandle(h,s)
  472. #define MemDbGetUnorderedBlobByDataHandleEx(h,b,s) MemDbGetDataByDataHandle(h,b,s)
  473. #define MemDbGetUnorderedBlobByKeyHandle(h,i,s) MemDbGetDataByKeyHandle(h,DATAFLAG_UNORDERED,i,s)
  474. #define MemDbGetUnorderedBlobByKeyHandleEx(h,i,b,s) MemDbGetDataByKeyHandleEx(h,DATAFLAG_UNORDERED,i,b,s)
  475. #define MemDbDeleteUnorderedBlobA(k,i) MemDbDeleteDataA(k,DATAFLAG_UNORDERED,i);
  476. #define MemDbDeleteUnorderedBlobW(k,i) MemDbDeleteDataW(k,DATAFLAG_UNORDERED,i);
  477. #define MemDbDeleteUnorderedBlobByDataHandle(h) MemDbDeleteDataByDataHandle(h)
  478. #define MemDbDeleteUnorderedBlobByKeyHandle(h,i) MemDbDeleteDataByKeyHandle(h,DATAFLAG_UNORDERED,i)
  479. //
  480. // low-level linkage functions
  481. //
  482. DATAHANDLE
  483. MemDbAddLinkageValueA (
  484. IN PCSTR KeyName,
  485. IN BYTE Type,
  486. IN BYTE Instance,
  487. IN UINT Linkage,
  488. IN BOOL AllowDuplicates
  489. );
  490. DATAHANDLE
  491. MemDbAddLinkageValueW (
  492. IN PCWSTR KeyName,
  493. IN BYTE Type,
  494. IN BYTE Instance,
  495. IN UINT Linkage,
  496. IN BOOL AllowDuplicates
  497. );
  498. DATAHANDLE
  499. MemDbAddLinkageValueByKeyHandle (
  500. IN KEYHANDLE KeyHandle,
  501. IN BYTE Type,
  502. IN BYTE Instance,
  503. IN UINT Linkage,
  504. IN BOOL AllowDuplicates
  505. );
  506. DATAHANDLE
  507. MemDbAddLinkageValueByDataHandle (
  508. IN DATAHANDLE DataHandle,
  509. IN UINT Linkage,
  510. IN BOOL AllowDuplicates
  511. );
  512. BOOL
  513. MemDbDeleteLinkageValueA (
  514. IN PCSTR KeyName,
  515. IN BYTE Type,
  516. IN BYTE Instance,
  517. IN UINT Linkage,
  518. IN BOOL FirstOnly
  519. );
  520. BOOL
  521. MemDbDeleteLinkageValueW (
  522. IN PCWSTR KeyName,
  523. IN BYTE Type,
  524. IN BYTE Instance,
  525. IN UINT Linkage,
  526. IN BOOL FirstOnly
  527. );
  528. BOOL
  529. MemDbDeleteLinkageValueByKeyHandle (
  530. IN KEYHANDLE KeyHandle,
  531. IN BYTE Type,
  532. IN BYTE Instance,
  533. IN UINT Linkage,
  534. IN BOOL FirstOnly
  535. );
  536. BOOL
  537. MemDbDeleteLinkageValueByDataHandle (
  538. IN DATAHANDLE DataHandle,
  539. IN UINT Linkage,
  540. IN BOOL FirstOnly
  541. );
  542. #define MemDbSetLinkageArrayA(k,t,i,d,s) MemDbSetDataA(k,t,i,(PCBYTE)d,s)
  543. #define MemDbSetLinkageArrayW(k,t,i,d,s) MemDbSetDataW(k,t,i,(PCBYTE)d,s)
  544. #define MemDbSetLinkageArrayByKeyHandle(h,t,i,d,s) MemDbSetDataByKeyHandle(h,t,i,(PCBYTE)d,s)
  545. #define MemDbSetLinkageArrayByDataHandle(h,d,s) MemDbSetDataByDataHandle(h,(PCBYTE)d,s)
  546. #define MemDbGetLinkageArrayA(k,t,i,s) (PUINT)MemDbGetDataA(k,t,i,s)
  547. #define MemDbGetLinkageArrayW(k,t,i,s) (PUINT)MemDbGetDataW(k,t,i,s)
  548. #define MemDbGetLinkageArrayByKeyHandle(h,t,i,s) (PUINT)MemDbGetDataByKeyHandle(h,t,i,s)
  549. #define MemDbGetLinkageArrayByKeyHandleEx(h,t,i,b,s) (PUINT)MemDbGetDataByKeyHandleEx(h,t,i,b,s)
  550. #define MemDbGetLinkageArrayByDataHandle(h,s) (PUINT)MemDbGetDataByDataHandle(h,s)
  551. #define MemDbGetLinkageArrayByDataHandleEx(h,b,s) (PUINT)MemDbGetDataByDataHandleEx(h,b,s)
  552. BOOL
  553. MemDbTestLinkageValueA (
  554. IN PCSTR KeyName,
  555. IN BYTE Type,
  556. IN BYTE Instance,
  557. IN KEYHANDLE Linkage
  558. );
  559. BOOL
  560. MemDbTestLinkageValueW (
  561. IN PCWSTR KeyName,
  562. IN BYTE Type,
  563. IN BYTE Instance,
  564. IN KEYHANDLE Linkage
  565. );
  566. BOOL
  567. MemDbTestLinkageValueByKeyHandle (
  568. IN KEYHANDLE KeyHandle,
  569. IN BYTE Type,
  570. IN BYTE Instance,
  571. IN KEYHANDLE Linkage
  572. );
  573. BOOL
  574. MemDbTestLinkageValueByDataHandle (
  575. IN DATAHANDLE DataHandle,
  576. IN KEYHANDLE Linkage
  577. );
  578. BOOL
  579. MemDbAddLinkageA (
  580. IN PCSTR KeyName1,
  581. IN PCSTR KeyName2,
  582. IN BYTE Type,
  583. IN BYTE Instance
  584. );
  585. BOOL
  586. MemDbAddLinkageW (
  587. IN PCWSTR KeyName1,
  588. IN PCWSTR KeyName2,
  589. IN BYTE Type,
  590. IN BYTE Instance
  591. );
  592. BOOL
  593. MemDbAddLinkageByKeyHandle (
  594. IN KEYHANDLE KeyHandle1,
  595. IN KEYHANDLE KeyHandle2,
  596. IN BYTE Type,
  597. IN BYTE Instance
  598. );
  599. BOOL
  600. MemDbDeleteLinkageA (
  601. IN PCSTR KeyName1,
  602. IN PCSTR KeyName2,
  603. IN BYTE Type,
  604. IN BYTE Instance
  605. );
  606. BOOL
  607. MemDbDeleteLinkageW (
  608. IN PCWSTR KeyName1,
  609. IN PCWSTR KeyName2,
  610. IN BYTE Type,
  611. IN BYTE Instance
  612. );
  613. BOOL
  614. MemDbDeleteLinkageByKeyHandle (
  615. IN KEYHANDLE KeyHandle1,
  616. IN KEYHANDLE KeyHandle2,
  617. IN BYTE Type,
  618. IN BYTE Instance
  619. );
  620. KEYHANDLE
  621. MemDbGetLinkageA (
  622. IN PCSTR KeyName,
  623. IN BYTE Type,
  624. IN BYTE Instance,
  625. IN UINT LinkageIndex
  626. );
  627. KEYHANDLE
  628. MemDbGetLinkageW (
  629. IN PCWSTR KeyName,
  630. IN BYTE Type,
  631. IN BYTE Instance,
  632. IN UINT LinkageIndex
  633. );
  634. KEYHANDLE
  635. MemDbGetLinkageByKeyHandle (
  636. IN KEYHANDLE KeyHandle,
  637. IN BYTE Type,
  638. IN BYTE Instance,
  639. IN UINT LinkageIndex
  640. );
  641. BOOL
  642. MemDbTestLinkageA (
  643. IN PCSTR KeyName1,
  644. IN PCSTR KeyName2,
  645. IN BYTE Type,
  646. IN BYTE Instance
  647. );
  648. BOOL
  649. MemDbTestLinkageW (
  650. IN PCWSTR KeyName1,
  651. IN PCWSTR KeyName2,
  652. IN BYTE Type,
  653. IN BYTE Instance
  654. );
  655. BOOL
  656. MemDbTestLinkageByKeyHandle (
  657. IN KEYHANDLE KeyHandle1,
  658. IN KEYHANDLE KeyHandle2,
  659. IN BYTE Type,
  660. IN BYTE Instance
  661. );
  662. // high-level linkage functions
  663. #define MemDbAddSingleLinkageValueA(k,i,l,a) MemDbAddLinkageValueA(k,DATAFLAG_SINGLELINK,i,l,a)
  664. #define MemDbAddSingleLinkageValueW(k,i,l,a) MemDbAddLinkageValueW(k,DATAFLAG_SINGLELINK,i,l,a)
  665. #define MemDbAddSingleLinkageValueByKeyHandle(k,i,l,a) MemDbAddLinkageValueByKeyHandle(k,DATAFLAG_SINGLELINK,i,l,a)
  666. #define MemDbAddSingleLinkageValueByDataHandle(h,l,a) MemDbAddLinkagaValueByDataHandle(h,l,a)
  667. #define MemDbDeleteSingleLinkageValueA(k,i,l,f) MemDbDeleteLinkageValueA(k,DATAFLAG_SINGLELINK,i,l,f)
  668. #define MemDbDeleteSingleLinkageValueW(k,i,l,f) MemDbDeleteLinkageValueW(k,DATAFLAG_SINGLELINK,i,l,f)
  669. #define MemDbDeleteSingleLinkageValueByKeyHandle(k,i,l,f) MemDbDeleteLinkageValueByKeyHandle(k,DATAFLAG_SINGLELINK,i,l,f)
  670. #define MemDbDeleteSingleLinkageValueByDataHandle(h,l,f) MemDbDeleteLinkagaValueByDataHandle(h,l,f)
  671. #define MemDbSetSingleLinkageArrayA(k,i,d,s) MemDbSetLinkageArrayA(k,DATAFLAG_SINGLELINK,i,d,s)
  672. #define MemDbSetSingleLinkageArrayW(k,i,d,s) MemDbSetLinkageArrayW(k,DATAFLAG_SINGLELINK,i,d,s)
  673. #define MemDbSetSingleLinkageArrayByKeyHandle(h,i,d,s) MemDbSetLinkageArrayByKeyHandle(h,DATAFLAG_SINGLELINK,i,d,s)
  674. #define MemDbSetSingleLinkageArrayByDataHandle(h,d,s) MemDbSetLinkageArrayByDataHandle(h,d,s)
  675. #define MemDbGetSingleLinkageArrayA(k,i,s) (PUINT)MemDbGetLinkageArrayA(k,DATAFLAG_SINGLELINK,i,s)
  676. #define MemDbGetSingleLinkageArrayW(k,i,s) (PUINT)MemDbGetLinkageArrayW(k,DATAFLAG_SINGLELINK,i,s)
  677. #define MemDbGetSingleLinkageArrayByKeyHandle(h,i,s) (PUINT)MemDbGetLinkageArrayByKeyHandle(h,DATAFLAG_SINGLELINK,i,s)
  678. #define MemDbGetSingleLinkageArrayByKeyHandleEx(h,i,b,s) (PUINT)MemDbGetLinkageArrayByKeyHandleEx(h,DATAFLAG_SINGLELINK,i,b,s)
  679. #define MemDbGetSingleLinkageArrayByDataHandle(h,s) (PUINT)MemDbGetLinkageArrayByDataHandle(h,s)
  680. #define MemDbGetSingleLinkageArrayByDataHandleEx(h,b,s) (PUINT)MemDbGetLinkageArrayByDataHandleEx(h,b,s)
  681. #define MemDbTestSingleLinkageValueA(k,i,l) MemDbTestLinkageValueA(k,DATAFLAG_SINGLELINK,i,l)
  682. #define MemDbTestSingleLinkageValueW(k,i,l) MemDbTestLinkageValueW(k,DATAFLAG_SINGLELINK,i,l)
  683. #define MemDbTestSingleLinkageValueByKeyHandle(h,i,l) MemDbTestLinkageValueByKeyHandle(h,DATAFLAG_SINGLELINK,i,l)
  684. #define MemDbTestSingleLinkageValueByDataHandle(h,l) MemDbTestLinkageValueByDataHandle(h,l)
  685. #define MemDbAddDoubleLinkageValueA (k,i,l,a) MemDbAddLinkageValueA(k,DATAFLAG_DOUBLELINK,i,l,a)
  686. #define MemDbAddDoubleLinkageValueW (k,i,l,a) MemDbAddLinkageValueW(k,DATAFLAG_DOUBLELINK,i,l,a)
  687. #define MemDbAddDoubleLinkageValueByKeyHandle(k,i,l,a) MemDbAddLinkageValueByKeyHandle(k,DATAFLAG_DOUBLELINK,i,l,a)
  688. #define MemDbAddDoubleLinkageValueByDataHandle(h,l,a) MemDbAddLinkagaValueByDataHandle(h,l,a)
  689. #define MemDbDeleteDoubleLinkageValueA(k,i,l,f) MemDbDeleteLinkageValueA(k,DATAFLAG_DOUBLELINK,i,l,f)
  690. #define MemDbDeleteDoubleLinkageValueW(k,i,l,f) MemDbDeleteLinkageValueW(k,DATAFLAG_DOUBLELINK,i,l,f)
  691. #define MemDbDeleteDoubleLinkageValueByKeyHandle(k,i,l,f) MemDbDeleteLinkageValueByKeyHandle(k,DATAFLAG_DOUBLELINK,i,l,f)
  692. #define MemDbDeleteDoubleLinkageValueByDataHandle(h,l,f) MemDbDeleteLinkagaValueByDataHandle(h,l,f)
  693. #define MemDbSetDoubleLinkageArrayA(k,i,d,s) MemDbSetLinkageArrayA(k,DATAFLAG_DOUBLELINK,i,d,s)
  694. #define MemDbSetDoubleLinkageArrayW(k,i,d,s) MemDbSetLinkageArrayW(k,DATAFLAG_DOUBLELINK,i,d,s)
  695. #define MemDbSetDoubleLinkageArrayByKeyHandle(h,i,d,s) MemDbSetLinkageArrayByKeyHandle(h,DATAFLAG_DOUBLELINK,i,d,s)
  696. #define MemDbSetDoubleLinkageArrayByDataHandle(h,d,s) MemDbSetLinkageArrayByDataHandle(h,d,s)
  697. #define MemDbGetDoubleLinkageArrayA(k,i,s) (PUINT)MemDbGetLinkageArrayA(k,DATAFLAG_DOUBLELINK,i,s)
  698. #define MemDbGetDoubleLinkageArrayW(k,i,s) (PUINT)MemDbGetLinkageArrayW(k,DATAFLAG_DOUBLELINK,i,s)
  699. #define MemDbGetDoubleLinkageArrayByKeyHandle(h,i,s) (PUINT)MemDbGetLinkageArrayByKeyHandle(h,DATAFLAG_DOUBLELINK,i,s)
  700. #define MemDbGetDoubleLinkageArrayByKeyHandleEx(h,i,b,s) (PUINT)MemDbGetLinkageArrayByKeyHandleEx(h,DATAFLAG_DOUBLELINK,i,b,s)
  701. #define MemDbGetDoubleLinkageArrayByDataHandle(h,s) (PUINT)MemDbGetLinkageArrayByDataHandle(h,s)
  702. #define MemDbGetDoubleLinkageArrayByDataHandleEx(h,b,s) (PUINT)MemDbGetLinkageArrayByDataHandleEx(h,b,s)
  703. #define MemDbTestDoubleLinkageValueA(k,i,l) MemDbTestLinkageValueA(k,DATAFLAG_DOUBLELINK,i,l)
  704. #define MemDbTestDoubleLinkageValueW(k,i,l) MemDbTestLinkageValueW(k,DATAFLAG_DOUBLELINK,i,l)
  705. #define MemDbTestDoubleLinkageValueByKeyHandle(h,i,l) MemDbTestLinkageValueByKeyHandle(h,DATAFLAG_DOUBLELINK,i,l)
  706. #define MemDbTestDoubleLinkageValueByDataHandle(h,l) MemDbTestLinkageValueByDataHandle(h,l)
  707. #define MemDbAddSingleLinkageA(k1,k2,i) MemDbAddLinkageA(k1,k2,DATAFLAG_SINGLELINK,i)
  708. #define MemDbAddSingleLinkageW(k1,k2,i) MemDbAddLinkageW(k1,k2,DATAFLAG_SINGLELINK,i)
  709. #define MemDbAddSingleLinkageByKeyHandle(h1,h2,i) MemDbAddLinkageByKeyHandle(h1,h2,DATAFLAG_SINGLELINK,i)
  710. #define MemDbDeleteSingleLinkageA(k1,k2,i) MemDbDeleteLinkageA(k1,k2,DATAFLAG_SINGLELINK,i)
  711. #define MemDbDeleteSingleLinkageW(k1,k2,i) MemDbDeleteLinkageW(k1,k2,DATAFLAG_SINGLELINK,i)
  712. #define MemDbDeleteSingleLinkageByKeyHandle(h1,h2,i) MemDbDeleteLinkageByKeyHandle(h1,h2,DATAFLAG_SINGLELINK,i)
  713. #define MemDbGetSingleLinkageA(k,i,l) MemDbGetLinkageA(k,DATAFLAG_SINGLELINK,i,l)
  714. #define MemDbGetSingleLinkageW(k,i,l) MemDbGetLinkageW(k,DATAFLAG_SINGLELINK,i,l)
  715. #define MemDbGetSingleLinkageByKeyHandle(h,i,l) MemDbGetLinkageByKeyHandle(h,DATAFLAG_SINGLELINK,i,l)
  716. #define MemDbTestSingleLinkageA(k1,k2,i) MemDbTestLinkageA(k1,k2,DATAFLAG_SINGLELINK,i)
  717. #define MemDbTestSingleLinkageW(k1,k2,i) MemDbTestLinkageW(k1,k2,DATAFLAG_SINGLELINK,i)
  718. #define MemDbTestSingleLinkageByKeyHandle(h1,h2,i) MemDbTestLinkageByKeyHandle(h1,h2,DATAFLAG_SINGLELINK,i)
  719. #define MemDbAddDoubleLinkageA(k1,k2,i) MemDbAddLinkageA(k1,k2,DATAFLAG_DOUBLELINK,i)
  720. #define MemDbAddDoubleLinkageW(k1,k2,i) MemDbAddLinkageW(k1,k2,DATAFLAG_DOUBLELINK,i)
  721. #define MemDbAddDoubleLinkageByKeyHandle(h1,h2,i) MemDbAddLinkageByKeyHandle(h1,h2,DATAFLAG_DOUBLELINK,i)
  722. #define MemDbDeleteDoubleLinkageA(k1,k2,i) MemDbDeleteLinkageA(k1,k2,DATAFLAG_DOUBLELINK,i)
  723. #define MemDbDeleteDoubleLinkageW(k1,k2,i) MemDbDeleteLinkageW(k1,k2,DATAFLAG_DOUBLELINK,i)
  724. #define MemDbDeleteDoubleLinkageByKeyHandle(h1,h2,i) MemDbDeleteLinkageByKeyHandle(h1,h2,DATAFLAG_DOUBLELINK,i)
  725. #define MemDbGetDoubleLinkageA(k,i,l) MemDbGetLinkageA(k,DATAFLAG_DOUBLELINK,i,l)
  726. #define MemDbGetDoubleLinkageW(k,i,l) MemDbGetLinkageW(k,DATAFLAG_DOUBLELINK,i,l)
  727. #define MemDbGetDoubleLinkageByKeyHandle(h,i,l) MemDbGetLinkageByKeyHandle(h,DATAFLAG_DOUBLELINK,i,l)
  728. #define MemDbTestDoubleLinkageA(k1,k2,i) MemDbTestLinkageA(k1,k2,DATAFLAG_DOUBLELINK,i)
  729. #define MemDbTestDoubleLinkageW(k1,k2,i) MemDbTestLinkageW(k1,k2,DATAFLAG_DOUBLELINK,i)
  730. #define MemDbTestDoubleLinkageByKeyHandle(h1,h2,i) MemDbTestLinkageByKeyHandle(h1,h2,DATAFLAG_DOUBLELINK,i)
  731. // enumeration functions
  732. BOOL
  733. RealMemDbEnumFirstExA (
  734. IN OUT PMEMDB_ENUMA MemDbEnum,
  735. IN PCSTR EnumPattern,
  736. IN UINT EnumFlags,
  737. IN UINT BeginLevel,
  738. IN UINT EndLevel,
  739. IN PMEMDB_PATTERNSTRUCTW PatternStruct OPTIONAL
  740. );
  741. #define MemDbEnumFirstExA(m,p,f,b,e,s) TRACK_BEGIN(BOOL, MemDbEnumFirstExA)\
  742. RealMemDbEnumFirstExA(m,p,f,b,e,s)\
  743. TRACK_END()
  744. #define MemDbEnumFirstA(e,p,f,l1,l2) MemDbEnumFirstExA(e,p,f,l1,l2,NULL)
  745. BOOL
  746. RealMemDbEnumFirstExW (
  747. IN OUT PMEMDB_ENUMW MemDbEnum,
  748. IN PCWSTR EnumPattern,
  749. IN UINT EnumFlags,
  750. IN UINT BeginLevel,
  751. IN UINT EndLevel,
  752. IN PMEMDB_PATTERNSTRUCTW PatternStruct OPTIONAL
  753. );
  754. #define MemDbEnumFirstExW(m,p,f,b,e,s) TRACK_BEGIN(BOOL, MemDbEnumFirstExW)\
  755. RealMemDbEnumFirstExW(m,p,f,b,e,s)\
  756. TRACK_END()
  757. #define MemDbEnumFirstW(e,p,f,l1,l2) MemDbEnumFirstExW(e,p,f,l1,l2,NULL)
  758. BOOL
  759. RealMemDbEnumNextA (
  760. IN OUT PMEMDB_ENUMA MemDbEnum
  761. );
  762. #define MemDbEnumNextA(m) TRACK_BEGIN(BOOL, MemDbEnumNextA)\
  763. RealMemDbEnumNextA(m)\
  764. TRACK_END()
  765. BOOL
  766. RealMemDbEnumNextW (
  767. IN OUT PMEMDB_ENUMW MemDbEnum
  768. );
  769. #define MemDbEnumNextW(m) TRACK_BEGIN(BOOL, MemDbEnumNextW)\
  770. RealMemDbEnumNextW(m)\
  771. TRACK_END()
  772. BOOL
  773. MemDbAbortEnumA (
  774. IN OUT PMEMDB_ENUMA MemDbEnum
  775. );
  776. BOOL
  777. MemDbAbortEnumW (
  778. IN OUT PMEMDB_ENUMW MemDbEnum
  779. );
  780. BOOL
  781. MemDbSetInsertionOrderedA (
  782. IN PCSTR Key
  783. );
  784. BOOL
  785. MemDbSetInsertionOrderedW (
  786. IN PCWSTR Key
  787. );
  788. BOOL
  789. MemDbSetInsertionOrderedByKeyHandle (
  790. IN KEYHANDLE KeyHandle
  791. );
  792. BOOL
  793. MemDbMoveKeyHandleToEnd (
  794. IN KEYHANDLE KeyHandle
  795. );
  796. BOOL
  797. MemDbSaveA (
  798. IN PCSTR szFile
  799. );
  800. BOOL
  801. MemDbSaveW (
  802. IN PCWSTR szFile
  803. );
  804. BOOL
  805. MemDbLoadA (
  806. IN PCSTR szFile
  807. );
  808. BOOL
  809. MemDbLoadW (
  810. IN PCWSTR szFile
  811. );
  812. BOOL
  813. MemDbValidateDatabase (
  814. VOID
  815. );
  816. BOOL
  817. MemDbQueryVersionA (
  818. IN PCSTR FileName,
  819. OUT PMEMDB_VERSION Version
  820. );
  821. BOOL
  822. MemDbQueryVersionW (
  823. IN PCWSTR FileName,
  824. OUT PMEMDB_VERSION Version
  825. );
  826. BOOL
  827. MemDbExportA (
  828. IN PCSTR RootTree,
  829. IN PCSTR FileName,
  830. IN BOOL AnsiFormat
  831. );
  832. BOOL
  833. MemDbExportW (
  834. IN PCWSTR RootTree,
  835. IN PCWSTR FileName,
  836. IN BOOL AnsiFormat
  837. );
  838. BOOL
  839. MemDbImportA (
  840. IN PCSTR FileName
  841. );
  842. BOOL
  843. MemDbImportW (
  844. IN PCWSTR FileName
  845. );
  846. PCBYTE
  847. MemDbGetDatabaseAddress (
  848. VOID
  849. );
  850. UINT
  851. MemDbGetDatabaseSize (
  852. VOID
  853. );
  854. #define MEMDB_CONVERT_DOUBLEWACKS_TO_ASCII_1 0x0001
  855. #define MEMDB_CONVERT_WILD_STAR_TO_ASCII_2 0x0002
  856. #define MEMDB_CONVERT_WILD_QMARK_TO_ASCII_3 0x0002
  857. // other conversion to be implemented when needed
  858. VOID MemDbMakeNonPrintableKeyA (PSTR KeyName, UINT Flags);
  859. VOID MemDbMakeNonPrintableKeyW (PWSTR KeyName, UINT Flags);
  860. VOID MemDbMakePrintableKeyA (PSTR KeyName, UINT Flags);
  861. VOID MemDbMakePrintableKeyW (PWSTR KeyName, UINT Flags);
  862. VOID GetFixedUserNameA (PSTR UserName);
  863. VOID GetFixedUserNameW (PWSTR UserName);
  864. #ifdef DEBUG
  865. extern UINT g_DatabaseCheckLevel;
  866. #define MEMDB_CHECKLEVEL1 0x000001
  867. #define MEMDB_CHECKLEVEL2 0x000002
  868. #define MEMDB_CHECKLEVEL3 0x000003
  869. BOOL MemDbCheckDatabase(UINT Level);
  870. #else
  871. #define MemDbCheckDatabase()
  872. #endif
  873. //
  874. // A & W
  875. //
  876. #ifdef UNICODE
  877. #define MemDbInitialize MemDbInitializeW
  878. #define MemDbInitializeEx MemDbInitializeExW
  879. #define MemDbAddKey MemDbAddKeyW
  880. #define MemDbSetKey MemDbSetKeyW
  881. #define MemDbTestKey MemDbTestKeyW
  882. #define MemDbDeleteKey MemDbDeleteKeyW
  883. #define MemDbDeleteTree MemDbDeleteTreeW
  884. #define MemDbGetKeyFromHandle MemDbGetKeyFromHandleW
  885. #define MemDbGetKeyFromHandleEx MemDbGetKeyFromHandleExW
  886. #define MemDbGetHandleFromKey MemDbGetHandleFromKeyW
  887. #define MemDbSetValueAndFlagsEx MemDbSetValueAndFlagsExW
  888. #define MemDbGetValueAndFlags MemDbGetValueAndFlagsW
  889. #define MemDbSetValueAndFlags MemDbSetValueAndFlagsW
  890. #define MemDbSetValue MemDbSetValueW
  891. #define MemDbGetValue MemDbGetValueW
  892. #define MemDbSetFlags MemDbSetFlagsW
  893. #define MemDbReplaceFlags MemDbReplaceFlagsW
  894. #define MemDbGetFlags MemDbGetFlagsW
  895. #define MemDbAddData MemDbAddDataW
  896. #define MemDbSetData MemDbSetDataW
  897. #define MemDbGrowData MemDbGrowDataW
  898. #define MemDbGetDataHandle MemDbGetDataHandleW
  899. #define MemDbGetData MemDbGetDataW
  900. #define MemDbGetDataEx MemDbGetDataExW
  901. #define MemDbDeleteData MemDbDeleteDataW
  902. #define MemDbAddUnorderedBlob MemDbAddUnorderedBlobW
  903. #define MemDbSetUnorderedBlob MemDbSetUnorderedBlobW
  904. #define MemDbGrowUnorderedBlob MemDbGrowUnorderedBlobW
  905. #define MemDbGetUnorderedBlob MemDbGetUnorderedBlobW
  906. #define MemDbGetUnorderedBlobEx MemDbGetUnorderedBlobExW
  907. #define MemDbDeleteUnorderedBlob MemDbDeleteUnorderedBlobW
  908. #define MemDbAddLinkageValue MemDbAddLinkageValueW
  909. #define MemDbDeleteLinkageValue MemDbDeleteLinkageValueW
  910. #define MemDbSetLinkageArray MemDbSetLinkageArrayW
  911. #define MemDbGetLinkageArray MemDbGetLinkageArrayW
  912. #define MemDbAddSingleLinkageValue MemDbAddSingleLinkageValueW
  913. #define MemDbDeleteSingleLinkageValue MemDbDeleteSingleLinkageValueW
  914. #define MemDbSetSingleLinkageArray MemDbSetSingleLinkageArrayW
  915. #define MemDbGetSingleLinkageArray MemDbGetSingleLinkageArrayW
  916. #define MemDbAddDoubleLinkageValue MemDbAddDoubleLinkageValueW
  917. #define MemDbDeleteDoubleLinkageValue MemDbDeleteDoubleLinkageValueW
  918. #define MemDbSetDoubleLinkageArray MemDbSetDoubleLinkageArrayW
  919. #define MemDbGetDoubleLinkageArray MemDbGetDoubleLinkageArrayW
  920. #define MemDbTestLinkageValue MemDbTestLinkageValueW
  921. #define MemDbTestSingleLinkageValue MemDbTestSingleLinkageValueW
  922. #define MemDbTestDoubleLinkageValue MemDbTestDoubleLinkageValueW
  923. #define MemDbAddLinkage MemDbAddLinkageW
  924. #define MemDbGetLinkage MemDbGetLinkageW
  925. #define MemDbTestLinkage MemDbTestLinkageW
  926. #define MemDbAddSingleLinkage MemDbAddSingleLinkageW
  927. #define MemDbDeleteSingleLinkage MemDbDeleteSingleLinkageW
  928. #define MemDbGetSingleLinkage MemDbGetSingleLinkageW
  929. #define MemDbTestSingleLinkage MemDbTestSingleLinkageW
  930. #define MemDbAddDoubleLinkage MemDbAddDoubleLinkageW
  931. #define MemDbDeleteDoubleLinkage MemDbDeleteDoubleLinkageW
  932. #define MemDbGetDoubleLinkage MemDbGetDoubleLinkageW
  933. #define MemDbTestDoubleLinkage MemDbTestDoubleLinkageW
  934. #define MemDbEnumFirst MemDbEnumFirstW
  935. #define MemDbEnumFirstEx MemDbEnumFirstExW
  936. #define MemDbEnumNext MemDbEnumNextW
  937. #define MemDbAbortEnum MemDbAbortEnumW
  938. #define MEMDB_ENUM MEMDB_ENUMW
  939. #define PMEMDB_ENUM PMEMDB_ENUMW
  940. #define MemDbSave MemDbSaveW
  941. #define MemDbLoad MemDbLoadW
  942. #define MemDbQueryVersion MemDbQueryVersionW
  943. #define MemDbExport MemDbExportW
  944. #define MemDbImport MemDbImportW
  945. #define MemDbMakeNonPrintableKey MemDbMakeNonPrintableKeyW
  946. #define MemDbMakePrintableKey MemDbMakePrintableKeyW
  947. #define GetFixedUserName GetFixedUserNameW
  948. #define MemDbSetInsertionOrdered MemDbSetInsertionOrderedW
  949. #else
  950. #define MemDbInitialize MemDbInitializeA
  951. #define MemDbInitializeEx MemDbInitializeExA
  952. #define MemDbAddKey MemDbAddKeyA
  953. #define MemDbSetKey MemDbSetKeyA
  954. #define MemDbTestKey MemDbTestKeyA
  955. #define MemDbDeleteKey MemDbDeleteKeyA
  956. #define MemDbDeleteTree MemDbDeleteTreeA
  957. #define MemDbGetKeyFromHandle MemDbGetKeyFromHandleA
  958. #define MemDbGetKeyFromHandleEx MemDbGetKeyFromHandleExA
  959. #define MemDbGetHandleFromKey MemDbGetHandleFromKeyA
  960. #define MemDbSetValueAndFlagsEx MemDbSetValueAndFlagsExA
  961. #define MemDbGetValueAndFlags MemDbGetValueAndFlagsA
  962. #define MemDbSetValueAndFlags MemDbSetValueAndFlagsA
  963. #define MemDbSetValue MemDbSetValueA
  964. #define MemDbGetValue MemDbGetValueA
  965. #define MemDbSetFlags MemDbSetFlagsA
  966. #define MemDbReplaceFlags MemDbReplaceFlagsA
  967. #define MemDbGetFlags MemDbGetFlagsA
  968. #define MemDbAddData MemDbAddDataA
  969. #define MemDbSetData MemDbSetDataA
  970. #define MemDbGrowData MemDbGrowDataA
  971. #define MemDbGetDataHandle MemDbGetDataHandleA
  972. #define MemDbGetData MemDbGetDataA
  973. #define MemDbGetDataEx MemDbGetDataExA
  974. #define MemDbDeleteData MemDbDeleteDataA
  975. #define MemDbAddUnorderedBlob MemDbAddUnorderedBlobA
  976. #define MemDbSetUnorderedBlob MemDbSetUnorderedBlobA
  977. #define MemDbGrowUnorderedBlob MemDbGrowUnorderedBlobA
  978. #define MemDbGetUnorderedBlob MemDbGetUnorderedBlobA
  979. #define MemDbGetUnorderedBlobEx MemDbGetUnorderedBlobExA
  980. #define MemDbDeleteUnorderedBlob MemDbDeleteUnorderedBlobA
  981. #define MemDbAddLinkageValue MemDbAddLinkageValueA
  982. #define MemDbDeleteLinkageValue MemDbDeleteLinkageValueA
  983. #define MemDbSetLinkageArray MemDbSetLinkageArrayA
  984. #define MemDbGetLinkageArray MemDbGetLinkageArrayA
  985. #define MemDbAddSingleLinkageValue MemDbAddSingleLinkageValueA
  986. #define MemDbDeleteSingleLinkageValue MemDbDeleteSingleLinkageValueA
  987. #define MemDbSetSingleLinkageArray MemDbSetSingleLinkageArrayA
  988. #define MemDbGetSingleLinkageArray MemDbGetSingleLinkageArrayA
  989. #define MemDbAddDoubleLinkageValue MemDbAddDoubleLinkageValueA
  990. #define MemDbDeleteDoubleLinkageValue MemDbDeleteDoubleLinkageValueA
  991. #define MemDbSetDoubleLinkageArray MemDbSetDoubleLinkageArrayA
  992. #define MemDbGetDoubleLinkageArray MemDbGetDoubleLinkageArrayA
  993. #define MemDbTestLinkageValue MemDbTestLinkageValueA
  994. #define MemDbTestSingleLinkageValue MemDbTestSingleLinkageValueA
  995. #define MemDbTestDoubleLinkageValue MemDbTestDoubleLinkageValueA
  996. #define MemDbAddLinkage MemDbAddLinkageA
  997. #define MemDbGetLinkage MemDbGetLinkageA
  998. #define MemDbTestLinkage MemDbTestLinkageA
  999. #define MemDbAddSingleLinkage MemDbAddSingleLinkageA
  1000. #define MemDbDeleteSingleLinkage MemDbDeleteSingleLinkageA
  1001. #define MemDbGetSingleLinkage MemDbGetSingleLinkageA
  1002. #define MemDbTestSingleLinkage MemDbTestSingleLinkageA
  1003. #define MemDbAddDoubleLinkage MemDbAddDoubleLinkageA
  1004. #define MemDbDeleteDoubleLinkage MemDbDeleteDoubleLinkageA
  1005. #define MemDbGetDoubleLinkage MemDbGetDoubleLinkageA
  1006. #define MemDbTestDoubleLinkage MemDbTestDoubleLinkageA
  1007. #define MemDbEnumFirst MemDbEnumFirstA
  1008. #define MemDbEnumFirstEx MemDbEnumFirstExA
  1009. #define MemDbEnumNext MemDbEnumNextA
  1010. #define MemDbAbortEnum MemDbAbortEnumA
  1011. #define MEMDB_ENUM MEMDB_ENUMA
  1012. #define PMEMDB_ENUM PMEMDB_ENUMA
  1013. #define MemDbSave MemDbSaveA
  1014. #define MemDbLoad MemDbLoadA
  1015. #define MemDbQueryVersion MemDbQueryVersionA
  1016. #define MemDbExport MemDbExportA
  1017. #define MemDbImport MemDbImportA
  1018. #define MemDbMakeNonPrintableKey MemDbMakeNonPrintableKeyA
  1019. #define MemDbMakePrintableKey MemDbMakePrintableKeyA
  1020. #define GetFixedUserName GetFixedUserNameA
  1021. #define MemDbSetInsertionOrdered MemDbSetInsertionOrderedA
  1022. #endif