Changeset 8584 for trunk/src/shlwapi/ordinal.c
- Timestamp:
- Jun 7, 2002, 10:02:20 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shlwapi/ordinal.c
r7820 r8584 5 5 * 1998 Jürgen Schmied 6 6 * 2001 Jon Griffiths 7 * 8 * This library is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public 10 * License as published by the Free Software Foundation; either 11 * version 2.1 of the License, or (at your option) any later version. 12 * 13 * This library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with this library; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 7 21 */ 8 22 … … 24 38 #include "winreg.h" 25 39 #include "winuser.h" 26 #include " debugtools.h"40 #include "wine/debug.h" 27 41 #include "ordinal.h" 28 42 #include "shlwapi.h" 29 43 30 DEFAULT_DEBUG_CHANNEL(shell);44 WINE_DEFAULT_DEBUG_CHANNEL(shell); 31 45 32 46 extern HINSTANCE shlwapi_hInstance; … … 36 50 extern HMODULE SHLWAPI_hmpr; 37 51 extern HMODULE SHLWAPI_hmlang; 52 extern HMODULE SHLWAPI_hversion; 53 54 extern DWORD SHLWAPI_ThreadRef_index; 38 55 39 56 typedef HANDLE HSHARED; /* Shared memory */ … … 98 115 }; 99 116 100 /* Macro to get function pointer for a module*/ 101 #define GET_FUNC(module, name, fail) \ 102 if (!SHLWAPI_h##module) SHLWAPI_h##module = LoadLibraryA(#module ".dll"); \ 103 if (!SHLWAPI_h##module) return fail; \ 104 if (!pfnFunc) pfnFunc = (void*)GetProcAddress(SHLWAPI_h##module, name); \ 105 if (!pfnFunc) return fail 117 /* function pointers for GET_FUNC macro; these need to be global because of gcc bug */ 118 #ifdef __WIN32OS2__ 119 static LPITEMIDLIST (* WINAPI pSHBrowseForFolderW)(LPBROWSEINFOW); 120 static HRESULT (* WINAPI pConvertINetUnicodeToMultiByte)(LPDWORD,DWORD,LPCWSTR,LPINT,LPSTR,LPINT); 121 static BOOL (* WINAPI pPlaySoundW)(LPCWSTR, HMODULE, DWORD); 122 static DWORD (* WINAPI pSHGetFileInfoW)(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); 123 static UINT (* WINAPI pDragQueryFileW)(HDROP, UINT, LPWSTR, UINT); 124 static BOOL (* WINAPI pSHGetPathFromIDListW)(LPCITEMIDLIST, LPWSTR); 125 static BOOL (* WINAPI pShellExecuteExW)(LPSHELLEXECUTEINFOW); 126 static HICON (* WINAPI pSHFileOperationW)(LPSHFILEOPSTRUCTW); 127 static HICON (* WINAPI pExtractIconExW)(LPCWSTR, INT,HICON *,HICON *, UINT); 128 static BOOL (* WINAPI pSHGetNewLinkInfoW)(LPCWSTR, LPCWSTR, LPCWSTR, BOOL*, UINT); 129 static DWORD (* WINAPI pSHDefExtractIconW)(LPVOID, LPVOID, LPVOID, LPVOID, LPVOID, LPVOID); /* FIXME: Correct args */ 130 static HICON (* WINAPI pExtractIconW)(HINSTANCE, LPCWSTR, UINT); 131 static BOOL (* WINAPI pGetSaveFileNameW)(LPOPENFILENAMEW); 132 static DWORD (* WINAPI pWNetRestoreConnectionW)(LPVOID, LPVOID); /* FIXME: Correct args */ 133 static DWORD (* WINAPI pWNetGetLastErrorW)(LPVOID, LPVOID, LPVOID, LPVOID, LPVOID); /* FIXME: Correct args */ 134 static BOOL (* WINAPI pPageSetupDlgW)(LPPAGESETUPDLGW); 135 static BOOL (* WINAPI pPrintDlgW)(LPPRINTDLGW); 136 static BOOL (* WINAPI pGetOpenFileNameW)(LPOPENFILENAMEW); 137 static HRESULT (* WINAPI pSHGetInstanceExplorer)(LPUNKNOWN *); 138 static DWORD (* WINAPI pGetFileVersionInfoSizeW)(LPCWSTR,LPDWORD); 139 static BOOL (* WINAPI pGetFileVersionInfoW)(LPCWSTR,DWORD,DWORD,LPVOID); 140 static WORD (* WINAPI pVerQueryValueW)(LPVOID,LPCWSTR,LPVOID*,UINT*); 141 #else 142 static LPITEMIDLIST (WINAPI *pSHBrowseForFolderW)(LPBROWSEINFOW); 143 static HRESULT (WINAPI *pConvertINetUnicodeToMultiByte)(LPDWORD,DWORD,LPCWSTR,LPINT,LPSTR,LPINT); 144 static BOOL (WINAPI *pPlaySoundW)(LPCWSTR, HMODULE, DWORD); 145 static DWORD (WINAPI *pSHGetFileInfoW)(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT); 146 static UINT (WINAPI *pDragQueryFileW)(HDROP, UINT, LPWSTR, UINT); 147 static BOOL (WINAPI *pSHGetPathFromIDListW)(LPCITEMIDLIST, LPWSTR); 148 static BOOL (WINAPI *pShellExecuteExW)(LPSHELLEXECUTEINFOW); 149 static HICON (WINAPI *pSHFileOperationW)(LPSHFILEOPSTRUCTW); 150 static HICON (WINAPI *pExtractIconExW)(LPCWSTR, INT,HICON *,HICON *, UINT); 151 static BOOL (WINAPI *pSHGetNewLinkInfoW)(LPCWSTR, LPCWSTR, LPCWSTR, BOOL*, UINT); 152 static DWORD (WINAPI *pSHDefExtractIconW)(LPVOID, LPVOID, LPVOID, LPVOID, LPVOID, LPVOID); /* FIXME: Correct args */ 153 static HICON (WINAPI *pExtractIconW)(HINSTANCE, LPCWSTR, UINT); 154 static BOOL (WINAPI *pGetSaveFileNameW)(LPOPENFILENAMEW); 155 static DWORD (WINAPI *pWNetRestoreConnectionW)(LPVOID, LPVOID); /* FIXME: Correct args */ 156 static DWORD (WINAPI *pWNetGetLastErrorW)(LPVOID, LPVOID, LPVOID, LPVOID, LPVOID); /* FIXME: Correct args */ 157 static BOOL (WINAPI *pPageSetupDlgW)(LPPAGESETUPDLGW); 158 static BOOL (WINAPI *pPrintDlgW)(LPPRINTDLGW); 159 static BOOL (WINAPI *pGetOpenFileNameW)(LPOPENFILENAMEW); 160 static HRESULT (WINAPI *pSHGetInstanceExplorer)(LPUNKNOWN *); 161 static DWORD (WINAPI *pGetFileVersionInfoSizeW)(LPCWSTR,LPDWORD); 162 static BOOL (WINAPI *pGetFileVersionInfoW)(LPCWSTR,DWORD,DWORD,LPVOID); 163 static WORD (WINAPI *pVerQueryValueW)(LPVOID,LPCWSTR,LPVOID*,UINT*); 164 #endif 106 165 107 166 /* … … 127 186 128 187 if (y->size != 0x18) return E_INVALIDARG; 129 /* FIXME: leading white space generates error of 0x80041001 which 188 /* FIXME: leading white space generates error of 0x80041001 which 130 189 * is undefined 131 190 */ … … 183 242 184 243 if (y->size != 0x18) return E_INVALIDARG; 185 /* FIXME: leading white space generates error of 0x80041001 which 244 /* FIXME: leading white space generates error of 0x80041001 which 186 245 * is undefined 187 246 */ … … 230 289 231 290 /************************************************************************* 291 * @ [SHLWAPI.3] 292 * 293 * Determine if a file exists locally and is of an executable type. 294 * 295 * PARAMS 296 * lpszFile [O] File to search for 297 * dwWhich [I] Type of executable to search for 298 * 299 * RETURNS 300 * TRUE If the file was found. lpszFile contains the file name. 301 * FALSE Otherwise. 302 * 303 * NOTES 304 * lpszPath is modified in place and must be at least MAX_PATH in length. 305 * If the function returns FALSE, the path is modified to its orginal state. 306 * If the given path contains an extension or dwWhich is 0, executable 307 * extensions are not checked. 308 * 309 * Ordinals 3-6 are a classic case of MS exposing limited functionality to 310 * users (here through PathFindOnPath) and keeping advanced functionality for 311 * their own developers exclusive use. Monopoly, anyone? 312 */ 313 BOOL WINAPI SHLWAPI_3(LPSTR lpszFile,DWORD dwWhich) 314 { 315 return SHLWAPI_PathFindLocalExeA(lpszFile,dwWhich); 316 } 317 318 /************************************************************************* 319 * @ [SHLWAPI.4] 320 * 321 * Unicode version of SHLWAPI_3. 322 */ 323 BOOL WINAPI SHLWAPI_4(LPWSTR lpszFile,DWORD dwWhich) 324 { 325 return SHLWAPI_PathFindLocalExeW(lpszFile,dwWhich); 326 } 327 328 /************************************************************************* 329 * @ [SHLWAPI.5] 330 * 331 * Search a range of paths for a specific type of executable. 332 * 333 * PARAMS 334 * lpszFile [O] File to search for 335 * lppszOtherDirs [I] Other directories to look in 336 * dwWhich [I] Type of executable to search for 337 * 338 * RETURNS 339 * Success: TRUE. The path to the executable is stored in sFile. 340 * Failure: FALSE. The path to the executable is unchanged. 341 */ 342 BOOL WINAPI SHLWAPI_5(LPSTR lpszFile,LPCSTR *lppszOtherDirs,DWORD dwWhich) 343 { 344 return SHLWAPI_PathFindOnPathExA(lpszFile,lppszOtherDirs,dwWhich); 345 } 346 347 /************************************************************************* 348 * @ [SHLWAPI.6] 349 * 350 * Unicode version of SHLWAPI_5. 351 */ 352 BOOL WINAPI SHLWAPI_6(LPWSTR lpszFile,LPCWSTR *lppszOtherDirs,DWORD dwWhich) 353 { 354 return SHLWAPI_PathFindOnPathExW(lpszFile,lppszOtherDirs,dwWhich); 355 } 356 357 /************************************************************************* 232 358 * SHLWAPI_DupSharedHandle 233 359 * … … 304 430 * SHLWAPI_11 - Helper function; Duplicate cross-process handles 305 431 */ 306 HSHARED WINAPI SHLWAPI_7 (DWORD dwProcId, LPCVOID lpvData, DWORD dwSize)432 HSHARED WINAPI SHLWAPI_7 (DWORD dwProcId, DWORD dwSize, LPCVOID lpvData) 307 433 { 308 434 HANDLE hMap; … … 528 654 * Function: 529 655 * Retrieves IE "AcceptLanguage" value from registry. ASCII mode. 530 * 656 * 531 657 */ 532 658 HRESULT WINAPI SHLWAPI_14 ( … … 540 666 541 667 mystrlen = (*buflen > 6) ? *buflen : 6; 542 mystr = (CHAR*)HeapAlloc(GetProcessHeap(), 668 mystr = (CHAR*)HeapAlloc(GetProcessHeap(), 543 669 HEAP_ZERO_MEMORY, mystrlen); 544 RegOpenKeyA(HKEY_CURRENT_USER, 545 "Software\\Microsoft\\Internet Explorer\\International", 670 RegOpenKeyA(HKEY_CURRENT_USER, 671 "Software\\Microsoft\\Internet Explorer\\International", 546 672 &mykey); 547 if (RegQueryValueExA(mykey, "AcceptLanguage", 673 if (RegQueryValueExA(mykey, "AcceptLanguage", 548 674 0, &mytype, mystr, &mystrlen)) { 549 675 /* Did not find value */ … … 564 690 FIXME("missing code\n"); 565 691 } 566 if (mystrlen > *buflen) 692 if (mystrlen > *buflen) 567 693 lstrcpynA(langbuf, mystr, *buflen); 568 694 else { 569 695 lstrcpyA(langbuf, mystr); 570 696 *buflen = lstrlenA(langbuf); 571 } 697 } 572 698 RegCloseKey(mykey); 573 699 HeapFree(GetProcessHeap(), 0, mystr); … … 581 707 * Function: 582 708 * Retrieves IE "AcceptLanguage" value from registry. UNICODE mode. 583 * 709 * 584 710 */ 585 711 HRESULT WINAPI SHLWAPI_15 ( … … 593 719 594 720 mystrlen = (*buflen > 6) ? *buflen : 6; 595 mystr = (CHAR*)HeapAlloc(GetProcessHeap(), 721 mystr = (CHAR*)HeapAlloc(GetProcessHeap(), 596 722 HEAP_ZERO_MEMORY, mystrlen); 597 RegOpenKeyA(HKEY_CURRENT_USER, 598 "Software\\Microsoft\\Internet Explorer\\International", 723 RegOpenKeyA(HKEY_CURRENT_USER, 724 "Software\\Microsoft\\Internet Explorer\\International", 599 725 &mykey); 600 if (RegQueryValueExA(mykey, "AcceptLanguage", 726 if (RegQueryValueExA(mykey, "AcceptLanguage", 601 727 0, &mytype, mystr, &mystrlen)) { 602 728 /* Did not find value */ … … 870 996 BOOL WINAPI SHLWAPI_36(HMENU h1, UINT ui2, UINT h3, LPCWSTR p4) 871 997 { 872 TRACE("(0x%08x, 0x%08x, 0x%08x, %s): stub\n", 998 TRACE("(0x%08x, 0x%08x, 0x%08x, %s): stub\n", 873 999 h1, ui2, h3, debugstr_w(p4)); 874 1000 return AppendMenuW(h1, ui2, h3, p4); 875 }876 877 /*************************************************************************878 * @ [SHLWAPI.40]879 *880 * Get pointer to next Unicode character.881 */882 LPCWSTR WINAPI SHLWAPI_40(LPCWSTR str)883 {884 return *str ? str + 1 : str;885 1001 } 886 1002 … … 941 1057 { 942 1058 return strncmpiW( str1, str2, len ); 1059 } 1060 1061 /************************************************************************* 1062 * @ [SHLWAPI.155] 1063 * 1064 * Case sensitive string compare (ASCII). Does not SetLastError(). 1065 */ 1066 DWORD WINAPI SHLWAPI_155 ( LPSTR str1, LPSTR str2) 1067 { 1068 return strcmp(str1, str2); 943 1069 } 944 1070 … … 1073 1199 * @ [SHLWAPI.174] 1074 1200 * 1075 * Seems to do call either IObjectWithSite::SetSite or 1201 * Seems to do call either IObjectWithSite::SetSite or 1076 1202 * IPersistMoniker::GetClassID. But since we do not implement either 1077 1203 * of those classes in our headers, we will fake it out. … … 1079 1205 DWORD WINAPI SHLWAPI_174( 1080 1206 IUnknown *p1, /* [in] OLE object */ 1081 LPVOID *p2) /* [out] ptr to result of either GetClassID 1207 LPVOID *p2) /* [out] ptr to result of either GetClassID 1082 1208 or SetSite call. */ 1083 1209 { … … 1089 1215 ret = IUnknown_QueryInterface((IUnknown *)p1, (REFIID)id1, (LPVOID *)&p1); 1090 1216 TRACE("first IU_QI ret=%08lx, p1=%p\n", ret, p1); 1091 if (ret) { 1217 if (ret) { 1092 1218 1093 1219 /* see if GetClassId interface exists for IPersistMoniker object */ … … 1098 1224 /* fake a GetClassId call */ 1099 1225 ret = IOleWindow_GetWindow((IOleWindow *)aa, (HWND*)p2); 1100 TRACE("second IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, 1226 TRACE("second IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, 1101 1227 *(LPDWORD)p2); 1102 1228 IUnknown_Release((IUnknown *)aa); … … 1105 1231 /* fake a SetSite call */ 1106 1232 ret = IOleWindow_GetWindow((IOleWindow *)p1, (HWND*)p2); 1107 TRACE("first IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, 1233 TRACE("first IU_QI doing 0x0c ret=%08lx, *p2=%08lx\n", ret, 1108 1234 *(LPDWORD)p2); 1109 1235 IUnknown_Release((IUnknown *)p1); … … 1112 1238 } 1113 1239 1240 /************************************************************************* 1241 * @ [SHLWAPI.175] 1242 * 1243 * NOTE: 1244 * Param1 can be an IShellFolder Object 1245 */ 1246 HRESULT WINAPI SHLWAPI_175 (LPVOID x, LPVOID y) 1247 { 1248 FIXME("(%p %p) stub\n", x,y); 1249 return E_FAIL; 1250 } 1114 1251 /************************************************************************* 1115 1252 * @ [SHLWAPI.176] … … 1133 1270 if (!unk) return E_FAIL; 1134 1271 ret = IUnknown_QueryInterface(unk, &IID_IServiceProvider, &aa); 1135 TRACE("did IU_QI retval=%08lx, aa=%p\n", ret, aa); 1272 TRACE("did IU_QI retval=%08lx, aa=%p\n", ret, aa); 1136 1273 if (ret) return ret; 1137 ret = IServiceProvider_QueryService((IServiceProvider *)aa, sid, riid, 1274 ret = IServiceProvider_QueryService((IServiceProvider *)aa, sid, riid, 1138 1275 (void **)z); 1139 TRACE("did ISP_QS retval=%08lx, *z=%p\n", ret, (LPVOID)*z); 1276 TRACE("did ISP_QS retval=%08lx, *z=%p\n", ret, (LPVOID)*z); 1140 1277 IUnknown_Release((IUnknown*)aa); 1141 1278 return ret; … … 1220 1357 1221 1358 /************************************************************************* 1359 * @ [SHLWAPI.209] 1360 * 1361 * Some sort of memory management process - associated with _208 1362 */ 1363 DWORD WINAPI SHLWAPI_209 ( 1364 LPVOID a) 1365 { 1366 FIXME("(%p) stub\n", 1367 a); 1368 return 1; 1369 } 1370 1371 /************************************************************************* 1222 1372 * @ [SHLWAPI.210] 1223 1373 * … … 1261 1411 len_a = lstrlenA(lpStrSrc); 1262 1412 ret = MultiByteToWideChar(0, 0, lpStrSrc, len_a, lpwStrDest, len); 1263 TRACE("%s %s %d, ret=%d\n", 1413 TRACE("%s %s %d, ret=%d\n", 1264 1414 debugstr_a(lpStrSrc), debugstr_w(lpwStrDest), len, ret); 1265 1415 return ret; … … 1274 1424 LPINT lpnMultiCharCount) 1275 1425 { 1276 static HRESULT (* WINAPI pfnFunc)(LPDWORD,DWORD,LPCWSTR,LPINT,LPSTR,LPINT);1277 1426 WCHAR emptyW[] = { '\0' }; 1278 1427 int len , reqLen; … … 1300 1449 INT nWideCharCount = len - 1; 1301 1450 1302 GET_FUNC( mlang, "ConvertINetUnicodeToMultiByte", 0);1303 if (!p fnFunc(&dwMode, CodePage, lpSrcStr, &nWideCharCount, lpDstStr,1304 lpnMultiCharCount))1451 GET_FUNC(pConvertINetUnicodeToMultiByte, mlang, "ConvertINetUnicodeToMultiByte", 0); 1452 if (!pConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &nWideCharCount, lpDstStr, 1453 lpnMultiCharCount)) 1305 1454 return 0; 1306 1455 … … 1313 1462 *lpnMultiCharCount = 0; 1314 1463 1315 if (p fnFunc(&dwMode, CodePage, lpSrcStr, &len, mem, lpnMultiCharCount))1464 if (pConvertINetUnicodeToMultiByte(&dwMode, CodePage, lpSrcStr, &len, mem, lpnMultiCharCount)) 1316 1465 { 1317 1466 SHLWAPI_162 (mem, *lpnMultiCharCount); … … 1400 1549 xmove = x; 1401 1550 while (xmove->refid) { 1402 TRACE("trying (indx %ld) %s\n", xmove->indx, 1551 TRACE("trying (indx %ld) %s\n", xmove->indx, 1403 1552 debugstr_guid(xmove->refid)); 1404 1553 if (IsEqualIID(riid, xmove->refid)) { … … 1543 1692 /************************************************************************* 1544 1693 * @ [SHLWAPI.266] 1694 * 1695 * native does at least approximately: 1696 * strcpyW(newstr, x); 1697 * strcatW(newstr, "\\Restrictions"); 1698 * if (RegOpenKeyExA(80000001, newstr, 00000000,00000001,40520b78)) 1699 * return 0; 1700 * *unknown* 1545 1701 */ 1546 1702 DWORD WINAPI SHLWAPI_266 ( 1547 1703 LPVOID w, 1548 LPVOID x, 1704 LPVOID x, /* [in] partial registry key */ 1549 1705 LPVOID y, 1550 1706 LPVOID z) 1551 1707 { 1552 1708 FIXME("(%p %p %p %p)stub\n",w,x,y,z); 1553 return 0xabba1248;1709 return /* 0xabba1248 */ 0; 1554 1710 } 1555 1711 … … 1558 1714 */ 1559 1715 HRESULT WINAPI SHLWAPI_267 ( 1560 LPVOID w, /* [???] NOTE: same as 1th parameter of SHLWAPI_219 */1561 LPVOID x, /* [???] NOTE: same as 2nd parameter of SHLWAPI_219 */1562 LPVOID y, 1563 LPVOID z) 1716 LPVOID w, 1717 LPVOID x, 1718 LPVOID y, /* [???] NOTE: same as 3rd parameter of SHLWAPI_219 */ 1719 LPVOID z) /* [???] NOTE: same as 4th parameter of SHLWAPI_219 */ 1564 1720 { 1565 1721 FIXME("(%p %p %p %p)stub\n",w,x,y,z); 1722 1723 /* native seems to do: 1724 * SHLWAPI_219 ((LPVOID)(((LPSTR)x)-4), ???, (REFIID) y, (LPVOID*) z); 1725 */ 1726 1566 1727 *((LPDWORD)z) = 0xabba1200; 1567 return 0xabba1254;1728 return /* 0xabba1254 */ 0; 1568 1729 } 1569 1730 … … 1582 1743 * @ [SHLWAPI.276] 1583 1744 * 1745 * on first call process does following: other calls just returns 2 1746 * instance = LoadLibraryA("SHELL32.DLL"); 1747 * func = GetProcAddress(instance, "DllGetVersion"); 1748 * ret = RegOpenKeyExA(80000002, "Software\\Microsoft\\Internet Explorer",00000000,0002001f, newkey); 1749 * ret = RegQueryValueExA(newkey, "IntegratedBrowser",00000000,00000000,4052588c,40525890); 1750 * RegCloseKey(newkey); 1751 * FreeLibrary(instance); 1752 * return 2; 1584 1753 */ 1585 1754 DWORD WINAPI SHLWAPI_276 () 1586 1755 { 1587 1756 FIXME("()stub\n"); 1588 return /* 0xabba1244 */ 0;1757 return /* 0xabba1244 */ 2; 1589 1758 } 1590 1759 … … 1637 1806 BOOL WINAPI SHLWAPI_289(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound) 1638 1807 { 1639 static BOOL (* WINAPI pfnFunc)(LPCWSTR, HMODULE, DWORD) = NULL; 1640 1641 GET_FUNC(winmm, "PlaySoundW", FALSE); 1642 return pfnFunc(pszSound, hmod, fdwSound); 1808 GET_FUNC(pPlaySoundW, winmm, "PlaySoundW", FALSE); 1809 return pPlaySoundW(pszSound, hmod, fdwSound); 1643 1810 } 1644 1811 … … 1675 1842 SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags) 1676 1843 { 1677 static DWORD (* WINAPI pfnFunc)(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT) = NULL; 1678 1679 GET_FUNC(shell32, "SHGetFileInfoW", 0); 1680 return pfnFunc(path, dwFileAttributes, psfi, sizeofpsfi, flags); 1844 GET_FUNC(pSHGetFileInfoW, shell32, "SHGetFileInfoW", 0); 1845 return pSHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags); 1681 1846 } 1682 1847 … … 1688 1853 UINT WINAPI SHLWAPI_318(HDROP hDrop, UINT lFile, LPWSTR lpszFile, UINT lLength) 1689 1854 { 1690 static UINT (* WINAPI pfnFunc)(HDROP, UINT, LPWSTR, UINT) = NULL; 1691 1692 GET_FUNC(shell32, "DragQueryFileW", 0); 1693 return pfnFunc(hDrop, lFile, lpszFile, lLength); 1855 GET_FUNC(pDragQueryFileW, shell32, "DragQueryFileW", 0); 1856 return pDragQueryFileW(hDrop, lFile, lpszFile, lLength); 1694 1857 } 1695 1858 … … 1701 1864 LPITEMIDLIST WINAPI SHLWAPI_333(LPBROWSEINFOW lpBi) 1702 1865 { 1703 static LPITEMIDLIST (* WINAPI pfnFunc)(LPBROWSEINFOW) = NULL; 1704 1705 GET_FUNC(shell32, "SHBrowseForFolderW", NULL); 1706 return pfnFunc(lpBi); 1866 GET_FUNC(pSHBrowseForFolderW, shell32, "SHBrowseForFolderW", NULL); 1867 return pSHBrowseForFolderW(lpBi); 1707 1868 } 1708 1869 … … 1714 1875 BOOL WINAPI SHLWAPI_334(LPCITEMIDLIST pidl,LPWSTR pszPath) 1715 1876 { 1716 static BOOL (* WINAPI pfnFunc)(LPCITEMIDLIST, LPWSTR) = NULL; 1717 1718 GET_FUNC(shell32, "SHGetPathFromIDListW", 0); 1719 return pfnFunc(pidl, pszPath); 1877 GET_FUNC(pSHGetPathFromIDListW, shell32, "SHGetPathFromIDListW", 0); 1878 return pSHGetPathFromIDListW(pidl, pszPath); 1720 1879 } 1721 1880 … … 1727 1886 BOOL WINAPI SHLWAPI_335(LPSHELLEXECUTEINFOW lpExecInfo) 1728 1887 { 1729 static BOOL (* WINAPI pfnFunc)(LPSHELLEXECUTEINFOW) = NULL; 1730 1731 GET_FUNC(shell32, "ShellExecuteExW", FALSE); 1732 return pfnFunc(lpExecInfo); 1888 GET_FUNC(pShellExecuteExW, shell32, "ShellExecuteExW", FALSE); 1889 return pShellExecuteExW(lpExecInfo); 1733 1890 } 1734 1891 … … 1740 1897 DWORD WINAPI SHLWAPI_336(LPSHFILEOPSTRUCTW lpFileOp) 1741 1898 { 1742 static HICON (* WINAPI pfnFunc)(LPSHFILEOPSTRUCTW) = NULL; 1743 1744 GET_FUNC(shell32, "SHFileOperationW", 0); 1745 return pfnFunc(lpFileOp); 1899 GET_FUNC(pSHFileOperationW, shell32, "SHFileOperationW", 0); 1900 return pSHFileOperationW(lpFileOp); 1746 1901 } 1747 1902 … … 1754 1909 HICON *phiconSmall, UINT nIcons) 1755 1910 { 1756 static HICON (* WINAPI pfnFunc)(LPCWSTR, INT,HICON *,HICON *, UINT) = NULL; 1757 1758 GET_FUNC(shell32, "ExtractIconExW", (HICON)0); 1759 return pfnFunc(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); 1911 GET_FUNC(pExtractIconExW, shell32, "ExtractIconExW", (HICON)0); 1912 return pExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); 1760 1913 } 1761 1914 … … 1764 1917 * 1765 1918 */ 1766 DWORD WINAPI SHLWAPI_342 ( 1767 LPDWORD w, /* [out] location to put HKEY value??? */ 1768 HKEY x, /* [in] appears to be HKEY_CURRENT_USER */ 1769 LPVOID y) 1770 { 1771 FIXME("(%p 0x%08x %p)stub\n", w,x,y); 1772 *w = (DWORD)x; 1773 return /* 0xabba1249 */ 0; 1919 LONG WINAPI SHInterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare) 1920 { 1921 return InterlockedCompareExchange(dest, xchg, compare); 1774 1922 } 1775 1923 … … 1788 1936 1789 1937 /************************************************************************* 1790 * @ [SHLWAPI.356] 1791 */ 1792 DWORD WINAPI SHLWAPI_356 ( 1793 LPVOID x, 1794 LPVOID y, 1795 LPVOID z) 1796 { 1797 FIXME("(%p %p %p)stub\n", x,y,z); 1798 return 0; 1799 } 1938 * @ [SHLWAPI.350] 1939 * 1940 * seems to be late bound call to GetFileVersionInfoSizeW 1941 */ 1942 DWORD WINAPI SHLWAPI_350 ( 1943 LPWSTR x, 1944 LPVOID y) 1945 { 1946 DWORD ret; 1947 1948 GET_FUNC(pGetFileVersionInfoSizeW, version, "GetFileVersionInfoSizeW", 0); 1949 ret = pGetFileVersionInfoSizeW(x, y); 1950 return 0x208 + ret; 1951 } 1952 1953 /************************************************************************* 1954 * @ [SHLWAPI.351] 1955 * 1956 * seems to be late bound call to GetFileVersionInfoW 1957 */ 1958 BOOL WINAPI SHLWAPI_351 ( 1959 LPWSTR w, /* [in] path to dll */ 1960 DWORD x, /* [in] parm 2 to GetFileVersionInfoA */ 1961 DWORD y, /* [in] return value from .350 - assume length */ 1962 LPVOID z) /* [in/out] buffer (+0x208 sent to GetFileVersionInfoA) */ 1963 { 1964 GET_FUNC(pGetFileVersionInfoW, version, "GetFileVersionInfoW", 0); 1965 #ifdef __WIN32OS2__ 1966 return pGetFileVersionInfoW(w, x, y-0x208, (LPSTR)z+0x208); 1967 #else 1968 return pGetFileVersionInfoW(w, x, y-0x208, z+0x208); 1969 #endif 1970 } 1971 1972 /************************************************************************* 1973 * @ [SHLWAPI.352] 1974 * 1975 * seems to be late bound call to VerQueryValueW 1976 */ 1977 WORD WINAPI SHLWAPI_352 ( 1978 LPVOID w, /* [in] buffer from _351 */ 1979 LPWSTR x, /* [in] value to retrieve - 1980 converted and passed to VerQueryValueA as #2 */ 1981 LPVOID y, /* [out] ver buffer - passed to VerQueryValueA as #3 */ 1982 UINT* z) /* [in] ver length - passed to VerQueryValueA as #4 */ 1983 { 1984 GET_FUNC(pVerQueryValueW, version, "VerQueryValueW", 0); 1985 #ifdef __WIN32OS2__ 1986 return pVerQueryValueW((LPSTR)w+0x208, x, y, z); 1987 #else 1988 return pVerQueryValueW(w+0x208, x, y, z); 1989 #endif 1990 } 1991 1992 /************************************************************************** 1993 * @ [SHLWAPI.356] 1994 * 1995 * mbc - this function is undocumented, The parameters are correct and 1996 * the calls to InitializeSecurityDescriptor and 1997 * SetSecurityDescriptorDacl are correct, but apparently some 1998 * apps call this function with all zero parameters. 1999 */ 2000 2001 DWORD WINAPI SHLWAPI_356(PACL pDacl, PSECURITY_DESCRIPTOR pSD, LPCSTR *str) 2002 { 2003 if(str != 0){ 2004 *str = 0; 2005 } 2006 2007 if(!pDacl){ 2008 return 0; 2009 } 2010 2011 if (!InitializeSecurityDescriptor(pSD, 1)) return 0; 2012 return SetSecurityDescriptorDacl(pSD, 1, pDacl, 0); 2013 } 2014 1800 2015 1801 2016 /************************************************************************* … … 1807 2022 BOOL *pfMustCopy, UINT uFlags) 1808 2023 { 1809 static BOOL (* WINAPI pfnFunc)(LPCWSTR, LPCWSTR, LPCWSTR, BOOL*, UINT) = NULL; 1810 1811 GET_FUNC(shell32, "SHGetNewLinkInfoW", FALSE); 1812 return pfnFunc(pszLinkTo, pszDir, pszName, pfMustCopy, uFlags); 2024 GET_FUNC(pSHGetNewLinkInfoW, shell32, "SHGetNewLinkInfoW", FALSE); 2025 return pSHGetNewLinkInfoW(pszLinkTo, pszDir, pszName, pfMustCopy, uFlags); 1813 2026 } 1814 2027 … … 1821 2034 LPVOID arg5, LPVOID arg6) 1822 2035 { 1823 /* FIXME: Correct args */ 1824 static DWORD (* WINAPI pfnFunc)(LPVOID, LPVOID, LPVOID, LPVOID, LPVOID, LPVOID) = NULL; 1825 1826 GET_FUNC(shell32, "SHDefExtractIconW", 0); 1827 return pfnFunc(arg1, arg2, arg3, arg4, arg5, arg6); 2036 GET_FUNC(pSHDefExtractIconW, shell32, "SHDefExtractIconW", 0); 2037 return pSHDefExtractIconW(arg1, arg2, arg3, arg4, arg5, arg6); 1828 2038 } 1829 2039 … … 1847 2057 UINT nIconIndex) 1848 2058 { 1849 static HICON (* WINAPI pfnFunc)(HINSTANCE, LPCWSTR, UINT) = NULL; 1850 1851 GET_FUNC(shell32, "ExtractIconW", (HICON)0); 1852 return pfnFunc(hInstance, lpszExeFileName, nIconIndex); 2059 GET_FUNC(pExtractIconW, shell32, "ExtractIconW", (HICON)0); 2060 return pExtractIconW(hInstance, lpszExeFileName, nIconIndex); 1853 2061 } 1854 2062 … … 1868 2076 * @ [SHLWAPI.377] 1869 2077 * 1870 * FIXME: Native appears to do DPA_Create and a DPA_InsertPtr for 2078 * FIXME: Native appears to do DPA_Create and a DPA_InsertPtr for 1871 2079 * each call here. 1872 2080 * FIXME: Native shows calls to: … … 1931 2139 BOOL WINAPI SHLWAPI_389(LPOPENFILENAMEW ofn) 1932 2140 { 1933 static BOOL (* WINAPI pfnFunc)(LPOPENFILENAMEW) = NULL; 1934 1935 GET_FUNC(comdlg32, "GetSaveFileNameW", FALSE); 1936 return pfnFunc(ofn); 2141 GET_FUNC(pGetSaveFileNameW, comdlg32, "GetSaveFileNameW", FALSE); 2142 return pGetSaveFileNameW(ofn); 1937 2143 } 1938 2144 … … 1944 2150 DWORD WINAPI SHLWAPI_390(LPVOID arg1, LPVOID arg2) 1945 2151 { 1946 /* FIXME: Correct args */ 1947 static DWORD (* WINAPI pfnFunc)(LPVOID, LPVOID) = NULL; 1948 1949 GET_FUNC(mpr, "WNetRestoreConnectionW", 0); 1950 return pfnFunc(arg1, arg2); 2152 GET_FUNC(pWNetRestoreConnectionW, mpr, "WNetRestoreConnectionW", 0); 2153 return pWNetRestoreConnectionW(arg1, arg2); 1951 2154 } 1952 2155 … … 1959 2162 LPVOID arg5) 1960 2163 { 1961 /* FIXME: Correct args */ 1962 static DWORD (* WINAPI pfnFunc)(LPVOID, LPVOID, LPVOID, LPVOID, LPVOID) = NULL; 1963 1964 GET_FUNC(mpr, "WNetGetLastErrorW", 0); 1965 return pfnFunc(arg1, arg2, arg3, arg4, arg5); 2164 GET_FUNC(pWNetGetLastErrorW, mpr, "WNetGetLastErrorW", 0); 2165 return pWNetGetLastErrorW(arg1, arg2, arg3, arg4, arg5); 1966 2166 } 1967 2167 … … 1973 2173 BOOL WINAPI SHLWAPI_401(LPPAGESETUPDLGW pagedlg) 1974 2174 { 1975 static BOOL (* WINAPI pfnFunc)(LPPAGESETUPDLGW) = NULL; 1976 1977 GET_FUNC(comdlg32, "PageSetupDlgW", FALSE); 1978 return pfnFunc(pagedlg); 2175 GET_FUNC(pPageSetupDlgW, comdlg32, "PageSetupDlgW", FALSE); 2176 return pPageSetupDlgW(pagedlg); 1979 2177 } 1980 2178 … … 1986 2184 BOOL WINAPI SHLWAPI_402(LPPRINTDLGW printdlg) 1987 2185 { 1988 static BOOL (* WINAPI pfnFunc)(LPPRINTDLGW) = NULL; 1989 1990 GET_FUNC(comdlg32, "PrintDlgW", FALSE); 1991 return pfnFunc(printdlg); 2186 GET_FUNC(pPrintDlgW, comdlg32, "PrintDlgW", FALSE); 2187 return pPrintDlgW(printdlg); 1992 2188 } 1993 2189 … … 1999 2195 BOOL WINAPI SHLWAPI_403(LPOPENFILENAMEW ofn) 2000 2196 { 2001 static BOOL (* WINAPI pfnFunc)(LPOPENFILENAMEW) = NULL; 2002 2003 GET_FUNC(comdlg32, "GetOpenFileNameW", FALSE); 2004 return pfnFunc(ofn); 2197 GET_FUNC(pGetOpenFileNameW, comdlg32, "GetOpenFileNameW", FALSE); 2198 return pGetOpenFileNameW(ofn); 2005 2199 } 2006 2200 … … 2069 2263 2070 2264 /************************************************************************* 2265 * @ [SHLWAPI.418] 2266 * 2267 * Function seems to do FreeLibrary plus other things. 2268 * 2269 * FIXME native shows the following calls: 2270 * RtlEnterCriticalSection 2271 * LocalFree 2272 * GetProcAddress(Comctl32??, 150L) 2273 * DPA_DeletePtr 2274 * RtlLeaveCriticalSection 2275 * followed by the FreeLibrary. 2276 * The above code may be related to .377 above. 2277 */ 2278 BOOL WINAPI SHLWAPI_418 (HMODULE x) 2279 { 2280 FIXME("(0x%08lx) partial stub\n", (LONG)x); 2281 return FreeLibrary(x); 2282 } 2283 2284 /************************************************************************* 2071 2285 * @ [SHLWAPI.431] 2072 2286 */ … … 2077 2291 } 2078 2292 2293 /************************************************************************* 2294 * @ [SHLWAPI.436] 2295 * 2296 * This is really CLSIDFromString which is exported by ole32.dll, 2297 * however the native shlwapi.dll does *not* import ole32. Nor does 2298 * ole32.dll import this ordinal from shlwapi. Therefore we must conclude 2299 * that MS duplicated the code for CLSIDFromString. 2300 * 2301 * This is a duplicate (with changes for UNICODE) of CLSIDFromString16 2302 * in dlls/ole32/compobj.c 2303 */ 2304 DWORD WINAPI SHLWAPI_436 (LPWSTR idstr, CLSID *id) 2305 { 2306 LPWSTR s = idstr; 2307 BYTE *p; 2308 INT i; 2309 WCHAR table[256]; 2310 2311 if (!s) { 2312 memset(s, 0, sizeof(CLSID)); 2313 return S_OK; 2314 } 2315 else { /* validate the CLSID string */ 2316 2317 if (strlenW(s) != 38) 2318 return CO_E_CLASSSTRING; 2319 2320 if ((s[0]!=L'{') || (s[9]!=L'-') || (s[14]!=L'-') || (s[19]!=L'-') || (s[24]!=L'-') || (s[37]!=L'}')) 2321 return CO_E_CLASSSTRING; 2322 2323 for (i=1; i<37; i++) 2324 { 2325 if ((i == 9)||(i == 14)||(i == 19)||(i == 24)) continue; 2326 if (!(((s[i] >= L'0') && (s[i] <= L'9')) || 2327 ((s[i] >= L'a') && (s[i] <= L'f')) || 2328 ((s[i] >= L'A') && (s[i] <= L'F'))) 2329 ) 2330 return CO_E_CLASSSTRING; 2331 } 2332 } 2333 2334 TRACE("%s -> %p\n", debugstr_w(s), id); 2335 2336 /* quick lookup table */ 2337 memset(table, 0, 256*sizeof(WCHAR)); 2338 2339 for (i = 0; i < 10; i++) { 2340 table['0' + i] = i; 2341 } 2342 for (i = 0; i < 6; i++) { 2343 table['A' + i] = i+10; 2344 table['a' + i] = i+10; 2345 } 2346 2347 /* in form {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} */ 2348 2349 p = (BYTE *) id; 2350 2351 s++; /* skip leading brace */ 2352 for (i = 0; i < 4; i++) { 2353 p[3 - i] = table[*s]<<4 | table[*(s+1)]; 2354 s += 2; 2355 } 2356 p += 4; 2357 s++; /* skip - */ 2358 2359 for (i = 0; i < 2; i++) { 2360 p[1-i] = table[*s]<<4 | table[*(s+1)]; 2361 s += 2; 2362 } 2363 p += 2; 2364 s++; /* skip - */ 2365 2366 for (i = 0; i < 2; i++) { 2367 p[1-i] = table[*s]<<4 | table[*(s+1)]; 2368 s += 2; 2369 } 2370 p += 2; 2371 s++; /* skip - */ 2372 2373 /* these are just sequential bytes */ 2374 for (i = 0; i < 2; i++) { 2375 *p++ = table[*s]<<4 | table[*(s+1)]; 2376 s += 2; 2377 } 2378 s++; /* skip - */ 2379 2380 for (i = 0; i < 6; i++) { 2381 *p++ = table[*s]<<4 | table[*(s+1)]; 2382 s += 2; 2383 } 2384 2385 return S_OK; 2386 } 2079 2387 #ifndef __WIN32OS2__ 2080 2388 /************************************************************************* … … 2104 2412 * Input HLS values are constrained to the range (0..240). 2105 2413 */ 2106 VOID WINAPI ColorRGBToHLS(COLORREF drRGB, LPWORD pwHue, 2414 VOID WINAPI ColorRGBToHLS(COLORREF drRGB, LPWORD pwHue, 2107 2415 LPWORD wLuminance, LPWORD pwSaturation) 2108 2416 { … … 2123 2431 * SHGetInverseCMAP (SHLWAPI.@) 2124 2432 */ 2125 DWORD WINAPI SHGetInverseCMAP (LPVOID x, DWORD why) 2126 { 2127 FIXME("(%p, %#lx)stub\n", x, why); 2433 DWORD WINAPI SHGetInverseCMAP (LPDWORD* x, DWORD why) 2434 { 2435 if (why == 4) { 2436 FIXME(" - returning bogus address for SHGetInverseCMAP\n"); 2437 *x = (LPDWORD)0xabba1249; 2128 2438 return 0; 2129 } 2130 2131 #ifndef __WIN32OS2__ 2439 } 2440 FIXME("(%p, %#lx)stub\n", x, why); 2441 return 0; 2442 } 2443 2132 2444 /************************************************************************* 2133 2445 * SHIsLowMemoryMachine [SHLWAPI.@] … … 2138 2450 return 0; 2139 2451 } 2140 #endif 2452 2141 2453 /************************************************************************* 2142 2454 * GetMenuPosFromID [SHLWAPI.@] … … 2164 2476 HRESULT WINAPI _SHGetInstanceExplorer (LPUNKNOWN *lpUnknown) 2165 2477 { 2166 static HRESULT (* WINAPI pfnFunc)(LPUNKNOWN *) = NULL; 2167 2168 GET_FUNC(shell32, "SHGetInstanceExplorer", E_FAIL); 2169 return pfnFunc(lpUnknown); 2170 } 2478 GET_FUNC(pSHGetInstanceExplorer, shell32, "SHGetInstanceExplorer", E_FAIL); 2479 return pSHGetInstanceExplorer(lpUnknown); 2480 } 2481 2482 /************************************************************************* 2483 * SHGetThreadRef [SHLWAPI.@] 2484 * 2485 * Retrieves the per-thread object reference set by SHSetThreadRef 2486 * "punk" - Address of a pointer to the IUnknown interface. Returns S_OK if 2487 * successful or E_NOINTERFACE otherwise. 2488 */ 2489 HRESULT WINAPI SHGetThreadRef (IUnknown ** ppunk) 2490 { 2491 if (SHLWAPI_ThreadRef_index < 0) return E_NOINTERFACE; 2492 *ppunk = (IUnknown *)TlsGetValue(SHLWAPI_ThreadRef_index); 2493 return S_OK; 2494 } 2495 2496 /************************************************************************* 2497 * SHSetThreadRef [SHLWAPI.@] 2498 * 2499 * Stores a per-thread reference to a COM object 2500 * "punk" - Pointer to the IUnknown interface of the object to 2501 * which you want to store a reference. Returns S_OK if successful 2502 * or an OLE error value. 2503 */ 2504 HRESULT WINAPI SHSetThreadRef (IUnknown * punk) 2505 { 2506 if (SHLWAPI_ThreadRef_index < 0) return E_NOINTERFACE; 2507 TlsSetValue(SHLWAPI_ThreadRef_index, (LPVOID) punk); 2508 return S_OK; 2509 }
Note:
See TracChangeset
for help on using the changeset viewer.