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

Alexandre Julliard julliard at winehq.org
Tue Nov 17 09:28:17 CST 2009


Module: wine
Branch: master
Commit: 932544d34c24ee3e69dbd9c80a343b29ef96ebbe
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=932544d34c24ee3e69dbd9c80a343b29ef96ebbe

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Mon Nov 16 23:41:48 2009 +0000

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 deletions(-)

diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index c612f33..6bf79fd 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 442e7b0..5ddfc11 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);




More information about the wine-cvs mailing list