[SHELL32] SHCreateShellFolderView(): Fix parameter validation order. (#1632)
authorSerge Gautherie <32623169+SergeGautherie@users.noreply.github.com>
Sun, 9 Jun 2019 13:57:45 +0000 (15:57 +0200)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Sun, 9 Jun 2019 13:57:45 +0000 (15:57 +0200)
Fixes one modification from commit ae2a85d0.
CORE-16098

dll/win32/shell32/CDefView.cpp

index 8541e56..df076f5 100644 (file)
@@ -3449,14 +3449,17 @@ HRESULT WINAPI SHCreateShellFolderView(const SFV_CREATE *pcsfv,
     CComPtr<IShellView> psv;
     HRESULT hRes;
 
-    if (!ppsv || !pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
+    if (!ppsv)
+        return E_INVALIDARG;
+
+    *ppsv = NULL;
+
+    if (!pcsfv || pcsfv->cbSize != sizeof(*pcsfv))
         return E_INVALIDARG;
 
     TRACE("sf=%p outer=%p callback=%p\n",
       pcsfv->pshf, pcsfv->psvOuter, pcsfv->psfvcb);
 
-    *ppsv = NULL;
-
     hRes = CDefView_CreateInstance(pcsfv->pshf, IID_PPV_ARG(IShellView, &psv));
     if (FAILED(hRes))
         return hRes;