Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

766 lines
20 KiB

  1. // shlwapi wrappers
  2. //
  3. // Since the HNW needs to run on win98 and W98 shipped with IE4 shlwapi.dll we need to created wrappers
  4. // for the IE5 shlwapi functions that aren't implemented in IE4 shlwapi.
  5. //
  6. #include "stdafx.h"
  7. #include "cstrinout.h"
  8. //
  9. // Globals
  10. //
  11. DWORD g_dwShlwapiVersion = 0;
  12. //
  13. // Version helper function.
  14. //
  15. DWORD GetShlwapiVersion()
  16. {
  17. DWORD dwVersion = 0;
  18. HMODULE hShlwapi = LoadLibrary(L"shlwapi.dll");
  19. if (hShlwapi)
  20. {
  21. HRESULT (*DllGetVersion)(DLLVERSIONINFO* pdvi) = (HRESULT (*)(DLLVERSIONINFO*))GetProcAddress(hShlwapi, "DllGetVersion");
  22. if (DllGetVersion)
  23. {
  24. DLLVERSIONINFO dvi;
  25. dvi.cbSize = sizeof(dvi);
  26. DllGetVersion(&dvi);
  27. dwVersion = dvi.dwMajorVersion;
  28. }
  29. else
  30. {
  31. dwVersion = 3;
  32. }
  33. FreeLibrary(hShlwapi);
  34. }
  35. return dwVersion;
  36. }
  37. //
  38. // wrappers
  39. //
  40. // SHChangeNotify
  41. #undef SHChangeNotify
  42. SHSTDAPI_(void) SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
  43. #define SHCNF_HAS_WSTR_PARAMS(f) ((f & SHCNF_TYPE) == SHCNF_PATHW || \
  44. (f & SHCNF_TYPE) == SHCNF_PRINTERW || \
  45. (f & SHCNF_TYPE) == SHCNF_PRINTJOBW )
  46. void SHChangeNotify_HNWWrap(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
  47. {
  48. if (g_dwShlwapiVersion >= 5)
  49. {
  50. _SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2); // delayloaded shlwapi version.
  51. }
  52. else
  53. {
  54. if (SHCNF_HAS_WSTR_PARAMS(uFlags))
  55. {
  56. CStrIn striItem1((LPWSTR)dwItem1);
  57. CStrIn striItem2((LPWSTR)dwItem2);
  58. if ((uFlags & SHCNF_TYPE) == SHCNF_PATHW)
  59. {
  60. uFlags = (uFlags & ~SHCNF_TYPE) | SHCNF_PATHA;
  61. }
  62. else if ((uFlags & SHCNF_TYPE) == SHCNF_PRINTERW)
  63. {
  64. uFlags = (uFlags & ~SHCNF_TYPE) | SHCNF_PRINTERA;
  65. }
  66. else
  67. {
  68. uFlags = (uFlags & ~SHCNF_TYPE) | SHCNF_PRINTJOBA;
  69. }
  70. SHChangeNotify(wEventId, uFlags, (void*)(LPSTR)striItem1, (void*)(LPSTR)striItem2); // shell32 version.
  71. }
  72. else
  73. {
  74. SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2); // shell32 version.
  75. }
  76. }
  77. return;
  78. }
  79. // wsprintf functions.
  80. #undef wvnsprintfW
  81. int wvnsprintfW_HNWWrap(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, va_list arglist)
  82. {
  83. int iRet;
  84. if (g_dwShlwapiVersion >= 5)
  85. {
  86. iRet = _wvnsprintfW(lpOut, cchLimitIn, lpFmt, arglist); // shlwapi delayloaded version.
  87. }
  88. else
  89. {
  90. // Change all %s to %S in the format buffer.
  91. // Note: this doesn't take into account format modifiers like %-30s!
  92. char szFmtA[1024];
  93. SHUnicodeToAnsi_HNWWrap(lpFmt, szFmtA, ARRAYSIZE(szFmtA));
  94. for (char* psz = szFmtA; *psz != '\0'; psz++)
  95. {
  96. if ('%' == psz[0] && 's' == psz[1])
  97. psz[1] = 'S';
  98. }
  99. CStrOut strOut(lpOut, cchLimitIn);
  100. // use unbounded version.
  101. iRet = wvsprintfA(strOut, szFmtA, arglist); // user32 version.
  102. }
  103. return iRet;
  104. }
  105. int __cdecl wnsprintfW_HNWWrap(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...)
  106. {
  107. int iRet;
  108. va_list arglist;
  109. va_start(arglist, lpFmt);
  110. iRet = wvnsprintfW_HNWWrap(lpOut, cchLimitIn, lpFmt, arglist);
  111. va_end(arglist);
  112. return iRet;
  113. }
  114. // SHSetWindowBits.
  115. void SHSetWindowBits_HNWWrap(HWND hWnd, int iWhich, DWORD dwBits, DWORD dwValue)
  116. {
  117. if (g_dwShlwapiVersion >= 5)
  118. {
  119. _SHSetWindowBits(hWnd, iWhich, dwBits, dwValue);
  120. }
  121. else
  122. {
  123. DWORD dwStyle = GetWindowLong(hWnd, iWhich);
  124. DWORD dwNewStyle = (dwStyle & ~dwBits) | (dwValue & dwBits);
  125. if (dwStyle != dwNewStyle)
  126. {
  127. SetWindowLong(hWnd, iWhich, dwNewStyle);
  128. }
  129. }
  130. return;
  131. }
  132. // SHAnsiToUnicode
  133. int SHAnsiToUnicode_HNWWrap(LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf)
  134. {
  135. int iRet;
  136. if (g_dwShlwapiVersion >= 5)
  137. {
  138. iRet = _SHAnsiToUnicode(pszSrc, pwszDst, cwchBuf);
  139. }
  140. else
  141. {
  142. iRet = MultiByteToWideChar(CP_ACP, 0, pszSrc, -1, pwszDst, cwchBuf);
  143. }
  144. return iRet;
  145. }
  146. // SHUnicodeToAnsi
  147. int SHUnicodeToAnsi_HNWWrap(LPCWSTR pwszSrc, LPSTR pszDst, int cchBuf)
  148. {
  149. int iRet;
  150. if (g_dwShlwapiVersion >= 5)
  151. {
  152. iRet = _SHUnicodeToAnsi(pwszSrc, pszDst, cchBuf);
  153. }
  154. else
  155. {
  156. iRet = WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, pszDst, cchBuf, NULL, NULL);
  157. }
  158. return iRet;
  159. }
  160. // GUIDFromStringA
  161. #undef CLSIDFromString
  162. WINOLEAPI CLSIDFromString(IN LPOLESTR lpsz, OUT LPCLSID pclsid);
  163. BOOL GUIDFromStringA_HNWWrap(LPCSTR psz, GUID* pguid)
  164. {
  165. BOOL fRet;
  166. if (g_dwShlwapiVersion >= 5)
  167. {
  168. fRet = _GUIDFromStringA(psz, pguid);
  169. }
  170. else
  171. {
  172. CStrInW str(psz);
  173. fRet = (S_OK == CLSIDFromString(str, pguid));
  174. }
  175. return fRet;
  176. }
  177. // WritePrivateProfileString
  178. BOOL WINAPI WritePrivateProfileStringW_HNWWrap(LPCWSTR pwzAppName, LPCWSTR pwzKeyName, LPCWSTR pwzString, LPCWSTR pwzFileName)
  179. {
  180. BOOL fRet;
  181. if (g_dwShlwapiVersion >= 5)
  182. {
  183. fRet = _WritePrivateProfileStringWrapW(pwzAppName, pwzKeyName, pwzString, pwzFileName);
  184. }
  185. else
  186. {
  187. CStrIn strTextAppName(pwzAppName);
  188. CStrIn strTextKeyName(pwzKeyName);
  189. CStrIn strTextString(pwzString);
  190. CStrIn strTextFileName(pwzFileName);
  191. fRet = WritePrivateProfileStringA(strTextAppName, strTextKeyName, strTextString, strTextFileName);
  192. }
  193. return fRet;
  194. }
  195. // ExtTextOutW
  196. #undef ExtTextOutW
  197. LWSTDAPI_(BOOL) ExtTextOutW(HDC hdc, int x, int y, UINT fuOptions, CONST RECT *lprc, LPCWSTR lpStr, UINT cch, CONST INT *lpDx);
  198. BOOL ExtTextOutWrapW_HNWWrap(HDC hdc, int x, int y, UINT fuOptions, CONST RECT *lprc, LPCWSTR lpStr, UINT cch, CONST INT *lpDx)
  199. {
  200. BOOL fRet;
  201. if (g_dwShlwapiVersion >= 5)
  202. {
  203. fRet = _ExtTextOutWrapW(hdc, x, y, fuOptions, lprc, lpStr, cch, lpDx);
  204. }
  205. else
  206. {
  207. fRet = ExtTextOutW(hdc, x, y, fuOptions, lprc, lpStr, cch, lpDx);
  208. }
  209. return fRet;
  210. }
  211. // LoadLibraryW
  212. HINSTANCE LoadLibraryW_HNWWrap(LPCWSTR pwzLibFileName)
  213. {
  214. HINSTANCE hinst;
  215. if (g_dwShlwapiVersion >= 5)
  216. {
  217. hinst = _LoadLibraryWrapW(pwzLibFileName);
  218. }
  219. else
  220. {
  221. CStrIn strFileName(pwzLibFileName);
  222. hinst = LoadLibraryA(strFileName);
  223. }
  224. return hinst;
  225. }
  226. // SHGetPathFromIDListW
  227. BOOL SHGetPathFromIDListW_HNWWrap(LPCITEMIDLIST pidl, LPWSTR pwzPath)
  228. {
  229. BOOL fRet;
  230. if (g_dwShlwapiVersion >= 5)
  231. {
  232. fRet = _SHGetPathFromIDListWrapW(pidl, pwzPath);
  233. }
  234. else
  235. {
  236. CStrOut strPathOut(pwzPath, MAX_PATH);
  237. fRet = SHGetPathFromIDListA(pidl, strPathOut);
  238. if (fRet)
  239. {
  240. strPathOut.ConvertIncludingNul();
  241. }
  242. }
  243. return fRet;
  244. }
  245. // SetFileAttributesW
  246. BOOL SetFileAttributesW_HNWWrap(LPCWSTR pwzFile, DWORD dwFileAttributes)
  247. {
  248. BOOL fRet;
  249. if (g_dwShlwapiVersion >= 5)
  250. {
  251. fRet = _SetFileAttributesWrapW(pwzFile, dwFileAttributes);
  252. }
  253. else
  254. {
  255. CStrIn str(pwzFile);
  256. fRet = SetFileAttributesA(str, dwFileAttributes);
  257. }
  258. return fRet;
  259. }
  260. // MessageBoxW
  261. int MessageBoxW_HNWWrap(HWND hwnd, LPCWSTR pwzText, LPCWSTR pwzCaption, UINT uType)
  262. {
  263. int iRet;
  264. if (g_dwShlwapiVersion >= 5)
  265. {
  266. iRet = _MessageBoxWrapW(hwnd, pwzText, pwzCaption, uType);
  267. }
  268. else
  269. {
  270. CStrIn strCaption(pwzCaption);
  271. CStrIn strText(pwzText);
  272. iRet = MessageBoxA(hwnd, strText, strCaption, uType);
  273. }
  274. return iRet;
  275. }
  276. // CreateProcessW
  277. BOOL CreateProcessW_HNWWrap(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes,
  278. LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags,
  279. LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo,
  280. LPPROCESS_INFORMATION lpProcessInformation)
  281. {
  282. BOOL fRet;
  283. if (g_dwShlwapiVersion >= 5)
  284. {
  285. fRet = _CreateProcessWrapW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes,
  286. bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory,
  287. lpStartupInfo, lpProcessInformation);
  288. }
  289. else
  290. {
  291. CStrIn striApplicationName(lpApplicationName);
  292. CStrIn striCommandLine(lpCommandLine);
  293. CStrIn striCurrentDirectory(lpCurrentDirectory);
  294. if (NULL == lpStartupInfo)
  295. {
  296. fRet = CreateProcessA(striApplicationName, striCommandLine,
  297. lpProcessAttributes, lpThreadAttributes,
  298. bInheritHandles, dwCreationFlags,
  299. lpEnvironment, striCurrentDirectory,
  300. NULL, lpProcessInformation);
  301. }
  302. else
  303. {
  304. STARTUPINFOA si = *(STARTUPINFOA*)lpStartupInfo;
  305. CStrIn striReserved(lpStartupInfo->lpReserved);
  306. CStrIn striDesktop(lpStartupInfo->lpDesktop);
  307. CStrIn striTitle(lpStartupInfo->lpTitle);
  308. si.lpReserved = striReserved;
  309. si.lpDesktop = striDesktop;
  310. si.lpTitle = striTitle;
  311. fRet = CreateProcessA(striApplicationName, striCommandLine,
  312. lpProcessAttributes, lpThreadAttributes,
  313. bInheritHandles, dwCreationFlags,
  314. lpEnvironment, striCurrentDirectory,
  315. &si, lpProcessInformation);
  316. }
  317. }
  318. return fRet;
  319. }
  320. // FormatMessageW
  321. DWORD FormatMessageW_HNWWrap(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId,
  322. LPWSTR lpBuffer, DWORD nSize, va_list* Arguments)
  323. {
  324. DWORD dwRet;
  325. if (g_dwShlwapiVersion >= 5)
  326. {
  327. dwRet = _FormatMessageWrapW(dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer,
  328. nSize, Arguments);
  329. }
  330. else
  331. {
  332. if (FORMAT_MESSAGE_FROM_STRING == dwFlags)
  333. {
  334. CStrIn strSource((LPWSTR)lpSource);
  335. CStrOut strBuffer(lpBuffer, nSize);
  336. dwRet = FormatMessageA(dwFlags, strSource, dwMessageId, dwLanguageId, strBuffer,
  337. strBuffer.BufSize(), Arguments);
  338. if (dwRet)
  339. {
  340. dwRet = strBuffer.ConvertExcludingNul();
  341. }
  342. }
  343. else
  344. {
  345. ASSERT(0);
  346. dwRet = 0;
  347. }
  348. }
  349. return dwRet;
  350. }
  351. // SHAnsiToUnicodeCP
  352. int SHAnsiToUnicodeCP_HNWWrap(UINT uiCP, LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf)
  353. {
  354. int iRet;
  355. if (g_dwShlwapiVersion >= 5)
  356. {
  357. iRet = _SHAnsiToUnicodeCP(uiCP, pszSrc, pwszDst, cwchBuf);
  358. }
  359. else
  360. {
  361. iRet = 0; /* Assume failure */
  362. int cchSrc = lstrlenA(pszSrc) + 1;
  363. iRet = MultiByteToWideChar(uiCP, 0, pszSrc, cchSrc, pwszDst, cwchBuf);
  364. if (iRet) {
  365. /*
  366. * The output buffer was big enough; no double-buffering
  367. * needed.
  368. */
  369. } else if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
  370. /*
  371. * The output buffer wasn't big enough. Need to double-buffer.
  372. */
  373. int cwchNeeded = MultiByteToWideChar(uiCP, 0, pszSrc, cchSrc,
  374. NULL, 0);
  375. ASSERT(iRet == 0); /* In case we fail later */
  376. if (cwchNeeded) {
  377. LPWSTR pwsz = (LPWSTR)LocalAlloc(LMEM_FIXED,
  378. cwchNeeded * SIZEOF(WCHAR));
  379. if (pwsz) {
  380. iRet = MultiByteToWideChar(uiCP, 0, pszSrc, cchSrc,
  381. pwsz, cwchNeeded);
  382. if (iRet) {
  383. StrCpyNW(pwszDst, pwsz, cwchBuf);
  384. iRet = cwchBuf;
  385. }
  386. LocalFree(pwsz);
  387. }
  388. }
  389. } else {
  390. /* Possibly unsupported code page */
  391. ASSERT(!"Unexpected error in MultiByteToWideChar");
  392. }
  393. }
  394. return iRet;
  395. }
  396. // StrRetToBufW
  397. HRESULT StrRetToBufW_HNWWrap(STRRET* psr, LPCITEMIDLIST pidl, LPWSTR pszBuf, UINT cchBuf)
  398. {
  399. HRESULT hr = E_FAIL;
  400. switch (psr->uType)
  401. {
  402. case STRRET_WSTR:
  403. {
  404. LPWSTR pwszTmp = psr->pOleStr;
  405. if (pwszTmp)
  406. {
  407. StrCpyNW(pszBuf, pwszTmp, cchBuf);
  408. CoTaskMemFree(pwszTmp);
  409. // Make sure no one thinks things are allocated still
  410. psr->uType = STRRET_CSTR;
  411. psr->cStr[0] = 0;
  412. hr = S_OK;
  413. }
  414. }
  415. break;
  416. case STRRET_CSTR:
  417. SHAnsiToUnicode_HNWWrap(psr->cStr, pszBuf, cchBuf);
  418. hr = S_OK;
  419. break;
  420. case STRRET_OFFSET:
  421. if (pidl)
  422. {
  423. SHAnsiToUnicode_HNWWrap(STRRET_OFFPTR(pidl, psr), pszBuf, cchBuf);
  424. hr = S_OK;
  425. }
  426. break;
  427. }
  428. if (FAILED(hr) && cchBuf)
  429. *pszBuf = 0;
  430. return hr;
  431. }
  432. // WhichPlatform
  433. UINT WhichPlatform_HNWWrap(void)
  434. {
  435. UINT uiRet;
  436. if (g_dwShlwapiVersion >= 5)
  437. {
  438. uiRet = _WhichPlatform();
  439. }
  440. else
  441. {
  442. uiRet = PLATFORM_UNKNOWN;
  443. if (uiRet != PLATFORM_UNKNOWN)
  444. return uiRet;
  445. // Not all callers are linked to SHELL32.DLL, so we must use LoadLibrary.
  446. HINSTANCE hinst = LoadLibraryA("SHELL32.DLL");
  447. if (hinst)
  448. {
  449. DWORD fValue;
  450. DWORD cbSize = sizeof(fValue);
  451. HKEY hKey;
  452. LONG lRes;
  453. // NOTE: GetProcAddress always takes ANSI strings!
  454. DLLGETVERSIONPROC pfnGetVersion =
  455. (DLLGETVERSIONPROC)GetProcAddress(hinst, "DllGetVersion");
  456. uiRet = (NULL != pfnGetVersion) ? PLATFORM_INTEGRATED : PLATFORM_BROWSERONLY;
  457. // check that the registry reflects the right value... (this is so iexplore can check efficiently)
  458. lRes = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Internet Explorer"),
  459. 0, KEY_READ | KEY_WRITE, &hKey);
  460. if (lRes == ERROR_SUCCESS)
  461. {
  462. lRes = RegQueryValueEx(hKey, L"IntegratedBrowser",
  463. NULL, NULL,
  464. (LPBYTE) &fValue, &cbSize);
  465. if (lRes == ERROR_SUCCESS && uiRet == PLATFORM_BROWSERONLY)
  466. {
  467. // remove the value, we are now Browser only release
  468. RegDeleteValue(hKey, L"IntegratedBrowser");
  469. }
  470. else if (lRes != ERROR_SUCCESS && uiRet == PLATFORM_INTEGRATED)
  471. {
  472. // install the RegValue, we are integrated browser mode...
  473. fValue = TRUE;
  474. cbSize = sizeof(fValue);
  475. RegSetValueEx(hKey, L"IntegratedBrowser",
  476. (DWORD) NULL, REG_DWORD,
  477. (LPBYTE) &fValue, cbSize);
  478. // ignore the failure, if the key is not present, shdocvw will be loaded and this
  479. // function called anyway....
  480. }
  481. RegCloseKey(hKey);
  482. }
  483. FreeLibrary(hinst);
  484. }
  485. }
  486. return uiRet;
  487. }
  488. //
  489. // Static libs are linked to various shlwapi exports. Some of the exports aren't implemented in
  490. // IE4 shlwapi. Define the exports here so that that linker fixes up the static lib imports
  491. // to these functions.
  492. //
  493. #undef LoadLibraryWrapW
  494. STDAPI_(HINSTANCE) LoadLibraryWrapW(LPCWSTR pwzLibFileName)
  495. {
  496. return LoadLibraryW_HNWWrap(pwzLibFileName);
  497. }
  498. #undef SHAnsiToUnicodeCP
  499. STDAPI_(int) SHAnsiToUnicodeCP(UINT uiCP, LPCSTR pszSrc, LPWSTR pwszDst, int cwchBuf)
  500. {
  501. return SHAnsiToUnicodeCP_HNWWrap(uiCP, pszSrc, pwszDst, cwchBuf);
  502. }
  503. #undef SHUnicodeToAnsi
  504. STDAPI_(int) SHUnicodeToAnsi(LPCWSTR pwszSrc, LPSTR pszDst, int cchBuf)
  505. {
  506. return SHUnicodeToAnsi_HNWWrap(pwszSrc, pszDst, cchBuf);
  507. }
  508. #undef GetModuleHandleWrapW
  509. STDAPI_(HMODULE) GetModuleHandleWrapW(LPCWSTR lpModuleName)
  510. {
  511. return GetModuleHandleW(lpModuleName);
  512. }
  513. #undef GetWindowsDirectoryWrapW
  514. STDAPI_(UINT) GetWindowsDirectoryWrapW(LPWSTR lpWinPath, UINT cch)
  515. {
  516. return GetWindowsDirectoryW(lpWinPath, cch);
  517. }
  518. #undef GetModuleFileNameWrapW
  519. STDAPI_(DWORD) GetModuleFileNameWrapW(HINSTANCE hModule, LPWSTR pwszFilename, DWORD nSize)
  520. {
  521. return GetModuleFileNameW(hModule, pwszFilename, nSize);
  522. }
  523. #undef CreateWindowExWrapW
  524. STDAPI_(HWND) CreateWindowExWrapW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, int X,
  525. int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance,
  526. LPVOID lpParam)
  527. {
  528. return CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu,
  529. hInstance, lpParam);
  530. }
  531. #undef CreateDialogIndirectParamWrapW
  532. STDAPI_(HWND) CreateDialogIndirectParamWrapW(HINSTANCE hInstance, LPCDLGTEMPLATEW hDialogTemplate, HWND hWndParent,
  533. DLGPROC lpDialogFunc, LPARAM dwInitParam)
  534. {
  535. return CreateDialogIndirectParamW(hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam);
  536. }
  537. #undef CreateDialogParamWrapW
  538. STDAPI_(HWND) CreateDialogParamWrapW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc,
  539. LPARAM dwInitParam)
  540. {
  541. return CreateDialogParamW(hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwInitParam);
  542. }
  543. #undef DialogBoxIndirectParamWrapW
  544. STDAPI_(INT_PTR) DialogBoxIndirectParamWrapW(HINSTANCE hInstance, LPCDLGTEMPLATEW hDialogTemplate, HWND hWndParent,
  545. DLGPROC lpDialogFunc, LPARAM dwInitParam)
  546. {
  547. return DialogBoxIndirectParamW(hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam);
  548. }
  549. #undef DialogBoxParamWrapW
  550. STDAPI_(INT_PTR) DialogBoxParamWrapW(HINSTANCE hInstance, LPCWSTR lpszTemplate, HWND hWndParent, DLGPROC lpDialogFunc,
  551. LPARAM dwInitParam)
  552. {
  553. return DialogBoxParamW(hInstance, lpszTemplate, hWndParent, lpDialogFunc, dwInitParam);
  554. }
  555. #undef RegisterClassWrapW
  556. STDAPI_(ATOM) RegisterClassWrapW(CONST WNDCLASSW* lpWndClass)
  557. {
  558. return RegisterClassW(lpWndClass);
  559. }
  560. #undef RegisterClassExWrapW
  561. STDAPI_(ATOM) RegisterClassExWrapW(CONST WNDCLASSEXW* pwcx)
  562. {
  563. return RegisterClassExW(pwcx);
  564. }
  565. #undef GetClassInfoWrapW
  566. STDAPI_(BOOL) GetClassInfoWrapW(HINSTANCE hModule, LPCWSTR lpClassName, LPWNDCLASSW lpWndClassW)
  567. {
  568. return GetClassInfoW(hModule, lpClassName, lpWndClassW);
  569. }
  570. #undef GetClassInfoExWrapW
  571. STDAPI_(BOOL) GetClassInfoExWrapW(HINSTANCE hinst, LPCWSTR pwzClass, LPWNDCLASSEXW lpwcx)
  572. {
  573. return GetClassInfoExW(hinst, pwzClass, lpwcx);
  574. }
  575. #undef CreateFileWrapW
  576. STDAPI_(HANDLE) CreateFileWrapW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  577. DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
  578. {
  579. return CreateFileW(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
  580. }
  581. #undef SetFileAttributesWrapW
  582. STDAPI_(BOOL) SetFileAttributesWrapW(LPCWSTR pwzFile, DWORD dwFileAttributes)
  583. {
  584. return SetFileAttributesW(pwzFile, dwFileAttributes);
  585. }
  586. #undef WhichPlatform
  587. STDAPI_(UINT) WhichPlatform(void)
  588. {
  589. return WhichPlatform_HNWWrap();
  590. }