wintrust: Test and correct alloc and free functions in WintrustLoadFunctionPointers.

This commit is contained in:
Juan Lang 2007-08-24 15:07:41 -07:00 committed by Alexandre Julliard
parent ff26d428e3
commit e8cc4db1c7
2 changed files with 14 additions and 2 deletions

View File

@ -812,6 +812,16 @@ error_close_key:
return Func;
}
static void * WINAPI WINTRUST_Alloc(DWORD cb)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb);
}
static void WINAPI WINTRUST_Free(void *p)
{
HeapFree(GetProcessHeap(), 0, p);
}
/***********************************************************************
* WintrustLoadFunctionPointers (WINTRUST.@)
*/
@ -834,8 +844,8 @@ BOOL WINAPI WintrustLoadFunctionPointers( GUID* pgActionID,
WINTRUST_Guid2Wstr( pgActionID, GuidString);
/* Get the function pointers from the registry, where applicable */
pPfns->pfnAlloc = NULL;
pPfns->pfnFree = NULL;
pPfns->pfnAlloc = WINTRUST_Alloc;
pPfns->pfnFree = WINTRUST_Free;
pPfns->pfnAddStore2Chain = NULL;
pPfns->pfnAddSgnr2Chain = NULL;
pPfns->pfnAddCert2Chain = NULL;

View File

@ -284,6 +284,8 @@ static void test_LoadFunctionPointers(void)
funcs.cbStruct = sizeof(funcs);
ret = pWintrustLoadFunctionPointers(&action, &funcs);
ok(ret, "WintrustLoadFunctionPointers failed: %d\n", GetLastError());
ok(funcs.pfnAlloc != NULL, "Expected a pointer\n");
ok(funcs.pfnFree != NULL, "Expected a pointer\n");
}
static void test_RegPolicyFlags(void)