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

This commit is contained in:
Rob Shearman 2008-04-28 19:42:35 +01:00 committed by Alexandre Julliard
parent 8580198dc8
commit b9f8a81d8c
2 changed files with 5 additions and 16 deletions

View File

@ -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);

View File

@ -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;
}