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.

764 lines
15 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993 - 1993.
  5. //
  6. // File: widewrap.h
  7. //
  8. // Contents: Wrapper functions for Win32c API used by 32-bit OLE 2
  9. //
  10. // History: 12-27-93 ErikGav Created
  11. // 06-14-94 KentCe Various Chicago build fixes.
  12. //
  13. //----------------------------------------------------------------------------
  14. #ifndef _WIDEWRAP_H_
  15. #define _WIDEWRAP_H_
  16. #ifndef RC_INVOKED
  17. #pragma message ("INCLUDING WIDEWRAP.H from " __FILE__)
  18. #endif /* RC_INVOKED */
  19. #ifdef _CHICAGO_
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #undef WNDCLASS
  24. #define WNDCLASS WNDCLASSW
  25. #define WNDCLASST WNDCLASSA
  26. #undef STARTUPINFO
  27. #define STARTUPINFO STARTUPINFOW
  28. #undef WIN32_FIND_DATA
  29. #define WIN32_FIND_DATA WIN32_FIND_DATAW
  30. HANDLE
  31. WINAPI
  32. CreateFileX(
  33. LPCWSTR lpFileName,
  34. DWORD dwDesiredAccess,
  35. DWORD dwShareMode,
  36. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  37. DWORD dwCreationDisposition,
  38. DWORD dwFlagsAndAttributes,
  39. HANDLE hTemplateFile
  40. );
  41. #undef CreateFile
  42. #define CreateFile CreateFileX
  43. #define CreateFileT CreateFileA
  44. BOOL
  45. WINAPI
  46. DeleteFileX(
  47. LPCWSTR lpFileName
  48. );
  49. #undef DeleteFile
  50. #define DeleteFile DeleteFileX
  51. #define DeleteFileT DeleteFileA
  52. UINT
  53. WINAPI
  54. RegisterClipboardFormatX(
  55. LPCWSTR lpszFormat);
  56. #undef RegisterClipboardFormat
  57. #define RegisterClipboardFormat RegisterClipboardFormatX
  58. #define RegisterClipboardFormatT RegisterClipboardFormatA
  59. int
  60. WINAPI
  61. GetClipboardFormatNameX(
  62. UINT format,
  63. LPWSTR lpszFormatName,
  64. int cchMaxCount);
  65. #undef GetClipboardFormatName
  66. #define GetClipboardFormatName GetClipboardFormatNameX
  67. #define GetClipboardFormatNameT GetClipboardFormatNameA
  68. LONG
  69. APIENTRY
  70. RegOpenKeyX (
  71. HKEY hKey,
  72. LPCWSTR lpSubKey,
  73. PHKEY phkResult
  74. );
  75. #undef RegOpenKey
  76. #define RegOpenKey RegOpenKeyX
  77. #define RegOpenKeyT RegOpenKeyA
  78. LONG
  79. APIENTRY
  80. RegQueryValueX (
  81. HKEY hKey,
  82. LPCWSTR lpSubKey,
  83. LPWSTR lpValue,
  84. PLONG lpcbValue
  85. );
  86. #undef RegQueryValue
  87. #define RegQueryValue RegQueryValueX
  88. #define RegQueryValueT RegQueryValueA
  89. LONG
  90. APIENTRY
  91. RegSetValueX (
  92. HKEY hKey,
  93. LPCWSTR lpSubKey,
  94. DWORD dwType,
  95. LPCWSTR lpData,
  96. DWORD cbData
  97. );
  98. #undef RegSetValue
  99. #define RegSetValue RegSetValueX
  100. #define RegSetValueT RegSetValueA
  101. LONG
  102. APIENTRY
  103. RegSetValueExX (
  104. HKEY hKey,
  105. LPCWSTR lpSubKey,
  106. DWORD dwReserved,
  107. DWORD dwType,
  108. LPBYTE lpData,
  109. DWORD cbData
  110. );
  111. #undef RegSetValueEx
  112. #define RegSetValueEx RegSetValueExX
  113. #define RegSetValueExT RegSetValueExA
  114. UINT
  115. WINAPI
  116. RegisterWindowMessageX(
  117. LPCWSTR lpString);
  118. #undef RegisterWindowMessage
  119. #define RegisterWindowMessage RegisterWindowMessageX
  120. #define RegisterWindowMessageT RegisterWindowMessageA
  121. LONG
  122. APIENTRY
  123. RegOpenKeyExX (
  124. HKEY hKey,
  125. LPCWSTR lpSubKey,
  126. DWORD ulOptions,
  127. REGSAM samDesired,
  128. PHKEY phkResult
  129. );
  130. #undef RegOpenKeyEx
  131. #define RegOpenKeyEx RegOpenKeyExX
  132. #define RegOpenKeyExT RegOpenKeyExA
  133. LONG
  134. APIENTRY
  135. RegQueryValueExX (
  136. HKEY hKey,
  137. LPWSTR lpValueName,
  138. LPDWORD lpReserved,
  139. LPDWORD lpType,
  140. LPBYTE lpData,
  141. LPDWORD lpcbData
  142. );
  143. #undef RegQueryValueEx
  144. #define RegQueryValueEx RegQueryValueExX
  145. #define RegQueryValueExT RegQueryValueExA
  146. HWND
  147. WINAPI
  148. CreateWindowExX(
  149. DWORD dwExStyle,
  150. LPCWSTR lpClassName,
  151. LPCWSTR lpWindowName,
  152. DWORD dwStyle,
  153. int X,
  154. int Y,
  155. int nWidth,
  156. int nHeight,
  157. HWND hWndParent ,
  158. HMENU hMenu,
  159. HINSTANCE hInstance,
  160. LPVOID lpParam);
  161. #undef CreateWindowEx
  162. #define CreateWindowEx CreateWindowExX
  163. #define CreateWindowExT CreateWindowExA
  164. ATOM
  165. WINAPI
  166. RegisterClassX(
  167. CONST WNDCLASSW *lpWndClass);
  168. #undef RegisterClass
  169. #define RegisterClass RegisterClassX
  170. #define RegisterClassT RegisterClassA
  171. BOOL
  172. WINAPI
  173. UnregisterClassX(
  174. LPCWSTR lpClassName,
  175. HINSTANCE hInstance);
  176. #undef UnregisterClass
  177. #define UnregisterClass UnregisterClassX
  178. #define UnregisterClassT UnregisterClassA
  179. int WINAPIV wsprintfX(LPWSTR pwszOut, LPCWSTR pwszFormat, ...);
  180. #undef wsprintf
  181. #define wsprintf wsprintfX
  182. #define wsprintfT wsprintfA
  183. HWND
  184. WINAPI
  185. CreateWindowX(
  186. LPCWSTR lpClassName,
  187. LPCWSTR lpWindowName,
  188. DWORD dwStyle,
  189. int X,
  190. int Y,
  191. int nWidth,
  192. int nHeight,
  193. HWND hWndParent ,
  194. HMENU hMenu,
  195. HINSTANCE hInstance,
  196. LPVOID lpParam);
  197. #undef CreateWindow
  198. #define CreateWindow CreateWindowX
  199. #define CreateWindowT CreateWindowA
  200. HANDLE
  201. WINAPI
  202. GetPropX(
  203. HWND hWnd,
  204. LPCWSTR lpString);
  205. #undef GetProp
  206. #define GetProp GetPropX
  207. #define GetPropT GetPropA
  208. BOOL
  209. WINAPI
  210. SetPropX(
  211. HWND hWnd,
  212. LPCWSTR lpString,
  213. HANDLE hData);
  214. #undef SetProp
  215. #define SetProp SetPropX
  216. #define SetPropT SetPropA
  217. HANDLE
  218. WINAPI
  219. RemovePropX(
  220. HWND hWnd,
  221. LPCWSTR lpString);
  222. #undef RemoveProp
  223. #define RemoveProp RemovePropX
  224. #define RemovePropT RemovePropA
  225. UINT
  226. WINAPI
  227. GetProfileIntX(
  228. LPCWSTR lpAppName,
  229. LPCWSTR lpKeyName,
  230. INT nDefault
  231. );
  232. #undef GetProfileInt
  233. #define GetProfileInt GetProfileIntX
  234. #define GetProfileIntT GetProfileIntA
  235. ATOM
  236. WINAPI
  237. GlobalAddAtomX(
  238. LPCWSTR lpString
  239. );
  240. #undef GlobalAddAtom
  241. #define GlobalAddAtom GlobalAddAtomX
  242. #define GlobalAddAtomT GlobalAddAtomA
  243. UINT
  244. WINAPI
  245. GlobalGetAtomNameX(
  246. ATOM nAtom,
  247. LPWSTR lpBuffer,
  248. int nSize
  249. );
  250. #undef GlobalGetAtomName
  251. #define GlobalGetAtomName GlobalGetAtomNameX
  252. #define GlobalGetAtomNameT GlobalGetAtomNameA
  253. DWORD
  254. WINAPI
  255. GetModuleFileNameX(
  256. HMODULE hModule,
  257. LPWSTR lpFilename,
  258. DWORD nSize
  259. );
  260. #undef GetModuleFileName
  261. #define GetModuleFileName GetModuleFileNameX
  262. #define GetModuleFileNameT GetModuleFileNameA
  263. LPWSTR
  264. WINAPI
  265. CharPrevX(
  266. LPCWSTR lpszStart,
  267. LPCWSTR lpszCurrent);
  268. #undef CharPrev
  269. #define CharPrev CharPrevX
  270. #define CharPrevT CharPrevA
  271. HFONT WINAPI CreateFontX(int, int, int, int, int, DWORD,
  272. DWORD, DWORD, DWORD, DWORD, DWORD,
  273. DWORD, DWORD, LPCWSTR);
  274. #undef CreateFont
  275. #define CreateFont CreateFontX
  276. #define CreateFontT CreateFontA
  277. HMODULE
  278. WINAPI
  279. LoadLibraryX(
  280. LPCWSTR lpLibFileName
  281. );
  282. #undef LoadLibrary
  283. #define LoadLibrary LoadLibraryX
  284. #define LoadLibraryT LoadLibraryA
  285. HMODULE
  286. WINAPI
  287. LoadLibraryExX(
  288. LPCWSTR lpLibFileName,
  289. HANDLE hFile,
  290. DWORD dwFlags
  291. );
  292. #undef LoadLibraryEx
  293. #define LoadLibraryEx LoadLibraryExX
  294. #define LoadLibraryExT LoadLibraryExA
  295. LONG
  296. APIENTRY
  297. RegDeleteKeyX (
  298. HKEY hKey,
  299. LPCWSTR lpSubKey
  300. );
  301. #undef RegDeleteKey
  302. #define RegDeleteKey RegDeleteKeyX
  303. #define RegDeleteKeyT RegDeleteKeyA
  304. #undef RpcStringBindingCompose
  305. #define RpcStringBindingCompose RpcStringBindingComposeW
  306. #undef RpcBindingFromStringBinding
  307. #define RpcBindingFromStringBinding RpcBindingFromStringBindingW
  308. #undef RpcStringFree
  309. #define RpcStringFree RpcStringFreeW
  310. BOOL
  311. WINAPI
  312. CreateProcessX(
  313. LPCWSTR lpApplicationName,
  314. LPWSTR lpCommandLine,
  315. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  316. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  317. BOOL bInheritHandles,
  318. DWORD dwCreationFlags,
  319. LPVOID lpEnvironment,
  320. LPCWSTR lpCurrentDirectory,
  321. LPSTARTUPINFOW lpStartupInfo,
  322. LPPROCESS_INFORMATION lpProcessInformation
  323. );
  324. #undef CreateProcess
  325. #define CreateProcess CreateProcessX
  326. #define CreateProcessT CreateProcessA
  327. LONG
  328. APIENTRY
  329. RegEnumKeyExX (
  330. HKEY hKey,
  331. DWORD dwIndex,
  332. LPWSTR lpName,
  333. LPDWORD lpcbName,
  334. LPDWORD lpReserved,
  335. LPWSTR lpClass,
  336. LPDWORD lpcbClass,
  337. PFILETIME lpftLastWriteTime
  338. );
  339. #undef RegEnumKeyEx
  340. #define RegEnumKeyEx RegEnumKeyExX
  341. #define RegEnumKeyExT RegEnumKeyExA
  342. #undef RpcServerUseProtseqEp
  343. #define RpcServerUseProtseqEp RpcServerUseProtseqEpW
  344. BOOL
  345. WINAPI
  346. AppendMenuX(
  347. HMENU hMenu,
  348. UINT uFlags,
  349. UINT uIDNewItem,
  350. LPCWSTR lpNewItem
  351. );
  352. #undef AppendMenu
  353. #define AppendMenu AppendMenuX
  354. #define AppendMenuT AppendMenuA
  355. HANDLE
  356. WINAPI
  357. OpenEventX(
  358. DWORD dwDesiredAccess,
  359. BOOL bInheritHandle,
  360. LPCWSTR lpName
  361. );
  362. #undef OpenEvent
  363. #define OpenEvent OpenEventX
  364. #define OpenEventT OpenEventA
  365. HANDLE
  366. WINAPI
  367. CreateEventX(
  368. LPSECURITY_ATTRIBUTES lpEventAttributes,
  369. BOOL bManualReset,
  370. BOOL bInitialState,
  371. LPCWSTR lpName
  372. );
  373. #undef CreateEvent
  374. #define CreateEvent CreateEventX
  375. #define CreateEventT CreateEventA
  376. UINT
  377. WINAPI
  378. GetDriveTypeX(
  379. LPCWSTR lpRootPathName
  380. );
  381. #undef GetDriveType
  382. #define GetDriveType GetDriveTypeX
  383. #define GetDriveTypeT GetDriveTypeA
  384. DWORD
  385. WINAPI
  386. GetFileAttributesX(
  387. LPCWSTR lpFileName
  388. );
  389. #undef GetFileAttributes
  390. #define GetFileAttributes GetFileAttributesX
  391. #define GetFileAttributesT GetFileAttributesA
  392. LONG
  393. APIENTRY
  394. RegEnumKeyX (
  395. HKEY hKey,
  396. DWORD dwIndex,
  397. LPWSTR lpName,
  398. DWORD cbName
  399. );
  400. #undef RegEnumKey
  401. #define RegEnumKey RegEnumKeyX
  402. #define RegEnumKeyT RegEnumKeyA
  403. HANDLE
  404. WINAPI
  405. FindFirstFileX(
  406. LPCWSTR lpFileName,
  407. LPWIN32_FIND_DATAW lpFindFileData
  408. );
  409. #undef FindFirstFile
  410. #define FindFirstFile FindFirstFileX
  411. #define FindFirstFileT FindFirstFileA
  412. #undef RegisterProtseq
  413. #define RegisterProtseq RegisterProtseqW
  414. #undef RpcStringBindingParse
  415. #define RpcStringBindingParse RpcStringBindingParseW
  416. #undef RpcNetworkIsProtseqValid
  417. #define RpcNetworkIsProtseqValid RpcNetworkIsProtseqValidW
  418. #undef RpcBindingToStringBinding
  419. #define RpcBindingToStringBinding RpcBindingToStringBindingW
  420. #undef RpcServerUseProtseq
  421. #define RpcServerUseProtseq RpcServerUseProtseqW
  422. BOOL
  423. WINAPI
  424. GetComputerNameX (
  425. LPWSTR lpBuffer,
  426. LPDWORD nSize
  427. );
  428. #undef GetComputerName
  429. #define GetComputerName GetComputerNameX
  430. #define GetComputerNameT GetComputerNameA
  431. #undef Foo
  432. #define Foo FooW
  433. #undef Foo
  434. #define Foo FooW
  435. #undef Foo
  436. #define Foo FooW
  437. //The following force Chicago to directly use the ANSI versions
  438. #undef DefWindowProc
  439. #define DefWindowProc DefWindowProcA
  440. #undef CopyMetaFile // Currently str ptr is always
  441. #define CopyMetaFile CopyMetaFileA // null, write a wrapper if this
  442. // changes
  443. #undef CreateMetaFile
  444. #define CreateMetaFile CreateMetaFileA
  445. #undef PostMessage
  446. #define PostMessage PostMessageA
  447. #undef SendMessage
  448. #define SendMessage SendMessageA
  449. #undef PeekMessage
  450. #define PeekMessage PeekMessageA
  451. #undef DispatchMessage
  452. #define DispatchMessage DispatchMessageA
  453. #undef GetWindowLong
  454. #define GetWindowLong GetWindowLongA
  455. #undef SetWindowLong
  456. #define SetWindowLong SetWindowLongA
  457. DWORD
  458. WINAPI
  459. GetShortPathNameX(
  460. LPCWSTR lpszLongPath,
  461. LPWSTR lpszShortPath,
  462. DWORD cchBuffer
  463. );
  464. #undef GetShortPathName
  465. #define GetShortPathName GetShortPathNameX
  466. #define GetShortPathNameT GetShortPathNameA
  467. DWORD
  468. WINAPI
  469. GetFullPathNameX(
  470. LPCWSTR lpFileName,
  471. DWORD nBufferLength,
  472. LPWSTR lpBuffer,
  473. LPWSTR *lpFilePart
  474. );
  475. #undef GetFullPathName
  476. #define GetFullPathName GetFullPathNameX
  477. #define GetFullPathNameT GetFullPathNameA
  478. DWORD
  479. WINAPI
  480. SearchPathX(
  481. LPCWSTR lpPath,
  482. LPCWSTR lpFileName,
  483. LPCWSTR lpExtension,
  484. DWORD nBufferLength,
  485. LPWSTR lpBuffer,
  486. LPWSTR *lpFilePart
  487. );
  488. #undef SearchPath
  489. #define SearchPath SearchPathX
  490. #define SearchPathT SearchPathA
  491. ATOM
  492. WINAPI
  493. GlobalFindAtomX(
  494. LPCWSTR lpString
  495. );
  496. #undef GlobalFindAtom
  497. #define GlobalFindAtom GlobalFindAtomX
  498. #define GlobalFindAtomT GlobalFindAtomA
  499. int
  500. WINAPI
  501. GetClassNameX(
  502. HWND hWnd,
  503. LPWSTR lpClassName,
  504. int nMaxCount);
  505. #undef GetClassName
  506. #define GetClassName GetClassNameX
  507. #define GetClassNameT GetClassNameA
  508. int
  509. WINAPI
  510. lstrlenX(LPCWSTR lpString);
  511. #undef lstrlen
  512. #define lstrlen lstrlenX
  513. #define lstrlenT lstrlenA
  514. LPWSTR
  515. WINAPI
  516. lstrcatX(
  517. LPWSTR lpString1,
  518. LPCWSTR lpString2);
  519. #undef lstrcat
  520. #define lstrcat lstrcatX
  521. #define lstrcatT lstrcatA
  522. int
  523. WINAPI
  524. lstrcmpX(
  525. LPCWSTR lpString1,
  526. LPCWSTR lpString2
  527. );
  528. #undef lstrcmp
  529. #define lstrcmp lstrcmpX
  530. #define lstrcmpT lstrcmpA
  531. int
  532. WINAPI
  533. lstrcmpiX(
  534. LPCWSTR lpString1,
  535. LPCWSTR lpString2
  536. );
  537. #undef lstrcmpi
  538. #define lstrcmpi lstrcmpiX
  539. #define lstrcmpiT lstrcmpiA
  540. LPWSTR
  541. WINAPI
  542. lstrcpyX(
  543. LPWSTR lpString1,
  544. LPCWSTR lpString2
  545. );
  546. #undef lstrcpy
  547. #define lstrcpy lstrcpyX
  548. #define lstrcpyT lstrcpyA
  549. HANDLE
  550. WINAPI
  551. CreateFileMappingX(
  552. HANDLE hFile,
  553. LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
  554. DWORD flProtect,
  555. DWORD dwMaximumSizeHigh,
  556. DWORD dwMaximumSizeLow,
  557. LPCWSTR lpName
  558. );
  559. #undef CreateFileMapping
  560. #define CreateFileMapping CreateFileMappingX
  561. #define CreateFileMappingT CreateFileMappingA
  562. HANDLE
  563. WINAPI
  564. OpenFileMappingX(
  565. DWORD dwDesiredAccess,
  566. BOOL bInheritHandle,
  567. LPCWSTR lpName
  568. );
  569. #undef OpenFileMapping
  570. #define OpenFileMapping OpenFileMappingX
  571. #define OpenFileMappingT OpenFileMappingA
  572. #ifdef __cplusplus
  573. }
  574. #endif
  575. #else
  576. //
  577. // These are the definitions for NT
  578. //
  579. #define CreateFileT CreateFileW
  580. #define DeleteFileT DeleteFileW
  581. #define RegisterClipboardFormatT RegisterClipboardFormatW
  582. #define GetClipboardFormatNameT GetClipboardFormatNameW
  583. #define RegOpenKeyT RegOpenKeyW
  584. #define RegQueryValueT RegQueryValueW
  585. #define RegSetValueT RegSetValueW
  586. #define RegSetValueExT RegSetValueExW
  587. #define RegisterWindowMessageT RegisterWindowMessageW
  588. #define RegOpenKeyExT RegOpenKeyExW
  589. #define RegQueryValueExT RegQueryValueExW
  590. #define CreateWindowExT CreateWindowExW
  591. #define RegisterClassT RegisterClassW
  592. #define UnregisterClassT UnregisterClassW
  593. #define wsprintfT wsprintfW
  594. #define CreateWindowT CreateWindowW
  595. #define GetPropT GetPropW
  596. #define SetPropT SetPropW
  597. #define RemovePropT RemovePropW
  598. #define GetProfileIntT GetProfileIntW
  599. #define GlobalAddAtomT GlobalAddAtomW
  600. #define GlobalGetAtomNameT GlobalGetAtomNameW
  601. #define GetModuleFileNameT GetModuleFileNameW
  602. #define CharPrevT CharPrevW
  603. #define CreateFontT CreateFontW
  604. #define LoadLibraryT LoadLibraryW
  605. #define LoadLibraryExT LoadLibraryExW
  606. #define RegDeleteKeyT RegDeleteKeyW
  607. #define CreateProcessT CreateProcessW
  608. #define RegEnumKeyExT RegEnumKeyExW
  609. #define AppendMenuT AppendMenuW
  610. #define OpenEventT OpenEventW
  611. #define CreateEventT CreateEventW
  612. #define GetDriveTypeT GetDriveTypeW
  613. #define GetFileAttributesT GetFileAttributesW
  614. #define RegEnumKeyT RegEnumKeyW
  615. #define FindFirstFileT FindFirstFileW
  616. #define GetComputerNameT GetComputerNameW
  617. #define GetShortPathNameT GetShortPathNameW
  618. #define GetFullPathNameT GetFullPathNameW
  619. #define SearchPathT SearchPathW
  620. #define GlobalFindAtomT GlobalFindAtomW
  621. #define GetClassNameT GetClassNameW
  622. #define lstrlenT lstrlenW
  623. #define lstrcatT lstrcatW
  624. #define lstrcmpT lstrcmpW
  625. #define lstrcmpiT lstrcmpiW
  626. #define lstrcpyT lstrcpyW
  627. #define CreateFileMappingT CreateFileMappingW
  628. #define OpenFileMappingT OpenFileMappingW
  629. #define WNDCLASST WNDCLASSW
  630. #endif // _CHICAGO_
  631. #endif // _WIDEWRAP_H_