ole32: CoCreateGuid returns E_INVALIDARG on null-GUID.
This commit is contained in:
parent
d13d296c27
commit
216b24527d
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue