[PATCH v2 4/5] shell32: Return E_INVALIDARG from FolderItems functions on null output.

Alex Henrie alexhenrie24 at gmail.com
Tue Jul 5 00:47:29 CDT 2016


Cc: Christian Costa <titan.costa at gmail.com>
Cc: Sebastian Lackner <sebastian at fds-team.de>

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/shell32/shelldispatch.c       | 15 +++++++++++++++
 dlls/shell32/tests/shelldispatch.c |  4 ----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index 3661430..2a27104 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -1056,6 +1056,9 @@ static HRESULT WINAPI FolderItemsImpl_get_Count(FolderItems3 *iface, LONG *count
 {
     FIXME("(%p,%p)\n", iface, count);
 
+    if (!count)
+        return E_INVALIDARG;
+
     return E_NOTIMPL;
 }
 
@@ -1063,6 +1066,9 @@ static HRESULT WINAPI FolderItemsImpl_get_Application(FolderItems3 *iface, IDisp
 {
     FIXME("(%p,%p)\n", iface, ppid);
 
+    if (!ppid)
+        return E_INVALIDARG;
+
     return E_NOTIMPL;
 }
 
@@ -1077,6 +1083,9 @@ static HRESULT WINAPI FolderItemsImpl_Item(FolderItems3 *iface, VARIANT index, F
 {
     FIXME("(%p,%s,%p)\n", iface, debugstr_variant(&index), ppid);
 
+    if (!ppid)
+        return E_INVALIDARG;
+
     return E_NOTIMPL;
 }
 
@@ -1084,6 +1093,9 @@ static HRESULT WINAPI FolderItemsImpl__NewEnum(FolderItems3 *iface, IUnknown **p
 {
     FIXME("(%p,%p)\n", iface, ppunk);
 
+    if (!ppunk)
+        return E_INVALIDARG;
+
     return E_NOTIMPL;
 }
 
@@ -1105,6 +1117,9 @@ static HRESULT WINAPI FolderItemsImpl_get_Verbs(FolderItems3 *iface, FolderItemV
 {
     FIXME("(%p,%p)\n", iface, ppfic);
 
+    if (!ppfic)
+        return E_INVALIDARG;
+
     return E_NOTIMPL;
 }
 
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index 2a0f67b..f0738d4 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -355,7 +355,6 @@ static void test_items(void)
     if (0) /* crashes on all versions of Windows */
     {
         r = FolderItems_get_Count(items, NULL);
-todo_wine
         ok(r == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", r);
     }
 
@@ -376,7 +375,6 @@ todo_wine
     if (0) /* crashes on xp */
     {
         r = FolderItems_get_Application(items, NULL);
-todo_wine
         ok(r == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", r);
     }
 
@@ -402,7 +400,6 @@ todo_wine
     if (0) /* crashes on xp */
     {
         r = FolderItems__NewEnum(items, NULL);
-todo_wine
         ok(r == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", r);
     }
 
@@ -422,7 +419,6 @@ todo_wine
         if (0) /* crashes on xp */
         {
             r = FolderItems3_get_Verbs(items3, NULL);
-todo_wine
             ok(r == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", r);
         }
 
-- 
2.9.0




More information about the wine-patches mailing list