ole32: OleInitialize should return S_OK if it is called for the first time on a thread independently of CoInitializeEx.

This commit is contained in:
Rob Shearman 2009-11-16 23:41:48 +00:00 committed by Alexandre Julliard
parent d168f71912
commit 932544d34c
2 changed files with 4 additions and 1 deletions

View File

@ -190,6 +190,9 @@ HRESULT WINAPI OleInitialize(LPVOID reserved)
if (FAILED(hr))
return hr;
if (!COM_CurrentInfo()->ole_inits)
hr = S_OK;
/*
* Then, it has to initialize the OLE specific modules.
* This includes:

View File

@ -1415,7 +1415,7 @@ static void test_CoInitializeEx(void)
/* Calling OleInitialize for the first time should yield S_OK even with
* apartment already initialized by previous CoInitialize(Ex) calls. */
hr = OleInitialize(NULL);
todo_wine ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
/* Subsequent calls to OleInitialize should return S_FALSE */
hr = OleInitialize(NULL);