Leaked source code of windows server 2003
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.

762 lines
19 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. migutil.h
  5. Abstract:
  6. Includes all header files necessary to use the lib generated by
  7. common\migutil. Declares a bunch of utility functions and macros.
  8. Declares project-wide MAX constants.
  9. Author:
  10. Jim Schmidt (jimschm) 23-Aug-1996
  11. Revision History:
  12. Many changes, see SLM log for details.
  13. --*/
  14. #pragma once
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. //
  19. // MAX constants
  20. //
  21. #define MAX_PATH_PLUS_NUL (MAX_PATH+1)
  22. #define MAX_MBCHAR_PATH (MAX_PATH_PLUS_NUL*2)
  23. #define MAX_WCHAR_PATH MAX_PATH_PLUS_NUL
  24. #define MAX_MBCHAR_PRINTABLE_PATH (MAX_PATH*2)
  25. #define MAX_WCHAR_PRINTABLE_PATH MAX_PATH
  26. #define MAX_SERVER_NAMEA (64*2)
  27. #define MAX_USER_NAMEA (MAX_PATH)
  28. #define MAX_REGISTRY_KEYA (1024 * 2)
  29. #define MAX_REGISTRY_VALUE_NAMEA (260 * 2)
  30. #define MAX_COMPONENT_NAMEA (256 * 2)
  31. #define MAX_COMPUTER_NAMEA (64 * 2)
  32. #define MAX_CMDLINEA (1024 * 2) // maximum number of chars in a Win95 command line
  33. #define MAX_TRANSLATION 32
  34. #define MAX_KEYBOARDLAYOUT 64
  35. #define MAX_INF_SECTION_NAME 128
  36. #define MAX_INF_KEY_NAME 128
  37. #define MAX_SERVER_NAMEW 64
  38. #define MAX_USER_NAMEW (MAX_PATH)
  39. #define MAX_REGISTRY_KEYW 1024
  40. #define MAX_REGISTRY_VALUE_NAMEW 260
  41. #define MAX_COMPONENT_NAMEW 256
  42. #define MAX_COMPUTER_NAMEW 64
  43. #define MAX_CMDLINEW 1024 // maximum number of chars in a Win95 command line
  44. #ifdef UNICODE
  45. #define MAX_SERVER_NAME MAX_SERVER_NAMEW
  46. #define MAX_USER_NAME MAX_USER_NAMEW
  47. #define MAX_REGISTRY_KEY MAX_REGISTRY_KEYW
  48. #define MAX_REGISTRY_VALUE_NAME MAX_REGISTRY_VALUE_NAMEW
  49. #define MAX_COMPONENT_NAME MAX_COMPONENT_NAMEW
  50. #define MAX_COMPUTER_NAME MAX_COMPUTER_NAMEW
  51. #define MAX_CMDLINE MAX_CMDLINEW
  52. #define MAX_TCHAR_PATH MAX_WCHAR_PATH
  53. #define MAX_TCHAR_PRINTABLE_PATH MAX_WCHAR_PRINTABLE_PATH
  54. #else
  55. #define MAX_SERVER_NAME MAX_SERVER_NAMEA
  56. #define MAX_USER_NAME MAX_USER_NAMEA
  57. #define MAX_REGISTRY_KEY MAX_REGISTRY_KEYA
  58. #define MAX_REGISTRY_VALUE_NAME MAX_REGISTRY_VALUE_NAMEA
  59. #define MAX_COMPONENT_NAME MAX_COMPONENT_NAMEA
  60. #define MAX_COMPUTER_NAME MAX_COMPUTER_NAMEA
  61. #define MAX_CMDLINE MAX_CMDLINEA
  62. #define MAX_TCHAR_PATH MAX_MBCHAR_PATH
  63. #define MAX_TCHAR_PRINTABLE_PATH MAX_MBCHAR_PRINTABLE_PATH
  64. #endif
  65. //
  66. // Critical Section APIs, implemented because TryEnterCriticalSection is
  67. // supported only on NT, and we need it on Win9x.
  68. //
  69. typedef struct {
  70. HANDLE EventHandle;
  71. } OUR_CRITICAL_SECTION, *POUR_CRITICAL_SECTION;
  72. BOOL
  73. InitializeOurCriticalSection (
  74. OUR_CRITICAL_SECTION *pcs
  75. );
  76. VOID
  77. DeleteOurCriticalSection (
  78. OUR_CRITICAL_SECTION *pcs
  79. );
  80. BOOL
  81. EnterOurCriticalSection (
  82. OUR_CRITICAL_SECTION *pcs
  83. );
  84. VOID
  85. LeaveOurCriticalSection (
  86. OUR_CRITICAL_SECTION *pcs
  87. );
  88. BOOL
  89. TryEnterOurCriticalSection (
  90. OUR_CRITICAL_SECTION *pcs
  91. );
  92. PSTR
  93. UnicodeToCcs (
  94. PCWSTR Source
  95. );
  96. //
  97. // Fail-proof memory allocators
  98. //
  99. PVOID
  100. SafeHeapAlloc (
  101. HANDLE g_hHeap,
  102. DWORD Flags,
  103. SIZE_T Size
  104. );
  105. PVOID
  106. SafeHeapReAlloc (
  107. HANDLE g_hHeap,
  108. DWORD Flags,
  109. PVOID OldBlock,
  110. SIZE_T Size
  111. );
  112. //
  113. // Includes of util modules
  114. //
  115. extern HINSTANCE g_hInst;
  116. extern HANDLE g_hHeap;
  117. extern OSVERSIONINFOA g_OsInfo;
  118. extern BOOL g_IsMbcp;
  119. #include "debug.h"
  120. #include "log.h"
  121. #include "staticsz.h"
  122. #include "growbuf.h" // must appear before strings.h and file.h
  123. #include "strings.h"
  124. #include "poolmem.h"
  125. #include "growlist.h"
  126. #include "file.h"
  127. #include "reg.h"
  128. #include "ipc.h"
  129. #include "fileenum.h"
  130. #include "inf.h"
  131. #include "unicode.h"
  132. #include "hash.h"
  133. #include "persist.h"
  134. VOID
  135. CenterWindow (
  136. HWND Wnd,
  137. HWND Parent OPTIONAL
  138. );
  139. VOID
  140. TurnOnWaitCursor (
  141. VOID
  142. );
  143. VOID
  144. TurnOffWaitCursor (
  145. VOID
  146. );
  147. //
  148. // Version APIs
  149. //
  150. typedef struct {
  151. WORD CodePage;
  152. WORD Language;
  153. } TRANSLATION, *PTRANSLATION;
  154. typedef struct {
  155. GROWBUFFER GrowBuf;
  156. PBYTE VersionBuffer;
  157. PTRANSLATION Translations;
  158. PBYTE StringBuffer;
  159. UINT Size;
  160. DWORD Handle;
  161. VS_FIXEDFILEINFO *FixedInfo;
  162. UINT FixedInfoSize;
  163. CHAR TranslationStr[MAX_TRANSLATION];
  164. UINT MaxTranslations;
  165. UINT CurrentTranslation;
  166. UINT CurrentDefaultTranslation;
  167. PCSTR FileSpec;
  168. PCSTR VersionField;
  169. } VERSION_STRUCTA, *PVERSION_STRUCTA;
  170. typedef struct {
  171. GROWBUFFER GrowBuf;
  172. PBYTE VersionBuffer;
  173. PTRANSLATION Translations;
  174. PBYTE StringBuffer;
  175. UINT Size;
  176. DWORD Handle;
  177. VS_FIXEDFILEINFO *FixedInfo;
  178. UINT FixedInfoSize;
  179. WCHAR TranslationStr[MAX_TRANSLATION];
  180. UINT MaxTranslations;
  181. UINT CurrentTranslation;
  182. UINT CurrentDefaultTranslation;
  183. PCWSTR FileSpec;
  184. PCWSTR VersionField;
  185. } VERSION_STRUCTW, *PVERSION_STRUCTW;
  186. BOOL
  187. CreateVersionStructA (
  188. OUT PVERSION_STRUCTA VersionStruct,
  189. IN PCSTR FileSpec
  190. );
  191. VOID
  192. DestroyVersionStructA (
  193. IN PVERSION_STRUCTA VersionStruct
  194. );
  195. PCSTR
  196. EnumFirstVersionTranslationA (
  197. IN OUT PVERSION_STRUCTA VersionStruct
  198. );
  199. PCSTR
  200. EnumNextVersionTranslationA (
  201. IN OUT PVERSION_STRUCTA VersionStruct
  202. );
  203. PCSTR
  204. EnumFirstVersionValueA (
  205. IN OUT PVERSION_STRUCTA VersionStruct,
  206. IN PCSTR VersionField
  207. );
  208. PCSTR
  209. EnumNextVersionValueA (
  210. IN OUT PVERSION_STRUCTA VersionStruct
  211. );
  212. BOOL
  213. CreateVersionStructW (
  214. OUT PVERSION_STRUCTW VersionStruct,
  215. IN PCWSTR FileSpec
  216. );
  217. VOID
  218. DestroyVersionStructW (
  219. IN PVERSION_STRUCTW VersionStruct
  220. );
  221. PCWSTR
  222. EnumFirstVersionTranslationW (
  223. IN OUT PVERSION_STRUCTW VersionStruct
  224. );
  225. PCWSTR
  226. EnumNextVersionTranslationW (
  227. IN OUT PVERSION_STRUCTW VersionStruct
  228. );
  229. PCWSTR
  230. EnumFirstVersionValueW (
  231. IN OUT PVERSION_STRUCTW VersionStruct,
  232. IN PCWSTR VersionField
  233. );
  234. PCWSTR
  235. EnumNextVersionValueW (
  236. IN OUT PVERSION_STRUCTW VersionStruct
  237. );
  238. ULONGLONG
  239. VerGetFileVer (
  240. IN PVERSION_STRUCTA VersionStruct
  241. );
  242. ULONGLONG
  243. VerGetProductVer (
  244. IN PVERSION_STRUCTA VersionStruct
  245. );
  246. DWORD
  247. VerGetFileDateLo (
  248. IN PVERSION_STRUCTA VersionStruct
  249. );
  250. DWORD
  251. VerGetFileDateHi (
  252. IN PVERSION_STRUCTA VersionStruct
  253. );
  254. DWORD
  255. VerGetFileVerOs (
  256. IN PVERSION_STRUCTA VersionStruct
  257. );
  258. DWORD
  259. VerGetFileVerType (
  260. IN PVERSION_STRUCTA VersionStruct
  261. );
  262. //
  263. // Reusable memory alloc, kind of like a GROWBUFFER but more simple
  264. //
  265. PVOID
  266. ReuseAlloc (
  267. HANDLE Heap,
  268. PVOID OldPtr,
  269. SIZE_T SizeNeeded
  270. );
  271. VOID
  272. ReuseFree (
  273. HANDLE Heap,
  274. PVOID Ptr
  275. );
  276. VOID
  277. OutOfMemory_Terminate (
  278. VOID
  279. );
  280. VOID
  281. SetOutOfMemoryParent (
  282. HWND hwnd
  283. );
  284. //
  285. // Error condition tags.
  286. //
  287. // These tags should be used for all error conditions.
  288. //
  289. #define ERROR_CRITICAL
  290. #define ERROR_NONCRITICAL
  291. #define ERROR_TRIVIAL
  292. #define ERROR_ABNORMAL_CONDITION
  293. //
  294. // OSVERSION macros...
  295. //
  296. #define BUILDNUMBER() (LOWORD(g_OsInfo.dwBuildNumber))
  297. #define ISNT() (g_OsInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
  298. #define ISWIN9X() (g_OsInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
  299. #define ISWIN95_GOLDEN() (ISWIN95() && BUILDNUMBER() <= 1000)
  300. #define ISWIN95_OSR2() (ISWIN95() && BUILDNUMBER() > 1000)
  301. #define ISWIN95() (ISWIN9X() && !ISATLEASTWIN98())
  302. #define ISMEMPHIS() (ISWIN9X() && g_OsInfo.dwMajorVersion==4 && g_OsInfo.dwMinorVersion==10)
  303. #define ISMILLENNIUM() (ISWIN9X() && g_OsInfo.dwMajorVersion==4 && g_OsInfo.dwMinorVersion==90)
  304. #define ISATLEASTOSR2() (ISWIN9X() && g_OsInfo.dwMajorVersion>=4 && BUILDNUMBER()>1000)
  305. #define ISATLEASTWIN98() (ISWIN9X() && g_OsInfo.dwMajorVersion>=4 && g_OsInfo.dwMinorVersion>=10)
  306. //
  307. // Platform macros...
  308. //
  309. extern BOOL g_IsPc98;
  310. #define ISPC98() (g_IsPc98)
  311. //
  312. // Boot drive letter
  313. //
  314. extern PCSTR g_BootDrivePathA;
  315. extern PCWSTR g_BootDrivePathW;
  316. extern PCSTR g_BootDriveA;
  317. extern PCWSTR g_BootDriveW;
  318. extern CHAR g_BootDriveLetterA;
  319. extern WCHAR g_BootDriveLetterW;
  320. //
  321. // String Mapping
  322. //
  323. #define STRMAP_ANY_MATCH 0
  324. #define STRMAP_COMPLETE_MATCH_ONLY 0x0001
  325. #define STRMAP_FIRST_CHAR_MUST_MATCH 0x0002
  326. #define STRMAP_RETURN_AFTER_FIRST_REPLACE 0x0004
  327. #define STRMAP_REQUIRE_WACK_OR_NUL 0x0008
  328. typedef struct {
  329. BOOL UnicodeData;
  330. //
  331. // The filter can replace NewSubString. (The filter must also
  332. // set NewSubStringSizeInBytes when replacing NewSubString.)
  333. //
  334. union {
  335. struct {
  336. PCWSTR OriginalString;
  337. PCWSTR BeginningOfMatch;
  338. PCWSTR CurrentString;
  339. PCWSTR OldSubString;
  340. PCWSTR NewSubString;
  341. INT NewSubStringSizeInBytes;
  342. } Unicode;
  343. struct {
  344. PCSTR OriginalString;
  345. PCSTR BeginningOfMatch;
  346. PCSTR CurrentString;
  347. PCSTR OldSubString;
  348. PCSTR NewSubString;
  349. INT NewSubStringSizeInBytes;
  350. } Ansi;
  351. };
  352. } REG_REPLACE_DATA, *PREG_REPLACE_DATA;
  353. typedef BOOL(REG_REPLACE_FILTER_PROTOTYPE)(PREG_REPLACE_DATA Data);
  354. typedef REG_REPLACE_FILTER_PROTOTYPE * REG_REPLACE_FILTER;
  355. typedef struct TAG_CHARNODE {
  356. WORD Char;
  357. WORD Flags;
  358. PVOID OriginalStr;
  359. PVOID ReplacementStr;
  360. INT ReplacementBytes;
  361. struct TAG_CHARNODE *NextLevel;
  362. struct TAG_CHARNODE *NextPeer;
  363. } CHARNODE, *PCHARNODE;
  364. typedef struct {
  365. CHARNODE Node;
  366. REG_REPLACE_FILTER Filter;
  367. ULONG_PTR ExtraData;
  368. } CHARNODEEX, *PCHARNODEEX;
  369. typedef struct {
  370. POOLHANDLE Pool;
  371. PCHARNODE FirstLevelRoot;
  372. BOOL UsesExNode;
  373. BOOL UsesFilter;
  374. BOOL UsesExtraData;
  375. } MAPSTRUCT, *PMAPSTRUCT;
  376. //
  377. // APIs
  378. //
  379. PMAPSTRUCT
  380. CreateStringMappingEx (
  381. IN BOOL UsesFilter,
  382. IN BOOL UsesExtraData
  383. );
  384. #define CreateStringMapping() CreateStringMappingEx(FALSE,FALSE)
  385. VOID
  386. DestroyStringMapping (
  387. IN PMAPSTRUCT Map
  388. );
  389. VOID
  390. AddStringMappingPairExA (
  391. IN OUT PMAPSTRUCT Map,
  392. IN PCSTR Old,
  393. IN PCSTR New,
  394. IN REG_REPLACE_FILTER Filter, OPTIONAL
  395. IN ULONG_PTR ExtraData, OPTIONAL
  396. IN DWORD Flags
  397. );
  398. #define AddStringMappingPairA(Map,Old,New) AddStringMappingPairExA(Map,Old,New,NULL,0,0)
  399. VOID
  400. AddStringMappingPairExW (
  401. IN OUT PMAPSTRUCT Map,
  402. IN PCWSTR Old,
  403. IN PCWSTR New,
  404. IN REG_REPLACE_FILTER Filter, OPTIONAL
  405. IN ULONG_PTR ExtraData, OPTIONAL
  406. IN DWORD Flags
  407. );
  408. #define AddStringMappingPairW(Map,Old,New) AddStringMappingPairExW(Map,Old,New,NULL,0,0)
  409. BOOL
  410. MappingSearchAndReplaceExA (
  411. IN PMAPSTRUCT Map,
  412. IN PCSTR SrcBuffer,
  413. OUT PSTR Buffer, // can be the same as SrcBuffer
  414. IN INT InboundBytes, OPTIONAL
  415. OUT PINT OutboundBytesPtr, OPTIONAL
  416. IN INT MaxSizeInBytes,
  417. IN DWORD Flags,
  418. OUT ULONG_PTR *ExtraDataValue, OPTIONAL
  419. OUT PCSTR *EndOfString OPTIONAL
  420. );
  421. #define MappingSearchAndReplaceA(map,buffer,maxbytes) MappingSearchAndReplaceExA(map,buffer,buffer,0,NULL,maxbytes,0,NULL,NULL)
  422. BOOL
  423. MappingSearchAndReplaceExW (
  424. IN PMAPSTRUCT Map,
  425. IN PCWSTR SrcBuffer,
  426. OUT PWSTR Buffer, // can be the same as SrcBuffer
  427. IN INT InboundBytes, OPTIONAL
  428. OUT PINT OutboundBytes, OPTIONAL
  429. IN INT MaxSizeInBytes,
  430. IN DWORD Flags,
  431. OUT ULONG_PTR *ExtraDataValue, OPTIONAL
  432. OUT PCWSTR *EndOfString OPTIONAL
  433. );
  434. #define MappingSearchAndReplaceW(map,buffer,maxbytes) MappingSearchAndReplaceExW(map,buffer,buffer,0,NULL,maxbytes,0,NULL,NULL)
  435. BOOL
  436. MappingMultiTableSearchAndReplaceExA (
  437. IN PMAPSTRUCT *MapArray,
  438. IN UINT MapArrayCount,
  439. IN PCSTR SrcBuffer,
  440. OUT PSTR Buffer, // can be the same as SrcBuffer
  441. IN INT InboundBytes, OPTIONAL
  442. OUT PINT OutboundBytesPtr, OPTIONAL
  443. IN INT MaxSizeInBytes,
  444. IN DWORD Flags,
  445. OUT ULONG_PTR *ExtraDataValue, OPTIONAL
  446. OUT PCSTR *EndOfString OPTIONAL
  447. );
  448. #define MappingMultiTableSearchAndReplaceA(array,count,buffer,maxbytes) \
  449. MappingMultiTableSearchAndReplaceExA(array,count,buffer,buffer,0,NULL,maxbytes,0,NULL,NULL)
  450. BOOL
  451. MappingMultiTableSearchAndReplaceExW (
  452. IN PMAPSTRUCT *MapArray,
  453. IN UINT MapArrayCount,
  454. IN PCWSTR SrcBuffer,
  455. OUT PWSTR Buffer, // can be the same as SrcBuffer
  456. IN INT InboundBytes, OPTIONAL
  457. OUT PINT OutboundBytes, OPTIONAL
  458. IN INT MaxSizeInBytes,
  459. IN DWORD Flags,
  460. OUT ULONG_PTR *ExtraDataValue, OPTIONAL
  461. OUT PCWSTR *EndOfString OPTIONAL
  462. );
  463. #define MappingMultiTableSearchAndReplaceW(array,count,buffer,maxbytes) \
  464. MappingMultiTableSearchAndReplaceExW(array,count,buffer,buffer,0,NULL,maxbytes,0,NULL,NULL)
  465. HANDLE
  466. StartThread (
  467. IN PTHREAD_START_ROUTINE Address,
  468. IN PVOID Arg
  469. );
  470. typedef struct {
  471. WCHAR DisplayName[80];
  472. ULONGLONG Checksum;
  473. WCHAR Version[80];
  474. WCHAR Publisher[80];
  475. WCHAR ProductID[80];
  476. WCHAR RegisteredOwner[80];
  477. WCHAR RegisteredCompany[80];
  478. WCHAR Language[80];
  479. WCHAR SupportUrl[80];
  480. WCHAR SupportTelephone[80];
  481. WCHAR HelpLink[80];
  482. WCHAR InstallLocation[80];
  483. WCHAR InstallSource[80];
  484. WCHAR InstallDate[80];
  485. WCHAR Contact[80];
  486. WCHAR Comments[80];
  487. WCHAR Image[80];
  488. WCHAR ReadmeUrl[80];
  489. WCHAR UpdateInfoUrl[80];
  490. } INSTALLEDAPPW, *PINSTALLEDAPPW;
  491. PINSTALLEDAPPW
  492. GetInstalledAppsW (
  493. IN OUT PGROWBUFFER Buffer,
  494. OUT PUINT Count OPTIONAL
  495. );
  496. typedef PVOID MOVELISTW;
  497. MOVELISTW
  498. AllocateMoveListW (
  499. IN POOLHANDLE PoolHandle
  500. );
  501. //
  502. // Free move list by destrying the pool it was allocated from
  503. //
  504. BOOL
  505. InsertMoveIntoListW (
  506. IN MOVELISTW List,
  507. IN PCWSTR Source,
  508. IN PCWSTR Destination
  509. );
  510. MOVELISTW
  511. RemoveMoveListOverlapW (
  512. IN MOVELISTW List
  513. );
  514. BOOL
  515. OutputMoveListW (
  516. IN HANDLE File,
  517. IN MOVELISTW List, OPTIONAL
  518. IN BOOL AddNestedMoves
  519. );
  520. BOOL
  521. BuildSystemDirectoryPathA (
  522. OUT PSTR Buffer,
  523. IN UINT BufferSizeInTchars,
  524. IN PCSTR SubPath OPTIONAL
  525. );
  526. BOOL
  527. BuildSystemDirectoryPathW (
  528. OUT PWSTR Buffer,
  529. IN UINT BufferSizeInTchars,
  530. IN PCWSTR SubPath OPTIONAL
  531. );
  532. HMODULE
  533. LoadSystemLibraryA (
  534. IN PCSTR DllFileName
  535. );
  536. HMODULE
  537. LoadSystemLibraryW (
  538. IN PCWSTR DllFileName
  539. );
  540. DWORD
  541. OurGetModuleFileNameA (
  542. IN HMODULE Module,
  543. OUT PSTR Buffer,
  544. IN INT BufferChars
  545. );
  546. DWORD
  547. OurGetModuleFileNameW (
  548. IN HMODULE Module,
  549. OUT PWSTR Buffer,
  550. IN INT BufferChars
  551. );
  552. //
  553. // by default, everybody should use OurGetModuleFileName which makes sure
  554. // the output buffer is nul-terminated; this also helps keeping code prefast-clean
  555. //
  556. #undef GetModuleFileName
  557. #define GetModuleFileNameA OurGetModuleFileNameA
  558. #define GetModuleFileNameW OurGetModuleFileNameW
  559. #ifdef UNICODE
  560. #define g_BootDrivePath g_BootDrivePathW
  561. #define g_BootDrive g_BootDriveW
  562. #define g_BootDriveLetter g_BootDriveLetterW
  563. #define MOVELIST MOVELISTW
  564. #define AllocateMoveList AllocateMoveListW
  565. #define InsertMoveIntoList InsertMoveIntoListW
  566. #define RemoveMoveListOverlap RemoveMoveListOverlapW
  567. #define OutputMoveList OutputMoveListW
  568. #define VERSION_STRUCT VERSION_STRUCTW
  569. #define PVERSION_STRUCT PVERSION_STRUCTW
  570. #define CreateVersionStruct CreateVersionStructW
  571. #define DestroyVersionStruct DestroyVersionStructW
  572. #define EnumFirstVersionTranslation EnumFirstVersionTranslationW
  573. #define EnumNextVersionTranslation EnumNextVersionTranslationW
  574. #define EnumFirstVersionValue EnumFirstVersionValueW
  575. #define EnumNextVersionValue EnumNextVersionValueW
  576. #define PINSTALLEDAPP PINSTALLEDAPPW
  577. #define GetInstalledApps GetInstalledAppsW
  578. #define AddStringMappingPairEx AddStringMappingPairExW
  579. #define AddStringMappingPair AddStringMappingPairW
  580. #define MappingSearchAndReplaceEx MappingSearchAndReplaceExW
  581. #define MappingSearchAndReplace MappingSearchAndReplaceW
  582. #define MappingMultiTableSearchAndReplaceEx MappingMultiTableSearchAndReplaceExW
  583. #define MappingMultiTableSearchAndReplace MappingMultiTableSearchAndReplaceW
  584. #define BuildSystemDirectoryPath BuildSystemDirectoryPathW
  585. #define LoadSystemLibrary LoadSystemLibraryW
  586. #define OurGetModuleFileName OurGetModuleFileNameW
  587. #define GetModuleFileName OurGetModuleFileNameW
  588. #else
  589. #define g_BootDrivePath g_BootDrivePathA
  590. #define g_BootDrive g_BootDriveA
  591. #define g_BootDriveLetter g_BootDriveLetterA
  592. #define VERSION_STRUCT VERSION_STRUCTA
  593. #define PVERSION_STRUCT PVERSION_STRUCTA
  594. #define CreateVersionStruct CreateVersionStructA
  595. #define DestroyVersionStruct DestroyVersionStructA
  596. #define EnumFirstVersionTranslation EnumFirstVersionTranslationA
  597. #define EnumNextVersionTranslation EnumNextVersionTranslationA
  598. #define EnumFirstVersionValue EnumFirstVersionValueA
  599. #define EnumNextVersionValue EnumNextVersionValueA
  600. #define AddStringMappingPairEx AddStringMappingPairExA
  601. #define AddStringMappingPair AddStringMappingPairA
  602. #define MappingSearchAndReplaceEx MappingSearchAndReplaceExA
  603. #define MappingSearchAndReplace MappingSearchAndReplaceA
  604. #define MappingMultiTableSearchAndReplaceEx MappingMultiTableSearchAndReplaceExA
  605. #define MappingMultiTableSearchAndReplace MappingMultiTableSearchAndReplaceA
  606. #define BuildSystemDirectoryPath BuildSystemDirectoryPathA
  607. #define LoadSystemLibrary LoadSystemLibraryA
  608. #define OurGetModuleFileName OurGetModuleFileNameA
  609. #define GetModuleFileName OurGetModuleFileNameA
  610. #endif
  611. #ifdef __cplusplus
  612. }
  613. #endif