shell32/tests: ILFree() and ILIsEqual() are exported by ordinal only on Win9x. So use GetProcAddress().

This commit is contained in:
Francois Gouget 2007-02-09 12:38:11 +01:00 committed by Alexandre Julliard
parent f3899c2651
commit 14712ece18
1 changed files with 18 additions and 15 deletions

View File

@ -46,6 +46,8 @@ static HRESULT (WINAPI *pSHBindToParent)(LPCITEMIDLIST, REFIID, LPVOID*, LPCITEM
static BOOL (WINAPI *pSHGetSpecialFolderPathW)(HWND, LPWSTR, int, BOOL);
static HRESULT (WINAPI *pStrRetToBufW)(STRRET*,LPCITEMIDLIST,LPWSTR,UINT);
static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST);
static void (WINAPI *pILFree)(LPITEMIDLIST);
static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
static void init_function_pointers(void)
{
@ -58,7 +60,8 @@ static void init_function_pointers(void)
pSHBindToParent = (void*)GetProcAddress(hmod, "SHBindToParent");
pSHGetSpecialFolderPathW = (void*)GetProcAddress(hmod, "SHGetSpecialFolderPathW");
pILFindLastID = (void *)GetProcAddress(hmod, (LPCSTR)16);
pILFree = (void*)GetProcAddress(hmod, (LPSTR)155);
pILIsEqual = (void*)GetProcAddress(hmod, (LPSTR)21);
}
hmod = GetModuleHandleA("shlwapi.dll");
@ -429,10 +432,10 @@ static void test_GetDisplayName(void)
hr = IShellFolder_SetNameOf(psfPersonal, NULL, pidlNew, wszFileName, SHGDN_FORPARSING, NULL);
ok (SUCCEEDED(hr), "SetNameOf failed! hr = %08x\n", hr);
ILFree(pidlNew);
pILFree(pidlNew);
IShellFolder_Release(psfPersonal);
}
/* Deleting the file and the directory */
DeleteFileA(szTestFile);
RemoveDirectoryA(szTestDir);
@ -1122,17 +1125,17 @@ static void test_FolderShortcut(void) {
ok (SUCCEEDED(hr), "IPersistFolder3::Initialize failed! hr = %08x\n", hr);
if (FAILED(hr)) {
IPersistFolder3_Release(pPersistFolder3);
ILFree(pidlWineTestFolder);
pILFree(pidlWineTestFolder);
return;
}
hr = IPersistFolder3_GetCurFolder(pPersistFolder3, &pidlCurrentFolder);
ok(SUCCEEDED(hr), "IPersistFolder3_GetCurFolder failed! hr=0x%08x\n", hr);
ok(ILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
ok(pILIsEqual(pidlCurrentFolder, pidlWineTestFolder),
"IPersistFolder3_GetCurFolder should return pidlWineTestFolder!\n");
ILFree(pidlCurrentFolder);
ILFree(pidlWineTestFolder);
pILFree(pidlCurrentFolder);
pILFree(pidlWineTestFolder);
hr = IPersistFolder3_QueryInterface(pPersistFolder3, &IID_IShellFolder, (LPVOID*)&pShellFolder);
IPersistFolder3_Release(pPersistFolder3);
ok(SUCCEEDED(hr), "IPersistFolder3_QueryInterface(IShellFolder) failed! hr = %08x\n", hr);
@ -1166,12 +1169,12 @@ static void test_FolderShortcut(void) {
return;
}
hr = IShellFolder_BindToObject(pShellFolder, pidlSubFolder, NULL, &IID_IPersistFolder3,
hr = IShellFolder_BindToObject(pShellFolder, pidlSubFolder, NULL, &IID_IPersistFolder3,
(LPVOID*)&pPersistFolder3);
IShellFolder_Release(pShellFolder);
ILFree(pidlSubFolder);
pILFree(pidlSubFolder);
ok (SUCCEEDED(hr), "IShellFolder::BindToObject failed! hr = %08x\n", hr);
if (FAILED(hr))
if (FAILED(hr))
return;
/* On windows, we expect CLSID_ShellFSFolder. On wine we relax this constraint
@ -1242,10 +1245,10 @@ static void test_ITEMIDLIST_format(void) {
return;
}
hr = IShellFolder_BindToObject(psfDesktop, pidlPersonal, NULL, &IID_IShellFolder,
hr = IShellFolder_BindToObject(psfDesktop, pidlPersonal, NULL, &IID_IShellFolder,
(LPVOID*)&psfPersonal);
IShellFolder_Release(psfDesktop);
ILFree(pidlPersonal);
pILFree(pidlPersonal);
ok(SUCCEEDED(hr), "psfDesktop->BindToObject failed! hr = %08x\n", hr);
if (FAILED(hr)) return;
@ -1329,7 +1332,7 @@ static void test_ITEMIDLIST_format(void) {
}
}
ILFree(pidlFile);
pILFree(pidlFile);
}
}