From b9f8a81d8c8ebf35d597b3cc0b35813d0473da7d Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Mon, 28 Apr 2008 19:42:35 +0100 Subject: [PATCH] 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 aa737c0413e..b15cce43e5e 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 21ede3201d1..6f322059ac3 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; }