Commit b9f8a81d authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcss: When registering a moniker that is already registered in the ROT another…

rpcss: When registering a moniker that is already registered in the ROT another ROT entry should still be created and a distinct cookie returned.
parent 8580198d
......@@ -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);
......
......@@ -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;
}
......
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