Paul Vriens : shell32/tests: Make tests run again on win95.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 14 07:13:04 CDT 2007


Module: wine
Branch: master
Commit: f076919ca828e02a6e86f6286a20d11f44d0e0ed
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f076919ca828e02a6e86f6286a20d11f44d0e0ed

Author: Paul Vriens <paul.vriens.wine at gmail.com>
Date:   Tue Aug 14 12:11:04 2007 +0200

shell32/tests: Make tests run again on win95.

---

 dlls/shell32/tests/shelllink.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 8db88bb..bdf537e 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -41,6 +41,8 @@ static fnILFree pILFree;
 static fnILIsEqual pILIsEqual;
 static fnSHILCreateFromPath pSHILCreateFromPath;
 
+static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD);
+
 static const GUID _IID_IShellLinkDataList = {
     0x45e2b4ae, 0xb1c3, 0x11d0,
     { 0xb9, 0x2f, 0x00, 0xa0, 0xc9, 0x03, 0x12, 0xe1 }
@@ -563,7 +565,7 @@ static void test_load_save(void)
     /* Create a temporary non-executable file */
     r=GetTempPath(sizeof(mypath), mypath);
     ok(r>=0 && r<sizeof(mypath), "GetTempPath failed (%d), err %d\n", r, GetLastError());
-    r=GetLongPathName(mypath, mydir, sizeof(mydir));
+    r=pGetLongPathNameA(mypath, mydir, sizeof(mydir));
     ok(r>=0 && r<sizeof(mydir), "GetLongPathName failed (%d), err %d\n", r, GetLastError());
     p=strrchr(mydir, '\\');
     if (p)
@@ -681,13 +683,15 @@ static void test_datalink(void)
 START_TEST(shelllink)
 {
     HRESULT r;
-    HMODULE hmod;
+    HMODULE hmod = GetModuleHandleA("shell32.dll");
+    HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
 
-    hmod = GetModuleHandle("shell32");
     pILFree = (fnILFree) GetProcAddress(hmod, (LPSTR)155);
     pILIsEqual = (fnILIsEqual) GetProcAddress(hmod, (LPSTR)21);
     pSHILCreateFromPath = (fnSHILCreateFromPath) GetProcAddress(hmod, (LPSTR)28);
 
+    pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA");
+
     r = CoInitialize(NULL);
     ok(SUCCEEDED(r), "CoInitialize failed (0x%08x)\n", r);
     if (!SUCCEEDED(r))




More information about the wine-cvs mailing list