ole: ProgIDFromCLSID sets progid to NULL on failure.
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Fri Jan 20 06:46:15 CST 2006
Huw Davies <huw at codeweavers.com>
ole: ProgIDFromCLSID sets progid to NULL on failure.
--
Huw Davies
huw at codeweavers.com
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 80ecd11..ce6be87 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -1049,6 +1049,7 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID
HRESULT ret;
LONG progidlen = 0;
+ *lplpszProgID = NULL;
ret = COM_OpenKeyForCLSID(clsid, wszProgID, KEY_READ, &hkey);
if (FAILED(ret))
return ret;
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index b4a5cb4..ef043b1 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -30,6 +30,7 @@
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08lx\n", hr)
+static const CLSID CLSID_non_existent = { 0x12345678, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
static const CLSID CLSID_CDeviceMoniker = { 0x4315d437, 0x5b8c, 0x11d0, { 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86 } };
static const WCHAR devicedotone[] = {'d','e','v','i','c','e','.','1',0};
static const WCHAR wszCLSID_CDeviceMoniker[] =
@@ -53,6 +54,11 @@ static void test_ProgIDFromCLSID(void)
ok(!lstrcmpiW(progid, devicedotone), "Didn't get expected prog ID\n");
CoTaskMemFree(progid);
}
+
+ progid = (LPWSTR)0xdeadbeef;
+ hr = ProgIDFromCLSID(&CLSID_non_existent, &progid);
+ ok(hr == REGDB_E_CLASSNOTREG, "ProgIDFromCLSID returned %08lx\n", hr);
+ ok(progid == NULL, "ProgIDFromCLSID returns with progid %p\n", progid);
}
static void test_CLSIDFromProgID(void)
More information about the wine-patches
mailing list