Thomas Faber : shell32: Add missing parameter check in ISF_Desktop_fnQueryInterface.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Jun 30 10:07:58 CDT 2015
Module: wine
Branch: master
Commit: c0cd954f98545ff21e68abdfd7b4fdaf17c17005
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c0cd954f98545ff21e68abdfd7b4fdaf17c17005
Author: Thomas Faber <thomas.faber at reactos.org>
Date: Sat Jun 27 06:40:11 2015 -0400
shell32: Add missing parameter check in ISF_Desktop_fnQueryInterface.
---
dlls/shell32/shfldr_desktop.c | 2 ++
dlls/shell32/tests/shfldr_special.c | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c
index 4aa1dcf..40cd752 100644
--- a/dlls/shell32/shfldr_desktop.c
+++ b/dlls/shell32/shfldr_desktop.c
@@ -106,6 +106,8 @@ static HRESULT WINAPI ISF_Desktop_fnQueryInterface(
TRACE ("(%p)->(%s,%p)\n", This, shdebugstr_guid (riid), ppvObj);
+ if (!ppvObj) return E_POINTER;
+
*ppvObj = NULL;
if (IsEqualIID (riid, &IID_IUnknown) ||
diff --git a/dlls/shell32/tests/shfldr_special.c b/dlls/shell32/tests/shfldr_special.c
index 8f97347..6d61220 100644
--- a/dlls/shell32/tests/shfldr_special.c
+++ b/dlls/shell32/tests/shfldr_special.c
@@ -224,9 +224,24 @@ if (0)
CoUninitialize();
}
+static void test_desktop_folder(void)
+{
+ IShellFolder *psf;
+ HRESULT hr;
+
+ hr = SHGetDesktopFolder(&psf);
+ ok(hr == S_OK, "Got %x\n", hr);
+
+ hr = IShellFolder_QueryInterface(psf, &IID_IShellFolder, NULL);
+ ok(hr == E_POINTER, "Got %x\n", hr);
+
+ IShellFolder_Release(psf);
+}
+
START_TEST(shfldr_special)
{
test_parse_for_entire_network();
test_parse_for_control_panel();
test_printers_folder();
+ test_desktop_folder();
}
More information about the wine-cvs
mailing list