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.

8276 lines
176 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993 - 1999.
  5. //
  6. // File: win95wrp.cpp
  7. //
  8. // This file was taken from the Davinci sources and adapted for TriEdit
  9. // on 3/11/98 in order to get rid of the external dependency for the TriEdit SDK
  10. // The adaptation process included getting rid of several APIs that were not being
  11. // supported and moving some APIs from the supported to unsupported group
  12. //
  13. // Contents: Unicode wrapper API, used only on Win95
  14. //
  15. // Functions: About 125 Win32 function wrappers
  16. //
  17. // Notes: 'sz' is used instead of the "correct" hungarian 'psz'
  18. // throughout to enhance readability.
  19. //
  20. // Not all of every Win32 function is wrapped here. Some
  21. // obscurely-documented features may not be handled correctly
  22. // in these wrappers. Caller beware.
  23. //
  24. // These are privately exported for use by the Shell.
  25. // All memory allocation is done on the stack.
  26. //
  27. //----------------------------------------------------------------------------
  28. // Includes ------------------------------------------------------------------
  29. #include "stdafx.h"
  30. // The following two lines will ensure that no mapping from Foo to OFoo will take place
  31. // and the real windows APIs will get called from this file
  32. #define __WIN95WRP_CPP__
  33. #include "win95wrp.h"
  34. #include <mbstring.h>
  35. #include <commctrl.h>
  36. #include <shlobj.h>
  37. // Function prototypes
  38. inline LONG UnicodeToAnsi(LPSTR szOut, LPCWSTR pwszIn, LONG cbOut, LONG cbIn = -1) throw();
  39. inline LONG AnsiToUnicode(LPWSTR pwszOut, LPCSTR szIn, LONG cbOut, LONG cbIn = -1) throw();
  40. static void CvtDevmode(DEVMODEA *pdma, const DEVMODEW *pdmw) throw();
  41. BOOL g_fWin95;
  42. BOOL g_fOSInit = FALSE;
  43. // Debug ----------------------------------------------------------------------
  44. #ifdef _DEBUG
  45. #define Assert(f) ((f) ? 0 : AssertFail(#f))
  46. #define Verify(f) Assert(f)
  47. #define Debug(f) (f)
  48. #else
  49. #define Assert(f) (0)
  50. #define Verify(f) (f)
  51. #define Debug(f) (0)
  52. #endif
  53. #ifdef DEBUG
  54. int AssertFail(const CHAR *pszMsg) throw()
  55. {
  56. int wRet = MessageBoxA(NULL, pszMsg, "Assert Failed in Win95 layer",
  57. MB_ABORTRETRYIGNORE | MB_DEFBUTTON3 |
  58. MB_SYSTEMMODAL | MB_ICONHAND );
  59. switch (wRet)
  60. {
  61. case IDABORT:
  62. FatalAppExit(0, L"BOO HOO");
  63. break;
  64. case IDRETRY:
  65. DebugBreak();
  66. // deliberately fall through to IDIGNORE in order to continue
  67. case IDIGNORE:
  68. // go aways
  69. break;
  70. }
  71. return 0;
  72. }
  73. #else
  74. #define AssertFail(s) (0)
  75. #endif // ! DEBUG
  76. // This macro determines whether a LPTSTR is an atom or string pointer
  77. #define FATOM(x) (!(HIWORD(x)))
  78. // OffsetOf - Return the byte offset into s of m
  79. #define OffsetOf(s,m) (size_t)(((unsigned char*)&(((s*)0)->m))-((unsigned char*)0))
  80. inline LONG UnicodeToAnsi(LPSTR szDestString, LPCWSTR pwszSrcString,
  81. LONG cbDestString, LONG cbSrcString ) throw()
  82. {
  83. Assert(-1 != cbDestString && (!cbDestString || szDestString));
  84. return WideCharToMultiByte(CP_ACP, 0, pwszSrcString, cbSrcString,
  85. szDestString, cbDestString, NULL, NULL);
  86. }
  87. inline LONG AnsiToUnicode(LPWSTR pwszDestString, LPCSTR szSrcString,
  88. LONG cbDestString, LONG cbSrcString ) throw()
  89. {
  90. Assert(-1 != cbDestString && (!cbDestString || pwszDestString));
  91. return MultiByteToWideChar(CP_ACP, 0, szSrcString, cbSrcString,
  92. pwszDestString, cbDestString );
  93. }
  94. static void CvtDevmode(
  95. DEVMODEA *pdma,
  96. const DEVMODEW *pdmw
  97. ) throw()
  98. {
  99. Verify(0 <= UnicodeToAnsi((LPSTR)pdma->dmDeviceName, pdmw->dmDeviceName, CCHDEVICENAME));
  100. memcpy(&pdma->dmSpecVersion, &pdmw->dmSpecVersion, OffsetOf(DEVMODE,dmFormName) -
  101. OffsetOf(DEVMODE,dmSpecVersion));
  102. Verify(0 <= UnicodeToAnsi((LPSTR)pdma->dmFormName, pdmw->dmFormName, CCHFORMNAME));
  103. memcpy(&pdma->dmLogPixels, &pdmw->dmLogPixels, sizeof(DEVMODE)-OffsetOf(DEVMODE, dmLogPixels));
  104. // Make sure we copy the extra driver bits.
  105. if ( pdmw->dmDriverExtra )
  106. memcpy((char*)pdma + sizeof(DEVMODEA), (char*)pdmw + sizeof(DEVMODEW), pdmw->dmDriverExtra );
  107. }
  108. inline bool FWide() throw()
  109. {
  110. if (!g_fOSInit)
  111. {
  112. OSVERSIONINFOA osvi;
  113. osvi.dwOSVersionInfoSize = sizeof(osvi);
  114. GetVersionExA(&osvi);
  115. g_fWin95 = (VER_PLATFORM_WIN32_WINDOWS == osvi.dwPlatformId);
  116. g_fOSInit = TRUE;
  117. }
  118. Assert(g_fOSInit);
  119. return !g_fWin95;
  120. }
  121. // The implementation of the Unicode to ANSI (MBCS) convertion macros use the
  122. // _alloca() function to allocate memory from the stack instead of the heap.
  123. // Allocating memory from the stack is much faster than allocating memory on
  124. // the heap, and the memory is automatically freed when the function is exited.
  125. // In addition, these macros avoid calling WideCharToMultiByte more than one
  126. // time. This is done by allocating a little bit more memory than is
  127. // necessary. We know that an MBC will convert into at most one WCHAR and
  128. // that for each WCHAR we will have a maximum of two MBC bytes. By allocating
  129. // a little more than necessary, but always enough to handle the conversion
  130. // the second call to the conversion function is avoided. The call to the
  131. // helper function UnicodeToAnsi reduces the number of argument pushes that
  132. // must be done in order to perform the conversion (this results in smaller
  133. // code, than if it called WideCharToMultiByte directly).
  134. //
  135. // In order for the macros to store the temporary length and the pointer to
  136. // the resultant string, it is necessary to declare some local variables
  137. // called _len and _sz in each function that uses these conversion macros.
  138. // This is done by invoking the PreConvert macro in each function before any
  139. // uses of Convert or ConverWithLen. (PreConvert just need to be invoked once
  140. // per function.)
  141. #define PreConvert() \
  142. LONG _len; \
  143. LPSTR _sz; \
  144. LONG _lJunk; \
  145. _lJunk; // Unused sometimes
  146. // stack-allocates a char buffer of size cch
  147. #define SzAlloc(cch) ((LPSTR)_alloca(cch))
  148. // stack-allocates a wchar buffer of size cch
  149. #define SzWAlloc(cch) ((LPWSTR)_alloca(cch * sizeof(WCHAR)))
  150. // Returns a properly converted string,
  151. // or NULL string on failure or szFrom == NULL
  152. // On return the variable passed via pnTo will have the output byte count
  153. // (including the trailing '\0' iff the nFrom is -1)
  154. #define ConvertWithLen(szFrom, nFrom, pnTo) \
  155. (!szFrom ? NULL : \
  156. (_len = (-1 == nFrom ? (wcslen(szFrom) + 1) : nFrom) * \
  157. sizeof(WCHAR), \
  158. _sz = SzAlloc(_len + sizeof(WCHAR)), \
  159. Debug(_sz[_len] = '\0'), \
  160. ( ((*pnTo) = UnicodeToAnsi(_sz, szFrom, _len, nFrom)) < 0 ? \
  161. (AssertFail("Convert failed in Unicode wrapper"), NULL) : \
  162. (Assert('\0' == _sz[_len]), _sz) ) ) )
  163. #define Convert(szFrom) ConvertWithLen(szFrom, -1, &_lJunk)
  164. // There are strings which are blocks of strings end to end with a trailing '\0'
  165. // to indicate the true end. These strings are used with the REG_MULTI_SZ
  166. // option of the Reg... routines and the lpstrFilter field of the OPENFILENAME
  167. // structure used in the GetOpenFileName and GetSaveFileName routines. To help
  168. // in converting these strings here are two routines which calculate the length
  169. // of the Unicode and ASNI versions (including all '\0's!):
  170. size_t
  171. cUnicodeMultiSzLen
  172. (
  173. LPCWSTR lpsz
  174. ) throw()
  175. {
  176. size_t cRet = 0;
  177. while (*lpsz)
  178. {
  179. size_t c = wcslen(lpsz) + 1;
  180. cRet += c;
  181. lpsz += c;
  182. }
  183. return cRet + 1;
  184. }
  185. size_t
  186. cAnsiMultiSzLen
  187. (
  188. LPCSTR lpsz
  189. ) throw()
  190. {
  191. size_t cRet = 0;
  192. while (*lpsz)
  193. {
  194. size_t c = _mbslen((const unsigned char*)lpsz) + 1;
  195. cRet += c;
  196. lpsz += c;
  197. }
  198. return cRet + 1;
  199. }
  200. extern "C"{
  201. // Added by VanK for DHTMLEdit OCX
  202. HINTERNET
  203. WINAPI
  204. OInternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
  205. {
  206. if(FWide())
  207. return InternetOpenW(lpszAgent, dwAccessType, lpszProxy, lpszProxyBypass, dwFlags);
  208. PreConvert();
  209. LPSTR szAgent = NULL;
  210. LPSTR szProxy = NULL;
  211. LPSTR szBypass = NULL;
  212. if ( NULL != lpszAgent )
  213. szAgent = Convert(lpszAgent);
  214. if ( NULL != lpszProxy )
  215. szProxy = Convert(lpszProxy);
  216. if ( NULL != lpszProxyBypass )
  217. szBypass = Convert(lpszProxyBypass);
  218. return InternetOpenA(szAgent, dwAccessType, szProxy, szBypass, dwFlags);
  219. }
  220. HINTERNET
  221. WINAPI
  222. OInternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
  223. {
  224. if(FWide())
  225. return InternetOpenUrlW(hInternet, lpszUrl, lpszHeaders, dwHeadersLength, dwFlags, dwContext);
  226. PreConvert();
  227. LPSTR szURL = NULL;
  228. LPSTR szHead = NULL;
  229. if ( NULL != lpszUrl )
  230. szURL = Convert(lpszUrl);
  231. if ( NULL != lpszHeaders )
  232. szHead = Convert(lpszHeaders);
  233. return InternetOpenUrlA(hInternet, szURL, szHead, dwHeadersLength, dwFlags, dwContext);
  234. }
  235. HRESULT
  236. __stdcall
  237. OURLOpenBlockingStreamW(
  238. LPUNKNOWN pCaller, // In
  239. LPCWSTR wszURL, // In
  240. LPSTREAM *ppStream, // Out
  241. DWORD dwReserved, // In
  242. LPBINDSTATUSCALLBACK lpfnCB // In
  243. )
  244. {
  245. if(FWide())
  246. return URLOpenBlockingStreamW(pCaller, wszURL, ppStream, dwReserved, lpfnCB);
  247. PreConvert();
  248. LPSTR szURL = Convert(wszURL);
  249. return URLOpenBlockingStreamA(pCaller, szURL, ppStream, dwReserved, lpfnCB);
  250. }
  251. // Added by VanK for DHTMLEdit OCX
  252. // lpdwUrlLength must be set even on failure; callers use a zero length to determine
  253. // how many bytes to actually allocate.
  254. // NOTE that contrary to all expectations, lpdwUrlLength is a byte count, not a character count!
  255. BOOL
  256. WINAPI
  257. OInternetCreateUrlW(
  258. LPURL_COMPONENTSW lpUrlComponents, // In
  259. DWORD dwFlags, // In
  260. LPWSTR lpwszUrl, // Out
  261. LPDWORD lpdwUrlLength // In/Out
  262. )
  263. {
  264. Assert ( lpUrlComponents );
  265. Assert ( lpdwUrlLength );
  266. if(FWide())
  267. return InternetCreateUrlW(lpUrlComponents, dwFlags, lpwszUrl, lpdwUrlLength);
  268. PreConvert();
  269. DWORD cchLen = (*lpdwUrlLength) / sizeof(WCHAR); // dwUrlLength is a count of bytes
  270. LPSTR szUrl = SzAlloc(*lpdwUrlLength);
  271. URL_COMPONENTSA urlaComp;
  272. memset ( &urlaComp, 0, sizeof ( urlaComp ) ); // In case this is ever recompiled with a larger structure
  273. urlaComp.dwStructSize = sizeof(URL_COMPONENTSA);
  274. urlaComp.lpszScheme = Convert(lpUrlComponents->lpszScheme);
  275. urlaComp.dwSchemeLength = lpUrlComponents->dwSchemeLength;
  276. urlaComp.nScheme = lpUrlComponents->nScheme;
  277. urlaComp.lpszHostName = Convert(lpUrlComponents->lpszHostName);
  278. urlaComp.dwHostNameLength = lpUrlComponents->dwHostNameLength;
  279. urlaComp.nPort = lpUrlComponents->nPort;
  280. urlaComp.lpszUserName = Convert(lpUrlComponents->lpszUserName);
  281. urlaComp.dwUserNameLength = lpUrlComponents->dwUserNameLength;
  282. urlaComp.lpszPassword = Convert(lpUrlComponents->lpszPassword);
  283. urlaComp.dwPasswordLength = lpUrlComponents->dwPasswordLength;
  284. urlaComp.lpszUrlPath = Convert(lpUrlComponents->lpszUrlPath);
  285. urlaComp.dwUrlPathLength = lpUrlComponents->dwUrlPathLength;
  286. urlaComp.lpszExtraInfo = Convert(lpUrlComponents->lpszExtraInfo);
  287. urlaComp.dwExtraInfoLength = lpUrlComponents->dwExtraInfoLength;
  288. BOOL bfResult = InternetCreateUrlA(&urlaComp, dwFlags, szUrl, &cchLen);
  289. *lpdwUrlLength = cchLen*sizeof(WCHAR); // Return even on fail; this tells how much to allocate on next call.
  290. if ( bfResult )
  291. {
  292. LONG lRet = AnsiToUnicode(lpwszUrl, szUrl, *lpdwUrlLength, cchLen);
  293. *lpdwUrlLength = lRet * sizeof(WCHAR);
  294. }
  295. return bfResult;
  296. }
  297. // Added by VanK for DHTMLEdit OCX
  298. // INCOMPLETE IMPLEMENTATION:
  299. // This implementation is not designed to work in the case where string pointers
  300. // are specified as NULL and their corresponding lengths non-zero.
  301. // Normally, this results in a pointer to the first character of the corresponding
  302. // component to be stored in the pointer.
  303. //
  304. // IMPLEMENTATION NOTE:
  305. // Returned strings are terminated. Although the system implementation seems to assume
  306. // that the buffers are one character larger than the character count supplied, and
  307. // thereby equipped to accept an additional terminator, this behavior is never clearly
  308. // documented. I feel this behavior is too unsafe, so ONE CHARACTER LESS than the
  309. // buffer size in characters is the maximum size of the string that can be returned.
  310. BOOL WINAPI OInternetCrackUrlW(
  311. LPCWSTR lpwszUrl, // In
  312. DWORD dwUrlLength, // In
  313. DWORD dwFlags, // In
  314. LPURL_COMPONENTSW lpUrlComponents // Out
  315. )
  316. {
  317. if(FWide())
  318. return InternetCrackUrlW(lpwszUrl, dwUrlLength, dwFlags, lpUrlComponents);
  319. // Test our limitation restrictions:
  320. Assert ( ((NULL != lpUrlComponents->lpszScheme) && (0 < lpUrlComponents->dwSchemeLength)) ||
  321. ((NULL == lpUrlComponents->lpszScheme) && (0 == lpUrlComponents->dwSchemeLength)));
  322. Assert ( ((NULL != lpUrlComponents->lpszHostName) && (0 < lpUrlComponents->dwHostNameLength)) ||
  323. ((NULL == lpUrlComponents->lpszHostName) && (0 == lpUrlComponents->dwHostNameLength)));
  324. Assert ( ((NULL != lpUrlComponents->lpszUserName) && (0 < lpUrlComponents->dwUserNameLength)) ||
  325. ((NULL == lpUrlComponents->lpszUserName) && (0 == lpUrlComponents->dwUserNameLength)));
  326. Assert ( ((NULL != lpUrlComponents->lpszPassword) && (0 < lpUrlComponents->dwPasswordLength)) ||
  327. ((NULL == lpUrlComponents->lpszPassword) && (0 == lpUrlComponents->dwPasswordLength)));
  328. Assert ( ((NULL != lpUrlComponents->lpszUrlPath) && (0 < lpUrlComponents->dwUrlPathLength)) ||
  329. ((NULL == lpUrlComponents->lpszUrlPath) && (0 == lpUrlComponents->dwUrlPathLength)));
  330. Assert ( ((NULL != lpUrlComponents->lpszExtraInfo) && (0 < lpUrlComponents->dwExtraInfoLength)) ||
  331. ((NULL == lpUrlComponents->lpszExtraInfo) && (0 == lpUrlComponents->dwExtraInfoLength)));
  332. PreConvert();
  333. LPCSTR szURLIn = Convert(lpwszUrl);
  334. LPSTR szScheme = NULL;
  335. LPSTR szHostName = NULL;
  336. LPSTR szUserName = NULL;
  337. LPSTR szPassword = NULL;
  338. LPSTR szUrlPath = NULL;
  339. LPSTR szExtraInfo = NULL;
  340. URL_COMPONENTSA urlaComp;
  341. memset ( &urlaComp, 0, sizeof ( urlaComp ) ); // In case this is ever recompiled with a larger structure
  342. if ( 0 != lpUrlComponents->dwSchemeLength && NULL != lpUrlComponents->lpszScheme )
  343. {
  344. szScheme = SzAlloc((lpUrlComponents->dwSchemeLength+1)*sizeof(WCHAR));
  345. }
  346. if ( 0 != lpUrlComponents->dwHostNameLength && NULL != lpUrlComponents->lpszHostName )
  347. {
  348. szHostName = SzAlloc((lpUrlComponents->dwHostNameLength+1)*sizeof(WCHAR));
  349. }
  350. if ( 0 != lpUrlComponents->dwUserNameLength && NULL != lpUrlComponents->lpszUserName )
  351. {
  352. szUserName = SzAlloc((lpUrlComponents->dwUserNameLength+1)*sizeof(WCHAR));
  353. }
  354. if ( 0 != lpUrlComponents->dwPasswordLength && NULL != lpUrlComponents->lpszPassword )
  355. {
  356. szPassword = SzAlloc((lpUrlComponents->dwPasswordLength+1)*sizeof(WCHAR));
  357. }
  358. if ( 0 != lpUrlComponents->dwUrlPathLength && NULL != lpUrlComponents->lpszUrlPath )
  359. {
  360. szUrlPath = SzAlloc((lpUrlComponents->dwUrlPathLength+1)*sizeof(WCHAR));
  361. }
  362. if ( 0 != lpUrlComponents->dwExtraInfoLength && NULL != lpUrlComponents->lpszExtraInfo )
  363. {
  364. szExtraInfo = SzAlloc((lpUrlComponents->dwExtraInfoLength+1)*sizeof(WCHAR));
  365. }
  366. urlaComp.dwStructSize = sizeof(URL_COMPONENTSA);
  367. urlaComp.lpszScheme = szScheme;
  368. urlaComp.dwSchemeLength = lpUrlComponents->dwSchemeLength;
  369. urlaComp.nScheme = lpUrlComponents->nScheme;
  370. urlaComp.lpszHostName = szHostName;
  371. urlaComp.dwHostNameLength = lpUrlComponents->dwHostNameLength;
  372. urlaComp.nPort = lpUrlComponents->nPort;
  373. urlaComp.lpszUserName = szUserName;
  374. urlaComp.dwUserNameLength = lpUrlComponents->dwUserNameLength;
  375. urlaComp.lpszPassword = szPassword;
  376. urlaComp.dwPasswordLength = lpUrlComponents->dwPasswordLength;
  377. urlaComp.lpszUrlPath = szUrlPath;
  378. urlaComp.dwUrlPathLength = lpUrlComponents->dwUrlPathLength;
  379. urlaComp.lpszExtraInfo = szExtraInfo;
  380. urlaComp.dwExtraInfoLength = lpUrlComponents->dwExtraInfoLength;
  381. BOOL bfResult = InternetCrackUrlA ( szURLIn, dwUrlLength, dwFlags, &urlaComp );
  382. if ( bfResult )
  383. {
  384. lpUrlComponents->nScheme = urlaComp.nScheme;
  385. lpUrlComponents->nPort = urlaComp.nPort;
  386. if ( NULL != szScheme )
  387. {
  388. lpUrlComponents->dwSchemeLength = AnsiToUnicode(
  389. lpUrlComponents->lpszScheme, szScheme,
  390. lpUrlComponents->dwSchemeLength, urlaComp.dwSchemeLength+1) - 1;
  391. }
  392. if ( NULL != szHostName )
  393. {
  394. lpUrlComponents->dwHostNameLength = AnsiToUnicode(
  395. lpUrlComponents->lpszHostName, szHostName,
  396. lpUrlComponents->dwHostNameLength, urlaComp.dwHostNameLength+1) - 1;
  397. }
  398. if ( NULL != szUserName )
  399. {
  400. lpUrlComponents->dwUserNameLength = AnsiToUnicode(
  401. lpUrlComponents->lpszUserName, szUserName,
  402. lpUrlComponents->dwUserNameLength, urlaComp.dwUserNameLength+1) - 1;
  403. }
  404. if ( NULL != szPassword )
  405. {
  406. lpUrlComponents->dwPasswordLength = AnsiToUnicode(
  407. lpUrlComponents->lpszPassword, szPassword,
  408. lpUrlComponents->dwPasswordLength, urlaComp.dwPasswordLength+1) - 1;
  409. }
  410. if ( NULL != szUrlPath )
  411. {
  412. lpUrlComponents->dwUrlPathLength = AnsiToUnicode(
  413. lpUrlComponents->lpszUrlPath, szUrlPath,
  414. lpUrlComponents->dwUrlPathLength, urlaComp.dwUrlPathLength+1) - 1;
  415. }
  416. if ( NULL != szExtraInfo )
  417. {
  418. lpUrlComponents->dwExtraInfoLength = AnsiToUnicode(
  419. lpUrlComponents->lpszExtraInfo, szExtraInfo,
  420. lpUrlComponents->dwExtraInfoLength, urlaComp.dwExtraInfoLength+1) - 1;
  421. }
  422. }
  423. return bfResult;
  424. }
  425. // Added by VanK for DHTMLEdit OCX
  426. BOOL
  427. WINAPI
  428. ODeleteUrlCacheEntryW(
  429. LPCWSTR lpwszUrlName // In
  430. )
  431. {
  432. if(FWide())
  433. return DeleteUrlCacheEntryW(lpwszUrlName);
  434. PreConvert();
  435. LPSTR szUrlName = Convert(lpwszUrlName);
  436. return DeleteUrlCacheEntryA(szUrlName);
  437. }
  438. BOOL
  439. WINAPI
  440. OAppendMenuW(
  441. HMENU hMenu,
  442. UINT uFlags,
  443. UINT uIDnewItem,
  444. LPCWSTR lpnewItem
  445. )
  446. {
  447. if(FWide())
  448. return AppendMenuW(hMenu, uFlags, uIDnewItem, lpnewItem);
  449. if(MF_STRING != uFlags)
  450. return AppendMenuA(hMenu, uFlags, uIDnewItem, (LPSTR)lpnewItem);
  451. PreConvert();
  452. LPSTR sz = Convert(lpnewItem);
  453. return AppendMenuA(hMenu, uFlags, uIDnewItem, sz);
  454. }
  455. LRESULT
  456. WINAPI
  457. OCallWindowProcW(
  458. WNDPROC lpPrevWndFunc,
  459. HWND hWnd,
  460. UINT Msg,
  461. WPARAM wParam,
  462. LPARAM lParam)
  463. {
  464. if(FWide())
  465. return CallWindowProcW(lpPrevWndFunc, hWnd, Msg, wParam, lParam);
  466. return CallWindowProcA(lpPrevWndFunc, hWnd, Msg, wParam, lParam); //$ CONSIDER - Not really wrapped
  467. }
  468. DWORD
  469. WINAPI
  470. OCharLowerBuffW(
  471. LPWSTR lpsz,
  472. DWORD cchLength)
  473. {
  474. if(!lpsz)
  475. return 0;
  476. if(FWide())
  477. return CharLowerBuffW(lpsz, cchLength);
  478. DWORD i = 0;
  479. while(i++ < cchLength)
  480. {
  481. *lpsz = towlower(*lpsz);
  482. lpsz++;
  483. }
  484. return i;
  485. }
  486. LPWSTR
  487. WINAPI
  488. OCharLowerW(
  489. LPWSTR lpsz)
  490. {
  491. if(!lpsz)
  492. return NULL;
  493. if(FWide())
  494. return CharLowerW(lpsz);
  495. // Checking if it's a single byte character.
  496. if(FATOM(lpsz))
  497. {
  498. return (LPWSTR)towlower((WCHAR)LOWORD(lpsz));
  499. }
  500. LPWSTR lp = lpsz;
  501. while(*lp)
  502. {
  503. *lp = towlower(*lp);
  504. lp++;
  505. }
  506. return lpsz;
  507. }
  508. // From: Mark Ashton on 5/29/97
  509. LPWSTR
  510. WINAPI
  511. OCharPrevW(
  512. LPCWSTR lpszStart,
  513. LPCWSTR lpszCurrent)
  514. {
  515. return (LPWSTR)((lpszStart != lpszCurrent) ? lpszCurrent - 1 : lpszCurrent);
  516. }
  517. BOOL
  518. WINAPI
  519. OCharToOemW(
  520. LPCWSTR lpszSrc,
  521. LPSTR lpszDst)
  522. {
  523. if(FWide())
  524. {
  525. Assert((LPSTR) lpszSrc != lpszDst);
  526. return CharToOemW(lpszSrc, lpszDst);
  527. }
  528. PreConvert();
  529. LPSTR sz = Convert(lpszSrc);
  530. return CharToOemA(sz, lpszDst);
  531. }
  532. LPWSTR
  533. WINAPI
  534. OCharUpperW(
  535. LPWSTR lpsz)
  536. {
  537. if(!lpsz)
  538. return NULL;
  539. if(FWide())
  540. return CharUpperW(lpsz);
  541. // Checking if it's a single byte character.
  542. if(FATOM(lpsz))
  543. {
  544. return (LPWSTR)towupper((WCHAR)LOWORD(lpsz));
  545. }
  546. LPWSTR lp = lpsz;
  547. while(*lp)
  548. {
  549. *lp = towupper(*lp);
  550. lp++;
  551. }
  552. return lpsz;
  553. }
  554. // From: Mark Ashton on 5/8/97
  555. BOOL
  556. WINAPI
  557. OCopyFileW(
  558. LPCWSTR lpExistingFileName,
  559. LPCWSTR lpNewFileName,
  560. BOOL bFailIfExists
  561. )
  562. {
  563. if (FWide())
  564. return CopyFileW(lpExistingFileName, lpNewFileName, bFailIfExists);
  565. char szExisting[_MAX_PATH], szNew[_MAX_PATH];
  566. Verify(0 <= UnicodeToAnsi(szExisting, lpExistingFileName, _MAX_PATH));
  567. Verify(0 <= UnicodeToAnsi(szNew, lpNewFileName, _MAX_PATH));
  568. return CopyFileA(szExisting, szNew, bFailIfExists);
  569. }
  570. HDC
  571. WINAPI
  572. OCreateDCW(
  573. LPCWSTR lpszDriver,
  574. LPCWSTR lpszDevice,
  575. LPCWSTR lpszOutput,
  576. CONST DEVMODEW *lpInitData)
  577. {
  578. Assert(!lpszOutput);
  579. if(FWide())
  580. return CreateDCW(lpszDriver, lpszDevice, lpszOutput, lpInitData);
  581. DEVMODEA *pdma = lpInitData ?
  582. (DEVMODEA*)SzAlloc(sizeof(DEVMODEA) + lpInitData->dmDriverExtra) :
  583. NULL;
  584. PreConvert();
  585. LPSTR szDriv = Convert(lpszDriver);
  586. LPSTR szDev = NULL;
  587. // in Win95, only "display" is allowed as a driver name
  588. if (szDriv && !lstrcmpiA(szDriv, "display"))
  589. {
  590. Assert(!lpszDevice);
  591. Assert(!lpInitData);
  592. pdma = NULL; // Force to NULL.
  593. }
  594. else
  595. {
  596. #ifdef DEBUG
  597. // For NT we pass this in so only assert if this is
  598. // not true.
  599. if (szDriv && lstrcmpiA(szDriv, "winspool"))
  600. Assert(!lpszDriver);
  601. #endif // DEBUG
  602. szDriv = NULL;
  603. Assert(lpszDevice);
  604. szDev = Convert(lpszDevice);
  605. if (lpInitData)
  606. {
  607. CvtDevmode(pdma, lpInitData);
  608. }
  609. }
  610. return CreateDCA(szDriv, szDev, NULL, pdma);
  611. }
  612. // From: Mark Ashton on 5/8/97
  613. BOOL
  614. WINAPI
  615. OCreateDirectoryW(
  616. LPCWSTR lpPathName,
  617. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  618. )
  619. {
  620. if (FWide())
  621. return CreateDirectoryW(lpPathName, lpSecurityAttributes);
  622. PreConvert();
  623. LPSTR sz = Convert(lpPathName);
  624. return CreateDirectoryA(sz, NULL);
  625. }
  626. // From: Mark Ashton on 5/8/97
  627. // Ted Smith: simpified on 6/25
  628. // Smoke tested by Mark Ashton on 6/25
  629. BOOL
  630. WINAPI
  631. OCreateDirectoryExW(
  632. LPCWSTR lpTemplateDirectory,
  633. LPCWSTR lpNewDirectory,
  634. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  635. )
  636. {
  637. if (FWide())
  638. return CreateDirectoryExW(lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes);
  639. PreConvert();
  640. LPSTR szTemplateDirectory = Convert(lpTemplateDirectory);
  641. LPSTR szNewDirectory = Convert(lpNewDirectory);
  642. return CreateDirectoryExA(szTemplateDirectory, szNewDirectory, NULL);
  643. }
  644. HDC
  645. WINAPI
  646. OCreateEnhMetaFileW(
  647. HDC hdc,
  648. LPCWSTR lpFileName,
  649. CONST RECT *lpRect,
  650. LPCWSTR lpDescription)
  651. {
  652. if(FWide())
  653. return CreateEnhMetaFileW(hdc, lpFileName, lpRect, lpDescription);
  654. PreConvert();
  655. LPSTR szN = Convert(lpFileName);
  656. LPSTR szD = ConvertWithLen(lpDescription, cUnicodeMultiSzLen(lpDescription), &_lJunk);
  657. return CreateEnhMetaFileA(hdc, szN, lpRect, szD);
  658. }
  659. HANDLE
  660. WINAPI
  661. OCreateEventW(
  662. LPSECURITY_ATTRIBUTES lpEventAttributes,
  663. BOOL bManualReset,
  664. BOOL bInitialState,
  665. LPCWSTR lpName
  666. )
  667. {
  668. if(FWide())
  669. return CreateEventW(lpEventAttributes, bManualReset, bInitialState, lpName);
  670. PreConvert();
  671. LPSTR sz = Convert(lpName);
  672. return CreateEventA(lpEventAttributes, bManualReset, bInitialState, sz);
  673. }
  674. HANDLE
  675. WINAPI
  676. OCreateFileW(
  677. LPCWSTR lpFileName,
  678. DWORD dwDesiredAccess,
  679. DWORD dwShareMode,
  680. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  681. DWORD dwCreationDisposition,
  682. DWORD dwFlagsAndAttributes,
  683. HANDLE hTemplateFile
  684. )
  685. {
  686. // Don't even attempt this on Win95!
  687. Assert(0 != wcsncmp(lpFileName, L"\\\\?\\", 4));
  688. if(FWide())
  689. return CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes,
  690. dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
  691. PreConvert();
  692. LPSTR sz = Convert(lpFileName);
  693. return CreateFileA(sz, dwDesiredAccess, dwShareMode, lpSecurityAttributes,
  694. dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
  695. }
  696. HFONT
  697. WINAPI
  698. OCreateFontIndirectW(CONST LOGFONTW * plfw)
  699. {
  700. Assert(plfw);
  701. if(FWide())
  702. return CreateFontIndirectW(plfw);
  703. LOGFONTA lfa;
  704. // It's assumed here that sizeof(LOGFONTA) <= sizeof (LOGFONTW);
  705. memcpy(&lfa, plfw, sizeof(LOGFONTA));
  706. Verify(0 <= UnicodeToAnsi(lfa.lfFaceName, plfw->lfFaceName, LF_FACESIZE));
  707. return CreateFontIndirectA(&lfa);
  708. }
  709. // From: Mark Ashton on 5/29/97
  710. HFONT
  711. OCreateFontW(
  712. int nHeight, // logical height of font
  713. int nWidth, // logical average character width
  714. int nEscapement, // angle of escapement
  715. int nOrientation, // base-line orientation angle
  716. int fnWeight, // font weight
  717. DWORD fdwItalic, // italic attribute flag
  718. DWORD fdwUnderline, // underline attribute flag
  719. DWORD fdwStrikeOut, // strikeout attribute flag
  720. DWORD fdwCharSet, // character set identifier
  721. DWORD fdwOutputPrecision, // output precision
  722. DWORD fdwClipPrecision, // clipping precision
  723. DWORD fdwQuality, // output quality
  724. DWORD fdwPitchAndFamily, // pitch and family
  725. LPCWSTR lpszFace) // pointer to typeface name string
  726. {
  727. if (FWide())
  728. return CreateFontW(nHeight, nWidth, nEscapement, nOrientation, fnWeight, fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet, fdwOutputPrecision, fdwClipPrecision, fdwQuality, fdwPitchAndFamily, lpszFace);
  729. PreConvert();
  730. LPSTR sz = Convert(lpszFace);
  731. return CreateFontA(nHeight, nWidth, nEscapement, nOrientation, fnWeight, fdwItalic, fdwUnderline, fdwStrikeOut, fdwCharSet, fdwOutputPrecision, fdwClipPrecision, fdwQuality, fdwPitchAndFamily, sz);
  732. }
  733. HWND
  734. WINAPI
  735. OCreateMDIWindowW(
  736. LPWSTR lpClassName,
  737. LPWSTR lpWindowName,
  738. DWORD dwStyle,
  739. int X,
  740. int Y,
  741. int nWidth,
  742. int nHeight,
  743. HWND hWndParent,
  744. HINSTANCE hInstance,
  745. LPARAM lParam
  746. )
  747. {
  748. if(FWide())
  749. return CreateMDIWindowW(lpClassName, lpWindowName, dwStyle,
  750. X, Y, nWidth, nHeight, hWndParent, hInstance, lParam);
  751. PreConvert();
  752. LPSTR szClass = Convert(lpClassName);
  753. LPSTR szWin = Convert(lpWindowName);
  754. return CreateMDIWindowA(szClass, szWin, dwStyle,
  755. X, Y, nWidth, nHeight, hWndParent, hInstance, lParam);
  756. }
  757. HDC
  758. WINAPI
  759. OCreateMetaFileW(LPCWSTR lpstr)
  760. {
  761. if(FWide())
  762. return CreateMetaFileW(lpstr);
  763. PreConvert();
  764. LPSTR sz = Convert(lpstr);
  765. return CreateMetaFileA(sz);
  766. }
  767. HANDLE
  768. WINAPI
  769. OCreateSemaphoreW(
  770. LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
  771. LONG lInitialCount,
  772. LONG lMaximumCount,
  773. LPCWSTR lpName
  774. )
  775. {
  776. if(FWide())
  777. return CreateSemaphoreW(lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName);
  778. PreConvert();
  779. LPSTR sz = Convert(lpName);
  780. return CreateSemaphoreA(lpSemaphoreAttributes, lInitialCount, lMaximumCount, sz);
  781. }
  782. HWND
  783. WINAPI
  784. OCreateWindowExW( DWORD dwExStyle,
  785. LPCWSTR lpClassName,
  786. LPCWSTR lpWindowName,
  787. DWORD dwStyle,
  788. int X,
  789. int Y,
  790. int nWidth,
  791. int nHeight,
  792. HWND hWndParent ,
  793. HMENU hMenu,
  794. HINSTANCE hInstance,
  795. LPVOID lpParam )
  796. {
  797. if(FWide())
  798. return CreateWindowExW(dwExStyle,
  799. lpClassName,
  800. lpWindowName,
  801. dwStyle,
  802. X,
  803. Y,
  804. nWidth,
  805. nHeight,
  806. hWndParent ,
  807. hMenu,
  808. hInstance,
  809. lpParam );
  810. PreConvert();
  811. LPSTR szClass;
  812. if (FATOM(lpClassName))
  813. {
  814. // is it an atom?
  815. szClass = (LPSTR) lpClassName;
  816. }
  817. else
  818. {
  819. // otherwise convert the string
  820. szClass = Convert(lpClassName);
  821. }
  822. LPSTR szWindow = Convert(lpWindowName);
  823. return CreateWindowExA (dwExStyle, szClass, szWindow, dwStyle, X, Y,
  824. nWidth, nHeight, hWndParent, hMenu, hInstance,
  825. lpParam);
  826. }
  827. HSZ
  828. WINAPI
  829. ODdeCreateStringHandleW(
  830. DWORD idInst,
  831. LPCWSTR psz,
  832. int iCodePage)
  833. {
  834. if(FWide())
  835. {
  836. Assert(CP_WINUNICODE == iCodePage);
  837. return DdeCreateStringHandleW(idInst, psz, iCodePage);
  838. }
  839. PreConvert();
  840. LPSTR sz = Convert(psz);
  841. return DdeCreateStringHandleA(idInst, sz, CP_WINANSI);
  842. }
  843. UINT
  844. WINAPI
  845. ODdeInitializeW(
  846. LPDWORD pidInst,
  847. PFNCALLBACK pfnCallback,
  848. DWORD afCmd,
  849. DWORD ulRes)
  850. {
  851. if(FWide())
  852. return DdeInitializeW(pidInst, pfnCallback, afCmd, ulRes);
  853. return DdeInitializeA(pidInst, pfnCallback, afCmd, ulRes);
  854. }
  855. LRESULT
  856. WINAPI
  857. ODefFrameProcW(
  858. HWND hWnd,
  859. HWND hWndMDIClient ,
  860. UINT uMsg,
  861. WPARAM wParam,
  862. LPARAM lParam)
  863. {
  864. if(FWide())
  865. return DefFrameProcW(hWnd, hWndMDIClient , uMsg, wParam, lParam);
  866. return DefFrameProcA(hWnd, hWndMDIClient , uMsg, wParam, lParam);
  867. }
  868. LRESULT
  869. WINAPI
  870. ODefMDIChildProcW(
  871. HWND hWnd,
  872. UINT uMsg,
  873. WPARAM wParam,
  874. LPARAM lParam)
  875. {
  876. if(FWide())
  877. return DefMDIChildProcW(hWnd, uMsg, wParam, lParam);
  878. return DefMDIChildProcA(hWnd, uMsg, wParam, lParam);
  879. }
  880. LRESULT
  881. WINAPI
  882. ODefWindowProcW(
  883. HWND hWnd,
  884. UINT Msg,
  885. WPARAM wParam,
  886. LPARAM lParam)
  887. {
  888. if(FWide())
  889. return DefWindowProcW( hWnd, Msg,wParam, lParam);
  890. return DefWindowProcA( hWnd, Msg,wParam, lParam);
  891. }
  892. BOOL
  893. WINAPI
  894. ODeleteFileW(
  895. LPCWSTR pwsz)
  896. {
  897. if(FWide())
  898. return DeleteFileW(pwsz);
  899. PreConvert();
  900. LPSTR sz = Convert(pwsz);
  901. return DeleteFileA(sz);
  902. }
  903. LRESULT
  904. WINAPI
  905. ODialogBoxIndirectParamW(
  906. HINSTANCE hInstance,
  907. LPCDLGTEMPLATEW hDialogTemplate,
  908. HWND hWndParent ,
  909. DLGPROC lpDialogFunc,
  910. LPARAM dwInitParam)
  911. {
  912. if(FWide())
  913. return DialogBoxIndirectParamW(hInstance, hDialogTemplate, hWndParent ,
  914. lpDialogFunc, dwInitParam);
  915. return DialogBoxIndirectParamA(hInstance, hDialogTemplate, hWndParent ,
  916. lpDialogFunc, dwInitParam);
  917. }
  918. LRESULT
  919. WINAPI
  920. ODialogBoxParamW(
  921. HINSTANCE hInstance,
  922. LPCWSTR lpTemplateName,
  923. HWND hWndParent ,
  924. DLGPROC lpDialogFunc,
  925. LPARAM dwInitParam)
  926. {
  927. if(FWide())
  928. return DialogBoxParamW(hInstance, lpTemplateName, hWndParent , lpDialogFunc, dwInitParam);
  929. if(FATOM(lpTemplateName))
  930. return DialogBoxParamA(hInstance, (LPSTR)lpTemplateName, hWndParent , lpDialogFunc, dwInitParam);
  931. PreConvert();
  932. LPSTR sz = Convert(lpTemplateName);
  933. return DialogBoxParamA(hInstance, sz, hWndParent , lpDialogFunc, dwInitParam);
  934. }
  935. LRESULT
  936. WINAPI
  937. ODispatchMessageW(
  938. CONST MSG *lpMsg)
  939. {
  940. if(FWide())
  941. return DispatchMessageW(lpMsg);
  942. return DispatchMessageA(lpMsg);
  943. }
  944. int
  945. WINAPI
  946. ODrawTextW(
  947. HDC hDC,
  948. LPCWSTR lpString,
  949. int nCount,
  950. LPRECT lpRect,
  951. UINT uFormat)
  952. {
  953. // NOTE OS may write 3 characters beyond end of lpString so make room!
  954. if(FWide())
  955. return DrawTextW(hDC, lpString, nCount, lpRect, uFormat);
  956. bool fModifyString = (uFormat & DT_MODIFYSTRING) &&
  957. (uFormat & (DT_END_ELLIPSIS | DT_PATH_ELLIPSIS));
  958. const int nBuff = WideCharToMultiByte(CP_ACP, 0, lpString, nCount,
  959. NULL, 0, NULL, NULL );
  960. Assert(0 <= nBuff);
  961. // OS may write beyond end of buffer so make room!
  962. const LPSTR sz = SzAlloc(nBuff + 4);
  963. Verify(nBuff == WideCharToMultiByte(CP_ACP, 0, lpString, nCount,
  964. sz, nBuff, NULL, NULL ));
  965. if (fModifyString)
  966. {
  967. // DrawTextA doesn't nessacerily '\0' terminate the output,
  968. // so have termiators ready
  969. memcpy(sz + nBuff, "\0\0\0\0", 4);
  970. }
  971. const int iDrawTextReturn = DrawTextA(hDC, sz, nBuff - 1, lpRect, uFormat);
  972. // With certain flags, DrawText modifies the string, truncating it with
  973. // an ellipsis. We need to convert back and update the string passed to
  974. // the wrapper before we return.
  975. if (fModifyString && 0 <= iDrawTextReturn)
  976. {
  977. Assert('\0' == sz[nBuff + 3]); // Verify not too many were overwritten
  978. // The windows function prototype has lpString as constant even
  979. // though the string gets modified!
  980. const int nStringLen = -1 != nCount ? nCount : wcslen(lpString);
  981. Verify(0 <= AnsiToUnicode(const_cast<LPWSTR>(lpString), sz,
  982. nStringLen + 4 ));
  983. }
  984. return iDrawTextReturn;
  985. }
  986. // Written by Bill Hiebert on 9/4/97
  987. // Smoke tested by Bill Hiebert 9/4/97
  988. int
  989. WINAPI
  990. ODrawTextExW(HDC hdc, LPWSTR pwsz, int cb, LPRECT lprect, UINT dwDTFormat, LPDRAWTEXTPARAMS lpDTParams)
  991. {
  992. Assert(-1 != cb);
  993. Assert(!(DT_MODIFYSTRING & dwDTFormat));
  994. if(FWide())
  995. return DrawTextExW(hdc, pwsz, cb, lprect, dwDTFormat, lpDTParams);
  996. PreConvert();
  997. LONG n = 0;
  998. LPSTR sz = ConvertWithLen(pwsz, cb, &n);
  999. return DrawTextExA(hdc, sz, n, lprect, dwDTFormat, lpDTParams);
  1000. }
  1001. // Written for Carlos Gomes on 6/26/97 by Ted Smith
  1002. // Smoke tested by Carlos Gomes on 6/26
  1003. DWORD
  1004. WINAPI
  1005. OExpandEnvironmentStringsW(
  1006. LPCWSTR lpSrc,
  1007. LPWSTR lpDst,
  1008. DWORD nSize
  1009. )
  1010. {
  1011. if (FWide())
  1012. return ExpandEnvironmentStringsW(lpSrc, lpDst, nSize);
  1013. PreConvert();
  1014. LPSTR szSrc = Convert(lpSrc);
  1015. LPSTR szDst = SzAlloc(sizeof(WCHAR) * nSize);
  1016. DWORD dwRet = ExpandEnvironmentStringsA(szSrc, szDst, sizeof(WCHAR) * nSize);
  1017. if (dwRet)
  1018. {
  1019. LONG lRet = AnsiToUnicode(lpDst, szDst, nSize, min(dwRet, sizeof(WCHAR) * nSize));
  1020. if (dwRet < (DWORD) lRet)
  1021. {
  1022. dwRet = lRet;
  1023. }
  1024. }
  1025. else if (lpDst && 0 < nSize)
  1026. {
  1027. *lpDst = L'\0';
  1028. }
  1029. return dwRet;
  1030. }
  1031. VOID
  1032. WINAPI
  1033. OFatalAppExitW(
  1034. UINT uAction,
  1035. LPCWSTR lpMessageText
  1036. )
  1037. {
  1038. if(FWide())
  1039. FatalAppExitW(uAction, lpMessageText);
  1040. PreConvert();
  1041. LPSTR sz = Convert(lpMessageText);
  1042. FatalAppExitA(uAction, sz);
  1043. }
  1044. // From: Mark Ashton on 5/8/97
  1045. HANDLE
  1046. WINAPI
  1047. OFindFirstChangeNotificationW(
  1048. LPCWSTR lpPathName,
  1049. BOOL bWatchSubtree,
  1050. DWORD dwNotifyFilter
  1051. )
  1052. {
  1053. if (FWide())
  1054. return FindFirstChangeNotificationW(lpPathName, bWatchSubtree, dwNotifyFilter);
  1055. PreConvert();
  1056. LPSTR sz = Convert(lpPathName);
  1057. return FindFirstChangeNotificationA(sz, bWatchSubtree, dwNotifyFilter);
  1058. }
  1059. // From: Mark Ashton on 5/8/97
  1060. HANDLE
  1061. WINAPI
  1062. OFindFirstFileW(
  1063. LPCWSTR lpFileName,
  1064. LPWIN32_FIND_DATAW lpFindFileData
  1065. )
  1066. {
  1067. if (FWide())
  1068. return FindFirstFileW(lpFileName, lpFindFileData);
  1069. PreConvert();
  1070. LPSTR sz = Convert(lpFileName);
  1071. WIN32_FIND_DATAA findFileData;
  1072. HANDLE h = FindFirstFileA(sz, &findFileData);
  1073. if (INVALID_HANDLE_VALUE != h)
  1074. {
  1075. lpFindFileData->dwFileAttributes = findFileData.dwFileAttributes;
  1076. lpFindFileData->ftCreationTime = findFileData.ftCreationTime;
  1077. lpFindFileData->ftLastAccessTime = findFileData.ftLastAccessTime;
  1078. lpFindFileData->ftLastWriteTime = findFileData.ftLastWriteTime;
  1079. lpFindFileData->nFileSizeHigh = findFileData.nFileSizeHigh;
  1080. lpFindFileData->nFileSizeLow = findFileData.nFileSizeLow;
  1081. lpFindFileData->dwReserved0 = findFileData.dwReserved0;
  1082. lpFindFileData->dwReserved1 = findFileData.dwReserved1;
  1083. Verify(0 <= AnsiToUnicode(lpFindFileData->cFileName, findFileData.cFileName, _MAX_PATH));
  1084. Verify(0 <= AnsiToUnicode(lpFindFileData->cAlternateFileName, findFileData.cAlternateFileName, 14));
  1085. }
  1086. return h;
  1087. }
  1088. // From: Mark Ashton on 5/8/97
  1089. BOOL
  1090. WINAPI
  1091. OFindNextFileW(
  1092. HANDLE hFindFile,
  1093. LPWIN32_FIND_DATAW lpFindFileData
  1094. )
  1095. {
  1096. if (FWide())
  1097. return FindNextFileW(hFindFile, lpFindFileData);
  1098. WIN32_FIND_DATAA findFileData;
  1099. BOOL fFlag = FindNextFileA(hFindFile, &findFileData);
  1100. if (fFlag)
  1101. {
  1102. lpFindFileData->dwFileAttributes = findFileData.dwFileAttributes;
  1103. lpFindFileData->ftCreationTime = findFileData.ftCreationTime;
  1104. lpFindFileData->ftLastAccessTime = findFileData.ftLastAccessTime;
  1105. lpFindFileData->ftLastWriteTime = findFileData.ftLastWriteTime;
  1106. lpFindFileData->nFileSizeHigh = findFileData.nFileSizeHigh;
  1107. lpFindFileData->nFileSizeLow = findFileData.nFileSizeLow;
  1108. lpFindFileData->dwReserved0 = findFileData.dwReserved0;
  1109. lpFindFileData->dwReserved1 = findFileData.dwReserved1;
  1110. Verify(0 <= AnsiToUnicode(lpFindFileData->cFileName, findFileData.cFileName, _MAX_PATH));
  1111. Verify(0 <= AnsiToUnicode(lpFindFileData->cAlternateFileName, findFileData.cAlternateFileName, 14));
  1112. }
  1113. return fFlag;
  1114. }
  1115. HRSRC
  1116. WINAPI
  1117. OFindResourceW(
  1118. HINSTANCE hModule,
  1119. LPCWSTR lpName,
  1120. LPCWSTR lpType
  1121. )
  1122. {
  1123. if(FWide())
  1124. return FindResourceW(hModule, lpName, lpType);
  1125. LPCSTR szName = (LPCSTR)lpName;
  1126. LPCSTR szType = (LPCSTR)lpType;
  1127. PreConvert();
  1128. if(!FATOM(lpName))
  1129. szName = Convert(lpName);
  1130. if(!FATOM(lpType))
  1131. szType = Convert(lpType);
  1132. return FindResourceA(hModule, szName, szType);
  1133. }
  1134. HWND
  1135. WINAPI
  1136. OFindWindowW(
  1137. LPCWSTR lpClassName ,
  1138. LPCWSTR lpWindowName)
  1139. {
  1140. if(FWide())
  1141. return FindWindowW(lpClassName , lpWindowName);
  1142. PreConvert();
  1143. LPSTR szClass = Convert(lpClassName);
  1144. LPSTR szWnd = Convert(lpWindowName);
  1145. return FindWindowA(szClass, szWnd);
  1146. }
  1147. // Bill Hiebert of IStudio on 6/13/97 added support for the
  1148. // FORMAT_MESSAGE_ALLOCATE_BUFFER flag
  1149. // Bill donated a bugfix for 1819 on 8/1/97
  1150. DWORD
  1151. WINAPI
  1152. OFormatMessageW(
  1153. DWORD dwFlags,
  1154. LPCVOID lpSource,
  1155. DWORD dwMessageId,
  1156. DWORD dwLanguageId,
  1157. LPWSTR lpBuffer,
  1158. DWORD nSize,
  1159. va_list *Arguments)
  1160. {
  1161. if (FWide())
  1162. return FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId,
  1163. lpBuffer, nSize, Arguments );
  1164. DWORD dwRet;
  1165. LPSTR szBuffer = NULL;
  1166. if (!(dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER))
  1167. {
  1168. Assert(!IsBadWritePtr(lpBuffer, nSize * sizeof(WCHAR)));
  1169. szBuffer = SzAlloc(sizeof(WCHAR) * nSize);
  1170. }
  1171. if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
  1172. {
  1173. PreConvert();
  1174. LPSTR szSource = Convert((LPWSTR)lpSource);
  1175. if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER)
  1176. { // Must pass address of szBuffer
  1177. dwRet = FormatMessageA(dwFlags, szSource, dwMessageId, dwLanguageId,
  1178. (char*)&szBuffer, sizeof(WCHAR) * nSize, Arguments);
  1179. }
  1180. else
  1181. {
  1182. dwRet = FormatMessageA(dwFlags, szSource, dwMessageId, dwLanguageId,
  1183. szBuffer, sizeof(WCHAR) * nSize, Arguments);
  1184. }
  1185. }
  1186. else
  1187. {
  1188. if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER)
  1189. { // Must pass address of szBuffer
  1190. dwRet = FormatMessageA(dwFlags, lpSource, dwMessageId, dwLanguageId,
  1191. (char*)&szBuffer, sizeof(WCHAR) * nSize, Arguments);
  1192. }
  1193. else
  1194. {
  1195. dwRet = FormatMessageA(dwFlags, lpSource, dwMessageId, dwLanguageId,
  1196. szBuffer, sizeof(WCHAR) * nSize, Arguments);
  1197. }
  1198. }
  1199. if (dwRet)
  1200. {
  1201. if (dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER)
  1202. { // szBuffer contains LocalAlloc ptr to new string. lpBuffer is a
  1203. // WCHAR** when FORMAT_MESSAGE_ALLOCATE_BUFFER is defined.
  1204. WCHAR* pTemp = (WCHAR*)LocalAlloc(NONZEROLPTR, (dwRet + 1) * sizeof(WCHAR) );
  1205. dwRet = pTemp == NULL? 0 : AnsiToUnicode(pTemp, szBuffer, dwRet + 1);
  1206. LocalFree(szBuffer);
  1207. if (dwRet)
  1208. {
  1209. *(WCHAR**)lpBuffer = pTemp;
  1210. }
  1211. return dwRet;
  1212. }
  1213. else
  1214. { // Just convert
  1215. return AnsiToUnicode(lpBuffer, szBuffer, nSize);
  1216. }
  1217. }
  1218. else if (lpBuffer && 0 < nSize)
  1219. {
  1220. *lpBuffer = L'\0';
  1221. }
  1222. return dwRet;
  1223. }
  1224. BOOL
  1225. APIENTRY
  1226. OGetCharABCWidthsFloatW(
  1227. HDC hdc,
  1228. UINT uFirstChar,
  1229. UINT uLastChar,
  1230. LPABCFLOAT lpABC)
  1231. {
  1232. if(FWide())
  1233. return GetCharABCWidthsFloatW(hdc, uFirstChar, uLastChar, lpABC);
  1234. return GetCharABCWidthsFloatA(hdc, uFirstChar, uLastChar, lpABC);
  1235. }
  1236. BOOL
  1237. APIENTRY
  1238. OGetCharABCWidthsW(
  1239. HDC hdc,
  1240. UINT uFirstChar,
  1241. UINT uLastChar,
  1242. LPABC lpABC)
  1243. {
  1244. if(FWide())
  1245. return GetCharABCWidthsW(hdc, uFirstChar, uLastChar, lpABC);
  1246. return GetCharABCWidthsA(hdc, uFirstChar, uLastChar, lpABC);
  1247. }
  1248. BOOL
  1249. APIENTRY
  1250. OGetCharWidthFloatW(
  1251. HDC hdc,
  1252. UINT iFirstChar,
  1253. UINT iLastChar,
  1254. PFLOAT pBuffer)
  1255. {
  1256. if(FWide())
  1257. return GetCharWidthFloatW(hdc, iFirstChar, iLastChar, pBuffer);
  1258. return GetCharWidthFloatA(hdc, iFirstChar, iLastChar, pBuffer);
  1259. }
  1260. BOOL
  1261. WINAPI
  1262. OGetCharWidthW(
  1263. HDC hdc,
  1264. UINT iFirstChar,
  1265. UINT iLastChar,
  1266. LPINT lpBuffer)
  1267. {
  1268. if(FWide())
  1269. return GetCharWidth32W(hdc, iFirstChar, iLastChar, lpBuffer);
  1270. return GetCharWidth32A(hdc, iFirstChar, iLastChar, lpBuffer);
  1271. }
  1272. // Static buffers for GetClassInfo[Ex] to return the classname
  1273. // and menuname in Unicode, when running on an Ansi system.
  1274. // The contract of GetClassInfo is that it returns const ptrs
  1275. // back to the class name and menu name. Unfortuntely, this
  1276. // prevents us from translating these back from Ansi to Unicode,
  1277. // without having some static buffers to use. Since we strongly
  1278. // believe that the only people calling this are doing it just to
  1279. // see if it succeeds or not, so they know whether the class is
  1280. // already registered, we've willing to just have one set of
  1281. // static buffers to use.
  1282. // CAUTION: this will work as long as two threads don't call
  1283. // GetClassInfo[Ex] at the same time!
  1284. static WCHAR g_szClassName[256];
  1285. static WCHAR g_szMenuName[256];
  1286. #ifdef DEBUG
  1287. static DWORD g_dwCallingThread = 0; // debug global for ensuring one thread.
  1288. #endif // DEBUG
  1289. BOOL
  1290. WINAPI
  1291. OGetClassInfoW
  1292. (
  1293. HINSTANCE hInstance,
  1294. LPCWSTR lpClassName,
  1295. LPWNDCLASSW lpWndClass
  1296. )
  1297. {
  1298. if (FWide())
  1299. return GetClassInfoW(hInstance, lpClassName, lpWndClass);
  1300. PreConvert();
  1301. LPSTR szClassName = Convert(lpClassName);
  1302. BOOL fRet = GetClassInfoA(hInstance, szClassName, (LPWNDCLASSA)lpWndClass);
  1303. if (!fRet)
  1304. {
  1305. return false;
  1306. }
  1307. // if ClassName or MenuName aren't atom's, we need to
  1308. // translate them back to Unicode. We use our static
  1309. // buffers above. See note about why and the CAUTION!
  1310. #ifdef DEBUG
  1311. if (!g_dwCallingThread)
  1312. g_dwCallingThread = GetCurrentThreadId();
  1313. Assert(GetCurrentThreadId() == g_dwCallingThread);
  1314. #endif // DEBUG
  1315. if (!FATOM(lpWndClass->lpszMenuName))
  1316. {
  1317. Assert(strlen((LPCSTR)lpWndClass->lpszMenuName) <
  1318. (sizeof(g_szMenuName)/sizeof(WCHAR)));
  1319. if (!AnsiToUnicode(g_szMenuName, (LPCSTR)lpWndClass->lpszMenuName,
  1320. strlen((LPCSTR)lpWndClass->lpszMenuName)+1))
  1321. {
  1322. return false;
  1323. }
  1324. lpWndClass->lpszMenuName = g_szMenuName;
  1325. }
  1326. if (!FATOM(lpWndClass->lpszClassName))
  1327. {
  1328. Assert(strlen((LPCSTR)lpWndClass->lpszClassName) <
  1329. (sizeof(g_szClassName)/sizeof(WCHAR)));
  1330. if (!AnsiToUnicode(g_szClassName, (LPCSTR)lpWndClass->lpszClassName,
  1331. strlen((LPCSTR)lpWndClass->lpszClassName)+1))
  1332. {
  1333. return false;
  1334. }
  1335. lpWndClass->lpszClassName = g_szClassName;
  1336. }
  1337. return fRet;
  1338. }
  1339. BOOL
  1340. WINAPI
  1341. OGetClassInfoExW
  1342. (
  1343. HINSTANCE hInstance,
  1344. LPCWSTR lpClassName,
  1345. LPWNDCLASSEXW lpWndClass
  1346. )
  1347. {
  1348. if (FWide())
  1349. return GetClassInfoExW(hInstance, lpClassName, lpWndClass);
  1350. PreConvert();
  1351. LPSTR szClassName = Convert(lpClassName);
  1352. BOOL fRet = GetClassInfoExA(hInstance, szClassName, (LPWNDCLASSEXA)lpWndClass);
  1353. if (!fRet)
  1354. {
  1355. return false;
  1356. }
  1357. // if ClassName or MenuName aren't atom's, we need to
  1358. // translate them back to Unicode. We use our static
  1359. // buffers above. See note about why and the CAUTION!
  1360. #ifdef DEBUG
  1361. if (!g_dwCallingThread)
  1362. g_dwCallingThread = GetCurrentThreadId();
  1363. Assert(GetCurrentThreadId() == g_dwCallingThread);
  1364. #endif // DEBUG
  1365. if (!FATOM(lpWndClass->lpszMenuName))
  1366. {
  1367. Assert(strlen((LPCSTR)lpWndClass->lpszMenuName) <
  1368. (sizeof(g_szMenuName)/sizeof(WCHAR)));
  1369. if (!AnsiToUnicode(g_szMenuName, (LPCSTR)lpWndClass->lpszMenuName,
  1370. strlen((LPCSTR)lpWndClass->lpszMenuName)+1))
  1371. {
  1372. return false;
  1373. }
  1374. lpWndClass->lpszMenuName = g_szMenuName;
  1375. }
  1376. if (!FATOM(lpWndClass->lpszClassName))
  1377. {
  1378. Assert(strlen((LPCSTR)lpWndClass->lpszClassName) <
  1379. (sizeof(g_szClassName)/sizeof(WCHAR)));
  1380. if (!AnsiToUnicode(g_szClassName, (LPCSTR)lpWndClass->lpszClassName,
  1381. strlen((LPCSTR)lpWndClass->lpszClassName)+1))
  1382. {
  1383. return false;
  1384. }
  1385. lpWndClass->lpszClassName = g_szClassName;
  1386. }
  1387. return fRet;
  1388. }
  1389. DWORD
  1390. WINAPI
  1391. OGetClassLongW(
  1392. HWND hWnd,
  1393. int nIndex)
  1394. {
  1395. if(FWide())
  1396. return GetClassLongW(hWnd, nIndex);
  1397. return GetClassLongA(hWnd, nIndex); //$UNDONE_POST_98 Watch out for GCL_MENUNAME, etc!
  1398. }
  1399. DWORD
  1400. WINAPI
  1401. OSetClassLongW(
  1402. HWND hWnd,
  1403. int nIndex,
  1404. LONG dwNewLong)
  1405. {
  1406. if (FWide())
  1407. return SetClassLongW(hWnd, nIndex, dwNewLong);
  1408. return SetClassLongA(hWnd, nIndex, dwNewLong); //$UNDONE_POST_98 Watch out for GCL_MENUNAME, etc!
  1409. }
  1410. int
  1411. WINAPI
  1412. OGetClassNameW(
  1413. HWND hWnd,
  1414. LPWSTR lpClassName,
  1415. int nMaxCount)
  1416. {
  1417. if(FWide())
  1418. return GetClassNameW(hWnd, lpClassName, nMaxCount);
  1419. LPSTR sz = SzAlloc(sizeof(WCHAR) * nMaxCount + 2);
  1420. int nRet = GetClassNameA(hWnd, sz, sizeof(WCHAR) * nMaxCount);
  1421. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  1422. if (nRet)
  1423. {
  1424. // force null-termination
  1425. sz[sizeof(WCHAR) * nMaxCount] = '\0';
  1426. sz[sizeof(WCHAR) * nMaxCount + 1] = '\0';
  1427. // need a temporary wide string
  1428. LPWSTR wsz = SzWAlloc(2 * nMaxCount + 1);
  1429. nRet = min(AnsiToUnicode(wsz, sz, 2 * nMaxCount + 1), nMaxCount);
  1430. // copy the requested number of characters
  1431. if (lpClassName)
  1432. {
  1433. memcpy(lpClassName, wsz, nRet * sizeof(WCHAR));
  1434. }
  1435. return nRet;
  1436. }
  1437. else if (lpClassName && 0 < nMaxCount)
  1438. {
  1439. *lpClassName = L'\0';
  1440. }
  1441. return nRet;
  1442. }
  1443. DWORD
  1444. WINAPI
  1445. OGetCurrentDirectoryW(
  1446. DWORD nBufferLength,
  1447. LPWSTR lpBuffer)
  1448. {
  1449. if (FWide())
  1450. return GetCurrentDirectoryW(nBufferLength, lpBuffer);
  1451. LPSTR sz = SzAlloc(sizeof(WCHAR) * nBufferLength);
  1452. DWORD dwRet = GetCurrentDirectoryA(sizeof(WCHAR) * nBufferLength, sz);
  1453. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  1454. if (dwRet)
  1455. {
  1456. return AnsiToUnicode(lpBuffer, sz, nBufferLength);
  1457. }
  1458. else if (lpBuffer && 0 < nBufferLength)
  1459. {
  1460. *lpBuffer = L'\0';
  1461. }
  1462. return dwRet;
  1463. }
  1464. UINT
  1465. WINAPI
  1466. OGetDlgItemTextW(
  1467. HWND hDlg,
  1468. int nIDDlgItem,
  1469. LPWSTR lpString,
  1470. int nMaxCount)
  1471. {
  1472. if(FWide())
  1473. return GetDlgItemTextW(hDlg, nIDDlgItem, lpString, nMaxCount);
  1474. LPSTR sz = SzAlloc(sizeof(WCHAR) * nMaxCount);
  1475. UINT uRet = GetDlgItemTextA(hDlg, nIDDlgItem, sz, sizeof(WCHAR) * nMaxCount);
  1476. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  1477. if(uRet)
  1478. {
  1479. return AnsiToUnicode(lpString, sz, nMaxCount);
  1480. }
  1481. else if (lpString && 0 < nMaxCount)
  1482. {
  1483. *lpString = L'\0';
  1484. }
  1485. return uRet;
  1486. }
  1487. DWORD
  1488. WINAPI
  1489. OGetFileAttributesW(
  1490. LPCWSTR lpFileName
  1491. )
  1492. {
  1493. if(FWide())
  1494. return GetFileAttributesW(lpFileName);
  1495. PreConvert();
  1496. LPSTR sz = Convert(lpFileName);
  1497. return GetFileAttributesA(sz);
  1498. }
  1499. DWORD
  1500. WINAPI
  1501. OGetFullPathNameW(
  1502. LPCWSTR lpFileName,
  1503. DWORD nBufferLength,
  1504. LPWSTR lpBuffer,
  1505. LPWSTR *lpFilePart
  1506. )
  1507. {
  1508. if(FWide())
  1509. return GetFullPathNameW(lpFileName, nBufferLength, lpBuffer, lpFilePart);
  1510. PreConvert();
  1511. LPSTR szFile = Convert(lpFileName);
  1512. LPSTR szBuffer = SzAlloc(sizeof(WCHAR) * nBufferLength);
  1513. LPSTR pszFile;
  1514. DWORD dwRet = GetFullPathNameA(szFile ,sizeof(WCHAR) * nBufferLength, szBuffer , &pszFile);
  1515. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  1516. if(dwRet)
  1517. {
  1518. DWORD dwNoOfChar = AnsiToUnicode(lpBuffer, szBuffer , nBufferLength);
  1519. *pszFile = '\0';
  1520. *lpFilePart = lpBuffer + AnsiToUnicode(NULL, szBuffer, 0);
  1521. return dwNoOfChar;
  1522. }
  1523. return dwRet;
  1524. }
  1525. DWORD
  1526. WINAPI
  1527. OGetGlyphOutlineW(
  1528. HDC hdc,
  1529. UINT uChar,
  1530. UINT uFormat,
  1531. LPGLYPHMETRICS lpgm,
  1532. DWORD cbBuffer,
  1533. LPVOID lpvBuffer,
  1534. CONST MAT2 * lpmat2)
  1535. {
  1536. if (FWide())
  1537. return GetGlyphOutlineW(hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, lpmat2);
  1538. return GetGlyphOutlineA(hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, lpmat2);
  1539. }
  1540. DWORD
  1541. WINAPI
  1542. OGetKerningPairsW(
  1543. HDC hdc,
  1544. DWORD nNumPairs,
  1545. LPKERNINGPAIR lpkrnpair)
  1546. {
  1547. if(FWide())
  1548. return GetKerningPairsW(hdc, nNumPairs, lpkrnpair);
  1549. return GetKerningPairsA(hdc, nNumPairs, lpkrnpair);
  1550. }
  1551. BOOL
  1552. WINAPI
  1553. OGetMessageW(
  1554. LPMSG lpMsg,
  1555. HWND hWnd ,
  1556. UINT wMsgFilterMin,
  1557. UINT wMsgFilterMax)
  1558. {
  1559. if(FWide())
  1560. return GetMessageW(lpMsg, hWnd , wMsgFilterMin, wMsgFilterMax);
  1561. return GetMessageA(lpMsg, hWnd , wMsgFilterMin, wMsgFilterMax);
  1562. }
  1563. DWORD
  1564. WINAPI
  1565. OGetModuleFileNameW(
  1566. HINSTANCE hModule,
  1567. LPWSTR pwszFilename,
  1568. DWORD nSize
  1569. )
  1570. {
  1571. if(FWide())
  1572. return GetModuleFileNameW(
  1573. hModule,
  1574. pwszFilename,
  1575. nSize
  1576. );
  1577. LPSTR sz = SzAlloc(sizeof(WCHAR) * nSize);
  1578. DWORD dwRet = GetModuleFileNameA(hModule, sz, sizeof(WCHAR) * nSize);
  1579. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  1580. if (dwRet)
  1581. {
  1582. return AnsiToUnicode(pwszFilename, sz, nSize, dwRet + 1);
  1583. }
  1584. else if (pwszFilename && 0 < nSize)
  1585. {
  1586. *pwszFilename = L'\0';
  1587. }
  1588. return dwRet;
  1589. }
  1590. HMODULE
  1591. WINAPI
  1592. OGetModuleHandleW(
  1593. LPCWSTR lpModuleName
  1594. )
  1595. {
  1596. if(FWide())
  1597. return GetModuleHandleW(lpModuleName);
  1598. PreConvert();
  1599. LPSTR sz = Convert(lpModuleName);
  1600. return GetModuleHandleA(sz);
  1601. }
  1602. // From: Mark Ashton on 5/8/97
  1603. // Ted Smith: Re-wrote fixing handling of non-trivial parameters on 6/25
  1604. // Smoke tested by Mark Ashton on 6/25
  1605. APIENTRY
  1606. OGetOpenFileNameW
  1607. (
  1608. LPOPENFILENAMEW lpofn
  1609. )
  1610. {
  1611. if (FWide())
  1612. return GetOpenFileNameW(lpofn);
  1613. Assert(!(lpofn->Flags & OFN_ENABLEHOOK));
  1614. PreConvert();
  1615. OPENFILENAMEA ofn;
  1616. ofn.lStructSize = sizeof(OPENFILENAMEA);
  1617. ofn.hwndOwner = lpofn->hwndOwner;
  1618. ofn.hInstance = lpofn->hInstance;
  1619. ofn.lpstrFilter = ConvertWithLen(lpofn->lpstrFilter, cUnicodeMultiSzLen(lpofn->lpstrFilter), &_lJunk);
  1620. ofn.lpstrCustomFilter = ConvertWithLen(lpofn->lpstrCustomFilter, lpofn->nMaxCustFilter, (LONG *)&ofn.nMaxCustFilter);
  1621. ofn.nFilterIndex = lpofn->nFilterIndex;
  1622. ofn.lpstrFile = ConvertWithLen(lpofn->lpstrFile, lpofn->nMaxFile, (LONG *)&ofn.nMaxFile);
  1623. ofn.lpstrFileTitle = ConvertWithLen(lpofn->lpstrFileTitle, lpofn->nMaxFileTitle, (LONG *)&ofn.nMaxFileTitle);
  1624. ofn.lpstrInitialDir = Convert(lpofn->lpstrInitialDir);
  1625. ofn.lpstrTitle = Convert(lpofn->lpstrTitle);
  1626. ofn.Flags = lpofn->Flags;
  1627. ofn.nFileOffset = lpofn->nFileOffset;
  1628. ofn.nFileExtension = lpofn->nFileExtension;
  1629. ofn.lpstrDefExt = Convert(lpofn->lpstrDefExt);
  1630. ofn.lCustData = lpofn->lCustData;
  1631. ofn.lpfnHook = NULL;
  1632. ofn.lpTemplateName = ((lpofn->Flags & OFN_ENABLETEMPLATE) &&
  1633. !FATOM(lpofn->lpTemplateName) ) ?
  1634. Convert(lpofn->lpTemplateName) :
  1635. (LPSTR)lpofn->lpTemplateName;
  1636. BOOL fFlag = GetOpenFileNameA(&ofn);
  1637. if (fFlag)
  1638. {
  1639. Assert(lpofn->hwndOwner == ofn.hwndOwner);
  1640. Assert(lpofn->hInstance == ofn.hInstance);
  1641. if (ofn.lpstrCustomFilter)
  1642. {
  1643. lpofn->nMaxCustFilter = AnsiToUnicode(lpofn->lpstrCustomFilter, ofn.lpstrCustomFilter, lpofn->nMaxCustFilter, strlen(ofn.lpstrCustomFilter) + 1);
  1644. }
  1645. lpofn->nFilterIndex = ofn.nFilterIndex;
  1646. Assert(lpofn->nMaxFile == ofn.nMaxFile);
  1647. Verify(0 <= AnsiToUnicode(lpofn->lpstrFile, ofn.lpstrFile, lpofn->nMaxFile, strlen(ofn.lpstrFile) + 1));
  1648. if (ofn.lpstrFileTitle)
  1649. {
  1650. lpofn->nMaxFileTitle = AnsiToUnicode(lpofn->lpstrFileTitle, ofn.lpstrFileTitle, strlen(ofn.lpstrFileTitle) + 1);
  1651. }
  1652. lpofn->Flags = ofn.Flags;
  1653. lpofn->nFileOffset = ofn.nFileOffset;
  1654. lpofn->nFileExtension = ofn.nFileExtension;
  1655. Assert(lpofn->lCustData == ofn.lCustData);
  1656. Assert(lpofn->lpfnHook == ofn.lpfnHook);
  1657. }
  1658. else if (lpofn->lpstrFile)
  1659. { // if buffer too small first 2 bytes are the required size
  1660. memcpy(lpofn->lpstrFile, ofn.lpstrFile, sizeof(short));
  1661. }
  1662. return fFlag;
  1663. }
  1664. UINT
  1665. APIENTRY
  1666. OGetOutlineTextMetricsW(
  1667. HDC hdc,
  1668. UINT cbData,
  1669. LPOUTLINETEXTMETRICW lpOTM)
  1670. {
  1671. // *** TextMetrics defines BYTE elements in the structure for the
  1672. // value of first first/last character defined in the font.
  1673. // Problem for DBCS.
  1674. if(FWide())
  1675. return GetOutlineTextMetricsW(hdc, cbData, lpOTM);
  1676. return GetOutlineTextMetricsA(hdc, cbData, (LPOUTLINETEXTMETRICA)lpOTM); //$ UNDONE_POST_98 - This doesn't convert the embedded Names...
  1677. }
  1678. UINT
  1679. WINAPI
  1680. OGetPrivateProfileIntW(
  1681. LPCWSTR lpAppName,
  1682. LPCWSTR lpKeyName,
  1683. INT nDefault,
  1684. LPCWSTR lpFileName)
  1685. {
  1686. if(FWide())
  1687. return GetPrivateProfileIntW(lpAppName, lpKeyName, nDefault, lpFileName);
  1688. PreConvert();
  1689. LPSTR szAppName = Convert(lpAppName);
  1690. LPSTR szKeyName = Convert(lpKeyName);
  1691. LPSTR szFileName = Convert(lpFileName);
  1692. return GetPrivateProfileIntA(szAppName, szKeyName, nDefault, szFileName);
  1693. }
  1694. DWORD
  1695. WINAPI
  1696. OGetPrivateProfileStringW(
  1697. LPCWSTR lpAppName,
  1698. LPCWSTR lpKeyName,
  1699. LPCWSTR lpDefault,
  1700. LPWSTR lpReturnedString,
  1701. DWORD nSize,
  1702. LPCWSTR lpFileName)
  1703. {
  1704. if(FWide())
  1705. return GetPrivateProfileStringW(lpAppName, lpKeyName, lpDefault, lpReturnedString,
  1706. nSize, lpFileName);
  1707. PreConvert();
  1708. LPSTR szAppName = Convert(lpAppName);
  1709. LPSTR szKeyName = Convert(lpKeyName);
  1710. LPSTR szDefault = Convert(lpDefault);
  1711. LPSTR szFileName = Convert(lpFileName);
  1712. LPSTR szReturnedString = SzAlloc(sizeof(WCHAR) * nSize);
  1713. DWORD dwRet = GetPrivateProfileStringA(szAppName, szKeyName, szDefault, szReturnedString,
  1714. sizeof(WCHAR) * nSize, szFileName);
  1715. // I hope this doesn't fail because there's no clear failure value in the docs
  1716. DWORD dwNoOfChar = AnsiToUnicode(lpReturnedString, szReturnedString, nSize);
  1717. if (dwNoOfChar)
  1718. return dwRet;
  1719. else
  1720. {
  1721. LPWSTR lpTempString = SzWAlloc(sizeof(WCHAR) * nSize);
  1722. if (AnsiToUnicode(lpTempString, szReturnedString, sizeof(WCHAR) * nSize))
  1723. {
  1724. if (lpAppName && lpKeyName)
  1725. {
  1726. lpTempString[nSize - 1] = L'\0';
  1727. wcsncpy(lpReturnedString, lpTempString, nSize);
  1728. return nSize - 1;
  1729. }
  1730. else
  1731. {
  1732. lpTempString[nSize - 1] = L'\0';
  1733. lpTempString[nSize - 2] = L'\0';
  1734. wcsncpy(lpReturnedString, lpTempString, nSize);
  1735. return nSize - 2;
  1736. }
  1737. }
  1738. }
  1739. return dwRet;
  1740. }
  1741. int
  1742. WINAPI
  1743. OGetObjectW(
  1744. HGDIOBJ hgdiobj,
  1745. int cbBuffer,
  1746. LPVOID lpvObject)
  1747. {
  1748. if(FWide())
  1749. return GetObjectW(hgdiobj, cbBuffer, lpvObject);
  1750. DWORD dwObj = GetObjectType(hgdiobj);
  1751. if (OBJ_FONT == dwObj)
  1752. {
  1753. //$CONSIDER: This effects all getobject call, performance?
  1754. Assert(cbBuffer == sizeof(LOGFONTW));
  1755. LOGFONTA lfa;
  1756. LOGFONTW *plfw = (LOGFONTW *)lpvObject;
  1757. int nRet = GetObjectA(hgdiobj, sizeof(lfa), &lfa);
  1758. if(nRet)
  1759. {
  1760. memcpy(plfw, &lfa, sizeof(LOGFONTA));
  1761. Verify(0 <= AnsiToUnicode(plfw->lfFaceName, lfa.lfFaceName, LF_FACESIZE));
  1762. }
  1763. return nRet;
  1764. }
  1765. else
  1766. {
  1767. return GetObjectA(hgdiobj, cbBuffer, lpvObject);
  1768. }
  1769. }
  1770. UINT
  1771. WINAPI
  1772. OGetProfileIntW(
  1773. LPCWSTR lpAppName,
  1774. LPCWSTR lpKeyName,
  1775. INT nDefault
  1776. )
  1777. {
  1778. if(FWide())
  1779. return GetProfileIntW(lpAppName, lpKeyName, nDefault);
  1780. PreConvert();
  1781. LPSTR szApp = Convert(lpAppName);
  1782. LPSTR szKey = Convert(lpKeyName);
  1783. return GetProfileIntA(szApp, szKey, nDefault);
  1784. }
  1785. HANDLE
  1786. WINAPI
  1787. OGetPropW(
  1788. HWND hWnd,
  1789. LPCWSTR lpString)
  1790. {
  1791. if(FWide())
  1792. return GetPropW(hWnd, lpString);
  1793. if(FATOM(lpString))
  1794. return GetPropA(hWnd, (LPSTR)lpString);
  1795. PreConvert();
  1796. LPSTR sz = Convert(lpString);
  1797. return GetPropA(hWnd, sz);
  1798. }
  1799. // From: Mark Ashton on 5/29/97
  1800. // Ted Smith: Re-wrote fixing handling of non-trivial parameters on 6/25
  1801. // Smoke tested by Mark Ashton on 6/25
  1802. APIENTRY
  1803. OGetSaveFileNameW(LPOPENFILENAMEW lpofn)
  1804. {
  1805. if (FWide())
  1806. return GetSaveFileNameW(lpofn);
  1807. PreConvert();
  1808. Assert(!(lpofn->Flags & OFN_ENABLEHOOK));
  1809. OPENFILENAMEA ofn;
  1810. ofn.lStructSize = sizeof(OPENFILENAMEA);
  1811. ofn.hwndOwner = lpofn->hwndOwner;
  1812. ofn.hInstance = lpofn->hInstance;
  1813. ofn.lpstrFilter = ConvertWithLen(lpofn->lpstrFilter, cUnicodeMultiSzLen(lpofn->lpstrFilter), &_lJunk);
  1814. ofn.lpstrCustomFilter = ConvertWithLen(lpofn->lpstrCustomFilter, lpofn->nMaxCustFilter, (LONG *)&ofn.nMaxCustFilter);
  1815. ofn.nFilterIndex = lpofn->nFilterIndex;
  1816. ofn.lpstrFile = ConvertWithLen(lpofn->lpstrFile, lpofn->nMaxFile, (LONG *)&ofn.nMaxFile);
  1817. ofn.lpstrFileTitle = ConvertWithLen(lpofn->lpstrFileTitle, lpofn->nMaxFileTitle, (LONG *)&ofn.nMaxFileTitle);
  1818. ofn.lpstrInitialDir = Convert(lpofn->lpstrInitialDir);
  1819. ofn.lpstrTitle = Convert(lpofn->lpstrTitle);
  1820. ofn.Flags = lpofn->Flags;
  1821. ofn.nFileOffset = lpofn->nFileOffset;
  1822. ofn.nFileExtension = lpofn->nFileExtension;
  1823. ofn.lpstrDefExt = Convert(lpofn->lpstrDefExt);
  1824. ofn.lCustData = lpofn->lCustData;
  1825. ofn.lpfnHook = NULL;
  1826. ofn.lpTemplateName = ((lpofn->Flags & OFN_ENABLETEMPLATE) &&
  1827. !FATOM(lpofn->lpTemplateName) ) ?
  1828. Convert(lpofn->lpTemplateName) :
  1829. (LPSTR)lpofn->lpTemplateName;
  1830. BOOL fFlag = GetSaveFileNameA(&ofn);
  1831. if (fFlag)
  1832. {
  1833. Assert(lpofn->hwndOwner == ofn.hwndOwner);
  1834. Assert(lpofn->hInstance == ofn.hInstance);
  1835. if (ofn.lpstrCustomFilter)
  1836. {
  1837. lpofn->nMaxCustFilter = AnsiToUnicode(lpofn->lpstrCustomFilter, ofn.lpstrCustomFilter, lpofn->nMaxCustFilter, ofn.nMaxCustFilter);
  1838. }
  1839. lpofn->nFilterIndex = ofn.nFilterIndex;
  1840. Assert(lpofn->nMaxFile == ofn.nMaxFile);
  1841. Verify(0 <= AnsiToUnicode(lpofn->lpstrFile, ofn.lpstrFile, lpofn->nMaxFile, ofn.nMaxFile));
  1842. if (ofn.lpstrFileTitle)
  1843. {
  1844. lpofn->nMaxFileTitle = AnsiToUnicode(lpofn->lpstrFileTitle, ofn.lpstrFileTitle, lpofn->nMaxFileTitle);
  1845. }
  1846. lpofn->Flags = ofn.Flags;
  1847. lpofn->nFileOffset = ofn.nFileOffset;
  1848. lpofn->nFileExtension = ofn.nFileExtension;
  1849. Assert(lpofn->lCustData == ofn.lCustData);
  1850. Assert(lpofn->lpfnHook == ofn.lpfnHook);
  1851. }
  1852. else if (lpofn->lpstrFile)
  1853. { // if buffer too small first 2 bytes are the required size
  1854. memcpy(lpofn->lpstrFile, ofn.lpstrFile, sizeof(short));
  1855. }
  1856. return fFlag;
  1857. }
  1858. DWORD
  1859. WINAPI
  1860. OGetTabbedTextExtentW(
  1861. HDC hDC,
  1862. LPCWSTR lpString,
  1863. int nCount,
  1864. int nTabPositions,
  1865. LPINT lpnTabStopPositions)
  1866. {
  1867. Assert(-1 != nCount);
  1868. if(FWide())
  1869. return GetTabbedTextExtentW(hDC, lpString, nCount, nTabPositions, lpnTabStopPositions);
  1870. PreConvert();
  1871. LONG n = 0;
  1872. LPSTR sz = ConvertWithLen(lpString, nCount, &n);
  1873. return GetTabbedTextExtentA(hDC, sz, n, nTabPositions, lpnTabStopPositions);
  1874. }
  1875. // From: Mark Ashton on 5/8/97
  1876. UINT
  1877. WINAPI
  1878. OGetTempFileNameW(
  1879. LPCWSTR lpPathName,
  1880. LPCWSTR lpPrefixString,
  1881. UINT uUnique,
  1882. LPWSTR lpTempFileName
  1883. )
  1884. {
  1885. if (FWide())
  1886. return GetTempFileNameW(lpPathName, lpPrefixString, uUnique, lpTempFileName);
  1887. char szPathName[_MAX_PATH];
  1888. Verify(0 <= UnicodeToAnsi(szPathName, lpPathName, _MAX_PATH));
  1889. char szPrefixString[_MAX_PATH];
  1890. Verify(0 <= UnicodeToAnsi(szPrefixString, lpPrefixString, _MAX_PATH));
  1891. char szTempFilename[_MAX_PATH];
  1892. UINT dwRet = GetTempFileNameA(szPathName, szPrefixString, uUnique, szTempFilename);
  1893. if (dwRet)
  1894. {
  1895. Verify(0 <= AnsiToUnicode(lpTempFileName, szTempFilename, _MAX_PATH));
  1896. }
  1897. return dwRet;
  1898. }
  1899. // From: Mark Ashton on 5/8/97
  1900. DWORD
  1901. WINAPI
  1902. OGetTempPathW(
  1903. DWORD nBufferLength,
  1904. LPWSTR lpBuffer
  1905. )
  1906. {
  1907. if (FWide())
  1908. return GetTempPathW(nBufferLength, lpBuffer);
  1909. char szPath[_MAX_PATH];
  1910. DWORD dwRet = GetTempPathA(_MAX_PATH, szPath);
  1911. if (dwRet)
  1912. {
  1913. Verify(0 <= AnsiToUnicode(lpBuffer, szPath, nBufferLength));
  1914. }
  1915. return dwRet;
  1916. }
  1917. BOOL
  1918. APIENTRY
  1919. OGetTextExtentPoint32W(
  1920. HDC hdc,
  1921. LPCWSTR pwsz,
  1922. int cb,
  1923. LPSIZE pSize
  1924. )
  1925. {
  1926. Assert(-1 != cb);
  1927. if(FWide())
  1928. return GetTextExtentPoint32W(hdc, pwsz, cb, pSize);
  1929. PreConvert();
  1930. LONG n = 0;
  1931. LPSTR sz = ConvertWithLen(pwsz, cb, &n);
  1932. return GetTextExtentPoint32A(hdc, sz, n, pSize);
  1933. }
  1934. BOOL
  1935. APIENTRY
  1936. OGetTextExtentPointW(
  1937. HDC hdc,
  1938. LPCWSTR pwsz,
  1939. int cb,
  1940. LPSIZE pSize
  1941. )
  1942. {
  1943. Assert(-1 != cb);
  1944. if(FWide())
  1945. return GetTextExtentPointW(hdc, pwsz, cb, pSize);
  1946. PreConvert();
  1947. LONG n = 0;
  1948. LPSTR sz = ConvertWithLen(pwsz, cb, &n);
  1949. return GetTextExtentPointA(hdc, sz, n, pSize);
  1950. }
  1951. BOOL
  1952. APIENTRY OGetTextExtentExPointW(
  1953. HDC hdc,
  1954. LPCWSTR lpszStr,
  1955. int cchString,
  1956. int nMaxExtent,
  1957. LPINT lpnFit,
  1958. LPINT alpDx,
  1959. LPSIZE pSize
  1960. )
  1961. {
  1962. Assert(-1 != cchString);
  1963. if(FWide())
  1964. return GetTextExtentExPointW(hdc, lpszStr, cchString,
  1965. nMaxExtent, lpnFit, alpDx, pSize);
  1966. PreConvert();
  1967. LONG n = 0;
  1968. LPSTR sz = ConvertWithLen(lpszStr, cchString, &n);
  1969. return GetTextExtentExPointA(hdc, sz, n, nMaxExtent, lpnFit, alpDx, pSize);
  1970. }
  1971. LONG
  1972. WINAPI
  1973. OGetWindowLongW(
  1974. HWND hWnd,
  1975. int nIndex)
  1976. {
  1977. if(FWide())
  1978. return GetWindowLongW(hWnd, nIndex);
  1979. return GetWindowLongA(hWnd, nIndex);
  1980. }
  1981. BOOL
  1982. WINAPI
  1983. OGetTextMetricsW(
  1984. HDC hdc,
  1985. LPTEXTMETRICW lptm)
  1986. {
  1987. if(FWide())
  1988. return GetTextMetricsW(hdc, lptm);
  1989. TEXTMETRICA tma;
  1990. memcpy(&tma, lptm, OffsetOf(TEXTMETRIC, tmFirstChar));
  1991. // tmFirstChar is defined as BYTE.
  1992. // $CONSIDER : will fail for DBCS !!
  1993. wctomb((LPSTR)&tma.tmFirstChar, lptm->tmFirstChar);
  1994. wctomb((LPSTR)&tma.tmLastChar, lptm->tmLastChar);
  1995. wctomb((LPSTR)&tma.tmDefaultChar, lptm->tmDefaultChar);
  1996. wctomb((LPSTR)&tma.tmBreakChar, lptm->tmBreakChar);
  1997. memcpy(&tma.tmItalic, &lptm->tmItalic, sizeof(TEXTMETRIC) - OffsetOf(TEXTMETRIC, tmItalic));
  1998. BOOL fRet = GetTextMetricsA(hdc, &tma);
  1999. if(fRet)
  2000. {
  2001. memcpy(&lptm->tmItalic, &tma.tmItalic, sizeof(TEXTMETRIC) - OffsetOf(TEXTMETRIC, tmItalic));
  2002. // Convert tma.tmFirstChar (1 byte char) to lptm->tmFirstChar
  2003. mbtowc(&lptm->tmFirstChar, (LPSTR)&tma.tmFirstChar, 1);
  2004. mbtowc(&lptm->tmLastChar, (LPSTR)&tma.tmLastChar, 1);
  2005. mbtowc(&lptm->tmDefaultChar, (LPSTR)&tma.tmDefaultChar, 1);
  2006. mbtowc(&lptm->tmBreakChar, (LPSTR)&tma.tmBreakChar, 1);
  2007. memcpy(lptm, &tma, OffsetOf(TEXTMETRIC, tmFirstChar));
  2008. }
  2009. return fRet;
  2010. }
  2011. // From: Mark Ashton on 5/8/97
  2012. BOOL
  2013. WINAPI
  2014. OGetUserNameW (
  2015. LPWSTR lpBuffer,
  2016. LPDWORD nSize
  2017. )
  2018. {
  2019. if (FWide())
  2020. return GetUserNameW(lpBuffer, nSize);
  2021. DWORD dwLen = *nSize;
  2022. LPSTR sz = SzAlloc(dwLen);
  2023. BOOL fFlag = GetUserNameA(sz, nSize);
  2024. if (fFlag)
  2025. {
  2026. *nSize = AnsiToUnicode(lpBuffer, sz, dwLen);
  2027. }
  2028. return fFlag;
  2029. }
  2030. BOOL
  2031. WINAPI
  2032. OGetVolumeInformationW(
  2033. LPCWSTR lpRootPathName,
  2034. LPWSTR lpVolumeNameBuffer,
  2035. DWORD nVolumeNameSize,
  2036. LPDWORD lpVolumeSerialNumber,
  2037. LPDWORD lpMaximumComponentLength,
  2038. LPDWORD lpFileSystemFlags,
  2039. LPWSTR lpFileSystemNameBuffer,
  2040. DWORD nFileSystemNameSize
  2041. )
  2042. {
  2043. if(FWide())
  2044. return GetVolumeInformationW(lpRootPathName, lpVolumeNameBuffer, nVolumeNameSize, lpVolumeSerialNumber,
  2045. lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer, nFileSystemNameSize);
  2046. PreConvert();
  2047. LPSTR szRoot = Convert(lpRootPathName);
  2048. LPSTR szName = SzAlloc(sizeof(WCHAR) * nVolumeNameSize);
  2049. LPSTR szSysName = SzAlloc(sizeof(WCHAR) * nFileSystemNameSize);
  2050. BOOL fRet = GetVolumeInformationA(szRoot, szName, sizeof(WCHAR) * nVolumeNameSize, lpVolumeSerialNumber,
  2051. lpMaximumComponentLength, lpFileSystemFlags, szSysName, sizeof(WCHAR) * nFileSystemNameSize);
  2052. if(fRet)
  2053. {
  2054. if (!AnsiToUnicode(lpVolumeNameBuffer, szName, nVolumeNameSize) ||
  2055. !AnsiToUnicode(lpFileSystemNameBuffer, szSysName, nFileSystemNameSize))
  2056. {
  2057. fRet = false;
  2058. }
  2059. }
  2060. if (!fRet)
  2061. {
  2062. if (lpVolumeNameBuffer && 0 < nVolumeNameSize)
  2063. {
  2064. *lpVolumeNameBuffer = L'\0';
  2065. }
  2066. if (lpFileSystemNameBuffer && 0 < nFileSystemNameSize)
  2067. {
  2068. *lpFileSystemNameBuffer = L'\0';
  2069. }
  2070. }
  2071. return fRet;
  2072. }
  2073. int
  2074. WINAPI
  2075. OGetWindowTextLengthW(
  2076. HWND hWnd)
  2077. {
  2078. if(FWide())
  2079. return GetWindowTextLengthW(hWnd);
  2080. return GetWindowTextLengthA(hWnd);
  2081. }
  2082. int
  2083. WINAPI
  2084. OGetWindowTextW(
  2085. HWND hWnd,
  2086. LPWSTR lpString,
  2087. int nMaxCount)
  2088. {
  2089. /******* Blackbox Testing results for GetWindowText Win32 API ******
  2090. TestCase lpString nMaxCount Return Value *lpString modified
  2091. ======================================================================
  2092. Testing GetWindowTextW on WinNT :-
  2093. A not NULL 0 0 No
  2094. B NULL 0 0 No
  2095. C NULL not 0 0 No
  2096. D not NULL not 0 # of chars w/o Yes
  2097. \0 terminator
  2098. Testing GetWindowTextA on Win95 :-
  2099. A not NULL 0 0 Yes
  2100. B NULL 0 GPF!!
  2101. C NULL not 0 GPF!!
  2102. D not NULL not 0 # of chars w/o Yes
  2103. \0 terminator
  2104. *********************************************************************/
  2105. if(FWide())
  2106. return GetWindowTextW(hWnd, lpString, nMaxCount);
  2107. LPSTR sz = SzAlloc(sizeof(WCHAR) * nMaxCount);
  2108. int nRet = GetWindowTextA(hWnd, sz, sizeof(WCHAR) * nMaxCount);
  2109. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  2110. if(nRet)
  2111. {
  2112. return AnsiToUnicode(lpString, sz, nMaxCount);
  2113. }
  2114. else
  2115. {
  2116. // GetWindowText() returns 0 when you call it on a window which
  2117. // has no text (e.g. edit control without any text). It also initializes
  2118. // the buffer passed in to receive the text to "\0". So we should initialize
  2119. // the buffer passed in before returning.
  2120. if (lpString && 0 < nMaxCount)
  2121. {
  2122. *lpString = L'\0';
  2123. }
  2124. }
  2125. return nRet;
  2126. }
  2127. ATOM
  2128. WINAPI
  2129. OGlobalAddAtomW(
  2130. LPCWSTR lpString
  2131. )
  2132. {
  2133. if(FWide())
  2134. return GlobalAddAtomW(lpString);
  2135. PreConvert();
  2136. LPSTR sz = Convert(lpString);
  2137. return GlobalAddAtomA(sz);
  2138. }
  2139. // From: Josh Kaplan on 8/12/97
  2140. UINT
  2141. WINAPI
  2142. OGlobalGetAtomNameW(
  2143. ATOM nAtom,
  2144. LPWSTR lpBuffer,
  2145. int nSize
  2146. )
  2147. {
  2148. if(FWide())
  2149. return GlobalGetAtomNameW(nAtom, lpBuffer, nSize);
  2150. LPSTR sz = SzAlloc(sizeof(WCHAR) * nSize);
  2151. if (GlobalGetAtomNameA(nAtom, sz, sizeof(WCHAR) * nSize))
  2152. {
  2153. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  2154. return AnsiToUnicode(lpBuffer, sz, nSize) - 1;
  2155. }
  2156. if (lpBuffer && 0 < nSize)
  2157. {
  2158. *lpBuffer = L'\0';
  2159. }
  2160. return 0;
  2161. }
  2162. BOOL
  2163. WINAPI
  2164. OGrayStringW(
  2165. HDC hDC,
  2166. HBRUSH hBrush,
  2167. GRAYSTRINGPROC lpOutputFunc,
  2168. LPARAM lpData,
  2169. int nCount,
  2170. int X,
  2171. int Y,
  2172. int nWidth,
  2173. int nHeight)
  2174. {
  2175. if(FWide())
  2176. return GrayStringW(hDC, hBrush, lpOutputFunc, lpData, nCount, X, Y, nWidth, nHeight);
  2177. if (!lpOutputFunc)
  2178. {
  2179. PreConvert();
  2180. LPSTR szData = Convert((LPCWSTR) lpData);
  2181. return GrayStringA(hDC, hBrush, lpOutputFunc, (LPARAM) szData, nCount, X, Y, nWidth, nHeight);
  2182. }
  2183. return GrayStringA(hDC, hBrush, lpOutputFunc, lpData, nCount, X, Y, nWidth, nHeight);
  2184. }
  2185. BOOL
  2186. WINAPI
  2187. OInsertMenuW(
  2188. HMENU hMenu,
  2189. UINT uPosition,
  2190. UINT uFlags,
  2191. UINT uIDNewItem,
  2192. LPCWSTR lpNewItem
  2193. )
  2194. {
  2195. if(FWide())
  2196. return InsertMenuW(hMenu, uPosition, uFlags, uIDNewItem, lpNewItem);
  2197. if(uFlags & (MF_BITMAP | MF_OWNERDRAW))
  2198. return InsertMenuA(hMenu, uPosition, uFlags, uIDNewItem, (LPSTR)lpNewItem);
  2199. PreConvert();
  2200. LPSTR sz = Convert(lpNewItem);
  2201. return InsertMenuA(hMenu, uPosition, uFlags, uIDNewItem, sz);
  2202. }
  2203. BOOL
  2204. WINAPI
  2205. OIsBadStringPtrW(
  2206. LPCWSTR lpsz,
  2207. UINT ucchMax
  2208. )
  2209. {
  2210. if(FWide())
  2211. return IsBadStringPtrW(lpsz, ucchMax);
  2212. return IsBadStringPtrA((LPSTR) lpsz, ucchMax * sizeof(WCHAR)); //$UNDONE_POST_98 - We should use IsBadReadPtr(strlen)!
  2213. }
  2214. BOOL
  2215. WINAPI
  2216. OIsCharAlphaNumericW(
  2217. WCHAR wch)
  2218. {
  2219. if(FWide())
  2220. return IsCharAlphaNumericW(wch);
  2221. //$CONSIDER: we really want to use MB_CUR_MAX, but that is
  2222. // not a defined constant
  2223. CHAR psz[4];
  2224. int cch = WideCharToMultiByte(CP_ACP, 0, &wch, 1, (CHAR *) psz, 4, NULL, NULL);
  2225. if (1 == cch)
  2226. {
  2227. return IsCharAlphaNumericA(*psz);
  2228. }
  2229. else if (1 < cch)
  2230. {
  2231. // It's a multi-byte character, so treat it as alpha
  2232. // Note: we are not sure that this is entirely correct
  2233. return true;
  2234. }
  2235. else
  2236. {
  2237. return false;
  2238. }
  2239. }
  2240. BOOL
  2241. WINAPI
  2242. OIsCharAlphaW(
  2243. WCHAR wch)
  2244. {
  2245. if(FWide())
  2246. return IsCharAlphaW(wch);
  2247. //$CONSIDER: we really want to use MB_CUR_MAX, but that is
  2248. // not a defined constant
  2249. CHAR psz[4];
  2250. int cch = WideCharToMultiByte(CP_ACP, 0, &wch, 1, (CHAR *) psz, 4, NULL, NULL);
  2251. if(1 == cch)
  2252. {
  2253. return IsCharAlphaA(*psz);
  2254. }
  2255. else if (1 < cch)
  2256. {
  2257. // It's a multi-byte character, so treat it as alpha
  2258. // Note: we are not sure that this is entirely correct
  2259. return true;
  2260. }
  2261. else
  2262. {
  2263. return false;
  2264. }
  2265. }
  2266. BOOL
  2267. WINAPI
  2268. OIsDialogMessageW(
  2269. HWND hDlg,
  2270. LPMSG lpMsg)
  2271. {
  2272. // WARNING!!!
  2273. // Bug #6488. We have run into problems due to using IsDialogMessageW on
  2274. // WinNT Japanese. The fix for the bug was calling ANSI version of
  2275. // IsDialogMessage irrespective of whether we are running on NT or Win95.
  2276. // The shell is compiled MBCS (not UNICODE) and they are always using the
  2277. // ANSI versions of the routines. lpMsg passed by shell contains MBCS
  2278. // characters & not UNICODE. So in cases where you get the message
  2279. // structure from the Shell, you will have to call the IsDialogMessageA
  2280. // directly and not use this wrapper.
  2281. if(FWide())
  2282. return IsDialogMessageW(hDlg, lpMsg);
  2283. return IsDialogMessageA(hDlg, lpMsg);
  2284. }
  2285. // From: Mark Ashton on 5/8/97
  2286. // Bill Hieber - 2/5/98 fixed buffer size problem.
  2287. int
  2288. WINAPI
  2289. OLCMapStringW(
  2290. LCID Locale,
  2291. DWORD dwMapFlags,
  2292. LPCWSTR lpSrcStr,
  2293. int cchSrc,
  2294. LPWSTR lpDestStr,
  2295. int cchDest)
  2296. {
  2297. if (FWide())
  2298. return LCMapStringW(Locale, dwMapFlags, lpSrcStr, cchSrc, lpDestStr, cchDest);
  2299. // lpSrcStr is not required to be '\0' terminated. Note that we don't support -1!
  2300. Assert(cchSrc != -1);
  2301. LPSTR sz = SzAlloc(cchSrc * 2);
  2302. int dw = WideCharToMultiByte(CP_ACP, 0, lpSrcStr, cchSrc, sz, cchSrc * 2, NULL, NULL);
  2303. LPSTR dst = cchDest ? SzAlloc(cchDest*2) : NULL;
  2304. int dwRet = LCMapStringA(Locale, dwMapFlags, sz, dw, dst, cchDest*2);
  2305. if (dwRet && cchDest)
  2306. {
  2307. dwRet = MultiByteToWideChar(CP_ACP, 0, dst, dwRet, lpDestStr, cchDest);
  2308. }
  2309. return dwRet;
  2310. }
  2311. HACCEL
  2312. WINAPI
  2313. OLoadAcceleratorsW(
  2314. HINSTANCE hInst,
  2315. LPCWSTR lpTableName)
  2316. {
  2317. if(FWide())
  2318. return LoadAcceleratorsW(hInst, lpTableName);
  2319. if(FATOM(lpTableName))
  2320. return LoadAcceleratorsA(hInst, (LPSTR)lpTableName);
  2321. PreConvert();
  2322. LPSTR sz = Convert(lpTableName);
  2323. return LoadAcceleratorsA(hInst, sz);
  2324. }
  2325. HBITMAP
  2326. WINAPI
  2327. OLoadBitmapW(
  2328. HINSTANCE hInstance,
  2329. LPCWSTR lpBitmapName)
  2330. {
  2331. if(FWide())
  2332. return LoadBitmapW(hInstance, lpBitmapName);
  2333. if(FATOM(lpBitmapName))
  2334. return LoadBitmapA(hInstance, (LPSTR)lpBitmapName);
  2335. PreConvert();
  2336. LPSTR sz = Convert(lpBitmapName);
  2337. return LoadBitmapA(hInstance, sz);
  2338. }
  2339. HCURSOR
  2340. WINAPI
  2341. OLoadCursorW(
  2342. HINSTANCE hInstance,
  2343. LPCWSTR lpCursorName)
  2344. {
  2345. if(FWide())
  2346. return LoadCursorW(
  2347. hInstance,
  2348. lpCursorName);
  2349. if (FATOM(lpCursorName))
  2350. return LoadCursorA(hInstance, (LPSTR) lpCursorName);
  2351. PreConvert();
  2352. LPSTR sz = Convert(lpCursorName);
  2353. return LoadCursorA(hInstance, sz);
  2354. }
  2355. HICON
  2356. WINAPI
  2357. OLoadIconW(
  2358. HINSTANCE hInstance,
  2359. LPCWSTR lpIconName)
  2360. {
  2361. if(FWide())
  2362. return LoadIconW(hInstance, lpIconName);
  2363. if(FATOM(lpIconName))
  2364. return LoadIconA(hInstance, (LPSTR)lpIconName);
  2365. PreConvert();
  2366. LPSTR sz = Convert(lpIconName);
  2367. return LoadIconA(hInstance, sz);
  2368. }
  2369. HINSTANCE
  2370. WINAPI
  2371. OLoadLibraryW(
  2372. LPCWSTR pwszFileName
  2373. )
  2374. {
  2375. if(FWide())
  2376. return LoadLibraryW(pwszFileName);
  2377. PreConvert();
  2378. LPSTR sz = Convert(pwszFileName);
  2379. return LoadLibraryA(sz);
  2380. }
  2381. HMODULE
  2382. WINAPI
  2383. OLoadLibraryExW(
  2384. LPCWSTR lpLibFileName,
  2385. HANDLE hFile,
  2386. DWORD dwFlags
  2387. )
  2388. {
  2389. if(FWide())
  2390. return LoadLibraryExW(lpLibFileName, hFile, dwFlags);
  2391. PreConvert();
  2392. LPSTR sz = Convert(lpLibFileName);
  2393. return LoadLibraryExA(sz, hFile, dwFlags);
  2394. }
  2395. HMENU
  2396. WINAPI
  2397. OLoadMenuIndirectW(
  2398. CONST MENUTEMPLATEW *lpMenuTemplate)
  2399. {
  2400. if(FWide())
  2401. return LoadMenuIndirectW(lpMenuTemplate);
  2402. //$NOTE: For both the ANSI and the Unicode version of this function,
  2403. //the strings in the MENUITEMTEMPLATE structure must be Unicode strings
  2404. return LoadMenuIndirectA(lpMenuTemplate);
  2405. }
  2406. HMENU
  2407. WINAPI
  2408. OLoadMenuW(
  2409. HINSTANCE hInstance,
  2410. LPCWSTR lpMenuName)
  2411. {
  2412. if(FWide())
  2413. return LoadMenuW(hInstance, lpMenuName);
  2414. if(FATOM(lpMenuName))
  2415. return LoadMenuA(hInstance, (LPCSTR)lpMenuName);
  2416. PreConvert();
  2417. LPSTR sz = Convert(lpMenuName);
  2418. return LoadMenuA(hInstance, sz);
  2419. }
  2420. int
  2421. WINAPI
  2422. OLoadStringW(
  2423. HINSTANCE hInstance,
  2424. UINT uID,
  2425. LPWSTR lpBuffer,
  2426. int nBufferMax)
  2427. {
  2428. if(FWide())
  2429. return LoadStringW(hInstance, uID, lpBuffer, nBufferMax);
  2430. LPSTR sz = SzAlloc(sizeof(WCHAR) * nBufferMax);
  2431. int nRet = LoadStringA(hInstance, uID, sz, sizeof(WCHAR) * nBufferMax);
  2432. if (!nRet)
  2433. {
  2434. if (lpBuffer && 0 < nBufferMax)
  2435. {
  2436. *lpBuffer = L'\0';
  2437. }
  2438. return 0;
  2439. }
  2440. LONG lRet = AnsiToUnicode(lpBuffer, sz, nBufferMax, nRet + 1); // '\0'
  2441. if (lRet)
  2442. {
  2443. return lRet - 1;
  2444. }
  2445. LPWSTR szBuff = SzWAlloc(nRet + 1);
  2446. lRet = AnsiToUnicode(szBuff, sz, nRet + 1, nRet + 1);
  2447. Assert(lRet);
  2448. memcpy(lpBuffer, szBuff, sizeof(WCHAR) * nBufferMax);
  2449. lpBuffer[nBufferMax - 1] = L'\0';
  2450. return nBufferMax - 1;
  2451. }
  2452. LPWSTR
  2453. WINAPI
  2454. OlstrcatW(
  2455. LPWSTR lpString1,
  2456. LPCWSTR lpString2
  2457. )
  2458. {
  2459. if (!lpString1 || !lpString2)
  2460. return lpString1;
  2461. return wcscat(lpString1, lpString2);
  2462. }
  2463. int
  2464. WINAPI
  2465. OlstrcmpiW(
  2466. LPCWSTR lpString1,
  2467. LPCWSTR lpString2
  2468. )
  2469. {
  2470. if(FWide())
  2471. return lstrcmpiW(lpString1, lpString2);
  2472. PreConvert();
  2473. LPSTR psz1 = lpString1 ? Convert(lpString1) : NULL;
  2474. LPSTR psz2 = lpString2 ? Convert(lpString2) : NULL;
  2475. return lstrcmpiA(psz1, psz2);
  2476. }
  2477. int
  2478. WINAPI
  2479. OlstrcmpW(
  2480. LPCWSTR lpString1,
  2481. LPCWSTR lpString2
  2482. )
  2483. {
  2484. if(FWide())
  2485. return lstrcmpW(lpString1, lpString2);
  2486. PreConvert();
  2487. LPSTR psz1 = lpString1 ? Convert(lpString1) : NULL;
  2488. LPSTR psz2 = lpString2 ? Convert(lpString2) : NULL;
  2489. return lstrcmpA(psz1, psz2);
  2490. }
  2491. LPWSTR
  2492. WINAPI
  2493. OlstrcpyW(
  2494. LPWSTR lpString1,
  2495. LPCWSTR lpString2
  2496. )
  2497. {
  2498. if (!lpString1)
  2499. return lpString1;
  2500. if (!lpString2)
  2501. lpString2 = L"";
  2502. return wcscpy(lpString1, lpString2);
  2503. }
  2504. // From: Mark Ashton on 5/8/97
  2505. // Ted Smith added null string pointer handling
  2506. LPWSTR
  2507. WINAPI
  2508. OlstrcpynW(
  2509. LPWSTR lpString1,
  2510. LPCWSTR lpString2,
  2511. int iMaxLength
  2512. )
  2513. {
  2514. if (!lpString1)
  2515. {
  2516. return lpString1;
  2517. }
  2518. if (!lpString2)
  2519. {
  2520. lpString2 = L"";
  2521. }
  2522. if(FWide())
  2523. return lstrcpynW(lpString1, lpString2, iMaxLength);
  2524. lpString1[--iMaxLength] = L'\0';
  2525. return wcsncpy(lpString1, lpString2, iMaxLength);
  2526. }
  2527. int
  2528. WINAPI
  2529. OlstrlenW(
  2530. LPCWSTR lpString
  2531. )
  2532. {
  2533. return lpString ? wcslen(lpString) : 0;
  2534. }
  2535. UINT
  2536. WINAPI
  2537. OMapVirtualKeyW(
  2538. UINT uCode,
  2539. UINT uMapType)
  2540. {
  2541. // The only person using this so far is using uMapType == 0
  2542. Assert(2 != uMapType);
  2543. if (FWide())
  2544. return MapVirtualKeyW(uCode, uMapType);
  2545. return MapVirtualKeyA(uCode, uMapType);
  2546. }
  2547. int
  2548. WINAPI
  2549. OMessageBoxW(
  2550. HWND hWnd ,
  2551. LPCWSTR lpText,
  2552. LPCWSTR lpCaption,
  2553. UINT uType)
  2554. {
  2555. if(FWide())
  2556. return MessageBoxW(hWnd, lpText, lpCaption, uType);
  2557. PreConvert();
  2558. LPSTR szText = Convert(lpText);
  2559. LPSTR szCap = Convert(lpCaption);
  2560. return MessageBoxA(hWnd, szText, szCap, uType);
  2561. }
  2562. int
  2563. WINAPI
  2564. OMessageBoxIndirectW(
  2565. LPMSGBOXPARAMSW lpmbp)
  2566. {
  2567. Assert(!IsBadWritePtr((void*)lpmbp, sizeof MSGBOXPARAMSW));
  2568. Assert(sizeof MSGBOXPARAMSW == lpmbp->cbSize);
  2569. Assert(sizeof MSGBOXPARAMSW == sizeof MSGBOXPARAMSA);
  2570. if(FWide())
  2571. return MessageBoxIndirectW(lpmbp);
  2572. PreConvert();
  2573. MSGBOXPARAMSA mbpa;
  2574. memcpy(&mbpa, lpmbp, sizeof MSGBOXPARAMSA);
  2575. if (!FATOM(lpmbp->lpszText))
  2576. {
  2577. mbpa.lpszText = Convert(lpmbp->lpszText);
  2578. }
  2579. if (!FATOM(lpmbp->lpszCaption))
  2580. {
  2581. mbpa.lpszCaption = Convert(lpmbp->lpszCaption);
  2582. }
  2583. if ((lpmbp->dwStyle & MB_USERICON) && !FATOM(lpmbp->lpszIcon))
  2584. {
  2585. mbpa.lpszIcon = Convert(lpmbp->lpszIcon);
  2586. }
  2587. return MessageBoxIndirectA(&mbpa);
  2588. }
  2589. BOOL
  2590. WINAPI
  2591. OModifyMenuW(
  2592. HMENU hMnu,
  2593. UINT uPosition,
  2594. UINT uFlags,
  2595. UINT uIDNewItem,
  2596. LPCWSTR lpNewItem
  2597. )
  2598. {
  2599. if(FWide())
  2600. return ModifyMenuW(hMnu, uPosition, uFlags, uIDNewItem, lpNewItem);
  2601. if (MF_STRING == uFlags)
  2602. {
  2603. PreConvert();
  2604. LPSTR sz = Convert(lpNewItem);
  2605. return ModifyMenuA(hMnu, uPosition, uFlags, uIDNewItem, sz);
  2606. }
  2607. else
  2608. return ModifyMenuA(hMnu, uPosition, uFlags, uIDNewItem, (LPSTR) lpNewItem);
  2609. }
  2610. // From: Mark Ashton on 5/29/97
  2611. BOOL
  2612. WINAPI
  2613. OMoveFileExW(
  2614. LPCWSTR lpExistingFileName,
  2615. LPCWSTR lpNewFileName,
  2616. DWORD dwFlags
  2617. )
  2618. {
  2619. if (FWide())
  2620. return MoveFileExW(lpExistingFileName, lpNewFileName, dwFlags);
  2621. PreConvert();
  2622. LPSTR szOld = Convert(lpExistingFileName);
  2623. LPSTR szNew = Convert(lpNewFileName);
  2624. return MoveFileExA(szOld, szNew, dwFlags);
  2625. }
  2626. BOOL
  2627. WINAPI
  2628. OMoveFileW(
  2629. LPCWSTR lpExistingFileName,
  2630. LPCWSTR lpNewFileName)
  2631. {
  2632. if(FWide())
  2633. return MoveFileW(lpExistingFileName, lpNewFileName);
  2634. PreConvert();
  2635. LPSTR szOld = Convert(lpExistingFileName);
  2636. LPSTR szNew = Convert(lpNewFileName);
  2637. return MoveFileA(szOld, szNew);
  2638. }
  2639. HANDLE
  2640. WINAPI
  2641. OLoadImageW(
  2642. HINSTANCE hinst,
  2643. LPCWSTR lpszName,
  2644. UINT uType,
  2645. int cxDesired,
  2646. int cyDesired,
  2647. UINT fuLoad)
  2648. {
  2649. if (FWide())
  2650. {
  2651. Assert(!(LR_LOADFROMFILE & fuLoad));
  2652. return LoadImageW(hinst, lpszName, uType, cxDesired, cyDesired, fuLoad);
  2653. }
  2654. if (!FATOM(lpszName))
  2655. {
  2656. PreConvert();
  2657. LPSTR pszName = Convert(lpszName);
  2658. return LoadImageA(hinst, pszName, uType, cxDesired, cyDesired, fuLoad);
  2659. }
  2660. else
  2661. return LoadImageA(hinst, (LPSTR) lpszName, uType, cxDesired, cyDesired, fuLoad);
  2662. }
  2663. BOOL
  2664. WINAPI
  2665. OOemToCharW(
  2666. LPCSTR lpszSrc,
  2667. LPWSTR lpszDst)
  2668. {
  2669. if(FWide())
  2670. {
  2671. Assert(lpszSrc != (LPCSTR) lpszDst);
  2672. #pragma prefast(suppress:56, "do not know the size of the destination")
  2673. return OemToCharW(lpszSrc, lpszDst);
  2674. }
  2675. DWORD cb = _mbslen((const unsigned char *)lpszSrc);
  2676. LPSTR szDst = SzAlloc(cb);
  2677. #pragma prefast(suppress:56, "noise")
  2678. BOOL fRet = OemToCharA(lpszSrc, szDst);
  2679. if(fRet)
  2680. {
  2681. Verify(0 <= AnsiToUnicode(lpszDst, szDst, cb));
  2682. }
  2683. return fRet;
  2684. }
  2685. VOID
  2686. WINAPI
  2687. OOutputDebugStringW(
  2688. LPCWSTR lpOutputString
  2689. )
  2690. {
  2691. if(FWide())
  2692. {
  2693. OutputDebugStringW(lpOutputString);
  2694. return;
  2695. }
  2696. PreConvert();
  2697. LPSTR sz = Convert(lpOutputString);
  2698. OutputDebugStringA(sz);
  2699. }
  2700. BOOL
  2701. WINAPI
  2702. OPeekMessageW(
  2703. LPMSG lpMsg,
  2704. HWND hWnd ,
  2705. UINT wMsgFilterMin,
  2706. UINT wMsgFilterMax,
  2707. UINT wRemoveMsg)
  2708. {
  2709. if(FWide())
  2710. return PeekMessageW(lpMsg, hWnd , wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
  2711. return PeekMessageA(lpMsg, hWnd , wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
  2712. }
  2713. BOOL
  2714. WINAPI
  2715. OPostMessageW(
  2716. HWND hWnd,
  2717. UINT Msg,
  2718. WPARAM wParam,
  2719. LPARAM lParam)
  2720. {
  2721. if(FWide())
  2722. return PostMessageW(hWnd, Msg, wParam, lParam);
  2723. return PostMessageA(hWnd, Msg, wParam, lParam);
  2724. }
  2725. BOOL
  2726. WINAPI
  2727. OPostThreadMessageW(
  2728. DWORD idThread,
  2729. UINT Msg,
  2730. WPARAM wParam,
  2731. LPARAM lParam)
  2732. {
  2733. if (FWide())
  2734. return PostThreadMessageW(idThread, Msg, wParam, lParam);
  2735. return PostThreadMessageA(idThread, Msg, wParam, lParam);
  2736. }
  2737. // From: Mark Ashton on 5/8/97
  2738. LONG
  2739. APIENTRY
  2740. ORegCreateKeyExW(
  2741. HKEY hKey,
  2742. LPCWSTR lpSubKey,
  2743. DWORD Reserved,
  2744. LPWSTR lpClass,
  2745. DWORD dwOptions,
  2746. REGSAM samDesired,
  2747. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  2748. PHKEY phkResult,
  2749. LPDWORD lpdwDisposition
  2750. )
  2751. {
  2752. Assert(lpSubKey);
  2753. if(FWide())
  2754. return RegCreateKeyExW(hKey, lpSubKey, Reserved, lpClass, dwOptions, samDesired,
  2755. lpSecurityAttributes, phkResult, lpdwDisposition);
  2756. PreConvert();
  2757. LPSTR sz = Convert(lpSubKey);
  2758. LPSTR sz2 = Convert(lpClass);
  2759. return RegCreateKeyExA(hKey, sz, Reserved, sz2, dwOptions, samDesired,
  2760. lpSecurityAttributes, phkResult, lpdwDisposition);
  2761. }
  2762. // From: Mark Ashton on 5/8/97
  2763. LONG
  2764. APIENTRY
  2765. ORegCreateKeyW (
  2766. HKEY hKey,
  2767. LPCWSTR lpSubKey,
  2768. PHKEY phkResult
  2769. )
  2770. {
  2771. if (FWide())
  2772. return RegCreateKeyW(hKey, lpSubKey, phkResult);
  2773. PreConvert();
  2774. LPSTR sz = Convert(lpSubKey);
  2775. return RegCreateKeyA(hKey, sz, phkResult);
  2776. }
  2777. // From: Mark Ashton on 5/8/97
  2778. LONG
  2779. APIENTRY
  2780. ORegEnumKeyW (
  2781. HKEY hKey,
  2782. DWORD dwIndex,
  2783. LPWSTR lpName,
  2784. DWORD cbName
  2785. )
  2786. {
  2787. if (FWide())
  2788. return RegEnumKeyW(hKey, dwIndex, lpName, cbName);
  2789. LPSTR sz = SzAlloc(cbName);
  2790. LONG dwRet = RegEnumKeyA(hKey, dwIndex, sz, cbName);
  2791. Verify(0 <= AnsiToUnicode(lpName, sz, cbName));
  2792. return dwRet;
  2793. }
  2794. // Van Kichline
  2795. // IHammer group
  2796. // Not supported: REG_MULTI_SZ
  2797. //
  2798. LONG
  2799. APIENTRY
  2800. ORegEnumValueW (
  2801. HKEY hKey,
  2802. DWORD dwIndex,
  2803. LPWSTR lpValueName,
  2804. LPDWORD lpcbValueName, // Documentation indicates this is a count of characters, despite the Hungarian.
  2805. LPDWORD lpReserved,
  2806. LPDWORD lpType, // May be NULL, but we need to know it on return if lpData is not NULL.
  2807. LPBYTE lpData, // May be NULL
  2808. LPDWORD lpcbData // May be NULL is lpData is NULL
  2809. )
  2810. {
  2811. if (FWide())
  2812. return RegEnumValueW(hKey, dwIndex, lpValueName, lpcbValueName, lpReserved, lpType, lpData, lpcbData);
  2813. // Required pointers:
  2814. if (!lpValueName || !lpcbValueName || !lpcbData && lpData)
  2815. {
  2816. Assert(lpValueName);
  2817. Assert(lpcbValueName);
  2818. Assert(!lpcbData && lpData);
  2819. return E_POINTER;
  2820. }
  2821. // If NULL was specified for lpType, we need to supply our own so we can check for string results.
  2822. DWORD dwPrivateType = 0;
  2823. if (!lpType)
  2824. {
  2825. lpType = &dwPrivateType;
  2826. }
  2827. DWORD cbValueName = *lpcbValueName;
  2828. DWORD dwOrigCbData = lpcbData ? *lpcbData : 0;
  2829. LPSTR pchValueName = SzAlloc(*lpcbValueName);
  2830. LONG lResult = RegEnumValueA(hKey, dwIndex, pchValueName, &cbValueName, lpReserved, lpType, lpData, lpcbData);
  2831. if (ERROR_SUCCESS == lResult)
  2832. {
  2833. *lpcbValueName = AnsiToUnicode(lpValueName, pchValueName, min(*lpcbValueName, cbValueName + 1)) - 1; // Returned value does NOT include terminating NULL
  2834. if (lpData)
  2835. {
  2836. // If the resulting data was a string, convert it in place.
  2837. switch (*lpType)
  2838. {
  2839. case REG_MULTI_SZ:
  2840. // Not supported
  2841. Assert(0 && REG_MULTI_SZ);
  2842. lResult = E_FAIL;
  2843. break;
  2844. case REG_EXPAND_SZ:
  2845. case REG_SZ:
  2846. {
  2847. Assert(lpcbData);
  2848. LPSTR pszTemp = SzAlloc(*lpcbData); // is the number of bytes!
  2849. memcpy(pszTemp, lpData, *lpcbData);
  2850. *lpcbData = AnsiToUnicode((LPWSTR)lpData, pszTemp, dwOrigCbData/sizeof(WCHAR), *lpcbData) * sizeof(WCHAR);
  2851. // It's possible to encounter a second stage overflow, if lpData >= sizeof(Unicode)/2
  2852. if ( 0 == *lpcbData )
  2853. {
  2854. lResult = ERROR_MORE_DATA;
  2855. }
  2856. }
  2857. break;
  2858. }
  2859. }
  2860. }
  2861. return lResult;
  2862. }
  2863. LONG
  2864. APIENTRY ORegOpenKeyW(HKEY hKey, LPCWSTR pwszSubKey, PHKEY phkResult)
  2865. {
  2866. if(FWide())
  2867. return RegOpenKeyW(hKey, pwszSubKey, phkResult);
  2868. PreConvert();
  2869. LPSTR sz = Convert(pwszSubKey);
  2870. return RegOpenKeyA(hKey, sz, phkResult);
  2871. }
  2872. LONG
  2873. APIENTRY
  2874. ORegDeleteKeyW(
  2875. HKEY hKey,
  2876. LPCWSTR pwszSubKey
  2877. )
  2878. {
  2879. Assert(pwszSubKey);
  2880. if(FWide())
  2881. return RegDeleteKeyW(hKey, pwszSubKey);
  2882. PreConvert();
  2883. LPSTR sz = Convert(pwszSubKey);
  2884. return RegDeleteKeyA(hKey, sz);
  2885. }
  2886. LONG
  2887. APIENTRY
  2888. ORegDeleteValueW(
  2889. HKEY hKey,
  2890. LPWSTR lpValueName
  2891. )
  2892. {
  2893. if(FWide())
  2894. return RegDeleteValueW (hKey, lpValueName);
  2895. PreConvert();
  2896. LPSTR sz = Convert(lpValueName);
  2897. return RegDeleteValueA(hKey, sz);
  2898. }
  2899. ATOM
  2900. WINAPI
  2901. ORegisterClassW(
  2902. CONST WNDCLASSW *lpWndClass)
  2903. {
  2904. if(FWide())
  2905. return RegisterClassW(lpWndClass);
  2906. WNDCLASSA wc;
  2907. memcpy(&wc, lpWndClass, sizeof(wc));
  2908. PreConvert();
  2909. if (!(IsBadReadPtr(wc.lpszMenuName, sizeof(* wc.lpszMenuName)) ||
  2910. IsBadReadPtr(lpWndClass->lpszMenuName, sizeof (*(lpWndClass->lpszMenuName)))))
  2911. {
  2912. wc.lpszMenuName = Convert(lpWndClass->lpszMenuName);
  2913. }
  2914. wc.lpszClassName = Convert(lpWndClass->lpszClassName);
  2915. return RegisterClassA(&wc);
  2916. }
  2917. ATOM
  2918. WINAPI
  2919. ORegisterClassExW(CONST WNDCLASSEXW * lpWndClass)
  2920. {
  2921. if (FWide())
  2922. return RegisterClassExW(lpWndClass);
  2923. WNDCLASSEXA wc;
  2924. memcpy(&wc, lpWndClass, sizeof(wc));
  2925. PreConvert();
  2926. if (!FATOM(wc.lpszMenuName))
  2927. {
  2928. wc.lpszMenuName = Convert(lpWndClass->lpszMenuName);
  2929. }
  2930. if (!FATOM(wc.lpszClassName))
  2931. wc.lpszClassName = Convert(lpWndClass->lpszClassName);
  2932. return RegisterClassExA(&wc);
  2933. }
  2934. BOOL
  2935. WINAPI
  2936. OUnregisterClassW
  2937. (
  2938. LPCTSTR lpClassName, // address of class name string
  2939. HINSTANCE hInstance // handle of application instance
  2940. )
  2941. {
  2942. if(FWide())
  2943. return UnregisterClassW(lpClassName, hInstance);
  2944. if (FATOM(lpClassName))
  2945. return UnregisterClassW(lpClassName, hInstance);
  2946. PreConvert();
  2947. LPSTR sz = Convert(lpClassName);
  2948. return UnregisterClassA(sz, hInstance);
  2949. }
  2950. UINT
  2951. WINAPI
  2952. ORegisterClipboardFormatW(
  2953. LPCWSTR lpszFormat)
  2954. {
  2955. if(FWide())
  2956. return RegisterClipboardFormatW(lpszFormat);
  2957. PreConvert();
  2958. LPSTR sz = Convert(lpszFormat);
  2959. return RegisterClipboardFormatA(sz);
  2960. }
  2961. UINT
  2962. WINAPI
  2963. ORegisterWindowMessageW(LPCWSTR lpString)
  2964. {
  2965. if(FWide())
  2966. return RegisterWindowMessageW(lpString);
  2967. PreConvert();
  2968. LPSTR sz = Convert(lpString);
  2969. return RegisterWindowMessageA(sz);
  2970. }
  2971. LONG
  2972. APIENTRY
  2973. ORegOpenKeyExW (
  2974. HKEY hKey,
  2975. LPCTSTR lpSubKey,
  2976. DWORD ulOptions,
  2977. REGSAM samDesired,
  2978. PHKEY phkResult
  2979. )
  2980. {
  2981. if(FWide())
  2982. return RegOpenKeyExW(hKey, lpSubKey, ulOptions, samDesired, phkResult);
  2983. PreConvert();
  2984. LPSTR sz = Convert(lpSubKey);
  2985. return RegOpenKeyExA(hKey, sz, ulOptions, samDesired, phkResult);
  2986. }
  2987. LONG
  2988. APIENTRY
  2989. ORegQueryInfoKeyW (
  2990. HKEY hKey,
  2991. LPWSTR lpClass,
  2992. LPDWORD lpcbClass,
  2993. LPDWORD lpReserved,
  2994. LPDWORD lpcSubKeys,
  2995. LPDWORD lpcbMaxSubKeyLen,
  2996. LPDWORD lpcbMaxClassLen,
  2997. LPDWORD lpcValues,
  2998. LPDWORD lpcbMaxValueNameLen,
  2999. LPDWORD lpcbMaxValueLen,
  3000. LPDWORD lpcbSecurityDescriptor,
  3001. PFILETIME lpftLastWriteTime
  3002. )
  3003. {
  3004. Assert(!lpClass && !lpcbClass); //$ UNDONE_POST_98 - Not wrapped yet!
  3005. if(FWide())
  3006. return RegQueryInfoKeyW(hKey, lpClass, lpcbClass, lpReserved,
  3007. lpcSubKeys, lpcbMaxSubKeyLen,
  3008. lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen,
  3009. lpcbMaxValueLen, lpcbSecurityDescriptor,
  3010. lpftLastWriteTime );
  3011. if (lpClass && (!lpcbClass || IsBadWritePtr(lpcbClass, sizeof(lpcbClass))))
  3012. {
  3013. // lpcbClass must be valid if lpClass is non-NULL
  3014. return ERROR_INVALID_PARAMETER;
  3015. }
  3016. return RegQueryInfoKeyA(hKey, NULL, NULL, lpReserved,
  3017. lpcSubKeys, lpcbMaxSubKeyLen,
  3018. lpcbMaxClassLen, lpcValues, lpcbMaxValueNameLen,
  3019. lpcbMaxValueLen, lpcbSecurityDescriptor,
  3020. lpftLastWriteTime );
  3021. }
  3022. LONG
  3023. APIENTRY ORegQueryValueW(HKEY hKey, LPCWSTR pwszSubKey, LPWSTR pwszValue,
  3024. PLONG lpcbValue)
  3025. {
  3026. if(FWide())
  3027. return RegQueryValueW(hKey, pwszSubKey, pwszValue, lpcbValue);
  3028. LONG cb;
  3029. LONG lRet = 0;
  3030. LPSTR szValue = NULL;
  3031. PreConvert();
  3032. LPSTR sz = Convert(pwszSubKey);
  3033. lRet = RegQueryValueA(hKey, sz, NULL, &cb);
  3034. if(ERROR_SUCCESS != lRet)
  3035. {
  3036. return lRet;
  3037. }
  3038. // If the caller was just asking for the size of the value, jump out
  3039. // now, without actually retrieving and converting the value.
  3040. if (!pwszValue)
  3041. {
  3042. // Adjust size of buffer to report, to account for CHAR -> WCHAR
  3043. *lpcbValue = cb * sizeof(WCHAR);
  3044. goto Exit;
  3045. }
  3046. // If the caller was asking for the value, but allocated too small
  3047. // of a buffer, set the buffer size and jump out.
  3048. if (*lpcbValue < (LONG) (cb * sizeof(WCHAR)))
  3049. {
  3050. //$UNDONE_POST_98: We should actually use the nubmer of bytes required, not some
  3051. // wild guess as we are here
  3052. // Adjust size of buffer to report, to account for CHAR -> WCHAR
  3053. *lpcbValue = cb * sizeof(WCHAR);
  3054. lRet = ERROR_MORE_DATA;
  3055. goto Exit;
  3056. }
  3057. // Otherwise, retrieve and convert the value.
  3058. szValue = SzAlloc(cb);
  3059. lRet = RegQueryValueA(hKey, sz, szValue, &cb);
  3060. if (ERROR_SUCCESS == lRet)
  3061. {
  3062. Verify(0 <= AnsiToUnicode(pwszValue, szValue, cb));
  3063. //$UNDONE_POST_98: We should actually use the nubmer of bytes required, not some
  3064. // wild guess as we are here
  3065. // Adjust size of buffer to report, to account for CHAR -> WCHAR
  3066. *lpcbValue = cb * sizeof(WCHAR);
  3067. }
  3068. else if (pwszValue && 0 < cb)
  3069. {
  3070. *pwszValue = L'\0';
  3071. }
  3072. Exit:
  3073. return lRet;
  3074. }
  3075. LONG
  3076. APIENTRY
  3077. ORegSetValueExW(
  3078. HKEY hKey,
  3079. LPCWSTR lpValueName,
  3080. DWORD Reserved,
  3081. DWORD dwType,
  3082. CONST BYTE* lpData,
  3083. DWORD cbData
  3084. )
  3085. {
  3086. if(FWide())
  3087. return RegSetValueExW(hKey, lpValueName, Reserved, dwType, lpData, cbData);
  3088. PreConvert();
  3089. LPSTR sz = Convert(lpValueName);
  3090. LONG lRet;
  3091. // NOTE: when calling RegSetValueExA, if the data type is
  3092. // REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ, then the API expects the strings
  3093. // to be ansi also.
  3094. if (REG_SZ == dwType || REG_EXPAND_SZ == dwType)
  3095. {
  3096. LONG lData = 0;
  3097. LPSTR szData = ConvertWithLen((LPTSTR)lpData, -1, &lData);
  3098. lRet = RegSetValueExA(hKey, sz, Reserved, dwType, (CONST BYTE *)szData, lData);
  3099. }
  3100. else if (REG_MULTI_SZ == dwType)
  3101. {
  3102. LONG lData = 0;
  3103. LPSTR szData = ConvertWithLen((LPWSTR)lpData,
  3104. cUnicodeMultiSzLen((LPWSTR)lpData),
  3105. &lData );
  3106. lRet = RegSetValueExA(hKey, sz, Reserved, dwType, (CONST BYTE *)szData, lData);
  3107. }
  3108. else
  3109. {
  3110. lRet = RegSetValueExA(hKey, sz, Reserved, dwType, lpData, cbData);
  3111. }
  3112. return lRet;
  3113. }
  3114. LONG
  3115. APIENTRY ORegSetValueW(HKEY hKey, LPCWSTR lpSubKey, DWORD dwType,
  3116. LPCWSTR lpData, DWORD cbData)
  3117. {
  3118. Assert(REG_SZ == dwType);
  3119. if(FWide())
  3120. return RegSetValueW(hKey, lpSubKey, dwType,
  3121. lpData, cbData);
  3122. PreConvert();
  3123. LPSTR szKey = Convert(lpSubKey);
  3124. LPSTR szValue = Convert(lpData);
  3125. return RegSetValueA(hKey, szKey, dwType, szValue, cbData);
  3126. }
  3127. LONG
  3128. APIENTRY
  3129. ORegQueryValueExW (
  3130. HKEY hKey,
  3131. LPCWSTR lpValueName,
  3132. LPDWORD lpReserved,
  3133. LPDWORD lpType,
  3134. LPBYTE lpData,
  3135. LPDWORD lpcbData
  3136. )
  3137. {
  3138. Assert(lpcbData || !lpData); // lpcbData can be NULL only if lpData is NULL
  3139. if(FWide())
  3140. return RegQueryValueExW (
  3141. hKey,
  3142. lpValueName,
  3143. lpReserved,
  3144. lpType,
  3145. lpData,
  3146. lpcbData
  3147. );
  3148. LPBYTE lpTempBuffer;
  3149. DWORD dwTempType;
  3150. DWORD cb, cbRequired;
  3151. LONG lRet;
  3152. PreConvert();
  3153. LPSTR sz = Convert(lpValueName);
  3154. lRet = RegQueryValueExA(hKey, sz, lpReserved, &dwTempType, NULL, &cb);
  3155. if(ERROR_SUCCESS != lRet)
  3156. {
  3157. return lRet;
  3158. }
  3159. // If the caller was just asking for the size of the value, jump out
  3160. // now, without actually retrieving and converting the value.
  3161. if (!lpData)
  3162. {
  3163. switch (dwTempType)
  3164. {
  3165. case REG_EXPAND_SZ:
  3166. case REG_MULTI_SZ:
  3167. case REG_SZ:
  3168. // Adjust size of buffer to report, to account for CHAR -> WCHAR
  3169. *lpcbData = cb * sizeof(WCHAR);
  3170. break;
  3171. default:
  3172. *lpcbData = cb;
  3173. break;
  3174. }
  3175. // Set the type, if required.
  3176. if (lpType)
  3177. {
  3178. *lpType = dwTempType;
  3179. }
  3180. goto Exit;
  3181. }
  3182. //
  3183. // Determine the size of buffer needed
  3184. //
  3185. switch (dwTempType)
  3186. {
  3187. case REG_EXPAND_SZ:
  3188. case REG_MULTI_SZ:
  3189. case REG_SZ:
  3190. cbRequired = cb * sizeof(WCHAR);
  3191. break;
  3192. default:
  3193. cbRequired = cb;
  3194. break;
  3195. }
  3196. // If the caller was asking for the value, but allocated too small
  3197. // of a buffer, set the buffer size and jump out.
  3198. if (*lpcbData < cbRequired)
  3199. {
  3200. // Adjust size of buffer to report, to account for CHAR -> WCHAR
  3201. *lpcbData = cbRequired;
  3202. // Set the type, if required.
  3203. if (lpType)
  3204. {
  3205. *lpType = dwTempType;
  3206. }
  3207. lRet = ERROR_MORE_DATA;
  3208. goto Exit;
  3209. }
  3210. // Otherwise, retrieve and convert the value.
  3211. switch (dwTempType)
  3212. {
  3213. case REG_EXPAND_SZ:
  3214. case REG_MULTI_SZ:
  3215. case REG_SZ:
  3216. lpTempBuffer = (LPBYTE)SzAlloc(cbRequired);
  3217. lRet = RegQueryValueExA(hKey,
  3218. sz,
  3219. lpReserved,
  3220. &dwTempType,
  3221. lpTempBuffer,
  3222. &cb);
  3223. if (ERROR_SUCCESS == lRet)
  3224. {
  3225. switch (dwTempType)
  3226. {
  3227. case REG_EXPAND_SZ:
  3228. case REG_MULTI_SZ:
  3229. case REG_SZ:
  3230. *lpcbData = AnsiToUnicode((LPWSTR)lpData, (LPSTR)lpTempBuffer, *lpcbData, cb);
  3231. *lpcbData = cb * sizeof(WCHAR); // Result it in BYTES!
  3232. // Set the type, if required.
  3233. if (lpType)
  3234. {
  3235. *lpType = dwTempType;
  3236. }
  3237. break;
  3238. }
  3239. }
  3240. goto Exit;
  3241. default:
  3242. //
  3243. // No conversion of out parameters needed. Just call narrow
  3244. // version with args passed in, and return directly.
  3245. //
  3246. lRet = RegQueryValueExA(hKey,
  3247. sz,
  3248. lpReserved,
  3249. lpType,
  3250. lpData,
  3251. lpcbData);
  3252. }
  3253. Exit:
  3254. return lRet;
  3255. }
  3256. HANDLE
  3257. WINAPI
  3258. ORemovePropW(
  3259. HWND hWnd,
  3260. LPCWSTR lpString)
  3261. {
  3262. if(FWide())
  3263. return RemovePropW(hWnd, lpString);
  3264. if(FATOM(lpString))
  3265. return RemovePropA(hWnd, (LPSTR)lpString);
  3266. PreConvert();
  3267. LPSTR sz = Convert(lpString);
  3268. return RemovePropA(hWnd, sz);
  3269. }
  3270. LRESULT
  3271. WINAPI
  3272. OSendDlgItemMessageW(
  3273. HWND hDlg,
  3274. int nIDDlgItem,
  3275. UINT Msg,
  3276. WPARAM wParam,
  3277. LPARAM lParam)
  3278. {
  3279. if(FWide())
  3280. return SendDlgItemMessageW(hDlg, nIDDlgItem, Msg, wParam, lParam);
  3281. PreConvert();
  3282. switch (Msg)
  3283. {
  3284. case LB_ADDSTRING:
  3285. case LB_INSERTSTRING:
  3286. case LB_SELECTSTRING:
  3287. case LB_FINDSTRING:
  3288. case LB_FINDSTRINGEXACT:
  3289. case CB_ADDSTRING:
  3290. case CB_INSERTSTRING:
  3291. case CB_SELECTSTRING:
  3292. case CB_FINDSTRING:
  3293. case CB_FINDSTRINGEXACT:
  3294. {
  3295. lParam = (LPARAM)Convert((LPWSTR)lParam);
  3296. break;
  3297. }
  3298. }
  3299. return SendDlgItemMessageA(hDlg, nIDDlgItem, Msg, wParam, lParam);
  3300. }
  3301. LRESULT
  3302. WINAPI
  3303. OSendMessageW(
  3304. HWND hWnd,
  3305. UINT Msg,
  3306. WPARAM wParam,
  3307. LPARAM lParam)
  3308. {
  3309. // incase TCHAR strings are being passed in lParam the caller
  3310. // will have to do the proper conversions PlatformToInternal or
  3311. // InternalToPlatform
  3312. if(FWide())
  3313. return SendMessageW(hWnd, Msg, wParam, lParam);
  3314. return SendMessageA(hWnd, Msg, wParam, lParam);
  3315. }
  3316. BOOL
  3317. WINAPI
  3318. OSendNotifyMessageW(
  3319. HWND hWnd,
  3320. UINT Msg,
  3321. WPARAM wParam,
  3322. LPARAM lParam)
  3323. {
  3324. if(FWide())
  3325. return SendNotifyMessageW(hWnd, Msg, wParam, lParam);
  3326. return SendNotifyMessageA(hWnd, Msg, wParam, lParam);
  3327. }
  3328. BOOL
  3329. WINAPI
  3330. OSetDlgItemTextW(
  3331. HWND hDlg,
  3332. int nIDDlgItem,
  3333. LPCWSTR lpString)
  3334. {
  3335. if(FWide())
  3336. return SetDlgItemTextW(hDlg, nIDDlgItem, lpString);
  3337. PreConvert();
  3338. LPSTR sz = Convert(lpString);
  3339. return SetDlgItemTextA(hDlg, nIDDlgItem, sz);
  3340. }
  3341. BOOL
  3342. WINAPI
  3343. OSetFileAttributesW(
  3344. LPCWSTR lpFileName,
  3345. DWORD dwFileAttributes
  3346. )
  3347. {
  3348. if (FWide())
  3349. return SetFileAttributesW(lpFileName, dwFileAttributes);
  3350. PreConvert();
  3351. LPSTR sz = Convert(lpFileName);
  3352. return SetFileAttributesA(sz, dwFileAttributes);
  3353. }
  3354. BOOL
  3355. WINAPI
  3356. OSetPropW(
  3357. HWND hWnd,
  3358. LPCWSTR lpString,
  3359. HANDLE hData)
  3360. {
  3361. if(FWide())
  3362. return SetPropW(hWnd, lpString, hData);
  3363. if(FATOM(lpString))
  3364. return SetPropA(hWnd, (LPSTR)lpString, hData);
  3365. PreConvert();
  3366. LPSTR sz = Convert(lpString);
  3367. return SetPropA(hWnd, sz, hData);
  3368. }
  3369. BOOL
  3370. WINAPI
  3371. OSetMenuItemInfoW(
  3372. HMENU hMenu,
  3373. UINT uItem,
  3374. BOOL fByPosition,
  3375. LPCMENUITEMINFOW lpcmii
  3376. )
  3377. {
  3378. Assert(!IsBadWritePtr((void*)lpcmii, sizeof MENUITEMINFOW));
  3379. Assert(sizeof MENUITEMINFOW == lpcmii->cbSize);
  3380. Assert(sizeof MENUITEMINFOW == sizeof MENUITEMINFOA);
  3381. if (FWide())
  3382. return SetMenuItemInfoW(hMenu, uItem, fByPosition, lpcmii);
  3383. MENUITEMINFOA mii;
  3384. memcpy(&mii, lpcmii, sizeof MENUITEMINFOA);
  3385. if (!(lpcmii->fMask & MIIM_TYPE) ||
  3386. MFT_STRING != (lpcmii->fType &
  3387. (MFT_BITMAP | MFT_SEPARATOR | MFT_OWNERDRAW | MFT_STRING) ) )
  3388. {
  3389. return SetMenuItemInfoA(hMenu, uItem, fByPosition, &mii);
  3390. }
  3391. PreConvert();
  3392. mii.dwTypeData = Convert(lpcmii->dwTypeData);
  3393. return SetMenuItemInfoA(hMenu, uItem, fByPosition, &mii);
  3394. }
  3395. LONG
  3396. WINAPI
  3397. OSetWindowLongW(
  3398. HWND hWnd,
  3399. int nIndex,
  3400. LONG dwNewLong)
  3401. {
  3402. if(FWide())
  3403. return SetWindowLongW(hWnd, nIndex, dwNewLong);
  3404. return SetWindowLongA(hWnd, nIndex, dwNewLong);
  3405. }
  3406. HHOOK
  3407. WINAPI
  3408. OSetWindowsHookExW(
  3409. int idHook,
  3410. HOOKPROC lpfn,
  3411. HINSTANCE hmod,
  3412. DWORD dwThreadId)
  3413. {
  3414. if(FWide())
  3415. return SetWindowsHookExW(idHook, lpfn, hmod, dwThreadId);
  3416. return SetWindowsHookExA(idHook, lpfn, hmod, dwThreadId); //$ CONSIDER - Not really wrapped
  3417. }
  3418. BOOL
  3419. WINAPI
  3420. OSetWindowTextW(
  3421. HWND hWnd,
  3422. LPCWSTR lpString)
  3423. {
  3424. if(FWide())
  3425. return SetWindowTextW(hWnd, lpString);
  3426. PreConvert();
  3427. LPSTR sz = Convert(lpString);
  3428. return SetWindowTextA(hWnd, sz);
  3429. }
  3430. LONG
  3431. WINAPI
  3432. OTabbedTextOutW(
  3433. HDC hDC,
  3434. int X,
  3435. int Y,
  3436. LPCWSTR lpString,
  3437. int nCount,
  3438. int nTabPositions,
  3439. LPINT lpnTabStopPositions,
  3440. int nTabOrigin)
  3441. {
  3442. Assert(-1 != nCount);
  3443. if(FWide())
  3444. return TabbedTextOutW(hDC, X, Y, lpString, nCount, nTabPositions,
  3445. lpnTabStopPositions, nTabOrigin);
  3446. PreConvert();
  3447. LONG n = 0;
  3448. LPSTR sz = ConvertWithLen(lpString, nCount, &n);
  3449. return TabbedTextOutA(hDC, X, Y, sz, n, nTabPositions,
  3450. lpnTabStopPositions, nTabOrigin );
  3451. }
  3452. #if 0
  3453. // FOR OLE CTL: THIS MAGLES INTERFACE MEMBERS BY SAME NAME
  3454. int
  3455. WINAPI
  3456. OTranslateAcceleratorW(
  3457. HWND hWnd,
  3458. HACCEL hAccTable,
  3459. LPMSG lpMsg)
  3460. {
  3461. if(FWide())
  3462. return TranslateAcceleratorW(hWnd, hAccTable, lpMsg);
  3463. return TranslateAcceleratorA(hWnd, hAccTable, lpMsg);
  3464. }
  3465. #endif
  3466. SHORT
  3467. WINAPI
  3468. OVkKeyScanW(
  3469. WCHAR ch)
  3470. {
  3471. if (FWide())
  3472. return VkKeyScanW(ch);
  3473. TCHAR szW[2];
  3474. char szA[2];
  3475. szW[0] = ch;
  3476. szW[1] = L'\0';
  3477. Verify(0 <= UnicodeToAnsi(szA, szW, 2));
  3478. return VkKeyScanA(szA[0]);
  3479. }
  3480. BOOL
  3481. WINAPI
  3482. OWinHelpW(
  3483. HWND hWndMain,
  3484. LPCWSTR lpszHelp,
  3485. UINT uCommand,
  3486. DWORD dwData
  3487. )
  3488. {
  3489. if(FWide())
  3490. return WinHelpW(hWndMain, lpszHelp, uCommand,dwData);
  3491. PreConvert();
  3492. LPSTR sz = Convert(lpszHelp);
  3493. return WinHelpA(hWndMain, sz, uCommand, dwData);
  3494. }
  3495. BOOL
  3496. WINAPI
  3497. OWritePrivateProfileStringW(
  3498. LPCWSTR lpAppName,
  3499. LPCWSTR lpKeyName,
  3500. LPCWSTR lpString,
  3501. LPCWSTR lpFileName)
  3502. {
  3503. if(FWide())
  3504. return WritePrivateProfileStringW(lpAppName, lpKeyName, lpString, lpFileName);
  3505. PreConvert();
  3506. LPSTR szAppName = Convert(lpAppName);
  3507. LPSTR szKeyName = Convert(lpKeyName);
  3508. LPSTR szString = Convert(lpString);
  3509. LPSTR szFileName = Convert(lpFileName);
  3510. return WritePrivateProfileStringA(szAppName, szKeyName, szString, szFileName);
  3511. }
  3512. int
  3513. WINAPIV
  3514. OwsprintfW(LPWSTR pwszOut, LPCWSTR pwszFormat, ...)
  3515. {
  3516. va_list vaArgs;
  3517. va_start(vaArgs, pwszFormat);
  3518. int retval;
  3519. if(FWide())
  3520. retval = wvsprintfW(pwszOut, pwszFormat, vaArgs);
  3521. else
  3522. retval = _vstprintf(pwszOut, pwszFormat, vaArgs); //$CONSIDER Why isn't this vswprint?
  3523. va_end(vaArgs);
  3524. return retval;
  3525. }
  3526. BOOL
  3527. WINAPI
  3528. OGetVersionExW(
  3529. LPOSVERSIONINFOW lpVersionInformation
  3530. )
  3531. {
  3532. if(FWide())
  3533. return GetVersionExW(lpVersionInformation);
  3534. if (lpVersionInformation->dwOSVersionInfoSize < sizeof(OSVERSIONINFOW))
  3535. return false;
  3536. OSVERSIONINFOA osviVersionInfo;
  3537. osviVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
  3538. int fRetval = GetVersionExA(&osviVersionInfo);
  3539. if (fRetval)
  3540. {
  3541. memcpy(lpVersionInformation, &osviVersionInfo, sizeof(OSVERSIONINFOA));
  3542. Verify(0 <= AnsiToUnicode(lpVersionInformation->szCSDVersion,
  3543. osviVersionInfo.szCSDVersion,
  3544. sizeof(lpVersionInformation->szCSDVersion)
  3545. /sizeof(lpVersionInformation->szCSDVersion[0])));
  3546. }
  3547. return fRetval;
  3548. }
  3549. LONG
  3550. APIENTRY
  3551. ORegEnumKeyExW (
  3552. HKEY hKey,
  3553. DWORD dwIndex,
  3554. LPWSTR lpName,
  3555. LPDWORD lpcbName,
  3556. LPDWORD lpReserved,
  3557. LPWSTR lpClass,
  3558. LPDWORD lpcbClass,
  3559. PFILETIME lpftLastWriteTime
  3560. )
  3561. {
  3562. if(FWide())
  3563. return RegEnumKeyExW (
  3564. hKey,
  3565. dwIndex,
  3566. lpName,
  3567. lpcbName,
  3568. lpReserved,
  3569. lpClass,
  3570. lpcbClass,
  3571. lpftLastWriteTime
  3572. );
  3573. LPSTR szName, szClass;
  3574. DWORD cbName, cbClass;
  3575. if (lpcbName)
  3576. {
  3577. cbName = sizeof(WCHAR) * *lpcbName;
  3578. szName = lpName ? SzAlloc(cbName) : NULL;
  3579. }
  3580. else
  3581. {
  3582. szName = NULL;
  3583. cbName = 0;
  3584. }
  3585. if (lpcbClass)
  3586. {
  3587. cbClass = sizeof(WCHAR) * (*lpcbClass);
  3588. szClass = lpClass ? SzAlloc(cbClass) : NULL;
  3589. }
  3590. else
  3591. {
  3592. szClass = NULL;
  3593. cbClass = 0;
  3594. }
  3595. LONG lRet = RegEnumKeyExA(hKey, dwIndex, szName, &cbName, lpReserved,
  3596. szClass, &cbClass, lpftLastWriteTime );
  3597. if (ERROR_SUCCESS != lRet)
  3598. {
  3599. return lRet;
  3600. }
  3601. // Get the number of characters instead of number of bytes.
  3602. if (lpcbName)
  3603. {
  3604. DWORD dwNoOfChar = AnsiToUnicode((LPWSTR) lpName, (LPSTR) szName, *lpcbName);
  3605. if (cbName && !dwNoOfChar)
  3606. {
  3607. return ERROR_BUFFER_OVERFLOW;
  3608. }
  3609. *lpcbName = dwNoOfChar;
  3610. }
  3611. if (lpcbClass && lpClass)
  3612. {
  3613. DWORD dwNoOfChar = AnsiToUnicode((LPWSTR) lpClass, (LPSTR) szClass, *lpcbClass);
  3614. if (cbClass && !dwNoOfChar)
  3615. {
  3616. return ERROR_BUFFER_OVERFLOW;
  3617. }
  3618. *lpcbClass = dwNoOfChar;
  3619. }
  3620. return lRet;
  3621. }
  3622. HANDLE
  3623. WINAPI
  3624. OCreateFileMappingW(
  3625. HANDLE hFile,
  3626. LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
  3627. DWORD flProtect,
  3628. DWORD dwMaximumSizeHigh,
  3629. DWORD dwMaximumSizeLow,
  3630. LPCWSTR lpName
  3631. )
  3632. {
  3633. if(FWide())
  3634. return CreateFileMappingW(hFile, lpFileMappingAttributes, flProtect, dwMaximumSizeHigh, dwMaximumSizeLow, lpName);
  3635. PreConvert();
  3636. LPSTR sz = Convert(lpName);
  3637. return CreateFileMappingA(hFile, lpFileMappingAttributes, flProtect, dwMaximumSizeHigh, dwMaximumSizeLow, sz);
  3638. }
  3639. LRESULT
  3640. WINAPI
  3641. ODefDlgProcW(
  3642. HWND hDlg,
  3643. UINT Msg,
  3644. WPARAM wParam,
  3645. LPARAM lParam)
  3646. {
  3647. // incase TCHAR strings are being passed in lParam the caller
  3648. // will have to do the proper conversions PlatformToInternal or
  3649. // InternalToPlatform
  3650. if(FWide())
  3651. return DefDlgProcW(hDlg, Msg, wParam, lParam);
  3652. return DefDlgProcA(hDlg, Msg, wParam, lParam);
  3653. }
  3654. int
  3655. WINAPI
  3656. OGetLocaleInfoW(
  3657. LCID Locale,
  3658. LCTYPE LCType,
  3659. LPWSTR lpLCData,
  3660. int cchData)
  3661. {
  3662. DWORD dwRet;
  3663. if (FWide())
  3664. return GetLocaleInfoW(Locale, LCType, lpLCData, cchData);
  3665. if (!cchData || !lpLCData)
  3666. return GetLocaleInfoA(Locale, LCType, NULL, cchData);
  3667. int cchDataAnsi = sizeof(WCHAR) * cchData;
  3668. LPSTR szBuffer = SzAlloc(cchDataAnsi);
  3669. dwRet = GetLocaleInfoA(Locale, LCType, szBuffer, cchDataAnsi);
  3670. // $UNDONE_POST_98: This is bogus, we should do this like OLoadStringW
  3671. if(dwRet)
  3672. {
  3673. return AnsiToUnicode(lpLCData, szBuffer, cchData, dwRet);
  3674. }
  3675. else if (lpLCData && 0 < cchData)
  3676. {
  3677. *lpLCData = L'\0';
  3678. }
  3679. return dwRet;
  3680. }
  3681. BOOL
  3682. WINAPI
  3683. OSetLocaleInfoW(
  3684. LCID Locale,
  3685. LCTYPE LCType,
  3686. LPCWSTR lpLCData)
  3687. {
  3688. if (FWide())
  3689. return SetLocaleInfoW(Locale, LCType, lpLCData);
  3690. PreConvert();
  3691. LPSTR sz = Convert(lpLCData);
  3692. return SetLocaleInfoA(Locale, LCType, sz);
  3693. }
  3694. // $UNDONE_POST_98$ Workaround because StgCreateDocfile is not reentrant.
  3695. // We were getting ACCESS DENIED errors when multiple threads opened
  3696. // temp files simultaneously.
  3697. //-----------------------------------------------------------------------------
  3698. // Name: StgCreateDocfileCriticalSection
  3699. //
  3700. // Description:
  3701. // Used solely by OStgCreateDocfile in order to protect its call to
  3702. // StgCreateDocfile from simultaneously entry by multiple threads.
  3703. //
  3704. //-----------------------------------------------------------------------------
  3705. class StgCreateDocfileCriticalSection
  3706. {
  3707. public:
  3708. StgCreateDocfileCriticalSection() {InitializeCriticalSection(&m_critsec);}
  3709. ~StgCreateDocfileCriticalSection() {DeleteCriticalSection(&m_critsec);}
  3710. VOID VEnter() {EnterCriticalSection(&m_critsec);}
  3711. VOID VLeave() {LeaveCriticalSection(&m_critsec);}
  3712. private:
  3713. CRITICAL_SECTION m_critsec;
  3714. };
  3715. //-----------------------------------------------------------------------------
  3716. // Name: OStgCreateDocfile
  3717. //
  3718. // Description:
  3719. // Wrapper for StgCreateDocfile to protect against reentrancy bug in OLE.
  3720. //
  3721. // Thread-Safety: Bullet-proof
  3722. //
  3723. // Return Values: same HRESULT as StgCreateDocfile
  3724. //-----------------------------------------------------------------------------
  3725. HRESULT
  3726. WINAPI
  3727. OStgCreateDocfile
  3728. (
  3729. const WCHAR * pwcsName,
  3730. DWORD grfMode,
  3731. DWORD reserved,
  3732. IStorage ** ppstgOpen
  3733. )
  3734. {
  3735. HRESULT hrReturn;
  3736. static StgCreateDocfileCriticalSection Crit;
  3737. Crit.VEnter();
  3738. // Change: Vank
  3739. // This definitions was infinitely recursive. The 64 bit compiler caught it and refused to let it pass.
  3740. #ifdef StgCreateDocfile
  3741. #undef StgCreateDocfile
  3742. hrReturn = StgCreateDocfile(pwcsName, grfMode, reserved, ppstgOpen);
  3743. #define StgCreateDocfile OStgCreateDocfile
  3744. #else
  3745. hrReturn = StgCreateDocfile(pwcsName, grfMode, reserved, ppstgOpen);
  3746. #endif
  3747. // End change: VanK
  3748. Crit.VLeave();
  3749. return hrReturn;
  3750. }
  3751. int
  3752. WINAPI
  3753. OStartDocW
  3754. (
  3755. HDC hDC,
  3756. CONST DOCINFOW * pdiDocW
  3757. )
  3758. {
  3759. if (FWide())
  3760. return StartDocW(hDC, pdiDocW);
  3761. DOCINFOA diDocA;
  3762. PreConvert();
  3763. diDocA.lpszDocName = Convert(pdiDocW->lpszDocName);
  3764. diDocA.lpszOutput = Convert(pdiDocW->lpszOutput);
  3765. diDocA.lpszDatatype = Convert(pdiDocW->lpszDatatype);
  3766. diDocA.cbSize = sizeof(DOCINFOA);
  3767. diDocA.fwType = pdiDocW->fwType;
  3768. return StartDocA(hDC, &diDocA);
  3769. }
  3770. BOOL
  3771. WINAPI
  3772. OSystemParametersInfoW(
  3773. UINT uiAction,
  3774. UINT uiParam,
  3775. PVOID pvParam,
  3776. UINT fWinIni)
  3777. {
  3778. if (FWide())
  3779. return SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
  3780. switch (uiAction)
  3781. { // unsupported actions
  3782. case SPI_GETHIGHCONTRAST:
  3783. case SPI_GETICONMETRICS:
  3784. case SPI_GETICONTITLELOGFONT:
  3785. case SPI_GETNONCLIENTMETRICS:
  3786. case SPI_GETSERIALKEYS:
  3787. case SPI_GETSOUNDSENTRY:
  3788. case SPI_SETDESKWALLPAPER:
  3789. case SPI_SETHIGHCONTRAST:
  3790. case SPI_SETICONMETRICS:
  3791. case SPI_SETICONTITLELOGFONT:
  3792. case SPI_SETNONCLIENTMETRICS:
  3793. case SPI_SETSERIALKEYS:
  3794. case SPI_SETSOUNDSENTRY:
  3795. AssertFail("No Unicode Wrapper Available for Win32 API - SystemParametersInfoW");
  3796. return 0;
  3797. };
  3798. return SystemParametersInfoA(uiAction, uiParam, pvParam, fWinIni);
  3799. }
  3800. LPWSTR
  3801. WINAPI
  3802. OCharNextW(
  3803. LPCWSTR lpsz)
  3804. {
  3805. if ( FWide() )
  3806. return CharNextW( lpsz );
  3807. if (*lpsz == L'\0')
  3808. {
  3809. return const_cast<LPWSTR>(lpsz);
  3810. }
  3811. return const_cast<LPWSTR>(lpsz + 1);
  3812. }
  3813. #ifdef DEBUG
  3814. BOOL
  3815. APIENTRY
  3816. OAbortSystemShutdownW(
  3817. LPWSTR lpMachineName
  3818. )
  3819. {
  3820. AssertFail("No Unicode Wrapper Available for Win32 API - AbortSystemShutdownW");
  3821. return 0;
  3822. }
  3823. BOOL
  3824. WINAPI
  3825. OAccessCheckAndAuditAlarmW (
  3826. LPCWSTR SubsystemName,
  3827. LPVOID HandleId,
  3828. LPWSTR ObjectTypeName,
  3829. LPWSTR ObjectName,
  3830. PSECURITY_DESCRIPTOR SecurityDescriptor,
  3831. DWORD DesiredAccess,
  3832. PGENERIC_MAPPING GenericMapping,
  3833. BOOL ObjectCreation,
  3834. LPDWORD GrantedAccess,
  3835. LPBOOL AccessStatus,
  3836. LPBOOL pfGenerateOnClose
  3837. )
  3838. {
  3839. AssertFail("No Unicode Wrapper Available for Win32 API - AccessCheckAndAuditAlarmW");
  3840. return 0;
  3841. }
  3842. int
  3843. WINAPI OAddFontResourceW(LPCWSTR)
  3844. {
  3845. AssertFail("No Unicode Wrapper Available for Win32 API - AddFontResourceW");
  3846. return 0;
  3847. }
  3848. BOOL
  3849. WINAPI
  3850. OAddFormW(
  3851. HANDLE hPrinter,
  3852. DWORD Level,
  3853. LPBYTE pForm
  3854. )
  3855. {
  3856. AssertFail("No Unicode Wrapper Available for Win32 API - AddFormW");
  3857. return 0;
  3858. }
  3859. BOOL
  3860. WINAPI
  3861. OAddJobW(
  3862. HANDLE hPrinter,
  3863. DWORD Level,
  3864. LPBYTE pData,
  3865. DWORD cbBuf,
  3866. LPDWORD pcbNeeded
  3867. )
  3868. {
  3869. AssertFail("No Unicode Wrapper Available for Win32 API - AddJobW");
  3870. return 0;
  3871. }
  3872. BOOL
  3873. WINAPI
  3874. OAddMonitorW(
  3875. LPWSTR pName,
  3876. DWORD Level,
  3877. LPBYTE pMonitors
  3878. )
  3879. {
  3880. AssertFail("No Unicode Wrapper Available for Win32 API - AddMonitorW");
  3881. return 0;
  3882. }
  3883. BOOL
  3884. WINAPI
  3885. OAddPortW(
  3886. LPWSTR pName,
  3887. HWND hWnd,
  3888. LPWSTR pMonitorName
  3889. )
  3890. {
  3891. AssertFail("No Unicode Wrapper Available for Win32 API - AddPortW");
  3892. return 0;
  3893. }
  3894. HANDLE
  3895. WINAPI
  3896. OAddPrinterW(
  3897. LPWSTR pName,
  3898. DWORD Level,
  3899. LPBYTE pPrinter
  3900. )
  3901. {
  3902. AssertFail("No Unicode Wrapper Available for Win32 API - AddPrinterW");
  3903. return 0;
  3904. }
  3905. BOOL
  3906. WINAPI
  3907. OAddPrinterConnectionW(
  3908. LPWSTR pName
  3909. )
  3910. {
  3911. AssertFail("No Unicode Wrapper Available for Win32 API - AddPrinterConnectionW");
  3912. return 0;
  3913. }
  3914. BOOL
  3915. WINAPI
  3916. OAddPrinterDriverW(
  3917. LPWSTR pName,
  3918. DWORD Level,
  3919. LPBYTE pDriverInfo
  3920. )
  3921. {
  3922. AssertFail("No Unicode Wrapper Available for Win32 API - AddPrinterDriverW");
  3923. return 0;
  3924. }
  3925. BOOL
  3926. WINAPI
  3927. OAddPrintProcessorW(
  3928. LPWSTR pName,
  3929. LPWSTR pEnvironment,
  3930. LPWSTR pPathName,
  3931. LPWSTR pPrintProcessorName
  3932. )
  3933. {
  3934. AssertFail("No Unicode Wrapper Available for Win32 API - AddPrintProcessorW");
  3935. return 0;
  3936. }
  3937. BOOL
  3938. WINAPI
  3939. OAddPrintProvidorW(
  3940. LPWSTR pName,
  3941. DWORD level,
  3942. LPBYTE pProvidorInfo
  3943. )
  3944. {
  3945. AssertFail("No Unicode Wrapper Available for Win32 API - AddPrintProvidorW");
  3946. return 0;
  3947. }
  3948. LONG
  3949. WINAPI
  3950. OAdvancedDocumentPropertiesW(
  3951. HWND hWnd,
  3952. HANDLE hPrinter,
  3953. LPWSTR pDeviceName,
  3954. PDEVMODEW pDevModeOutput,
  3955. PDEVMODEW pDevModeInput
  3956. )
  3957. {
  3958. AssertFail("No Unicode Wrapper Available for Win32 API - AdvancedDocumentPropertiesW");
  3959. return 0;
  3960. }
  3961. MMRESULT WINAPI OauxGetDevCapsW(UINT uDeviceID, LPAUXCAPSW pac, UINT cbac)
  3962. {
  3963. AssertFail("No Unicode Wrapper Available for Win32 API - auxGetDevCapsW");
  3964. return 0;
  3965. }
  3966. BOOL
  3967. WINAPI
  3968. OBackupEventLogW (
  3969. HANDLE hEventLog,
  3970. LPCWSTR lpBackupFileName
  3971. )
  3972. {
  3973. AssertFail("No Unicode Wrapper Available for Win32 API - BackupEventLogW");
  3974. return 0;
  3975. }
  3976. HANDLE
  3977. WINAPI
  3978. OBeginUpdateResourceW(
  3979. LPCWSTR pFileName,
  3980. BOOL bDeleteExistingResources
  3981. )
  3982. {
  3983. AssertFail("No Unicode Wrapper Available for Win32 API - BeginUpdateResourceW");
  3984. return 0;
  3985. }
  3986. BOOL
  3987. WINAPI
  3988. OBuildCommDCBW(
  3989. LPCWSTR lpDef,
  3990. LPDCB lpDCB
  3991. )
  3992. {
  3993. AssertFail("No Unicode Wrapper Available for Win32 API - BuildCommDCBW");
  3994. return 0;
  3995. }
  3996. BOOL
  3997. WINAPI
  3998. OBuildCommDCBAndTimeoutsW(
  3999. LPCWSTR lpDef,
  4000. LPDCB lpDCB,
  4001. LPCOMMTIMEOUTS lpCommTimeouts
  4002. )
  4003. {
  4004. AssertFail("No Unicode Wrapper Available for Win32 API - BuildCommDCBAndTimeoutsW");
  4005. return 0;
  4006. }
  4007. BOOL
  4008. WINAPI
  4009. OCallMsgFilterW(
  4010. LPMSG lpMsg,
  4011. int nCode)
  4012. {
  4013. AssertFail("No Unicode Wrapper Available for Win32 API - CallMsgFilterW");
  4014. return 0;
  4015. }
  4016. BOOL
  4017. WINAPI
  4018. OCallNamedPipeW(
  4019. LPCWSTR lpNamedPipeName,
  4020. LPVOID lpInBuffer,
  4021. DWORD nInBufferSize,
  4022. LPVOID lpOutBuffer,
  4023. DWORD nOutBufferSize,
  4024. LPDWORD lpBytesRead,
  4025. DWORD nTimeOut
  4026. )
  4027. {
  4028. AssertFail("No Unicode Wrapper Available for Win32 API - CallNamedPipeW");
  4029. return 0;
  4030. }
  4031. LONG
  4032. WINAPI
  4033. OChangeDisplaySettingsW(
  4034. LPDEVMODEW lpDevMode,
  4035. DWORD dwFlags)
  4036. {
  4037. AssertFail("No Unicode Wrapper Available for Win32 API - ChangeDisplaySettingsW");
  4038. return 0;
  4039. }
  4040. BOOL
  4041. WINAPI
  4042. OChangeMenuW(
  4043. HMENU hMenu,
  4044. UINT cmd,
  4045. LPCWSTR lpszNewItem,
  4046. UINT cmdInsert,
  4047. UINT flags)
  4048. {
  4049. AssertFail("No Unicode Wrapper Available for Win32 API - ChangeMenuW");
  4050. return 0;
  4051. }
  4052. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  4053. BOOL
  4054. WINAPI
  4055. OChangeServiceConfigW(
  4056. SC_HANDLE hService,
  4057. DWORD dwServiceType,
  4058. DWORD dwStartType,
  4059. DWORD dwErrorControl,
  4060. LPCWSTR lpBinaryPathName,
  4061. LPCWSTR lpLoadOrderGroup,
  4062. LPDWORD lpdwTagId,
  4063. LPCWSTR lpDependencies,
  4064. LPCWSTR lpServiceStartName,
  4065. LPCWSTR lpPassword,
  4066. LPCWSTR lpDisplayName
  4067. )
  4068. {
  4069. AssertFail("No Unicode Wrapper Available for Win32 API - ChangeServiceConfigW");
  4070. return 0;
  4071. }
  4072. #endif
  4073. BOOL
  4074. WINAPI
  4075. OCharToOemBuffW(
  4076. LPCWSTR lpszSrc,
  4077. LPSTR lpszDst,
  4078. DWORD cchDstLength)
  4079. {
  4080. AssertFail("No Unicode Wrapper Available for Win32 API - CharToOemBuffW");
  4081. return 0;
  4082. }
  4083. DWORD
  4084. WINAPI
  4085. OCharUpperBuffW(
  4086. LPWSTR lpsz,
  4087. DWORD cchLength)
  4088. {
  4089. AssertFail("No Unicode Wrapper Available for Win32 API - CharUpperBuffW");
  4090. return 0;
  4091. }
  4092. BOOL
  4093. WINAPI
  4094. OChooseColorW(
  4095. LPCHOOSECOLORW lpcc)
  4096. {
  4097. AssertFail("No Unicode Wrapper Available for Win32 API - ChooseColorW");
  4098. return 0;
  4099. }
  4100. BOOL
  4101. APIENTRY OChooseFontW(LPCHOOSEFONTW pchfw)
  4102. {
  4103. AssertFail("No Unicode Wrapper Available for Win32 API - ChooseFontW");
  4104. return 0;
  4105. }
  4106. BOOL
  4107. WINAPI
  4108. OClearEventLogW (
  4109. HANDLE hEventLog,
  4110. LPCWSTR lpBackupFileName
  4111. )
  4112. {
  4113. AssertFail("No Unicode Wrapper Available for Win32 API - ClearEventLogW");
  4114. return 0;
  4115. }
  4116. BOOL
  4117. WINAPI
  4118. OCommConfigDialogW(
  4119. LPCWSTR lpszName,
  4120. HWND hWnd,
  4121. LPCOMMCONFIG lpCC
  4122. )
  4123. {
  4124. AssertFail("No Unicode Wrapper Available for Win32 API - CommConfigDialogW");
  4125. return 0;
  4126. }
  4127. int
  4128. WINAPI
  4129. OCompareStringW(
  4130. LCID Locale,
  4131. DWORD dwCmpFlags,
  4132. LPCWSTR lpString1,
  4133. int cchCount1,
  4134. LPCWSTR lpString2,
  4135. int cchCount2)
  4136. {
  4137. AssertFail("No Unicode Wrapper Available for Win32 API - CompareStringW");
  4138. return 0;
  4139. }
  4140. BOOL
  4141. WINAPI
  4142. OConfigurePortW(
  4143. LPWSTR pName,
  4144. HWND hWnd,
  4145. LPWSTR pPortName
  4146. )
  4147. {
  4148. AssertFail("No Unicode Wrapper Available for Win32 API - ConfigurePortW");
  4149. return 0;
  4150. }
  4151. int
  4152. WINAPI
  4153. OCopyAcceleratorTableW(
  4154. HACCEL hAccelSrc,
  4155. LPACCEL lpAccelDst,
  4156. int cAccelEntries)
  4157. {
  4158. AssertFail("No Unicode Wrapper Available for Win32 API - CopyAcceleratorTableW");
  4159. return 0;
  4160. }
  4161. HENHMETAFILE
  4162. WINAPI
  4163. OCopyEnhMetaFileW(HENHMETAFILE, LPCWSTR)
  4164. {
  4165. AssertFail("No Unicode Wrapper Available for Win32 API - CopyEnhMetaFileW");
  4166. return 0;
  4167. }
  4168. HMETAFILE
  4169. WINAPI
  4170. OCopyMetaFileW(HMETAFILE, LPCWSTR)
  4171. {
  4172. AssertFail("No Unicode Wrapper Available for Win32 API - CopyMetaFileW");
  4173. return 0;
  4174. }
  4175. HACCEL
  4176. WINAPI
  4177. OCreateAcceleratorTableW(
  4178. LPACCEL, int)
  4179. {
  4180. AssertFail("No Unicode Wrapper Available for Win32 API - CreateAcceleratorTableW");
  4181. return 0;
  4182. }
  4183. WINAPI
  4184. OCreateColorSpaceW(LPLOGCOLORSPACEW)
  4185. {
  4186. AssertFail("No Unicode Wrapper Available for Win32 API - CreateColorSpaceW");
  4187. return 0;
  4188. }
  4189. HDESK
  4190. WINAPI
  4191. OCreateDesktopW(
  4192. LPWSTR lpszDesktop,
  4193. LPWSTR lpszDevice,
  4194. LPDEVMODEW pDevmode,
  4195. DWORD dwFlags,
  4196. DWORD dwDesiredAccess,
  4197. LPSECURITY_ATTRIBUTES lpsa)
  4198. {
  4199. AssertFail("No Unicode Wrapper Available for Win32 API - CreateDesktopW");
  4200. return 0;
  4201. }
  4202. HWND
  4203. WINAPI
  4204. OCreateDialogIndirectParamW(
  4205. HINSTANCE hInstance,
  4206. LPCDLGTEMPLATEW lpTemplate,
  4207. HWND hWndParent,
  4208. DLGPROC lpDialogFunc,
  4209. LPARAM dwInitParam)
  4210. {
  4211. AssertFail("No Unicode Wrapper Available for Win32 API - CreateDialogIndirectParamW");
  4212. return 0;
  4213. }
  4214. HWND
  4215. WINAPI
  4216. OCreateDialogParamW(
  4217. HINSTANCE hInstance,
  4218. LPCWSTR lpTemplateName,
  4219. HWND hWndParent ,
  4220. DLGPROC lpDialogFunc,
  4221. LPARAM dwInitParam)
  4222. {
  4223. AssertFail("No Unicode Wrapper Available for Win32 API - CreateDialogParamW");
  4224. return 0;
  4225. }
  4226. HDC
  4227. WINAPI
  4228. OCreateICW(
  4229. LPCWSTR lpszDriver,
  4230. LPCWSTR lpszDevice,
  4231. LPCWSTR lpszOutput,
  4232. CONST DEVMODEW *lpdvmInit)
  4233. {
  4234. AssertFail("No Unicode Wrapper Available for Win32 API - CreateICW");
  4235. return 0;
  4236. }
  4237. HANDLE
  4238. WINAPI
  4239. OCreateMailslotW(
  4240. LPCWSTR lpName,
  4241. DWORD nMaxMessageSize,
  4242. DWORD lReadTimeout,
  4243. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  4244. )
  4245. {
  4246. AssertFail("No Unicode Wrapper Available for Win32 API - CreateMailslotW");
  4247. return 0;
  4248. }
  4249. HANDLE
  4250. WINAPI
  4251. OCreateMutexW(
  4252. LPSECURITY_ATTRIBUTES lpMutexAttributes,
  4253. BOOL bInitialOwner,
  4254. LPCWSTR lpName
  4255. )
  4256. {
  4257. AssertFail("No Unicode Wrapper Available for Win32 API - CreateMutexW");
  4258. return 0;
  4259. }
  4260. HANDLE
  4261. WINAPI
  4262. OCreateNamedPipeW(
  4263. LPCWSTR lpName,
  4264. DWORD dwOpenMode,
  4265. DWORD dwPipeMode,
  4266. DWORD nMaxInstances,
  4267. DWORD nOutBufferSize,
  4268. DWORD nInBufferSize,
  4269. DWORD nDefaultTimeOut,
  4270. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  4271. )
  4272. {
  4273. AssertFail("No Unicode Wrapper Available for Win32 API - CreateNamedPipeW");
  4274. return 0;
  4275. }
  4276. BOOL
  4277. WINAPI
  4278. OCreateProcessW(
  4279. LPCWSTR lpApplicationName,
  4280. LPWSTR lpCommandLine,
  4281. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  4282. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  4283. BOOL bInheritHandles,
  4284. DWORD dwCreationFlags,
  4285. LPVOID lpEnvironment,
  4286. LPCWSTR lpCurrentDirectory,
  4287. LPSTARTUPINFOW lpStartupInfo,
  4288. LPPROCESS_INFORMATION lpProcessInformation
  4289. )
  4290. {
  4291. AssertFail("No Unicode Wrapper Available for Win32 API - CreateProcessW");
  4292. return 0;
  4293. }
  4294. BOOL
  4295. WINAPI
  4296. OCreateProcessAsUserW (
  4297. HANDLE hToken,
  4298. LPCWSTR lpApplicationName,
  4299. LPWSTR lpCommandLine,
  4300. LPSECURITY_ATTRIBUTES lpProcessAttributes,
  4301. LPSECURITY_ATTRIBUTES lpThreadAttributes,
  4302. BOOL bInheritHandles,
  4303. DWORD dwCreationFlags,
  4304. LPVOID lpEnvironment,
  4305. LPCWSTR lpCurrentDirectory,
  4306. LPSTARTUPINFOW lpStartupInfo,
  4307. LPPROCESS_INFORMATION lpProcessInformation
  4308. )
  4309. {
  4310. AssertFail("No Unicode Wrapper Available for Win32 API - CreateProcessAsUserW");
  4311. return 0;
  4312. }
  4313. HPROPSHEETPAGE
  4314. WINAPI
  4315. OCreatePropertySheetPageW(
  4316. LPCPROPSHEETPAGEW lpcpsp
  4317. )
  4318. {
  4319. AssertFail("No Unicode Wrapper Available for Win32 API - CreatePropertySheetPageW");
  4320. return 0;
  4321. }
  4322. BOOL
  4323. WINAPI
  4324. OCreateScalableFontResourceW(DWORD, LPCWSTR, LPCWSTR, LPCWSTR)
  4325. {
  4326. AssertFail("No Unicode Wrapper Available for Win32 API - CreateScalableFontResourceW");
  4327. return 0;
  4328. }
  4329. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  4330. SC_HANDLE
  4331. WINAPI
  4332. OCreateServiceW(
  4333. SC_HANDLE hSCManager,
  4334. LPCWSTR lpServiceName,
  4335. LPCWSTR lpDisplayName,
  4336. DWORD dwDesiredAccess,
  4337. DWORD dwServiceType,
  4338. DWORD dwStartType,
  4339. DWORD dwErrorControl,
  4340. LPCWSTR lpBinaryPathName,
  4341. LPCWSTR lpLoadOrderGroup,
  4342. LPDWORD lpdwTagId,
  4343. LPCWSTR lpDependencies,
  4344. LPCWSTR lpServiceStartName,
  4345. LPCWSTR lpPassword
  4346. )
  4347. {
  4348. AssertFail("No Unicode Wrapper Available for Win32 API - CreateServiceW");
  4349. return 0;
  4350. }
  4351. #endif
  4352. HWND WINAPI OCreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID)
  4353. {
  4354. AssertFail("No Unicode Wrapper Available for Win32 API - CreateStatusWindowW");
  4355. return 0;
  4356. }
  4357. HWINSTA
  4358. WINAPI
  4359. OCreateWindowStationW(
  4360. LPWSTR lpwinsta,
  4361. DWORD dwReserved,
  4362. DWORD dwDesiredAccess,
  4363. LPSECURITY_ATTRIBUTES lpsa)
  4364. {
  4365. AssertFail("No Unicode Wrapper Available for Win32 API - CreateWindowStationW");
  4366. return 0;
  4367. }
  4368. RPC_STATUS RPC_ENTRY
  4369. ODceErrorInqTextW (
  4370. IN RPC_STATUS RpcStatus,
  4371. OUT unsigned short __RPC_FAR * ErrorText
  4372. )
  4373. {
  4374. AssertFail("No Unicode Wrapper Available for Win32 API - DceErrorInqTextW");
  4375. return 0;
  4376. }
  4377. BOOL
  4378. WINAPI
  4379. ODefineDosDeviceW(
  4380. DWORD dwFlags,
  4381. LPCWSTR lpDeviceName,
  4382. LPCWSTR lpTargetPath
  4383. )
  4384. {
  4385. AssertFail("No Unicode Wrapper Available for Win32 API - DefineDosDeviceW");
  4386. return 0;
  4387. }
  4388. BOOL
  4389. WINAPI
  4390. ODeleteFormW(
  4391. HANDLE hPrinter,
  4392. LPWSTR pFormName
  4393. )
  4394. {
  4395. AssertFail("No Unicode Wrapper Available for Win32 API - DeleteFormW");
  4396. return 0;
  4397. }
  4398. BOOL
  4399. WINAPI
  4400. ODeleteMonitorW(
  4401. LPWSTR pName,
  4402. LPWSTR pEnvironment,
  4403. LPWSTR pMonitorName
  4404. )
  4405. {
  4406. AssertFail("No Unicode Wrapper Available for Win32 API - DeleteMonitorW");
  4407. return 0;
  4408. }
  4409. BOOL
  4410. WINAPI
  4411. ODeletePortW(
  4412. LPWSTR pName,
  4413. HWND hWnd,
  4414. LPWSTR pPortName
  4415. )
  4416. {
  4417. AssertFail("No Unicode Wrapper Available for Win32 API - DeletePortW");
  4418. return 0;
  4419. }
  4420. BOOL
  4421. WINAPI
  4422. ODeletePrinterConnectionW(
  4423. LPWSTR pName
  4424. )
  4425. {
  4426. AssertFail("No Unicode Wrapper Available for Win32 API - DeletePrinterConnectionW");
  4427. return 0;
  4428. }
  4429. BOOL
  4430. WINAPI
  4431. ODeletePrinterDriverW(
  4432. LPWSTR pName,
  4433. LPWSTR pEnvironment,
  4434. LPWSTR pDriverName
  4435. )
  4436. {
  4437. AssertFail("No Unicode Wrapper Available for Win32 API - DeletePrinterDriverW");
  4438. return 0;
  4439. }
  4440. BOOL
  4441. WINAPI
  4442. ODeletePrintProcessorW(
  4443. LPWSTR pName,
  4444. LPWSTR pEnvironment,
  4445. LPWSTR pPrintProcessorName
  4446. )
  4447. {
  4448. AssertFail("No Unicode Wrapper Available for Win32 API - DeletePrintProcessorW");
  4449. return 0;
  4450. }
  4451. BOOL
  4452. WINAPI
  4453. ODeletePrintProvidorW(
  4454. LPWSTR pName,
  4455. LPWSTR pEnvironment,
  4456. LPWSTR pPrintProvidorName
  4457. )
  4458. {
  4459. AssertFail("No Unicode Wrapper Available for Win32 API - DeletePrintProvidorW");
  4460. return 0;
  4461. }
  4462. int
  4463. WINAPI
  4464. ODeviceCapabilitiesW(LPCWSTR, LPCWSTR, WORD,
  4465. LPWSTR, CONST DEVMODEW *)
  4466. {
  4467. AssertFail("No Unicode Wrapper Available for Win32 API - DeviceCapabilitiesW");
  4468. return 0;
  4469. }
  4470. int
  4471. WINAPI
  4472. ODlgDirListW(
  4473. HWND hDlg,
  4474. LPWSTR lpPathSpec,
  4475. int nIDListBox,
  4476. int nIDStaticPath,
  4477. UINT uFileType)
  4478. {
  4479. AssertFail("No Unicode Wrapper Available for Win32 API - DlgDirListW");
  4480. return 0;
  4481. }
  4482. int
  4483. WINAPI
  4484. ODlgDirListComboBoxW(
  4485. HWND hDlg,
  4486. LPWSTR lpPathSpec,
  4487. int nIDComboBox,
  4488. int nIDStaticPath,
  4489. UINT uFiletype)
  4490. {
  4491. AssertFail("No Unicode Wrapper Available for Win32 API - DlgDirListComboBoxW");
  4492. return 0;
  4493. }
  4494. BOOL
  4495. WINAPI
  4496. ODlgDirSelectComboBoxExW(
  4497. HWND hDlg,
  4498. LPWSTR lpString,
  4499. int nCount,
  4500. int nIDComboBox)
  4501. {
  4502. AssertFail("No Unicode Wrapper Available for Win32 API - DlgDirSelectComboBoxExW");
  4503. return 0;
  4504. }
  4505. BOOL
  4506. WINAPI
  4507. ODlgDirSelectExW(
  4508. HWND hDlg,
  4509. LPWSTR lpString,
  4510. int nCount,
  4511. int nIDListBox)
  4512. {
  4513. AssertFail("No Unicode Wrapper Available for Win32 API - DlgDirSelectExW");
  4514. return 0;
  4515. }
  4516. DWORD
  4517. WINAPI
  4518. ODocumentPropertiesW(
  4519. HWND hWnd,
  4520. HANDLE hPrinter,
  4521. LPWSTR pDeviceName,
  4522. PDEVMODEW pDevModeOutput,
  4523. PDEVMODEW pDevModeInput,
  4524. DWORD fMode
  4525. )
  4526. {
  4527. AssertFail("No Unicode Wrapper Available for Win32 API - DocumentPropertiesW");
  4528. return 0;
  4529. }
  4530. DWORD
  4531. APIENTRY
  4532. ODoEnvironmentSubstW(LPWSTR szString, UINT cbString)
  4533. {
  4534. AssertFail("No Unicode Wrapper Available for Win32 API - DoEnvironmentSubstW");
  4535. return 0;
  4536. }
  4537. UINT
  4538. APIENTRY
  4539. ODragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch)
  4540. {
  4541. AssertFail("No Unicode Wrapper Available for Win32 API - DragQueryFileW");
  4542. return 0;
  4543. }
  4544. BOOL
  4545. WINAPI
  4546. ODrawStateW(HDC, HBRUSH, DRAWSTATEPROC, LPARAM, WPARAM, int, int, int, int, UINT)
  4547. {
  4548. AssertFail("No Unicode Wrapper Available for Win32 API - DrawStateW");
  4549. return 0;
  4550. }
  4551. BOOL
  4552. WINAPI
  4553. OEndUpdateResourceW(
  4554. HANDLE hUpdate,
  4555. BOOL fDiscard
  4556. )
  4557. {
  4558. AssertFail("No Unicode Wrapper Available for Win32 API - EndUpdateResourceW");
  4559. return 0;
  4560. }
  4561. BOOL
  4562. WINAPI
  4563. OEnumCalendarInfoW(
  4564. CALINFO_ENUMPROCW lpCalInfoEnumProc,
  4565. LCID Locale,
  4566. CALID Calendar,
  4567. CALTYPE CalType)
  4568. {
  4569. AssertFail("No Unicode Wrapper Available for Win32 API - EnumCalendarInfoW");
  4570. return 0;
  4571. }
  4572. BOOL
  4573. WINAPI
  4574. OEnumDateFormatsW(
  4575. DATEFMT_ENUMPROCW lpDateFmtEnumProc,
  4576. LCID Locale,
  4577. DWORD dwFlags)
  4578. {
  4579. AssertFail("No Unicode Wrapper Available for Win32 API - EnumDateFormatsW");
  4580. return 0;
  4581. }
  4582. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  4583. BOOL
  4584. WINAPI
  4585. OEnumDependentServicesW(
  4586. SC_HANDLE hService,
  4587. DWORD dwServiceState,
  4588. LPENUM_SERVICE_STATUSW lpServices,
  4589. DWORD cbBufSize,
  4590. LPDWORD pcbBytesNeeded,
  4591. LPDWORD lpServicesReturned
  4592. )
  4593. {
  4594. AssertFail("No Unicode Wrapper Available for Win32 API - EnumDependentServicesW");
  4595. return 0;
  4596. }
  4597. #endif
  4598. BOOL
  4599. WINAPI
  4600. OEnumDesktopsW(
  4601. HWINSTA hwinsta,
  4602. DESKTOPENUMPROCW lpEnumFunc,
  4603. LPARAM lParam)
  4604. {
  4605. AssertFail("No Unicode Wrapper Available for Win32 API - EnumDesktopsW");
  4606. return 0;
  4607. }
  4608. BOOL
  4609. WINAPI
  4610. OEnumDisplaySettingsW(
  4611. LPCWSTR lpszDeviceName,
  4612. DWORD iModeNum,
  4613. LPDEVMODEW lpDevMode)
  4614. {
  4615. AssertFail("No Unicode Wrapper Available for Win32 API - EnumDisplaySettingsW");
  4616. return 0;
  4617. }
  4618. int
  4619. WINAPI
  4620. OEnumFontFamiliesW(HDC, LPCWSTR, FONTENUMPROCW, LPARAM)
  4621. {
  4622. AssertFail("No Unicode Wrapper Available for Win32 API - EnumFontFamiliesW");
  4623. return 0;
  4624. }
  4625. int
  4626. WINAPI
  4627. OEnumFontFamiliesExW(HDC, LPLOGFONTW,FONTENUMPROCW, LPARAM,DWORD)
  4628. {
  4629. AssertFail("No Unicode Wrapper Available for Win32 API - EnumFontFamiliesExW");
  4630. return 0;
  4631. }
  4632. int
  4633. WINAPI
  4634. OEnumFontsW(HDC, LPCWSTR, FONTENUMPROCW, LPARAM)
  4635. {
  4636. AssertFail("No Unicode Wrapper Available for Win32 API - EnumFontsW");
  4637. return 0;
  4638. }
  4639. BOOL
  4640. WINAPI
  4641. OEnumFormsW(
  4642. HANDLE hPrinter,
  4643. DWORD Level,
  4644. LPBYTE pForm,
  4645. DWORD cbBuf,
  4646. LPDWORD pcbNeeded,
  4647. LPDWORD pcReturned
  4648. )
  4649. {
  4650. AssertFail("No Unicode Wrapper Available for Win32 API - EnumFormsW");
  4651. return 0;
  4652. }
  4653. WINAPI
  4654. OEnumICMProfilesW(HDC,ICMENUMPROCW,LPARAM)
  4655. {
  4656. AssertFail("No Unicode Wrapper Available for Win32 API - EnumICMProfilesW");
  4657. return 0;
  4658. }
  4659. BOOL
  4660. WINAPI
  4661. OEnumJobsW(
  4662. HANDLE hPrinter,
  4663. DWORD FirstJob,
  4664. DWORD NoJobs,
  4665. DWORD Level,
  4666. LPBYTE pJob,
  4667. DWORD cbBuf,
  4668. LPDWORD pcbNeeded,
  4669. LPDWORD pcReturned
  4670. )
  4671. {
  4672. AssertFail("No Unicode Wrapper Available for Win32 API - EnumJobsW");
  4673. return 0;
  4674. }
  4675. BOOL
  4676. WINAPI
  4677. OEnumMonitorsW(
  4678. LPWSTR pName,
  4679. DWORD Level,
  4680. LPBYTE pMonitors,
  4681. DWORD cbBuf,
  4682. LPDWORD pcbNeeded,
  4683. LPDWORD pcReturned
  4684. )
  4685. {
  4686. AssertFail("No Unicode Wrapper Available for Win32 API - EnumMonitorsW");
  4687. return 0;
  4688. }
  4689. BOOL
  4690. WINAPI
  4691. OEnumPortsW(
  4692. LPWSTR pName,
  4693. DWORD Level,
  4694. LPBYTE pPorts,
  4695. DWORD cbBuf,
  4696. LPDWORD pcbNeeded,
  4697. LPDWORD pcReturned
  4698. )
  4699. {
  4700. AssertFail("No Unicode Wrapper Available for Win32 API - EnumPortsW");
  4701. return 0;
  4702. }
  4703. BOOL
  4704. WINAPI
  4705. OEnumPrinterDriversW(
  4706. LPWSTR pName,
  4707. LPWSTR pEnvironment,
  4708. DWORD Level,
  4709. LPBYTE pDriverInfo,
  4710. DWORD cbBuf,
  4711. LPDWORD pcbNeeded,
  4712. LPDWORD pcReturned
  4713. )
  4714. {
  4715. AssertFail("No Unicode Wrapper Available for Win32 API - EnumPrinterDriversW");
  4716. return 0;
  4717. }
  4718. BOOL
  4719. WINAPI
  4720. OEnumPrintersW(
  4721. DWORD Flags,
  4722. LPWSTR Name,
  4723. DWORD Level,
  4724. LPBYTE pPrinterEnum,
  4725. DWORD cbBuf,
  4726. LPDWORD pcbNeeded,
  4727. LPDWORD pcReturned
  4728. )
  4729. {
  4730. AssertFail("No Unicode Wrapper Available for Win32 API - EnumPrintersW");
  4731. return 0;
  4732. }
  4733. BOOL
  4734. WINAPI
  4735. OEnumPrintProcessorDatatypesW(
  4736. LPWSTR pName,
  4737. LPWSTR pPrintProcessorName,
  4738. DWORD Level,
  4739. LPBYTE pDatatypes,
  4740. DWORD cbBuf,
  4741. LPDWORD pcbNeeded,
  4742. LPDWORD pcReturned
  4743. )
  4744. {
  4745. AssertFail("No Unicode Wrapper Available for Win32 API - EnumPrintProcessorDatatypesW");
  4746. return 0;
  4747. }
  4748. BOOL
  4749. WINAPI
  4750. OEnumPrintProcessorsW(
  4751. LPWSTR pName,
  4752. LPWSTR pEnvironment,
  4753. DWORD Level,
  4754. LPBYTE pPrintProcessorInfo,
  4755. DWORD cbBuf,
  4756. LPDWORD pcbNeeded,
  4757. LPDWORD pcReturned
  4758. )
  4759. {
  4760. AssertFail("No Unicode Wrapper Available for Win32 API - EnumPrintProcessorsW");
  4761. return 0;
  4762. }
  4763. int
  4764. WINAPI
  4765. OEnumPropsW(
  4766. HWND hWnd,
  4767. PROPENUMPROCW lpEnumFunc)
  4768. {
  4769. AssertFail("No Unicode Wrapper Available for Win32 API - EnumPropsW");
  4770. return 0;
  4771. }
  4772. int
  4773. WINAPI
  4774. OEnumPropsExW(
  4775. HWND hWnd,
  4776. PROPENUMPROCEXW lpEnumFunc,
  4777. LPARAM lParam)
  4778. {
  4779. AssertFail("No Unicode Wrapper Available for Win32 API - EnumPropsExW");
  4780. return 0;
  4781. }
  4782. INT
  4783. APIENTRY
  4784. OEnumProtocolsW (
  4785. IN LPINT lpiProtocols,
  4786. IN OUT LPVOID lpProtocolBuffer,
  4787. IN OUT LPDWORD lpdwBufferLength
  4788. )
  4789. {
  4790. AssertFail("No Unicode Wrapper Available for Win32 API - EnumProtocolsW");
  4791. return 0;
  4792. }
  4793. BOOL
  4794. WINAPI
  4795. OEnumResourceLanguagesW(
  4796. HMODULE hModule,
  4797. LPCWSTR lpType,
  4798. LPCWSTR lpName,
  4799. ENUMRESLANGPROC lpEnumFunc,
  4800. LONG lParam
  4801. )
  4802. {
  4803. AssertFail("No Unicode Wrapper Available for Win32 API - EnumResourceLanguagesW");
  4804. return 0;
  4805. }
  4806. BOOL
  4807. WINAPI
  4808. OEnumResourceNamesW(
  4809. HMODULE hModule,
  4810. LPCWSTR lpType,
  4811. ENUMRESNAMEPROC lpEnumFunc,
  4812. LONG lParam
  4813. )
  4814. {
  4815. AssertFail("No Unicode Wrapper Available for Win32 API - EnumResourceNamesW");
  4816. return 0;
  4817. }
  4818. BOOL
  4819. WINAPI
  4820. OEnumResourceTypesW(
  4821. HMODULE hModule,
  4822. ENUMRESTYPEPROC lpEnumFunc,
  4823. LONG lParam
  4824. )
  4825. {
  4826. AssertFail("No Unicode Wrapper Available for Win32 API - EnumResourceTypesW");
  4827. return 0;
  4828. }
  4829. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  4830. BOOL
  4831. WINAPI
  4832. OEnumServicesStatusW(
  4833. SC_HANDLE hSCManager,
  4834. DWORD dwServiceType,
  4835. DWORD dwServiceState,
  4836. LPENUM_SERVICE_STATUSW lpServices,
  4837. DWORD cbBufSize,
  4838. LPDWORD pcbBytesNeeded,
  4839. LPDWORD lpServicesReturned,
  4840. LPDWORD lpResumeHandle
  4841. )
  4842. {
  4843. AssertFail("No Unicode Wrapper Available for Win32 API - EnumServicesStatusW");
  4844. return 0;
  4845. }
  4846. #endif
  4847. BOOL
  4848. WINAPI
  4849. OEnumSystemCodePagesW(
  4850. CODEPAGE_ENUMPROCW lpCodePageEnumProc,
  4851. DWORD dwFlags)
  4852. {
  4853. AssertFail("No Unicode Wrapper Available for Win32 API - EnumSystemCodePagesW");
  4854. return 0;
  4855. }
  4856. BOOL
  4857. WINAPI
  4858. OEnumSystemLocalesW(
  4859. LOCALE_ENUMPROCW lpLocaleEnumProc,
  4860. DWORD dwFlags)
  4861. {
  4862. AssertFail("No Unicode Wrapper Available for Win32 API - EnumSystemLocalesW");
  4863. return 0;
  4864. }
  4865. BOOL
  4866. WINAPI
  4867. OEnumTimeFormatsW(
  4868. TIMEFMT_ENUMPROCW lpTimeFmtEnumProc,
  4869. LCID Locale,
  4870. DWORD dwFlags)
  4871. {
  4872. AssertFail("No Unicode Wrapper Available for Win32 API - EnumTimeFormatsW");
  4873. return 0;
  4874. }
  4875. BOOL
  4876. WINAPI
  4877. OEnumWindowStationsW(
  4878. WINSTAENUMPROCW lpEnumFunc,
  4879. LPARAM lParam)
  4880. {
  4881. AssertFail("No Unicode Wrapper Available for Win32 API - EnumWindowStationsW");
  4882. return 0;
  4883. }
  4884. HICON
  4885. APIENTRY
  4886. OExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon)
  4887. {
  4888. AssertFail("No Unicode Wrapper Available for Win32 API - ExtractAssociatedIconW");
  4889. return 0;
  4890. }
  4891. HICON
  4892. APIENTRY
  4893. OExtractIconW(HINSTANCE hInst, LPCWSTR lpszExeFileName, UINT nIconIndex)
  4894. {
  4895. AssertFail("No Unicode Wrapper Available for Win32 API - ExtractIconW");
  4896. return 0;
  4897. }
  4898. UINT
  4899. WINAPI
  4900. OExtractIconExW(LPCWSTR lpszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons)
  4901. {
  4902. AssertFail("No Unicode Wrapper Available for Win32 API - ExtractIconExW");
  4903. return 0;
  4904. }
  4905. // Commented since gdi32.dll on Win95 provides the wrapper for this function.
  4906. /*
  4907. BOOL
  4908. WINAPI
  4909. OExtTextOutW(HDC, int, int, UINT, CONST RECT *,LPCWSTR, UINT, CONST INT *)
  4910. {
  4911. AssertFail("No Unicode Wrapper Available for Win32 API - ExtTextOutW");
  4912. return 0;
  4913. }
  4914. */
  4915. BOOL
  4916. WINAPI
  4917. OFillConsoleOutputCharacterW(
  4918. HANDLE hConsoleOutput,
  4919. WCHAR cCharacter,
  4920. DWORD nLength,
  4921. COORD dwWriteCoord,
  4922. LPDWORD lpNumberOfCharsWritten
  4923. )
  4924. {
  4925. AssertFail("No Unicode Wrapper Available for Win32 API - FillConsoleOutputCharacterW");
  4926. return 0;
  4927. }
  4928. LPWSTR
  4929. APIENTRY
  4930. OFindEnvironmentStringW(LPWSTR szEnvVar)
  4931. {
  4932. AssertFail("No Unicode Wrapper Available for Win32 API - FindEnvironmentStringW");
  4933. return 0;
  4934. }
  4935. HINSTANCE
  4936. APIENTRY
  4937. OFindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult)
  4938. {
  4939. AssertFail("No Unicode Wrapper Available for Win32 API - FindExecutableW");
  4940. return 0;
  4941. }
  4942. HRSRC
  4943. WINAPI
  4944. OFindResourceExW(
  4945. HMODULE hModule,
  4946. LPCWSTR lpType,
  4947. LPCWSTR lpName,
  4948. WORD wLanguage
  4949. )
  4950. {
  4951. AssertFail("No Unicode Wrapper Available for Win32 API - FindResourceExW");
  4952. return 0;
  4953. }
  4954. APIENTRY
  4955. OFindTextW(LPFINDREPLACEW)
  4956. {
  4957. AssertFail("No Unicode Wrapper Available for Win32 API - FindTextW");
  4958. return 0;
  4959. }
  4960. HWND
  4961. WINAPI
  4962. OFindWindowExW(HWND, HWND, LPCWSTR, LPCWSTR)
  4963. {
  4964. AssertFail("No Unicode Wrapper Available for Win32 API - FindWindowExW");
  4965. return 0;
  4966. }
  4967. int
  4968. WINAPI
  4969. OFoldStringW(
  4970. DWORD dwMapFlags,
  4971. LPCWSTR lpSrcStr,
  4972. int cchSrc,
  4973. LPWSTR lpDestStr,
  4974. int cchDest)
  4975. {
  4976. AssertFail("No Unicode Wrapper Available for Win32 API - FoldStringW");
  4977. return 0;
  4978. }
  4979. BOOL
  4980. WINAPI
  4981. OGetBinaryTypeW(
  4982. LPCWSTR lpApplicationName,
  4983. LPDWORD lpBinaryType
  4984. )
  4985. {
  4986. AssertFail("No Unicode Wrapper Available for Win32 API - GetBinaryTypeW");
  4987. return 0;
  4988. }
  4989. DWORD
  4990. WINAPI
  4991. OGetCharacterPlacementW(HDC, LPCWSTR, int, int, LPGCP_RESULTSW, DWORD)
  4992. {
  4993. AssertFail("No Unicode Wrapper Available for Win32 API - GetCharacterPlacementW");
  4994. return 0;
  4995. }
  4996. BOOL
  4997. WINAPI
  4998. OGetCharWidth32W(HDC, UINT, UINT, LPINT)
  4999. {
  5000. AssertFail("No Unicode Wrapper Available for Win32 API - GetCharWidth32W");
  5001. return 0;
  5002. }
  5003. LPWSTR
  5004. WINAPI
  5005. OGetCommandLineW(
  5006. VOID
  5007. )
  5008. {
  5009. AssertFail("No Unicode Wrapper Available for Win32 API - GetCommandLineW");
  5010. return 0;
  5011. }
  5012. DWORD
  5013. WINAPI
  5014. OGetCompressedFileSizeW(
  5015. LPCWSTR lpFileName,
  5016. LPDWORD lpFileSizeHigh
  5017. )
  5018. {
  5019. AssertFail("No Unicode Wrapper Available for Win32 API - GetCompressedFileSizeW");
  5020. return 0;
  5021. }
  5022. BOOL
  5023. WINAPI
  5024. OGetComputerNameW (
  5025. LPWSTR lpBuffer,
  5026. LPDWORD nSize
  5027. )
  5028. {
  5029. AssertFail("No Unicode Wrapper Available for Win32 API - GetComputerNameW");
  5030. return 0;
  5031. }
  5032. DWORD
  5033. WINAPI
  5034. OGetConsoleTitleW(
  5035. LPWSTR lpConsoleTitle,
  5036. DWORD nSize
  5037. )
  5038. {
  5039. AssertFail("No Unicode Wrapper Available for Win32 API - GetConsoleTitleW");
  5040. return 0;
  5041. }
  5042. int
  5043. WINAPI
  5044. OGetCurrencyFormatW(
  5045. LCID Locale,
  5046. DWORD dwFlags,
  5047. LPCWSTR lpValue,
  5048. CONST CURRENCYFMTW *lpFormat,
  5049. LPWSTR lpCurrencyStr,
  5050. int cchCurrency)
  5051. {
  5052. AssertFail("No Unicode Wrapper Available for Win32 API - GetCurrencyFormatW");
  5053. return 0;
  5054. }
  5055. int
  5056. WINAPI
  5057. OGetDateFormatW(
  5058. LCID Locale,
  5059. DWORD dwFlags,
  5060. CONST SYSTEMTIME *lpDate,
  5061. LPCWSTR lpFormat,
  5062. LPWSTR lpDateStr,
  5063. int cchDate)
  5064. {
  5065. AssertFail("No Unicode Wrapper Available for Win32 API - GetDateFormatW");
  5066. return 0;
  5067. }
  5068. BOOL
  5069. WINAPI
  5070. OGetDefaultCommConfigW(
  5071. LPCWSTR lpszName,
  5072. LPCOMMCONFIG lpCC,
  5073. LPDWORD lpdwSize
  5074. )
  5075. {
  5076. AssertFail("No Unicode Wrapper Available for Win32 API - GetDefaultCommConfigW");
  5077. return 0;
  5078. }
  5079. BOOL
  5080. WINAPI
  5081. OGetDiskFreeSpaceW(
  5082. LPCWSTR lpRootPathName,
  5083. LPDWORD lpSectorsPerCluster,
  5084. LPDWORD lpBytesPerSector,
  5085. LPDWORD lpNumberOfFreeClusters,
  5086. LPDWORD lpTotalNumberOfClusters
  5087. )
  5088. {
  5089. AssertFail("No Unicode Wrapper Available for Win32 API - GetDiskFreeSpaceW");
  5090. return 0;
  5091. }
  5092. UINT
  5093. WINAPI
  5094. OGetDriveTypeW(
  5095. LPCWSTR lpRootPathName
  5096. )
  5097. {
  5098. AssertFail("No Unicode Wrapper Available for Win32 API - GetDriveTypeW");
  5099. return 0;
  5100. }
  5101. HENHMETAFILE
  5102. WINAPI
  5103. OGetEnhMetaFileW(LPCWSTR)
  5104. {
  5105. AssertFail("No Unicode Wrapper Available for Win32 API - GetEnhMetaFileW");
  5106. return 0;
  5107. }
  5108. UINT
  5109. WINAPI
  5110. OGetEnhMetaFileDescriptionW(HENHMETAFILE, UINT, LPWSTR )
  5111. {
  5112. AssertFail("No Unicode Wrapper Available for Win32 API - GetEnhMetaFileDescriptionW");
  5113. return 0;
  5114. }
  5115. DWORD
  5116. WINAPI
  5117. OGetEnvironmentVariableW(
  5118. LPCWSTR lpName,
  5119. LPWSTR lpBuffer,
  5120. DWORD nSize
  5121. )
  5122. {
  5123. AssertFail("No Unicode Wrapper Available for Win32 API - GetEnvironmentVariableW");
  5124. return 0;
  5125. }
  5126. INT
  5127. APIENTRY
  5128. OGetExpandedNameW(
  5129. LPWSTR,
  5130. LPWSTR
  5131. )
  5132. {
  5133. AssertFail("No Unicode Wrapper Available for Win32 API - GetExpandedNameW");
  5134. return 0;
  5135. }
  5136. BOOL
  5137. WINAPI
  5138. OGetFileSecurityW (
  5139. LPCWSTR lpFileName,
  5140. SECURITY_INFORMATION RequestedInformation,
  5141. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5142. DWORD nLength,
  5143. LPDWORD lpnLengthNeeded
  5144. )
  5145. {
  5146. AssertFail("No Unicode Wrapper Available for Win32 API - GetFileSecurityW");
  5147. return 0;
  5148. }
  5149. short
  5150. WINAPI
  5151. OGetFileTitleW
  5152. (
  5153. LPCWSTR pwszFile,
  5154. LPWSTR pwszOut,
  5155. WORD w
  5156. )
  5157. {
  5158. AssertFail("No Unicode Wrapper Available for Win32 API - GetFileTitleW");
  5159. return 0;
  5160. }
  5161. BOOL
  5162. WINAPI
  5163. OGetFileVersionInfoW(
  5164. LPWSTR lpszFile,
  5165. DWORD dwHandle,
  5166. DWORD cbBuf,
  5167. LPVOID lpvData)
  5168. {
  5169. AssertFail("No Unicode Wrapper Available for Win32 API - GetFileVersionInfoW");
  5170. return 0;
  5171. }
  5172. DWORD
  5173. WINAPI
  5174. OGetFileVersionInfoSizeW(
  5175. LPWSTR lpszFile,
  5176. LPDWORD lpdwHandle)
  5177. {
  5178. AssertFail("No Unicode Wrapper Available for Win32 API - GetFileVersionInfoSizeW");
  5179. return 0;
  5180. }
  5181. BOOL
  5182. WINAPI
  5183. OGetFormW(
  5184. HANDLE hPrinter,
  5185. LPWSTR pFormName,
  5186. DWORD Level,
  5187. LPBYTE pForm,
  5188. DWORD cbBuf,
  5189. LPDWORD pcbNeeded
  5190. )
  5191. {
  5192. AssertFail("No Unicode Wrapper Available for Win32 API - GetFormW");
  5193. return 0;
  5194. }
  5195. WINAPI OGetICMProfileW(HDC,LPDWORD,LPWSTR)
  5196. {
  5197. AssertFail("No Unicode Wrapper Available for Win32 API - GetICMProfileW");
  5198. return 0;
  5199. }
  5200. BOOL
  5201. WINAPI
  5202. OGetJobW(
  5203. HANDLE hPrinter,
  5204. DWORD JobId,
  5205. DWORD Level,
  5206. LPBYTE pJob,
  5207. DWORD cbBuf,
  5208. LPDWORD pcbNeeded
  5209. )
  5210. {
  5211. AssertFail("No Unicode Wrapper Available for Win32 API - GetJobW");
  5212. return 0;
  5213. }
  5214. BOOL
  5215. WINAPI
  5216. OGetKeyboardLayoutNameW(
  5217. LPWSTR pwszKLID)
  5218. {
  5219. AssertFail("No Unicode Wrapper Available for Win32 API - GetKeyboardLayoutNameW");
  5220. return 0;
  5221. }
  5222. WINAPI OGetLogColorSpaceW(HCOLORSPACE,LPLOGCOLORSPACEW,DWORD)
  5223. {
  5224. AssertFail("No Unicode Wrapper Available for Win32 API - GetLogColorSpaceW");
  5225. return 0;
  5226. }
  5227. DWORD
  5228. WINAPI
  5229. OGetLogicalDriveStringsW(
  5230. DWORD nBufferLength,
  5231. LPWSTR lpBuffer
  5232. )
  5233. {
  5234. AssertFail("No Unicode Wrapper Available for Win32 API - GetLogicalDriveStringsW");
  5235. return 0;
  5236. }
  5237. BOOL
  5238. WINAPI
  5239. OGetMenuItemInfoW(
  5240. HMENU,
  5241. UINT,
  5242. BOOL,
  5243. LPMENUITEMINFOW
  5244. )
  5245. {
  5246. AssertFail("No Unicode Wrapper Available for Win32 API - GetMenuItemInfoW");
  5247. return 0;
  5248. }
  5249. HMETAFILE WINAPI OGetMetaFileW(LPCWSTR)
  5250. {
  5251. AssertFail("No Unicode Wrapper Available for Win32 API - GetMetaFileW");
  5252. return 0;
  5253. }
  5254. INT
  5255. APIENTRY
  5256. OGetNameByTypeW (
  5257. IN LPGUID lpServiceType,
  5258. IN OUT LPWSTR lpServiceName,
  5259. IN DWORD dwNameLength
  5260. )
  5261. {
  5262. AssertFail("No Unicode Wrapper Available for Win32 API - GetNameByTypeW");
  5263. return 0;
  5264. }
  5265. BOOL
  5266. WINAPI
  5267. OGetNamedPipeHandleStateW(
  5268. HANDLE hNamedPipe,
  5269. LPDWORD lpState,
  5270. LPDWORD lpCurInstances,
  5271. LPDWORD lpMaxCollectionCount,
  5272. LPDWORD lpCollectDataTimeout,
  5273. LPWSTR lpUserName,
  5274. DWORD nMaxUserNameSize
  5275. )
  5276. {
  5277. AssertFail("No Unicode Wrapper Available for Win32 API - GetNamedPipeHandleStateW");
  5278. return 0;
  5279. }
  5280. int
  5281. WINAPI
  5282. OGetNumberFormatW(
  5283. LCID Locale,
  5284. DWORD dwFlags,
  5285. LPCWSTR lpValue,
  5286. CONST NUMBERFMTW *lpFormat,
  5287. LPWSTR lpNumberStr,
  5288. int cchNumber)
  5289. {
  5290. AssertFail("No Unicode Wrapper Available for Win32 API - GetNumberFormatW");
  5291. return 0;
  5292. }
  5293. BOOL
  5294. WINAPI
  5295. OGetPrinterW(
  5296. HANDLE hPrinter,
  5297. DWORD Level,
  5298. LPBYTE pPrinter,
  5299. DWORD cbBuf,
  5300. LPDWORD pcbNeeded
  5301. )
  5302. {
  5303. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrinterW");
  5304. return 0;
  5305. }
  5306. DWORD
  5307. WINAPI
  5308. OGetPrinterDataW(
  5309. HANDLE hPrinter,
  5310. LPWSTR pValueName,
  5311. LPDWORD pType,
  5312. LPBYTE pData,
  5313. DWORD nSize,
  5314. LPDWORD pcbNeeded
  5315. )
  5316. {
  5317. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrinterDataW");
  5318. return 0;
  5319. }
  5320. BOOL
  5321. WINAPI
  5322. OGetPrinterDriverW(
  5323. HANDLE hPrinter,
  5324. LPWSTR pEnvironment,
  5325. DWORD Level,
  5326. LPBYTE pDriverInfo,
  5327. DWORD cbBuf,
  5328. LPDWORD pcbNeeded
  5329. )
  5330. {
  5331. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrinterDriverW");
  5332. return 0;
  5333. }
  5334. BOOL
  5335. WINAPI
  5336. OGetPrinterDriverDirectoryW(
  5337. LPWSTR pName,
  5338. LPWSTR pEnvironment,
  5339. DWORD Level,
  5340. LPBYTE pDriverDirectory,
  5341. DWORD cbBuf,
  5342. LPDWORD pcbNeeded
  5343. )
  5344. {
  5345. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrinterDriverDirectoryW");
  5346. return 0;
  5347. }
  5348. BOOL
  5349. WINAPI
  5350. OGetPrintProcessorDirectoryW(
  5351. LPWSTR pName,
  5352. LPWSTR pEnvironment,
  5353. DWORD Level,
  5354. LPBYTE pPrintProcessorInfo,
  5355. DWORD cbBuf,
  5356. LPDWORD pcbNeeded
  5357. )
  5358. {
  5359. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrintProcessorDirectoryW");
  5360. return 0;
  5361. }
  5362. DWORD
  5363. WINAPI
  5364. OGetPrivateProfileSectionW(
  5365. LPCWSTR lpAppName,
  5366. LPWSTR lpReturnedString,
  5367. DWORD nSize,
  5368. LPCWSTR lpFileName
  5369. )
  5370. {
  5371. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrivateProfileSectionW");
  5372. return 0;
  5373. }
  5374. DWORD
  5375. WINAPI
  5376. OGetPrivateProfileSectionNamesW(
  5377. LPWSTR lpszReturnBuffer,
  5378. DWORD nSize,
  5379. LPCWSTR lpFileName
  5380. )
  5381. {
  5382. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrivateProfileSectionNamesW");
  5383. return 0;
  5384. }
  5385. BOOL
  5386. WINAPI
  5387. OGetPrivateProfileStructW(
  5388. LPCWSTR lpszSection,
  5389. LPCWSTR lpszKey,
  5390. LPVOID lpStruct,
  5391. UINT uSizeStruct,
  5392. LPCWSTR szFile
  5393. )
  5394. {
  5395. AssertFail("No Unicode Wrapper Available for Win32 API - GetPrivateProfileStructW");
  5396. return 0;
  5397. }
  5398. DWORD
  5399. WINAPI
  5400. OGetProfileSectionW(
  5401. LPCWSTR lpAppName,
  5402. LPWSTR lpReturnedString,
  5403. DWORD nSize
  5404. )
  5405. {
  5406. AssertFail("No Unicode Wrapper Available for Win32 API - GetProfileSectionW");
  5407. return 0;
  5408. }
  5409. DWORD
  5410. WINAPI
  5411. OGetProfileStringW(
  5412. LPCWSTR lpAppName,
  5413. LPCWSTR lpKeyName,
  5414. LPCWSTR lpDefault,
  5415. LPWSTR lpReturnedString,
  5416. DWORD nSize
  5417. )
  5418. {
  5419. AssertFail("No Unicode Wrapper Available for Win32 API - GetProfileStringW");
  5420. return 0;
  5421. }
  5422. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  5423. BOOL
  5424. WINAPI
  5425. OGetServiceDisplayNameW(
  5426. SC_HANDLE hSCManager,
  5427. LPCWSTR lpServiceName,
  5428. LPWSTR lpDisplayName,
  5429. LPDWORD lpcchBuffer
  5430. )
  5431. {
  5432. AssertFail("No Unicode Wrapper Available for Win32 API - GetServiceDisplayNameW");
  5433. return 0;
  5434. }
  5435. BOOL
  5436. WINAPI
  5437. OGetServiceKeyNameW(
  5438. SC_HANDLE hSCManager,
  5439. LPCWSTR lpDisplayName,
  5440. LPWSTR lpServiceName,
  5441. LPDWORD lpcchBuffer
  5442. )
  5443. {
  5444. AssertFail("No Unicode Wrapper Available for Win32 API - GetServiceKeyNameW");
  5445. return 0;
  5446. }
  5447. #endif
  5448. DWORD
  5449. WINAPI
  5450. OGetShortPathNameW(
  5451. LPCWSTR lpszLongPath,
  5452. LPWSTR lpszShortPath,
  5453. DWORD cchBuffer
  5454. )
  5455. {
  5456. AssertFail("No Unicode Wrapper Available for Win32 API - GetShortPathNameW");
  5457. return 0;
  5458. }
  5459. VOID
  5460. WINAPI
  5461. OGetStartupInfoW(
  5462. LPSTARTUPINFOW lpStartupInfo
  5463. )
  5464. {
  5465. AssertFail("No Unicode Wrapper Available for Win32 API - GetStartupInfoW");
  5466. return;
  5467. }
  5468. BOOL
  5469. WINAPI
  5470. OGetStringTypeExW(
  5471. LCID Locale,
  5472. DWORD dwInfoType,
  5473. LPCWSTR lpSrcStr,
  5474. int cchSrc,
  5475. LPWORD lpCharType)
  5476. {
  5477. AssertFail("No Unicode Wrapper Available for Win32 API - GetStringTypeExW");
  5478. return 0;
  5479. }
  5480. UINT
  5481. WINAPI
  5482. OGetSystemDirectoryW(
  5483. LPWSTR lpBuffer,
  5484. UINT uSize
  5485. )
  5486. {
  5487. AssertFail("No Unicode Wrapper Available for Win32 API - GetSystemDirectoryW");
  5488. return 0;
  5489. }
  5490. int
  5491. WINAPI
  5492. OGetTimeFormatW(
  5493. LCID Locale,
  5494. DWORD dwFlags,
  5495. CONST SYSTEMTIME *lpTime,
  5496. LPCWSTR lpFormat,
  5497. LPWSTR lpTimeStr,
  5498. int cchTime)
  5499. {
  5500. AssertFail("No Unicode Wrapper Available for Win32 API - GetTimeFormatW");
  5501. return 0;
  5502. }
  5503. INT
  5504. APIENTRY
  5505. OGetTypeByNameW (
  5506. IN LPWSTR lpServiceName,
  5507. IN OUT LPGUID lpServiceType
  5508. )
  5509. {
  5510. AssertFail("No Unicode Wrapper Available for Win32 API - GetTypeByNameW");
  5511. return 0;
  5512. }
  5513. BOOL
  5514. WINAPI
  5515. OGetUserObjectInformationW(
  5516. HANDLE hObj,
  5517. int nIndex,
  5518. PVOID pvInfo,
  5519. DWORD nLength,
  5520. LPDWORD lpnLengthNeeded)
  5521. {
  5522. AssertFail("No Unicode Wrapper Available for Win32 API - GetUserObjectInformationW");
  5523. return 0;
  5524. }
  5525. UINT
  5526. WINAPI
  5527. OGetWindowsDirectoryW(
  5528. LPWSTR lpBuffer,
  5529. UINT uSize
  5530. )
  5531. {
  5532. AssertFail("No Unicode Wrapper Available for Win32 API - GetWindowsDirectoryW");
  5533. return 0;
  5534. }
  5535. ATOM
  5536. WINAPI
  5537. OGlobalFindAtomW(
  5538. LPCWSTR lpString
  5539. )
  5540. {
  5541. AssertFail("No Unicode Wrapper Available for Win32 API - GlobalFindAtomW");
  5542. return 0;
  5543. }
  5544. RPC_STATUS RPC_ENTRY
  5545. OI_RpcServerUnregisterEndpointW (
  5546. IN unsigned short * Protseq,
  5547. IN unsigned short * Endpoint
  5548. )
  5549. {
  5550. AssertFail("No Unicode Wrapper Available for Win32 API - I_RpcServerUnregisterEndpointW");
  5551. return 0;
  5552. }
  5553. HIMAGELIST
  5554. WINAPI
  5555. OImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, int cx, int cGrow, COLORREF crMask, UINT uType, UINT uFlags)
  5556. {
  5557. AssertFail("No Unicode Wrapper Available for Win32 API - ImageList_LoadImageW");
  5558. return 0;
  5559. }
  5560. WINAPI
  5561. OImmConfigureIMEW(HKL, HWND, DWORD, LPVOID)
  5562. {
  5563. AssertFail("No Unicode Wrapper Available for Win32 API - ImmConfigureIMEW");
  5564. return 0;
  5565. }
  5566. WINAPI
  5567. OImmEnumRegisterWordW(HKL, REGISTERWORDENUMPROCW, LPCWSTR lpszReading, DWORD, LPCWSTR lpszRegister, LPVOID)
  5568. {
  5569. AssertFail("No Unicode Wrapper Available for Win32 API - ImmEnumRegisterWordW");
  5570. return 0;
  5571. }
  5572. WINAPI
  5573. OImmEscapeW(HKL, HIMC, UINT, LPVOID)
  5574. {
  5575. AssertFail("No Unicode Wrapper Available for Win32 API - ImmEscapeW");
  5576. return 0;
  5577. }
  5578. WINAPI
  5579. OImmGetCandidateListW(HIMC, DWORD deIndex, LPCANDIDATELIST, DWORD dwBufLen)
  5580. {
  5581. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetCandidateListW");
  5582. return 0;
  5583. }
  5584. WINAPI
  5585. OImmGetCandidateListCountW(HIMC, LPDWORD lpdwListCount)
  5586. {
  5587. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetCandidateListCountW");
  5588. return 0;
  5589. }
  5590. WINAPI
  5591. OImmGetCompositionFontW(HIMC, LPLOGFONTW)
  5592. {
  5593. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetCompositionFontW");
  5594. return 0;
  5595. }
  5596. WINAPI
  5597. OImmGetCompositionStringW(HIMC, DWORD, LPVOID, DWORD)
  5598. {
  5599. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetCompositionStringW");
  5600. return 0;
  5601. }
  5602. WINAPI
  5603. OImmGetConversionListW(HKL, HIMC, LPCWSTR, LPCANDIDATELIST, DWORD dwBufLen, UINT uFlag)
  5604. {
  5605. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetConversionListW");
  5606. return 0;
  5607. }
  5608. WINAPI
  5609. OImmGetDescriptionW(HKL, LPWSTR, UINT uBufLen)
  5610. {
  5611. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetDescriptionW");
  5612. return 0;
  5613. }
  5614. WINAPI
  5615. OImmGetGuideLineW(HIMC, DWORD dwIndex, LPWSTR, DWORD dwBufLen)
  5616. {
  5617. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetGuideLineW");
  5618. return 0;
  5619. }
  5620. WINAPI
  5621. OImmGetIMEFileNameW(HKL, LPWSTR, UINT uBufLen)
  5622. {
  5623. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetIMEFileNameW");
  5624. return 0;
  5625. }
  5626. WINAPI
  5627. OImmGetRegisterWordStyleW(HKL, UINT nItem, LPSTYLEBUFW)
  5628. {
  5629. AssertFail("No Unicode Wrapper Available for Win32 API - ImmGetRegisterWordStyleW");
  5630. return 0;
  5631. }
  5632. WINAPI
  5633. OImmInstallIMEW(LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText)
  5634. {
  5635. AssertFail("No Unicode Wrapper Available for Win32 API - ImmInstallIMEW");
  5636. return 0;
  5637. }
  5638. WINAPI
  5639. OImmIsUIMessageW(HWND, UINT, WPARAM, LPARAM)
  5640. {
  5641. AssertFail("No Unicode Wrapper Available for Win32 API - ImmIsUIMessageW");
  5642. return 0;
  5643. }
  5644. WINAPI
  5645. OImmRegisterWordW(HKL, LPCWSTR lpszReading, DWORD, LPCWSTR lpszRegister)
  5646. {
  5647. AssertFail("No Unicode Wrapper Available for Win32 API - ImmRegisterWordW");
  5648. return 0;
  5649. }
  5650. WINAPI
  5651. OImmSetCompositionFontW(HIMC, LPLOGFONTW)
  5652. {
  5653. AssertFail("No Unicode Wrapper Available for Win32 API - ImmSetCompositionFontW");
  5654. return 0;
  5655. }
  5656. WINAPI
  5657. OImmSetCompositionStringW(HIMC, DWORD dwIndex, LPCVOID lpComp, DWORD, LPCVOID lpRead, DWORD)
  5658. {
  5659. AssertFail("No Unicode Wrapper Available for Win32 API - ImmSetCompositionStringW");
  5660. return 0;
  5661. }
  5662. WINAPI
  5663. OImmUnregisterWordW(HKL, LPCWSTR lpszReading, DWORD, LPCWSTR lpszUnregister)
  5664. {
  5665. AssertFail("No Unicode Wrapper Available for Win32 API - ImmUnregisterWordW");
  5666. return 0;
  5667. }
  5668. BOOL
  5669. APIENTRY
  5670. OInitiateSystemShutdownW(
  5671. LPWSTR lpMachineName,
  5672. LPWSTR lpMessage,
  5673. DWORD dwTimeout,
  5674. BOOL bForceAppsClosed,
  5675. BOOL bRebootAfterShutdown
  5676. )
  5677. {
  5678. AssertFail("No Unicode Wrapper Available for Win32 API - InitiateSystemShutdownW");
  5679. return 0;
  5680. }
  5681. BOOL
  5682. WINAPI
  5683. OInsertMenuItemW(
  5684. HMENU,
  5685. UINT,
  5686. BOOL,
  5687. LPCMENUITEMINFOW
  5688. )
  5689. {
  5690. AssertFail("No Unicode Wrapper Available for Win32 API - InsertMenuItemW");
  5691. return 0;
  5692. }
  5693. BOOL
  5694. WINAPI
  5695. OIsCharLowerW(
  5696. WCHAR ch)
  5697. {
  5698. AssertFail("No Unicode Wrapper Available for Win32 API - IsCharLowerW");
  5699. return 0;
  5700. }
  5701. BOOL
  5702. WINAPI
  5703. OIsCharUpperW(
  5704. WCHAR ch)
  5705. {
  5706. AssertFail("No Unicode Wrapper Available for Win32 API - IsCharUpperW");
  5707. return 0;
  5708. }
  5709. MMRESULT
  5710. WINAPI
  5711. OjoyGetDevCapsW(UINT uJoyID, LPJOYCAPSW pjc, UINT cbjc)
  5712. {
  5713. AssertFail("No Unicode Wrapper Available for Win32 API - joyGetDevCapsW");
  5714. return 0;
  5715. }
  5716. HCURSOR
  5717. WINAPI
  5718. OLoadCursorFromFileW(
  5719. LPCWSTR lpFileName)
  5720. {
  5721. AssertFail("No Unicode Wrapper Available for Win32 API - LoadCursorFromFileW");
  5722. return 0;
  5723. }
  5724. HKL
  5725. WINAPI
  5726. OLoadKeyboardLayoutW(
  5727. LPCWSTR pwszKLID,
  5728. UINT Flags)
  5729. {
  5730. AssertFail("No Unicode Wrapper Available for Win32 API - LoadKeyboardLayoutW");
  5731. return 0;
  5732. }
  5733. BOOL
  5734. WINAPI
  5735. OLogonUserW (
  5736. LPWSTR lpszUsername,
  5737. LPWSTR lpszDomain,
  5738. LPWSTR lpszPassword,
  5739. DWORD dwLogonType,
  5740. DWORD dwLogonProvider,
  5741. PHANDLE phToken
  5742. )
  5743. {
  5744. AssertFail("No Unicode Wrapper Available for Win32 API - LogonUserW");
  5745. return 0;
  5746. }
  5747. INT
  5748. APIENTRY
  5749. OLZOpenFileW(
  5750. LPWSTR,
  5751. LPOFSTRUCT,
  5752. WORD
  5753. )
  5754. {
  5755. AssertFail("No Unicode Wrapper Available for Win32 API - LZOpenFileW");
  5756. return 0;
  5757. }
  5758. UINT
  5759. WINAPI
  5760. OMapVirtualKeyExW(
  5761. UINT uCode,
  5762. UINT uMapType,
  5763. HKL dwhkl)
  5764. {
  5765. AssertFail("No Unicode Wrapper Available for Win32 API - MapVirtualKeyExW");
  5766. return 0;
  5767. }
  5768. HRESULT
  5769. WINAPI
  5770. OMIMEAssociationDialogW(HWND hwndParent,
  5771. DWORD dwInFlags,
  5772. PCWSTR pcszFile,
  5773. PCWSTR pcszMIMEContentType,
  5774. PWSTR pszAppBuf,
  5775. UINT ucAppBufLen)
  5776. {
  5777. AssertFail("No Unicode Wrapper Available for Win32 API - MIMEAssociationDialogW");
  5778. return 0;
  5779. }
  5780. DWORD
  5781. APIENTRY
  5782. OMultinetGetConnectionPerformanceW(
  5783. LPNETRESOURCEW lpNetResource,
  5784. LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct
  5785. )
  5786. {
  5787. AssertFail("No Unicode Wrapper Available for Win32 API - MultinetGetConnectionPerformanceW");
  5788. return 0;
  5789. }
  5790. BOOL
  5791. WINAPI
  5792. OObjectCloseAuditAlarmW (
  5793. LPCWSTR SubsystemName,
  5794. LPVOID HandleId,
  5795. BOOL GenerateOnClose
  5796. )
  5797. {
  5798. AssertFail("No Unicode Wrapper Available for Win32 API - ObjectCloseAuditAlarmW");
  5799. return 0;
  5800. }
  5801. BOOL
  5802. WINAPI
  5803. OObjectOpenAuditAlarmW (
  5804. LPCWSTR SubsystemName,
  5805. LPVOID HandleId,
  5806. LPWSTR ObjectTypeName,
  5807. LPWSTR ObjectName,
  5808. PSECURITY_DESCRIPTOR pSecurityDescriptor,
  5809. HANDLE ClientToken,
  5810. DWORD DesiredAccess,
  5811. DWORD GrantedAccess,
  5812. PPRIVILEGE_SET Privileges,
  5813. BOOL ObjectCreation,
  5814. BOOL AccessGranted,
  5815. LPBOOL GenerateOnClose
  5816. )
  5817. {
  5818. AssertFail("No Unicode Wrapper Available for Win32 API - ObjectOpenAuditAlarmW");
  5819. return 0;
  5820. }
  5821. BOOL
  5822. WINAPI
  5823. OObjectPrivilegeAuditAlarmW (
  5824. LPCWSTR SubsystemName,
  5825. LPVOID HandleId,
  5826. HANDLE ClientToken,
  5827. DWORD DesiredAccess,
  5828. PPRIVILEGE_SET Privileges,
  5829. BOOL AccessGranted
  5830. )
  5831. {
  5832. AssertFail("No Unicode Wrapper Available for Win32 API - ObjectPrivilegeAuditAlarmW");
  5833. return 0;
  5834. }
  5835. BOOL
  5836. WINAPI
  5837. OOemToCharBuffW(
  5838. LPCSTR lpszSrc,
  5839. LPWSTR lpszDst,
  5840. DWORD cchDstLength)
  5841. {
  5842. AssertFail("No Unicode Wrapper Available for Win32 API - OemToCharBuffW");
  5843. return 0;
  5844. }
  5845. HANDLE
  5846. WINAPI
  5847. OOpenBackupEventLogW (
  5848. LPCWSTR lpUNCServerName,
  5849. LPCWSTR lpFileName
  5850. )
  5851. {
  5852. AssertFail("No Unicode Wrapper Available for Win32 API - OpenBackupEventLogW");
  5853. return 0;
  5854. }
  5855. HDESK
  5856. WINAPI
  5857. OOpenDesktopW(
  5858. LPWSTR lpszDesktop,
  5859. DWORD dwFlags,
  5860. BOOL fInherit,
  5861. DWORD dwDesiredAccess)
  5862. {
  5863. AssertFail("No Unicode Wrapper Available for Win32 API - OpenDesktopW");
  5864. return 0;
  5865. }
  5866. HANDLE
  5867. WINAPI
  5868. OOpenEventW(
  5869. DWORD dwDesiredAccess,
  5870. BOOL bInheritHandle,
  5871. LPCWSTR lpName
  5872. )
  5873. {
  5874. AssertFail("No Unicode Wrapper Available for Win32 API - OpenEventW");
  5875. return 0;
  5876. }
  5877. HANDLE
  5878. WINAPI
  5879. OOpenEventLogW (
  5880. LPCWSTR lpUNCServerName,
  5881. LPCWSTR lpSourceName
  5882. )
  5883. {
  5884. AssertFail("No Unicode Wrapper Available for Win32 API - OpenEventLogW");
  5885. return 0;
  5886. }
  5887. HANDLE
  5888. WINAPI
  5889. OOpenFileMappingW(
  5890. DWORD dwDesiredAccess,
  5891. BOOL bInheritHandle,
  5892. LPCWSTR lpName
  5893. )
  5894. {
  5895. AssertFail("No Unicode Wrapper Available for Win32 API - OpenFileMappingW");
  5896. return 0;
  5897. }
  5898. HANDLE
  5899. WINAPI
  5900. OOpenMutexW(
  5901. DWORD dwDesiredAccess,
  5902. BOOL bInheritHandle,
  5903. LPCWSTR lpName
  5904. )
  5905. {
  5906. AssertFail("No Unicode Wrapper Available for Win32 API - OpenMutexW");
  5907. return 0;
  5908. }
  5909. BOOL
  5910. WINAPI
  5911. OOpenPrinterW(
  5912. LPWSTR pPrinterName,
  5913. LPHANDLE phPrinter,
  5914. LPPRINTER_DEFAULTSW pDefault
  5915. )
  5916. {
  5917. AssertFail("No Unicode Wrapper Available for Win32 API - OpenPrinterW");
  5918. return 0;
  5919. }
  5920. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  5921. SC_HANDLE
  5922. WINAPI
  5923. OOpenSCManagerW(
  5924. LPCWSTR lpMachineName,
  5925. LPCWSTR lpDatabaseName,
  5926. DWORD dwDesiredAccess
  5927. )
  5928. {
  5929. AssertFail("No Unicode Wrapper Available for Win32 API - OpenSCManagerW");
  5930. return 0;
  5931. }
  5932. #endif
  5933. HANDLE
  5934. WINAPI
  5935. OOpenSemaphoreW(
  5936. DWORD dwDesiredAccess,
  5937. BOOL bInheritHandle,
  5938. LPCWSTR lpName
  5939. )
  5940. {
  5941. AssertFail("No Unicode Wrapper Available for Win32 API - OpenSemaphoreW");
  5942. return 0;
  5943. }
  5944. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  5945. SC_HANDLE
  5946. WINAPI
  5947. OOpenServiceW(
  5948. SC_HANDLE hSCManager,
  5949. LPCWSTR lpServiceName,
  5950. DWORD dwDesiredAccess
  5951. )
  5952. {
  5953. AssertFail("No Unicode Wrapper Available for Win32 API - OpenServiceW");
  5954. return 0;
  5955. }
  5956. #endif
  5957. HWINSTA
  5958. WINAPI
  5959. OOpenWindowStationW(
  5960. LPWSTR lpszWinSta,
  5961. BOOL fInherit,
  5962. DWORD dwDesiredAccess)
  5963. {
  5964. AssertFail("No Unicode Wrapper Available for Win32 API - OpenWindowStationW");
  5965. return 0;
  5966. }
  5967. APIENTRY OPageSetupDlgW( LPPAGESETUPDLGW )
  5968. {
  5969. AssertFail("No Unicode Wrapper Available for Win32 API - PageSetupDlgW");
  5970. return 0;
  5971. }
  5972. BOOL
  5973. WINAPI
  5974. OPeekConsoleInputW(
  5975. HANDLE hConsoleInput,
  5976. PINPUT_RECORD lpBuffer,
  5977. DWORD nLength,
  5978. LPDWORD lpNumberOfEventsRead
  5979. )
  5980. {
  5981. AssertFail("No Unicode Wrapper Available for Win32 API - PeekConsoleInputW");
  5982. return 0;
  5983. }
  5984. BOOL
  5985. WINAPI
  5986. OPolyTextOutW(HDC, CONST POLYTEXTW *, int)
  5987. {
  5988. AssertFail("No Unicode Wrapper Available for Win32 API - PolyTextOutW");
  5989. return 0;
  5990. }
  5991. APIENTRY
  5992. OPrintDlgW(LPPRINTDLGW lppd)
  5993. {
  5994. AssertFail("No Unicode Wrapper Available for Win32 API - PrintDlgW");
  5995. return 0;
  5996. }
  5997. DWORD
  5998. WINAPI
  5999. OPrinterMessageBoxW(
  6000. HANDLE hPrinter,
  6001. DWORD Error,
  6002. HWND hWnd,
  6003. LPWSTR pText,
  6004. LPWSTR pCaption,
  6005. DWORD dwType
  6006. )
  6007. {
  6008. AssertFail("No Unicode Wrapper Available for Win32 API - PrinterMessageBoxW");
  6009. return 0;
  6010. }
  6011. BOOL
  6012. WINAPI
  6013. OPrivilegedServiceAuditAlarmW (
  6014. LPCWSTR SubsystemName,
  6015. LPCWSTR ServiceName,
  6016. HANDLE ClientToken,
  6017. PPRIVILEGE_SET Privileges,
  6018. BOOL AccessGranted
  6019. )
  6020. {
  6021. AssertFail("No Unicode Wrapper Available for Win32 API - PrivilegedServiceAuditAlarmW");
  6022. return 0;
  6023. }
  6024. int
  6025. WINAPI
  6026. OPropertySheetW(
  6027. LPCPROPSHEETHEADERW lpcpsh
  6028. )
  6029. {
  6030. AssertFail("No Unicode Wrapper Available for Win32 API - PropertySheetW");
  6031. return 0;
  6032. }
  6033. DWORD
  6034. WINAPI
  6035. OQueryDosDeviceW(
  6036. LPCWSTR lpDeviceName,
  6037. LPWSTR lpTargetPath,
  6038. DWORD ucchMax
  6039. )
  6040. {
  6041. AssertFail("No Unicode Wrapper Available for Win32 API - QueryDosDeviceW");
  6042. return 0;
  6043. }
  6044. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  6045. BOOL
  6046. WINAPI
  6047. OQueryServiceConfigW(
  6048. SC_HANDLE hService,
  6049. LPQUERY_SERVICE_CONFIGW lpServiceConfig,
  6050. DWORD cbBufSize,
  6051. LPDWORD pcbBytesNeeded
  6052. )
  6053. {
  6054. AssertFail("No Unicode Wrapper Available for Win32 API - QueryServiceConfigW");
  6055. return 0;
  6056. }
  6057. BOOL
  6058. WINAPI
  6059. OQueryServiceLockStatusW(
  6060. SC_HANDLE hSCManager,
  6061. LPQUERY_SERVICE_LOCK_STATUSW lpLockStatus,
  6062. DWORD cbBufSize,
  6063. LPDWORD pcbBytesNeeded
  6064. )
  6065. {
  6066. AssertFail("No Unicode Wrapper Available for Win32 API - QueryServiceLockStatusW");
  6067. return 0;
  6068. }
  6069. #endif
  6070. BOOL
  6071. WINAPI
  6072. OReadConsoleW(
  6073. HANDLE hConsoleInput,
  6074. LPVOID lpBuffer,
  6075. DWORD nNumberOfCharsToRead,
  6076. LPDWORD lpNumberOfCharsRead,
  6077. LPVOID lpReserved
  6078. )
  6079. {
  6080. AssertFail("No Unicode Wrapper Available for Win32 API - ReadConsoleW");
  6081. return 0;
  6082. }
  6083. BOOL
  6084. WINAPI
  6085. OReadConsoleInputW(
  6086. HANDLE hConsoleInput,
  6087. PINPUT_RECORD lpBuffer,
  6088. DWORD nLength,
  6089. LPDWORD lpNumberOfEventsRead
  6090. )
  6091. {
  6092. AssertFail("No Unicode Wrapper Available for Win32 API - ReadConsoleInputW");
  6093. return 0;
  6094. }
  6095. BOOL
  6096. WINAPI
  6097. OReadConsoleOutputW(
  6098. HANDLE hConsoleOutput,
  6099. PCHAR_INFO lpBuffer,
  6100. COORD dwBufferSize,
  6101. COORD dwBufferCoord,
  6102. PSMALL_RECT lpReadRegion
  6103. )
  6104. {
  6105. AssertFail("No Unicode Wrapper Available for Win32 API - ReadConsoleOutputW");
  6106. return 0;
  6107. }
  6108. BOOL
  6109. WINAPI
  6110. OReadConsoleOutputCharacterW(
  6111. HANDLE hConsoleOutput,
  6112. LPWSTR lpCharacter,
  6113. DWORD nLength,
  6114. COORD dwReadCoord,
  6115. LPDWORD lpNumberOfCharsRead
  6116. )
  6117. {
  6118. AssertFail("No Unicode Wrapper Available for Win32 API - ReadConsoleOutputCharacterW");
  6119. return 0;
  6120. }
  6121. BOOL
  6122. WINAPI
  6123. OReadEventLogW (
  6124. HANDLE hEventLog,
  6125. DWORD dwReadFlags,
  6126. DWORD dwRecordOffset,
  6127. LPVOID lpBuffer,
  6128. DWORD nNumberOfBytesToRead,
  6129. DWORD *pnBytesRead,
  6130. DWORD *pnMinNumberOfBytesNeeded
  6131. )
  6132. {
  6133. AssertFail("No Unicode Wrapper Available for Win32 API - ReadEventLogW");
  6134. return 0;
  6135. }
  6136. LONG
  6137. APIENTRY
  6138. ORegConnectRegistryW (
  6139. LPWSTR lpMachineName,
  6140. HKEY hKey,
  6141. PHKEY phkResult
  6142. )
  6143. {
  6144. AssertFail("No Unicode Wrapper Available for Win32 API - RegConnectRegistryW");
  6145. return 0;
  6146. }
  6147. HANDLE
  6148. WINAPI
  6149. ORegisterEventSourceW (
  6150. LPCWSTR lpUNCServerName,
  6151. LPCWSTR lpSourceName
  6152. )
  6153. {
  6154. AssertFail("No Unicode Wrapper Available for Win32 API - RegisterEventSourceW");
  6155. return 0;
  6156. }
  6157. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  6158. SERVICE_STATUS_HANDLE
  6159. WINAPI
  6160. ORegisterServiceCtrlHandlerW(
  6161. LPCWSTR lpServiceName,
  6162. LPHANDLER_FUNCTION lpHandlerProc
  6163. )
  6164. {
  6165. AssertFail("No Unicode Wrapper Available for Win32 API - RegisterServiceCtrlHandlerW");
  6166. return 0;
  6167. }
  6168. #endif
  6169. LONG
  6170. APIENTRY
  6171. ORegLoadKeyW (
  6172. HKEY hKey,
  6173. LPCWSTR lpSubKey,
  6174. LPCWSTR lpFile
  6175. )
  6176. {
  6177. AssertFail("No Unicode Wrapper Available for Win32 API - RegLoadKeyW");
  6178. return 0;
  6179. }
  6180. LONG
  6181. APIENTRY
  6182. ORegQueryMultipleValuesW (
  6183. HKEY hKey,
  6184. PVALENTW val_list,
  6185. DWORD num_vals,
  6186. LPWSTR lpValueBuf,
  6187. LPDWORD ldwTotsize
  6188. )
  6189. {
  6190. AssertFail("No Unicode Wrapper Available for Win32 API - RegQueryMultipleValuesW");
  6191. return 0;
  6192. }
  6193. LONG
  6194. APIENTRY
  6195. ORegReplaceKeyW (
  6196. HKEY hKey,
  6197. LPCWSTR lpSubKey,
  6198. LPCWSTR lpNewFile,
  6199. LPCWSTR lpOldFile
  6200. )
  6201. {
  6202. AssertFail("No Unicode Wrapper Available for Win32 API - RegReplaceKeyW");
  6203. return 0;
  6204. }
  6205. LONG
  6206. APIENTRY
  6207. ORegRestoreKeyW (
  6208. HKEY hKey,
  6209. LPCWSTR lpFile,
  6210. DWORD dwFlags
  6211. )
  6212. {
  6213. AssertFail("No Unicode Wrapper Available for Win32 API - RegRestoreKeyW");
  6214. return 0;
  6215. }
  6216. LONG
  6217. APIENTRY
  6218. ORegSaveKeyW (
  6219. HKEY hKey,
  6220. LPCWSTR lpFile,
  6221. LPSECURITY_ATTRIBUTES lpSecurityAttributes
  6222. )
  6223. {
  6224. AssertFail("No Unicode Wrapper Available for Win32 API - RegSaveKeyW");
  6225. return 0;
  6226. }
  6227. LONG
  6228. APIENTRY
  6229. ORegUnLoadKeyW (
  6230. HKEY hKey,
  6231. LPCWSTR lpSubKey
  6232. )
  6233. {
  6234. AssertFail("No Unicode Wrapper Available for Win32 API - RegUnLoadKeyW");
  6235. return 0;
  6236. }
  6237. BOOL
  6238. WINAPI
  6239. ORemoveDirectoryW(
  6240. LPCWSTR lpPathName
  6241. )
  6242. {
  6243. AssertFail("No Unicode Wrapper Available for Win32 API - RemoveDirectoryW");
  6244. return 0;
  6245. }
  6246. BOOL
  6247. WINAPI
  6248. ORemoveFontResourceW(LPCWSTR)
  6249. {
  6250. AssertFail("No Unicode Wrapper Available for Win32 API - RemoveFontResourceW");
  6251. return 0;
  6252. }
  6253. APIENTRY
  6254. OReplaceTextW(LPFINDREPLACEW)
  6255. {
  6256. AssertFail("No Unicode Wrapper Available for Win32 API - ReplaceTextW");
  6257. return 0;
  6258. }
  6259. BOOL
  6260. WINAPI
  6261. OReportEventW (
  6262. HANDLE hEventLog,
  6263. WORD wType,
  6264. WORD wCategory,
  6265. DWORD dwEventID,
  6266. PSID lpUserSid,
  6267. WORD wNumStrings,
  6268. DWORD dwDataSize,
  6269. LPCWSTR *lpStrings,
  6270. LPVOID lpRawData
  6271. )
  6272. {
  6273. AssertFail("No Unicode Wrapper Available for Win32 API - ReportEventW");
  6274. return 0;
  6275. }
  6276. HDC
  6277. WINAPI
  6278. OResetDCW(
  6279. HDC hdc,
  6280. CONST DEVMODEW *lpInitData)
  6281. {
  6282. AssertFail("No Unicode Wrapper Available for Win32 API - ResetDCW");
  6283. return 0;
  6284. }
  6285. BOOL
  6286. WINAPI
  6287. OResetPrinterW(
  6288. HANDLE hPrinter,
  6289. LPPRINTER_DEFAULTSW pDefault
  6290. )
  6291. {
  6292. AssertFail("No Unicode Wrapper Available for Win32 API - ResetPrinterW");
  6293. return 0;
  6294. }
  6295. RPC_STATUS RPC_ENTRY
  6296. ORpcBindingFromStringBindingW (
  6297. IN unsigned short __RPC_FAR * StringBinding,
  6298. OUT RPC_BINDING_HANDLE __RPC_FAR * Binding
  6299. )
  6300. {
  6301. AssertFail("No Unicode Wrapper Available for Win32 API - RpcBindingFromStringBindingW");
  6302. return 0;
  6303. }
  6304. RPC_STATUS RPC_ENTRY
  6305. ORpcBindingInqAuthClientW (
  6306. IN RPC_BINDING_HANDLE ClientBinding, OPTIONAL
  6307. OUT RPC_AUTHZ_HANDLE __RPC_FAR * Privs,
  6308. OUT unsigned short __RPC_FAR * __RPC_FAR * ServerPrincName, OPTIONAL
  6309. OUT unsigned long __RPC_FAR * AuthnLevel, OPTIONAL
  6310. OUT unsigned long __RPC_FAR * AuthnSvc, OPTIONAL
  6311. OUT unsigned long __RPC_FAR * AuthzSvc OPTIONAL
  6312. )
  6313. {
  6314. AssertFail("No Unicode Wrapper Available for Win32 API - RpcBindingInqAuthClientW");
  6315. return 0;
  6316. }
  6317. RPC_STATUS RPC_ENTRY
  6318. ORpcBindingToStringBindingW (
  6319. IN RPC_BINDING_HANDLE Binding,
  6320. OUT unsigned short __RPC_FAR * __RPC_FAR * StringBinding
  6321. )
  6322. {
  6323. AssertFail("No Unicode Wrapper Available for Win32 API - RpcBindingToStringBindingW");
  6324. return 0;
  6325. }
  6326. RPC_STATUS RPC_ENTRY
  6327. ORpcEpRegisterNoReplaceW (
  6328. IN RPC_IF_HANDLE IfSpec,
  6329. IN RPC_BINDING_VECTOR * BindingVector,
  6330. IN UUID_VECTOR * UuidVector OPTIONAL,
  6331. IN unsigned short * Annotation
  6332. )
  6333. {
  6334. AssertFail("No Unicode Wrapper Available for Win32 API - RpcEpRegisterNoReplaceW");
  6335. return 0;
  6336. }
  6337. RPC_STATUS RPC_ENTRY
  6338. ORpcMgmtEpEltInqNextW (
  6339. IN RPC_EP_INQ_HANDLE InquiryContext,
  6340. OUT RPC_IF_ID __RPC_FAR * IfId,
  6341. OUT RPC_BINDING_HANDLE __RPC_FAR * Binding OPTIONAL,
  6342. OUT UUID __RPC_FAR * ObjectUuid OPTIONAL,
  6343. OUT unsigned short __RPC_FAR * __RPC_FAR * Annotation OPTIONAL
  6344. )
  6345. {
  6346. AssertFail("No Unicode Wrapper Available for Win32 API - RpcMgmtEpEltInqNextW");
  6347. return 0;
  6348. }
  6349. RPC_STATUS RPC_ENTRY
  6350. ORpcMgmtInqServerPrincNameW (
  6351. IN RPC_BINDING_HANDLE Binding,
  6352. IN unsigned long AuthnSvc,
  6353. OUT unsigned short __RPC_FAR * __RPC_FAR * ServerPrincName
  6354. )
  6355. {
  6356. AssertFail("No Unicode Wrapper Available for Win32 API - RpcMgmtInqServerPrincNameW");
  6357. return 0;
  6358. }
  6359. RPC_STATUS RPC_ENTRY
  6360. ORpcNetworkInqProtseqsW (
  6361. OUT RPC_PROTSEQ_VECTORW __RPC_FAR * __RPC_FAR * ProtseqVector
  6362. )
  6363. {
  6364. AssertFail("No Unicode Wrapper Available for Win32 API - RpcNetworkInqProtseqsW");
  6365. return 0;
  6366. }
  6367. RPC_STATUS RPC_ENTRY
  6368. ORpcNetworkIsProtseqValidW (
  6369. IN unsigned short __RPC_FAR * Protseq
  6370. )
  6371. {
  6372. AssertFail("No Unicode Wrapper Available for Win32 API - RpcNetworkIsProtseqValidW");
  6373. return 0;
  6374. }
  6375. RPC_STATUS RPC_ENTRY
  6376. ORpcNsBindingInqEntryNameW (
  6377. IN RPC_BINDING_HANDLE Binding,
  6378. IN unsigned long EntryNameSyntax,
  6379. OUT unsigned short __RPC_FAR * __RPC_FAR * EntryName
  6380. )
  6381. {
  6382. AssertFail("No Unicode Wrapper Available for Win32 API - RpcNsBindingInqEntryNameW");
  6383. return 0;
  6384. }
  6385. RPC_STATUS RPC_ENTRY
  6386. ORpcProtseqVectorFreeW (
  6387. IN OUT RPC_PROTSEQ_VECTORW __RPC_FAR * __RPC_FAR * ProtseqVector
  6388. )
  6389. {
  6390. AssertFail("No Unicode Wrapper Available for Win32 API - RpcProtseqVectorFreeW");
  6391. return 0;
  6392. }
  6393. RPC_STATUS RPC_ENTRY
  6394. ORpcServerInqDefaultPrincNameW (
  6395. IN unsigned long AuthnSvc,
  6396. OUT unsigned short __RPC_FAR * __RPC_FAR * PrincName
  6397. )
  6398. {
  6399. AssertFail("No Unicode Wrapper Available for Win32 API - RpcServerInqDefaultPrincNameW");
  6400. return 0;
  6401. }
  6402. RPC_STATUS RPC_ENTRY
  6403. ORpcServerUseProtseqW (
  6404. IN unsigned short __RPC_FAR * Protseq,
  6405. IN unsigned int MaxCalls,
  6406. IN void __RPC_FAR * SecurityDescriptor OPTIONAL
  6407. )
  6408. {
  6409. AssertFail("No Unicode Wrapper Available for Win32 API - RpcServerUseProtseqW");
  6410. return 0;
  6411. }
  6412. RPC_STATUS RPC_ENTRY
  6413. ORpcServerUseProtseqEpW (
  6414. IN unsigned short __RPC_FAR * Protseq,
  6415. IN unsigned int MaxCalls,
  6416. IN unsigned short __RPC_FAR * Endpoint,
  6417. IN void __RPC_FAR * SecurityDescriptor OPTIONAL
  6418. )
  6419. {
  6420. AssertFail("No Unicode Wrapper Available for Win32 API - RpcServerUseProtseqEpW");
  6421. return 0;
  6422. }
  6423. RPC_STATUS RPC_ENTRY
  6424. ORpcServerUseProtseqIfW (
  6425. IN unsigned short __RPC_FAR * Protseq,
  6426. IN unsigned int MaxCalls,
  6427. IN RPC_IF_HANDLE IfSpec,
  6428. IN void __RPC_FAR * SecurityDescriptor OPTIONAL
  6429. )
  6430. {
  6431. AssertFail("No Unicode Wrapper Available for Win32 API - RpcServerUseProtseqIfW");
  6432. return 0;
  6433. }
  6434. RPC_STATUS RPC_ENTRY
  6435. ORpcStringBindingComposeW (
  6436. IN unsigned short __RPC_FAR * ObjUuid OPTIONAL,
  6437. IN unsigned short __RPC_FAR * Protseq OPTIONAL,
  6438. IN unsigned short __RPC_FAR * NetworkAddr OPTIONAL,
  6439. IN unsigned short __RPC_FAR * Endpoint OPTIONAL,
  6440. IN unsigned short __RPC_FAR * Options OPTIONAL,
  6441. OUT unsigned short __RPC_FAR * __RPC_FAR * StringBinding OPTIONAL
  6442. )
  6443. {
  6444. AssertFail("No Unicode Wrapper Available for Win32 API - RpcStringBindingComposeW");
  6445. return 0;
  6446. }
  6447. RPC_STATUS RPC_ENTRY
  6448. ORpcStringBindingParseW (
  6449. IN unsigned short __RPC_FAR * StringBinding,
  6450. OUT unsigned short __RPC_FAR * __RPC_FAR * ObjUuid OPTIONAL,
  6451. OUT unsigned short __RPC_FAR * __RPC_FAR * Protseq OPTIONAL,
  6452. OUT unsigned short __RPC_FAR * __RPC_FAR * NetworkAddr OPTIONAL,
  6453. OUT unsigned short __RPC_FAR * __RPC_FAR * Endpoint OPTIONAL,
  6454. OUT unsigned short __RPC_FAR * __RPC_FAR * NetworkOptions OPTIONAL
  6455. )
  6456. {
  6457. AssertFail("No Unicode Wrapper Available for Win32 API - RpcStringBindingParseW");
  6458. return 0;
  6459. }
  6460. RPC_STATUS RPC_ENTRY
  6461. ORpcStringFreeW (
  6462. IN OUT unsigned short __RPC_FAR * __RPC_FAR * String
  6463. )
  6464. {
  6465. AssertFail("No Unicode Wrapper Available for Win32 API - RpcStringFreeW");
  6466. return 0;
  6467. }
  6468. BOOL
  6469. WINAPI
  6470. OScrollConsoleScreenBufferW(
  6471. HANDLE hConsoleOutput,
  6472. CONST SMALL_RECT *lpScrollRectangle,
  6473. CONST SMALL_RECT *lpClipRectangle,
  6474. COORD dwDestinationOrigin,
  6475. CONST CHAR_INFO *lpFill
  6476. )
  6477. {
  6478. AssertFail("No Unicode Wrapper Available for Win32 API - ScrollConsoleScreenBufferW");
  6479. return 0;
  6480. }
  6481. DWORD
  6482. WINAPI
  6483. OSearchPathW(
  6484. LPCWSTR lpPath,
  6485. LPCWSTR lpFileName,
  6486. LPCWSTR lpExtension,
  6487. DWORD nBufferLength,
  6488. LPWSTR lpBuffer,
  6489. LPWSTR *lpFilePart
  6490. )
  6491. {
  6492. AssertFail("No Unicode Wrapper Available for Win32 API - SearchPathW");
  6493. return 0;
  6494. }
  6495. BOOL
  6496. WINAPI
  6497. OSendMessageCallbackW(
  6498. HWND hWnd,
  6499. UINT Msg,
  6500. WPARAM wParam,
  6501. LPARAM lParam,
  6502. SENDASYNCPROC lpResultCallBack,
  6503. DWORD dwData)
  6504. {
  6505. AssertFail("No Unicode Wrapper Available for Win32 API - SendMessageCallbackW");
  6506. return 0;
  6507. }
  6508. LRESULT
  6509. WINAPI
  6510. OSendMessageTimeoutW(
  6511. HWND hWnd,
  6512. UINT Msg,
  6513. WPARAM wParam,
  6514. LPARAM lParam,
  6515. UINT fuFlags,
  6516. UINT uTimeout,
  6517. LPDWORD lpdwResult)
  6518. {
  6519. AssertFail("No Unicode Wrapper Available for Win32 API - SendMessageTimeoutW");
  6520. return 0;
  6521. }
  6522. BOOL
  6523. WINAPI
  6524. OSetComputerNameW (
  6525. LPCWSTR lpComputerName
  6526. )
  6527. {
  6528. AssertFail("No Unicode Wrapper Available for Win32 API - SetComputerNameW");
  6529. return 0;
  6530. }
  6531. BOOL
  6532. WINAPI
  6533. OSetConsoleTitleW(
  6534. LPCWSTR lpConsoleTitle
  6535. )
  6536. {
  6537. AssertFail("No Unicode Wrapper Available for Win32 API - SetConsoleTitleW");
  6538. return 0;
  6539. }
  6540. BOOL
  6541. WINAPI
  6542. OSetCurrentDirectoryW(
  6543. LPCWSTR lpPathName
  6544. )
  6545. {
  6546. AssertFail("No Unicode Wrapper Available for Win32 API - SetCurrentDirectoryW");
  6547. return 0;
  6548. }
  6549. BOOL
  6550. WINAPI
  6551. OSetDefaultCommConfigW(
  6552. LPCWSTR lpszName,
  6553. LPCOMMCONFIG lpCC,
  6554. DWORD dwSize
  6555. )
  6556. {
  6557. AssertFail("No Unicode Wrapper Available for Win32 API - SetDefaultCommConfigW");
  6558. return 0;
  6559. }
  6560. BOOL
  6561. WINAPI
  6562. OSetEnvironmentVariableW(
  6563. LPCWSTR lpName,
  6564. LPCWSTR lpValue
  6565. )
  6566. {
  6567. AssertFail("No Unicode Wrapper Available for Win32 API - SetEnvironmentVariableW");
  6568. return 0;
  6569. }
  6570. BOOL
  6571. WINAPI
  6572. OSetFileSecurityW (
  6573. LPCWSTR lpFileName,
  6574. SECURITY_INFORMATION SecurityInformation,
  6575. PSECURITY_DESCRIPTOR pSecurityDescriptor
  6576. )
  6577. {
  6578. AssertFail("No Unicode Wrapper Available for Win32 API - SetFileSecurityW");
  6579. return 0;
  6580. }
  6581. BOOL
  6582. WINAPI
  6583. OSetFormW(
  6584. HANDLE hPrinter,
  6585. LPWSTR pFormName,
  6586. DWORD Level,
  6587. LPBYTE pForm
  6588. )
  6589. {
  6590. AssertFail("No Unicode Wrapper Available for Win32 API - SetFormW");
  6591. return 0;
  6592. }
  6593. WINAPI
  6594. OSetICMProfileW(HDC,LPWSTR)
  6595. {
  6596. AssertFail("No Unicode Wrapper Available for Win32 API - SetICMProfileW");
  6597. return 0;
  6598. }
  6599. BOOL
  6600. WINAPI
  6601. OSetJobW(
  6602. HANDLE hPrinter,
  6603. DWORD JobId,
  6604. DWORD Level,
  6605. LPBYTE pJob,
  6606. DWORD Command
  6607. )
  6608. {
  6609. AssertFail("No Unicode Wrapper Available for Win32 API - SetJobW");
  6610. return 0;
  6611. }
  6612. BOOL
  6613. WINAPI
  6614. OSetPrinterW(
  6615. HANDLE hPrinter,
  6616. DWORD Level,
  6617. LPBYTE pPrinter,
  6618. DWORD Command
  6619. )
  6620. {
  6621. AssertFail("No Unicode Wrapper Available for Win32 API - SetPrinterW");
  6622. return 0;
  6623. }
  6624. DWORD
  6625. WINAPI
  6626. OSetPrinterDataW(
  6627. HANDLE hPrinter,
  6628. LPWSTR pValueName,
  6629. DWORD Type,
  6630. LPBYTE pData,
  6631. DWORD cbData
  6632. )
  6633. {
  6634. AssertFail("No Unicode Wrapper Available for Win32 API - SetPrinterDataW");
  6635. return 0;
  6636. }
  6637. BOOL
  6638. WINAPI
  6639. OSetUserObjectInformationW(
  6640. HANDLE hObj,
  6641. int nIndex,
  6642. PVOID pvInfo,
  6643. DWORD nLength)
  6644. {
  6645. AssertFail("No Unicode Wrapper Available for Win32 API - SetUserObjectInformationW");
  6646. return 0;
  6647. }
  6648. BOOL
  6649. WINAPI
  6650. OSetVolumeLabelW(
  6651. LPCWSTR lpRootPathName,
  6652. LPCWSTR lpVolumeName
  6653. )
  6654. {
  6655. AssertFail("No Unicode Wrapper Available for Win32 API - SetVolumeLabelW");
  6656. return 0;
  6657. }
  6658. HHOOK
  6659. WINAPI
  6660. OSetWindowsHookW(
  6661. int nFilterType,
  6662. HOOKPROC pfnFilterProc)
  6663. {
  6664. AssertFail("No Unicode Wrapper Available for Win32 API - SetWindowsHookW");
  6665. return 0;
  6666. }
  6667. LPITEMIDLIST
  6668. WINAPI
  6669. OSHBrowseForFolderW(
  6670. LPBROWSEINFO lpbi)
  6671. {
  6672. AssertFail("No Unicode Wrapper Available for Win32 API - SHBrowseForFolderW");
  6673. return 0;
  6674. }
  6675. BOOL
  6676. WINAPI
  6677. OShell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW lpData)
  6678. {
  6679. AssertFail("No Unicode Wrapper Available for Win32 API - Shell_NotifyIconW");
  6680. return 0;
  6681. }
  6682. INT
  6683. APIENTRY
  6684. OShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
  6685. {
  6686. AssertFail("No Unicode Wrapper Available for Win32 API - ShellAboutW");
  6687. return 0;
  6688. }
  6689. HINSTANCE
  6690. APIENTRY
  6691. OShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
  6692. {
  6693. AssertFail("No Unicode Wrapper Available for Win32 API - ShellExecuteW");
  6694. return 0;
  6695. }
  6696. BOOL
  6697. WINAPI
  6698. OShellExecuteExW(
  6699. LPSHELLEXECUTEINFOW lpExecInfo)
  6700. {
  6701. AssertFail("No Unicode Wrapper Available for Win32 API - ShellExecuteExW");
  6702. return 0;
  6703. }
  6704. int
  6705. WINAPI
  6706. OSHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
  6707. {
  6708. AssertFail("No Unicode Wrapper Available for Win32 API - SHFileOperationW");
  6709. return 0;
  6710. }
  6711. DWORD
  6712. WINAPI
  6713. OSHGetFileInfoW(LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW FAR *psfi, UINT cbFileInfo, UINT uFlags)
  6714. {
  6715. AssertFail("No Unicode Wrapper Available for Win32 API - SHGetFileInfoW");
  6716. return 0;
  6717. }
  6718. BOOL
  6719. WINAPI
  6720. OSHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
  6721. BOOL FAR * pfMustCopy, UINT uFlags)
  6722. {
  6723. AssertFail("No Unicode Wrapper Available for Win32 API - SHGetNewLinkInfoW");
  6724. return 0;
  6725. }
  6726. BOOL
  6727. WINAPI
  6728. OSHGetPathFromIDListW(
  6729. LPCITEMIDLIST pidl,
  6730. LPTSTR pszPath)
  6731. {
  6732. AssertFail("No Unicode Wrapper Available for Win32 API - SHGetPathFromIDListW");
  6733. return 0;
  6734. }
  6735. BOOL
  6736. WINAPI
  6737. OsndPlaySoundW(LPCWSTR pszSound, UINT fuSound)
  6738. {
  6739. AssertFail("No Unicode Wrapper Available for Win32 API - sndPlaySoundW");
  6740. return 0;
  6741. }
  6742. DWORD
  6743. WINAPI
  6744. OStartDocPrinterW(
  6745. HANDLE hPrinter,
  6746. DWORD Level,
  6747. LPBYTE pDocInfo
  6748. )
  6749. {
  6750. AssertFail("No Unicode Wrapper Available for Win32 API - StartDocPrinterW");
  6751. return 0;
  6752. }
  6753. #if 0 //$UNDONE_POST_98 - We should wrap these as being NT only...
  6754. BOOL
  6755. WINAPI
  6756. OStartServiceW(
  6757. SC_HANDLE hService,
  6758. DWORD dwNumServiceArgs,
  6759. LPCWSTR *lpServiceArgVectors
  6760. )
  6761. {
  6762. AssertFail("No Unicode Wrapper Available for Win32 API - StartServiceW");
  6763. return 0;
  6764. }
  6765. BOOL
  6766. WINAPI
  6767. OStartServiceCtrlDispatcherW(
  6768. LPSERVICE_TABLE_ENTRYW lpServiceStartTable
  6769. )
  6770. {
  6771. AssertFail("No Unicode Wrapper Available for Win32 API - StartServiceCtrlDispatcherW");
  6772. return 0;
  6773. }
  6774. #endif
  6775. // Commented since gdi32.dll on Win95 provides the wrapper for this function.
  6776. /*
  6777. BOOL
  6778. WINAPI
  6779. OTextOutW(HDC, int, int, LPCWSTR, int)
  6780. {
  6781. AssertFail("No Unicode Wrapper Available for Win32 API - TextOutW");
  6782. return 0;
  6783. }
  6784. */
  6785. HRESULT
  6786. WINAPI
  6787. OTranslateURLW(PCWSTR pcszURL,
  6788. DWORD dwInFlags,
  6789. PWSTR *ppszTranslatedURL)
  6790. {
  6791. AssertFail("No Unicode Wrapper Available for Win32 API - TranslateURLW");
  6792. return 0;
  6793. }
  6794. WINAPI
  6795. OUpdateICMRegKeyW(DWORD, DWORD, LPWSTR, UINT)
  6796. {
  6797. AssertFail("No Unicode Wrapper Available for Win32 API - UpdateICMRegKeyW");
  6798. return 0;
  6799. }
  6800. HRESULT
  6801. WINAPI
  6802. OURLAssociationDialogW(HWND hwndParent,
  6803. DWORD dwInFlags,
  6804. PCWSTR pcszFile,
  6805. PCWSTR pcszURL,
  6806. PWSTR pszAppBuf,
  6807. UINT ucAppBufLen)
  6808. {
  6809. AssertFail("No Unicode Wrapper Available for Win32 API - URLAssociationDialogW");
  6810. return 0;
  6811. }
  6812. /* client/server */
  6813. RPC_STATUS RPC_ENTRY
  6814. OUuidFromStringW (
  6815. IN unsigned short __RPC_FAR * StringUuid,
  6816. OUT UUID __RPC_FAR * Uuid
  6817. )
  6818. {
  6819. AssertFail("No Unicode Wrapper Available for Win32 API - UuidFromStringW");
  6820. return 0;
  6821. }
  6822. DWORD
  6823. APIENTRY
  6824. OVerFindFileW(
  6825. DWORD uFlags,
  6826. LPWSTR szFileName,
  6827. LPWSTR szWinDir,
  6828. LPWSTR szAppDir,
  6829. LPWSTR szCurDir,
  6830. PUINT lpuCurDirLen,
  6831. LPWSTR szDestDir,
  6832. PUINT lpuDestDirLen
  6833. )
  6834. {
  6835. AssertFail("No Unicode Wrapper Available for Win32 API - VerFindFileW");
  6836. return 0;
  6837. }
  6838. DWORD
  6839. APIENTRY
  6840. OVerInstallFileW(
  6841. DWORD uFlags,
  6842. LPWSTR szSrcFileName,
  6843. LPWSTR szDestFileName,
  6844. LPWSTR szSrcDir,
  6845. LPWSTR szDestDir,
  6846. LPWSTR szCurDir,
  6847. LPWSTR szTmpFile,
  6848. PUINT lpuTmpFileLen
  6849. )
  6850. {
  6851. AssertFail("No Unicode Wrapper Available for Win32 API - VerInstallFileW");
  6852. return 0;
  6853. }
  6854. DWORD
  6855. APIENTRY
  6856. OVerLanguageNameW(
  6857. DWORD wLang,
  6858. LPWSTR szLang,
  6859. DWORD nSize
  6860. )
  6861. {
  6862. AssertFail("No Unicode Wrapper Available for Win32 API - VerLanguageNameW");
  6863. return 0;
  6864. }
  6865. BOOL
  6866. WINAPI
  6867. OVerQueryValueW(
  6868. const LPVOID pBlock,
  6869. LPWSTR lpSubBlock,
  6870. LPVOID *lplpBuffer,
  6871. PUINT puLerr)
  6872. {
  6873. AssertFail("No Unicode Wrapper Available for Win32 API - VerQueryValueW");
  6874. return 0;
  6875. }
  6876. WINAPI
  6877. OVkKeyScanExW(
  6878. WCHAR ch,
  6879. HKL dwhkl)
  6880. {
  6881. AssertFail("No Unicode Wrapper Available for Win32 API - VkKeyScanExW");
  6882. return 0;
  6883. }
  6884. BOOL
  6885. WINAPI
  6886. OWaitNamedPipeW(
  6887. LPCWSTR lpNamedPipeName,
  6888. DWORD nTimeOut
  6889. )
  6890. {
  6891. AssertFail("No Unicode Wrapper Available for Win32 API - WaitNamedPipeW");
  6892. return 0;
  6893. }
  6894. MMRESULT
  6895. WINAPI
  6896. OwaveInGetDevCapsW(UINT uDeviceID, LPWAVEINCAPSW pwic, UINT cbwic)
  6897. {
  6898. AssertFail("No Unicode Wrapper Available for Win32 API - waveInGetDevCapsW");
  6899. return 0;
  6900. }
  6901. MMRESULT
  6902. WINAPI
  6903. OwaveInGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText)
  6904. {
  6905. AssertFail("No Unicode Wrapper Available for Win32 API - waveInGetErrorTextW");
  6906. return 0;
  6907. }
  6908. MMRESULT
  6909. WINAPI
  6910. OwaveOutGetDevCapsW(UINT uDeviceID, LPWAVEOUTCAPSW pwoc, UINT cbwoc)
  6911. {
  6912. AssertFail("No Unicode Wrapper Available for Win32 API - waveOutGetDevCapsW");
  6913. return 0;
  6914. }
  6915. MMRESULT
  6916. WINAPI
  6917. OwaveOutGetErrorTextW(MMRESULT mmrError, LPWSTR pszText, UINT cchText)
  6918. {
  6919. AssertFail("No Unicode Wrapper Available for Win32 API - waveOutGetErrorTextW");
  6920. return 0;
  6921. }
  6922. BOOL
  6923. WINAPI
  6924. OwglUseFontBitmapsW(HDC, DWORD, DWORD, DWORD)
  6925. {
  6926. AssertFail("No Unicode Wrapper Available for Win32 API - wglUseFontBitmapsW");
  6927. return 0;
  6928. }
  6929. BOOL
  6930. WINAPI
  6931. OwglUseFontOutlinesW(HDC, DWORD, DWORD, DWORD, FLOAT,
  6932. FLOAT, int, LPGLYPHMETRICSFLOAT)
  6933. {
  6934. AssertFail("No Unicode Wrapper Available for Win32 API - wglUseFontOutlinesW");
  6935. return 0;
  6936. }
  6937. void
  6938. WINAPI
  6939. OWinExecErrorW(HWND hwnd, int error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle)
  6940. {
  6941. AssertFail("No Unicode Wrapper Available for Win32 API - WinExecErrorW");
  6942. return;
  6943. }
  6944. DWORD
  6945. APIENTRY
  6946. OWNetAddConnectionW(
  6947. LPCWSTR lpRemoteName,
  6948. LPCWSTR lpPassword,
  6949. LPCWSTR lpLocalName
  6950. )
  6951. {
  6952. AssertFail("No Unicode Wrapper Available for Win32 API - WNetAddConnectionW");
  6953. return 0;
  6954. }
  6955. DWORD
  6956. APIENTRY
  6957. OWNetAddConnection2W(
  6958. LPNETRESOURCEW lpNetResource,
  6959. LPCWSTR lpPassword,
  6960. LPCWSTR lpUserName,
  6961. DWORD dwFlags
  6962. )
  6963. {
  6964. AssertFail("No Unicode Wrapper Available for Win32 API - WNetAddConnection2W");
  6965. return 0;
  6966. }
  6967. DWORD
  6968. APIENTRY
  6969. OWNetAddConnection3W(
  6970. HWND hwndOwner,
  6971. LPNETRESOURCEW lpNetResource,
  6972. LPCWSTR lpPassword,
  6973. LPCWSTR lpUserName,
  6974. DWORD dwFlags
  6975. )
  6976. {
  6977. AssertFail("No Unicode Wrapper Available for Win32 API - WNetAddConnection3W");
  6978. return 0;
  6979. }
  6980. DWORD
  6981. APIENTRY
  6982. OWNetCancelConnectionW(
  6983. LPCWSTR lpName,
  6984. BOOL fForce
  6985. )
  6986. {
  6987. AssertFail("No Unicode Wrapper Available for Win32 API - WNetCancelConnectionW");
  6988. return 0;
  6989. }
  6990. DWORD
  6991. APIENTRY
  6992. OWNetCancelConnection2W(
  6993. LPCWSTR lpName,
  6994. DWORD dwFlags,
  6995. BOOL fForce
  6996. )
  6997. {
  6998. AssertFail("No Unicode Wrapper Available for Win32 API - WNetCancelConnection2W");
  6999. return 0;
  7000. }
  7001. DWORD
  7002. APIENTRY
  7003. OWNetConnectionDialog1W(
  7004. LPCONNECTDLGSTRUCTW lpConnDlgStruct
  7005. )
  7006. {
  7007. AssertFail("No Unicode Wrapper Available for Win32 API - WNetConnectionDialog1W");
  7008. return 0;
  7009. }
  7010. DWORD
  7011. APIENTRY
  7012. OWNetDisconnectDialog1W(
  7013. LPDISCDLGSTRUCTW lpConnDlgStruct
  7014. )
  7015. {
  7016. AssertFail("No Unicode Wrapper Available for Win32 API - WNetDisconnectDialog1W");
  7017. return 0;
  7018. }
  7019. DWORD
  7020. APIENTRY
  7021. OWNetEnumResourceW(
  7022. HANDLE hEnum,
  7023. LPDWORD lpcCount,
  7024. LPVOID lpBuffer,
  7025. LPDWORD lpBufferSize
  7026. )
  7027. {
  7028. AssertFail("No Unicode Wrapper Available for Win32 API - WNetEnumResourceW");
  7029. return 0;
  7030. }
  7031. DWORD
  7032. APIENTRY
  7033. OWNetGetConnectionW(
  7034. LPCWSTR lpLocalName,
  7035. LPWSTR lpRemoteName,
  7036. LPDWORD lpnLength
  7037. )
  7038. {
  7039. AssertFail("No Unicode Wrapper Available for Win32 API - WNetGetConnectionW");
  7040. return 0;
  7041. }
  7042. DWORD
  7043. APIENTRY
  7044. OWNetGetLastErrorW(
  7045. LPDWORD lpError,
  7046. LPWSTR lpErrorBuf,
  7047. DWORD nErrorBufSize,
  7048. LPWSTR lpNameBuf,
  7049. DWORD nNameBufSize
  7050. )
  7051. {
  7052. AssertFail("No Unicode Wrapper Available for Win32 API - WNetGetLastErrorW");
  7053. return 0;
  7054. }
  7055. DWORD
  7056. APIENTRY
  7057. OWNetGetNetworkInformationW(
  7058. LPCWSTR lpProvider,
  7059. LPNETINFOSTRUCT lpNetInfoStruct
  7060. )
  7061. {
  7062. AssertFail("No Unicode Wrapper Available for Win32 API - WNetGetNetworkInformationW");
  7063. return 0;
  7064. }
  7065. DWORD
  7066. APIENTRY
  7067. OWNetGetProviderNameW(
  7068. DWORD dwNetType,
  7069. LPWSTR lpProviderName,
  7070. LPDWORD lpBufferSize
  7071. )
  7072. {
  7073. AssertFail("No Unicode Wrapper Available for Win32 API - WNetGetProviderNameW");
  7074. return 0;
  7075. }
  7076. DWORD
  7077. APIENTRY
  7078. OWNetGetUniversalNameW(
  7079. LPCWSTR lpLocalPath,
  7080. DWORD dwInfoLevel,
  7081. LPVOID lpBuffer,
  7082. LPDWORD lpBufferSize
  7083. )
  7084. {
  7085. AssertFail("No Unicode Wrapper Available for Win32 API - WNetGetUniversalNameW");
  7086. return 0;
  7087. }
  7088. DWORD
  7089. APIENTRY
  7090. OWNetGetUserW(
  7091. LPCWSTR lpName,
  7092. LPWSTR lpUserName,
  7093. LPDWORD lpnLength
  7094. )
  7095. {
  7096. AssertFail("No Unicode Wrapper Available for Win32 API - WNetGetUserW");
  7097. return 0;
  7098. }
  7099. DWORD
  7100. APIENTRY
  7101. OWNetOpenEnumW(
  7102. DWORD dwScope,
  7103. DWORD dwType,
  7104. DWORD dwUsage,
  7105. LPNETRESOURCEW lpNetResource,
  7106. LPHANDLE lphEnum
  7107. )
  7108. {
  7109. AssertFail("No Unicode Wrapper Available for Win32 API - WNetOpenEnumW");
  7110. return 0;
  7111. }
  7112. DWORD
  7113. APIENTRY
  7114. OWNetSetConnectionW(
  7115. LPCWSTR lpName,
  7116. DWORD dwProperties,
  7117. LPVOID pvValues
  7118. )
  7119. {
  7120. AssertFail("No Unicode Wrapper Available for Win32 API - WNetSetConnectionW");
  7121. return 0;
  7122. }
  7123. DWORD
  7124. APIENTRY
  7125. OWNetUseConnectionW(
  7126. HWND hwndOwner,
  7127. LPNETRESOURCEW lpNetResource,
  7128. LPCWSTR lpUserID,
  7129. LPCWSTR lpPassword,
  7130. DWORD dwFlags,
  7131. LPWSTR lpAccessName,
  7132. LPDWORD lpBufferSize,
  7133. LPDWORD lpResult
  7134. )
  7135. {
  7136. AssertFail("No Unicode Wrapper Available for Win32 API - WNetUseConnectionW");
  7137. return 0;
  7138. }
  7139. BOOL
  7140. WINAPI
  7141. OWriteConsoleW(
  7142. HANDLE hConsoleOutput,
  7143. CONST VOID *lpBuffer,
  7144. DWORD nNumberOfCharsToWrite,
  7145. LPDWORD lpNumberOfCharsWritten,
  7146. LPVOID lpReserved
  7147. )
  7148. {
  7149. AssertFail("No Unicode Wrapper Available for Win32 API - WriteConsoleW");
  7150. return 0;
  7151. }
  7152. BOOL
  7153. WINAPI
  7154. OWriteConsoleInputW(
  7155. HANDLE hConsoleInput,
  7156. CONST INPUT_RECORD *lpBuffer,
  7157. DWORD nLength,
  7158. LPDWORD lpNumberOfEventsWritten
  7159. )
  7160. {
  7161. AssertFail("No Unicode Wrapper Available for Win32 API - WriteConsoleInputW");
  7162. return 0;
  7163. }
  7164. BOOL
  7165. WINAPI
  7166. OWriteConsoleOutputW(
  7167. HANDLE hConsoleOutput,
  7168. CONST CHAR_INFO *lpBuffer,
  7169. COORD dwBufferSize,
  7170. COORD dwBufferCoord,
  7171. PSMALL_RECT lpWriteRegion
  7172. )
  7173. {
  7174. AssertFail("No Unicode Wrapper Available for Win32 API - WriteConsoleOutputW");
  7175. return 0;
  7176. }
  7177. BOOL
  7178. WINAPI
  7179. OWriteConsoleOutputCharacterW(
  7180. HANDLE hConsoleOutput,
  7181. LPCWSTR lpCharacter,
  7182. DWORD nLength,
  7183. COORD dwWriteCoord,
  7184. LPDWORD lpNumberOfCharsWritten
  7185. )
  7186. {
  7187. AssertFail("No Unicode Wrapper Available for Win32 API - WriteConsoleOutputCharacterW");
  7188. return 0;
  7189. }
  7190. BOOL
  7191. WINAPI
  7192. OWritePrivateProfileSectionW(
  7193. LPCWSTR lpAppName,
  7194. LPCWSTR lpString,
  7195. LPCWSTR lpFileName
  7196. )
  7197. {
  7198. AssertFail("No Unicode Wrapper Available for Win32 API - WritePrivateProfileSectionW");
  7199. return 0;
  7200. }
  7201. BOOL
  7202. WINAPI
  7203. OWritePrivateProfileStructW(
  7204. LPCWSTR lpszSection,
  7205. LPCWSTR lpszKey,
  7206. LPVOID lpStruct,
  7207. UINT uSizeStruct,
  7208. LPCWSTR szFile
  7209. )
  7210. {
  7211. AssertFail("No Unicode Wrapper Available for Win32 API - WritePrivateProfileStructW");
  7212. return 0;
  7213. }
  7214. BOOL
  7215. WINAPI
  7216. OWriteProfileSectionW(
  7217. LPCWSTR lpAppName,
  7218. LPCWSTR lpString
  7219. )
  7220. {
  7221. AssertFail("No Unicode Wrapper Available for Win32 API - WriteProfileSectionW");
  7222. return 0;
  7223. }
  7224. BOOL
  7225. WINAPI
  7226. OWriteProfileStringW(
  7227. LPCWSTR lpAppName,
  7228. LPCWSTR lpKeyName,
  7229. LPCWSTR lpString
  7230. )
  7231. {
  7232. AssertFail("No Unicode Wrapper Available for Win32 API - WriteProfileStringW");
  7233. return 0;
  7234. }
  7235. int
  7236. WINAPI
  7237. OwvsprintfW(
  7238. LPWSTR,
  7239. LPCWSTR,
  7240. va_list arglist)
  7241. {
  7242. AssertFail("No Unicode Wrapper Available for Win32 API - wvsprintfW");
  7243. return 0;
  7244. }
  7245. DWORD
  7246. WINAPI
  7247. ODdeQueryStringW(
  7248. DWORD idInst,
  7249. HSZ hsz,
  7250. LPWSTR psz,
  7251. DWORD cchMax,
  7252. int iCodePage)
  7253. {
  7254. AssertFail("No Unicode Wrapper Available for Win32 API - DdeQueryStringW");
  7255. return 0;
  7256. }
  7257. int WINAPI
  7258. OGetClipboardFormatNameW(
  7259. UINT format,
  7260. LPWSTR pwsz,
  7261. int cchMaxCount)
  7262. {
  7263. AssertFail("No Unicode Wrapper Available for Win32 API - GetClipboardFormatNameW");
  7264. return 0;
  7265. }
  7266. int
  7267. WINAPI
  7268. OGetKeyNameTextW(
  7269. LONG lParam,
  7270. LPWSTR lpString,
  7271. int nSize)
  7272. {
  7273. AssertFail("No Unicode Wrapper Available for Win32 API - GetKeyNameTextW");
  7274. return 0;
  7275. }
  7276. int
  7277. WINAPI
  7278. OGetMenuStringW(
  7279. HMENU hMenu,
  7280. UINT uIDItem,
  7281. LPWSTR lpString,
  7282. int nMaxCount,
  7283. UINT uFlag)
  7284. {
  7285. AssertFail("No Unicode Wrapper Available for Win32 API - GetMenuStringW");
  7286. return 0;
  7287. }
  7288. int
  7289. WINAPI
  7290. OGetTextFaceW(
  7291. HDC hdc,
  7292. int cch,
  7293. LPWSTR lpFaceName)
  7294. {
  7295. AssertFail("No Unicode Wrapper Available for Win32 API - GetMenuStringW");
  7296. return 0;
  7297. }
  7298. #endif //ifdef DEBUG
  7299. } // extern "C"