[PATCH] Add test to check for GetLongPathNameA on GetModuleFileNameA's returned string.

Zac Brown zac at zacbrown.org
Wed Jun 4 20:01:58 CDT 2008


---
 dlls/kernel32/tests/path.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index d158df1..7db740d 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -52,6 +52,7 @@ static const CHAR is_char_ok[] ="11111110111111111011";
 
 static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR,LPSTR,DWORD);
 static DWORD (WINAPI *pGetLongPathNameW)(LPWSTR,LPWSTR,DWORD);
+static DWORD (WINAPI *pGetModuleFileNameA)(HMODULE,LPTSTR,DWORD);
 
 /* Present in Win2003+ */
 static BOOL  (WINAPI *pNeedCurrentDirectoryForExePathA)(LPCSTR);
@@ -784,6 +785,15 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
     ok(lstrcmpiA(tmpstr1,tmpstr)==0,
        "GetLongPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
   }
+
+/* Try getting the long path of your module name */
+  if(pGetLongPathNameA) {
+    ok(pGetModuleFileNameA(NULL,tmpstr,sizeof(tmpstr)),"GetModuleFileNameA failed %s\n",
+       tmpstr);
+    todo_wine ok(pGetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA failed %s\n",
+       tmpstr);
+  }
+
 /* Check out Get*PathNameA on some funny characters */
   for(i=0;i<lstrlenA(funny_chars);i++) {
     INT valid;
@@ -1253,6 +1263,8 @@ START_TEST(path)
     pNeedCurrentDirectoryForExePathW =
         (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"),
                                "NeedCurrentDirectoryForExePathW" );
+    pGetModuleFileNameA =
+        (void*)GetProcAddress( GetModuleHandleA("kernel32.dll"), "GetModuleFileNameA" );
 
     test_InitPathA(curdir, &curDrive, &otherDrive);
     test_CurrentDirectoryA(origdir,curdir);
-- 
1.5.3.6


--------------080209060209040309010308--



More information about the wine-patches mailing list