wintrust: Implement CryptCATAdminReleaseContext.

Based on work done by Maarten Lankhorst.
This commit is contained in:
Hans Leidekker 2008-12-17 14:33:29 +01:00 committed by Alexandre Julliard
parent 1d9ce08ce2
commit a99ef3570f
2 changed files with 11 additions and 8 deletions

View File

@ -183,8 +183,17 @@ BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN hCatAdmin,
*/ */
BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags ) BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags )
{ {
FIXME("%p %x\n", hCatAdmin, dwFlags); struct catadmin *ca = hCatAdmin;
return TRUE;
TRACE("%p %x\n", hCatAdmin, dwFlags);
if (!ca || ca->magic != CATADMIN_MAGIC)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
ca->magic = 0;
return HeapFree(GetProcessHeap(), 0, ca);
} }
/*********************************************************************** /***********************************************************************

View File

@ -109,12 +109,9 @@ static void test_context(void)
/* All NULL */ /* All NULL */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCryptCATAdminReleaseContext(NULL, 0); ret = pCryptCATAdminReleaseContext(NULL, 0);
todo_wine
{
ok(!ret, "Expected failure\n"); ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
}
/* Proper release */ /* Proper release */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
@ -126,12 +123,9 @@ static void test_context(void)
/* Try to release a second time */ /* Try to release a second time */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCryptCATAdminReleaseContext(hca, 0); ret = pCryptCATAdminReleaseContext(hca, 0);
todo_wine
{
ok(!ret, "Expected failure\n"); ok(!ret, "Expected failure\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
}
/* NULL context handle and dummy GUID */ /* NULL context handle and dummy GUID */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);