From 932544d34c24ee3e69dbd9c80a343b29ef96ebbe Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Mon, 16 Nov 2009 23:41:48 +0000 Subject: [PATCH] ole32: OleInitialize should return S_OK if it is called for the first time on a thread independently of CoInitializeEx. --- dlls/ole32/ole2.c | 3 +++ dlls/ole32/tests/compobj.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index c612f335e9d..6bf79fdb507 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -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: diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index 442e7b0b323..5ddfc11fc79 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -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); -- 2.11.4.GIT