ole32: CoCreateGuid returns E_INVALIDARG on null-GUID.

This commit is contained in:
Guillaume Charifi 2014-06-07 19:24:28 +02:00 committed by Alexandre Julliard
parent d13d296c27
commit 216b24527d
2 changed files with 14 additions and 1 deletions

View file

@ -2051,7 +2051,11 @@ HRESULT WINAPI CoDisconnectObject( LPUNKNOWN lpUnk, DWORD reserved )
*/
HRESULT WINAPI CoCreateGuid(GUID *pguid)
{
DWORD status = UuidCreate(pguid);
DWORD status;
if(!pguid) return E_INVALIDARG;
status = UuidCreate(pguid);
if (status == RPC_S_OK || status == RPC_S_UUID_LOCAL_ONLY) return S_OK;
return HRESULT_FROM_WIN32( status );
}

View file

@ -1977,6 +1977,14 @@ static void test_OleRegGetMiscStatus(void)
}
}
static void test_CoCreateGuid(void)
{
HRESULT hr;
hr = CoCreateGuid(NULL);
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
}
static void init_funcs(void)
{
HMODULE hOle32 = GetModuleHandleA("ole32");
@ -2033,4 +2041,5 @@ START_TEST(compobj)
test_CoGetTreatAsClass();
test_CoInitializeEx();
test_OleRegGetMiscStatus();
test_CoCreateGuid();
}