shlwapi/tests: Reset cookie after service revoked (Valgrind).

This commit is contained in:
Nikolay Sivov 2011-01-29 11:54:51 +03:00 committed by Alexandre Julliard
parent 5f26248a39
commit 219f477a05
2 changed files with 8 additions and 0 deletions

View File

@ -1571,7 +1571,10 @@ HRESULT WINAPI IUnknown_ProfferService(IUnknown *lpUnknown, REFGUID service, ISe
if (pService)
hr = IProfferService_ProfferService(proffer, service, pService, pCookie);
else
{
hr = IProfferService_RevokeService(proffer, *pCookie);
*pCookie = 0;
}
IProfferService_Release(proffer);
}

View File

@ -2362,6 +2362,7 @@ static ULONG WINAPI IProfferServiceImpl_Release(IProfferService *iface)
static HRESULT WINAPI IProfferServiceImpl_ProfferService(IProfferService *iface,
REFGUID service, IServiceProvider *pService, DWORD *pCookie)
{
*pCookie = 0xdeadbeef;
add_call(&trace_got, 3, service, pService, pCookie, 0, 0);
return S_OK;
}
@ -2419,8 +2420,10 @@ static void test_IUnknown_ProfferService(void)
add_call(&trace_expected, 3, &dummy_serviceid, provider, &cookie, 0, 0);
init_call_trace(&trace_got);
cookie = 0;
hr = pIUnknown_ProfferService((IUnknown*)proff, &dummy_serviceid, provider, &cookie);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(cookie == 0xdeadbeef, "got %x\n", cookie);
ok_trace(&trace_expected, &trace_got);
free_call_trace(&trace_got);
@ -2434,8 +2437,10 @@ static void test_IUnknown_ProfferService(void)
add_call(&trace_expected, 4, (void*)(DWORD_PTR)cookie, 0, 0, 0, 0);
init_call_trace(&trace_got);
ok(cookie != 0, "got %x\n", cookie);
hr = pIUnknown_ProfferService((IUnknown*)proff, &dummy_serviceid, 0, &cookie);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(cookie == 0, "got %x\n", cookie);
ok_trace(&trace_expected, &trace_got);
free_call_trace(&trace_got);
free_call_trace(&trace_expected);