https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8a8453494f810be74820c…
commit 8a8453494f810be74820ce291e59fa1c7ad99b50
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Sun Jun 9 15:57:45 2019 +0200
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Jun 9 15:57:45 2019 +0200
[SHELL32] SHCreateShellFolderView(): Fix parameter validation order. (#1632)
Fixes one modification from commit ae2a85d0.
CORE-16098
---
dll/win32/shell32/CDefView.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 8541e56fa7..df076f5263 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -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;