Commit aaf7a974 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole: ProgIDFromCLSID sets progid to NULL on failure.

parent 6bc59056
......@@ -1049,6 +1049,7 @@ HRESULT WINAPI ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *lplpszProgID)
HRESULT ret;
LONG progidlen = 0;
*lplpszProgID = NULL;
ret = COM_OpenKeyForCLSID(clsid, wszProgID, KEY_READ, &hkey);
if (FAILED(ret))
return ret;
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment