Rob Shearman : rpcss: When registering a moniker that is already registered in the ROT another ROT entry should still be created and a distinct cookie returned .

Alexandre Julliard julliard at winehq.org
Tue Apr 29 08:54:24 CDT 2008


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Mon Apr 28 19:42:35 2008 +0100

rpcss: When registering a moniker that is already registered in the ROT another ROT entry should still be created and a distinct cookie returned.

---

 dlls/ole32/tests/moniker.c |    1 -
 programs/rpcss/irotp.c     |   20 +++++---------------
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/dlls/ole32/tests/moniker.c b/dlls/ole32/tests/moniker.c
index aa737c0..b15cce4 100644
--- a/dlls/ole32/tests/moniker.c
+++ b/dlls/ole32/tests/moniker.c
@@ -690,7 +690,6 @@ static void test_ROT_multiple_entries(void)
     hr = IRunningObjectTable_Register(pROT, 0, (IUnknown *)&Test_ClassFactory, pMoniker, &dwCookie2);
     ok(hr == MK_S_MONIKERALREADYREGISTERED, "IRunningObjectTable_Register should have returned MK_S_MONIKERALREADYREGISTERED instead of 0x%08x\n", hr);
 
-    todo_wine
     ok(dwCookie1 != dwCookie2, "cookie returned for registering duplicate object shouldn't match cookie of original object (0x%x)\n", dwCookie1);
 
     hr = IRunningObjectTable_GetObject(pROT, pMoniker, &pObject);
diff --git a/programs/rpcss/irotp.c b/programs/rpcss/irotp.c
index 21ede32..6f32205 100644
--- a/programs/rpcss/irotp.c
+++ b/programs/rpcss/irotp.c
@@ -137,24 +137,14 @@ HRESULT IrotRegister(
         }
     }
 
-    if (hr == S_OK)
-    {
-        list_add_tail(&RunningObjectTable, &rot_entry->entry);
-        /* gives a registration identifier to the registered object*/
-        *cookie = rot_entry->cookie = InterlockedIncrement(&last_cookie);
-        *ctxt_handle = rot_entry;
-    }
-    else
-    {
-        rot_entry_release(rot_entry);
-        *cookie = existing_rot_entry->cookie;
-        InterlockedIncrement(&existing_rot_entry->refs);
-        *ctxt_handle = existing_rot_entry;
-    }
-
+    list_add_tail(&RunningObjectTable, &rot_entry->entry);
 
     LeaveCriticalSection(&csRunningObjectTable);
 
+    /* gives a registration identifier to the registered object*/
+    *cookie = rot_entry->cookie = InterlockedIncrement(&last_cookie);
+    *ctxt_handle = rot_entry;
+
     return hr;
 }
 




More information about the wine-cvs mailing list