Commit 932544d3 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

ole32: OleInitialize should return S_OK if it is called for the first time on a…

ole32: OleInitialize should return S_OK if it is called for the first time on a thread independently of CoInitializeEx.
parent d168f719
...@@ -190,6 +190,9 @@ HRESULT WINAPI OleInitialize(LPVOID reserved) ...@@ -190,6 +190,9 @@ HRESULT WINAPI OleInitialize(LPVOID reserved)
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
if (!COM_CurrentInfo()->ole_inits)
hr = S_OK;
/* /*
* Then, it has to initialize the OLE specific modules. * Then, it has to initialize the OLE specific modules.
* This includes: * This includes:
......
...@@ -1415,7 +1415,7 @@ static void test_CoInitializeEx(void) ...@@ -1415,7 +1415,7 @@ static void test_CoInitializeEx(void)
/* Calling OleInitialize for the first time should yield S_OK even with /* Calling OleInitialize for the first time should yield S_OK even with
* apartment already initialized by previous CoInitialize(Ex) calls. */ * apartment already initialized by previous CoInitialize(Ex) calls. */
hr = OleInitialize(NULL); 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 */ /* Subsequent calls to OleInitialize should return S_FALSE */
hr = OleInitialize(NULL); hr = OleInitialize(NULL);
......
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