Vladimir Pankratov : shell32: Handle NULL path.

Alexandre Julliard julliard at winehq.org
Fri Aug 28 10:18:47 CDT 2009


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

Author: Vladimir Pankratov <scriptkid at mail.ru>
Date:   Fri Aug 28 15:38:11 2009 +0500

shell32: Handle NULL path.

---

 dlls/shell32/shell32_main.c    |    3 +++
 dlls/shell32/tests/shlfileop.c |    8 ++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c
index fdc22d2..f3f8725 100644
--- a/dlls/shell32/shell32_main.c
+++ b/dlls/shell32/shell32_main.c
@@ -350,6 +350,9 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
           (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes,
           psfi, psfi->dwAttributes, sizeofpsfi, flags);
 
+    if (!path)
+        return FALSE;
+
     /* windows initializes these values regardless of the flags */
     if (psfi != NULL)
     {
diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c
index 3c126ed..f89fa49 100644
--- a/dlls/shell32/tests/shlfileop.c
+++ b/dlls/shell32/tests/shlfileop.c
@@ -207,11 +207,11 @@ static void test_get_file_info(void)
         memset(&shfiw, 0xcf, sizeof(shfiw));
         memset(&unset_icon, 0xcf, sizeof(unset_icon));
         rc=pSHGetFileInfoW(NULL, 0, &shfiw, sizeof(shfiw), 0);
-        todo_wine ok(!rc, "SHGetFileInfoW(NULL | 0) should fail\n");
+        ok(!rc, "SHGetFileInfoW(NULL | 0) should fail\n");
         ok(shfiw.hIcon == unset_icon, "SHGetFileInfoW(NULL | 0) should not clear hIcon\n");
-        todo_wine ok(shfiw.szDisplayName[0] == 0xcfcf, "SHGetFileInfoW(NULL | 0) should not clear szDisplayName[0]\n");
-        todo_wine ok(shfiw.szTypeName[0] == 0xcfcf, "SHGetFileInfoW(NULL | 0) should not clear szTypeName[0]\n");
-        todo_wine ok(shfiw.iIcon == 0xcfcfcfcf, "SHGetFileInfoW(NULL | 0) should not clear iIcon\n");
+        ok(shfiw.szDisplayName[0] == 0xcfcf, "SHGetFileInfoW(NULL | 0) should not clear szDisplayName[0]\n");
+        ok(shfiw.szTypeName[0] == 0xcfcf, "SHGetFileInfoW(NULL | 0) should not clear szTypeName[0]\n");
+        ok(shfiw.iIcon == 0xcfcfcfcf, "SHGetFileInfoW(NULL | 0) should not clear iIcon\n");
         ok(shfiw.dwAttributes == 0xcfcfcfcf, "SHGetFileInfoW(NULL | 0) should not clear dwAttributes\n");
     }
     else




More information about the wine-cvs mailing list