On 07/22/2010 02:55 PM, Alexandre Julliard wrote:
Paul Vriens<[email protected]> writes:
On 07/22/2010 02:03 PM, Andrew Nguyen wrote:
There are a few things I'm wondering about:
When the winetest shlwapi binary was built, what made the compiler
decide to import shell32 for the problematic string functions? Neither
my local cross-compile build nor the build that the test bot performs
seemed to do this. I notice that shell32 is the first import listed in
dlls/shlwapi/tests/Makefile.in. Was it possible that the listed import
order influenced how the compiler linked the string functions, and would
changing the import order be preferable to explicitly loading string
functions that seem to be available on all shlwapi versions?
No clue. If we want to test some function in shlwapi however why not
explicitly load them?
The order matters, so functions will be resolved to shell32 first. A
better fix is to get rid of the shell32 import. We do want to import
shlwapi to test ordinal imports.
So something like the attached? Not fully tested yet.
--
Cheers,
Paul.
diff --git a/dlls/shlwapi/tests/Makefile.in b/dlls/shlwapi/tests/Makefile.in
index a810f84..e3f9b94 100644
--- a/dlls/shlwapi/tests/Makefile.in
+++ b/dlls/shlwapi/tests/Makefile.in
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = shlwapi.dll
-IMPORTS = shell32 shlwapi user32 ole32 oleaut32 advapi32
+IMPORTS = shlwapi user32 ole32 oleaut32 advapi32
C_SRCS = \
assoc.c \
diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c
index 4b1690a..ef8845b 100644
--- a/dlls/shlwapi/tests/ordinal.c
+++ b/dlls/shlwapi/tests/ordinal.c
@@ -62,6 +62,9 @@ static HRESULT (WINAPI
*pSHIShellFolder_EnumObjects)(LPSHELLFOLDER, HWND, SHCONT
static HMODULE hmlang;
static HRESULT (WINAPI *pLcidToRfc1766A)(LCID, LPSTR, INT);
+static HMODULE hshell32;
+static HRESULT (WINAPI *pSHGetDesktopFolder)(IShellFolder**);
+
static const CHAR ie_international[] = {
'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
@@ -2505,7 +2508,7 @@ static void test_SHIShellFolder_EnumObjects(void)
ok(enm == (IEnumIDList*)0xcafebabe, "Didn't get expected enumerator
location, instead: %p\n", enm);
/* SHIShellFolder_EnumObjects isn't strict about the IShellFolder object */
- hres = SHGetDesktopFolder(&folder);
+ hres = pSHGetDesktopFolder(&folder);
ok(hres == S_OK, "SHGetDesktopFolder failed: 0x%08x\n", hres);
enm = NULL;
@@ -2554,6 +2557,9 @@ START_TEST(ordinal)
hmlang = LoadLibraryA("mlang.dll");
pLcidToRfc1766A = (void *)GetProcAddress(hmlang, "LcidToRfc1766A");
+ hshell32 = LoadLibraryA("shell32.dll");
+ pSHGetDesktopFolder = (void *)GetProcAddress(hshell32,
"SHGetDesktopFolder");
+
test_GetAcceptLanguagesA();
test_SHSearchMapInt();
test_alloc_shared();
@@ -2570,4 +2576,7 @@ START_TEST(ordinal)
test_IUnknown_ProfferService();
test_SHCreateWorkerWindowA();
test_SHIShellFolder_EnumObjects();
+
+ FreeLibrary(hshell32);
+ FreeLibrary(hmlang);
}