From 3822f9d2e1cdfe1c77c5f026ba6eb686974a3702 Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Fri, 15 Jan 2010 11:02:47 -0600 Subject: [PATCH] advapi32/tests: Test SystemFunction036. --- dlls/advapi32/tests/crypt.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/dlls/advapi32/tests/crypt.c b/dlls/advapi32/tests/crypt.c index f31723758dd..2a5993c00d5 100644 --- a/dlls/advapi32/tests/crypt.c +++ b/dlls/advapi32/tests/crypt.c @@ -64,6 +64,7 @@ static BOOL (WINAPI *pCryptSetHashParam)(HCRYPTKEY, DWORD, BYTE*, DWORD); static BOOL (WINAPI *pCryptSetKeyParam)(HCRYPTKEY, DWORD, BYTE*, DWORD); static BOOL (WINAPI *pCryptSetProvParam)(HCRYPTPROV, DWORD, BYTE*, DWORD); static BOOL (WINAPI *pCryptVerifySignatureW)(HCRYPTHASH, BYTE*, DWORD, HCRYPTKEY, LPCWSTR, DWORD); +static BOOL (WINAPI *pSystemFunction036)(PVOID, ULONG); static void init_function_pointers(void) { @@ -99,6 +100,7 @@ static void init_function_pointers(void) pCryptSetKeyParam = (void*)GetProcAddress(hadvapi32, "CryptSetKeyParam"); pCryptSetProvParam = (void*)GetProcAddress(hadvapi32, "CryptSetProvParam"); pCryptVerifySignatureW = (void*)GetProcAddress(hadvapi32, "CryptVerifySignatureW"); + pSystemFunction036 = (void*)GetProcAddress(hadvapi32, "SystemFunction036"); } static void init_environment(void) @@ -1073,6 +1075,35 @@ static void test_rc2_keylen(void) } } +static void test_SystemFunction036(void) +{ + BOOL ret; + int test; + + if (!pSystemFunction036) + { + win_skip("SystemFunction036 is not available\n"); + return; + } + + ret = pSystemFunction036(NULL, 0); + ok(ret == TRUE, "Expected SystemFunction036 to return TRUE, got %d\n", ret); + + /* Test crashes on Windows. */ + if (0) + { + SetLastError(0xdeadbeef); + ret = pSystemFunction036(NULL, 5); + trace("ret = %d, GetLastError() = %d\n", ret, GetLastError()); + } + + ret = pSystemFunction036(&test, 0); + ok(ret == TRUE, "Expected SystemFunction036 to return TRUE, got %d\n", ret); + + ret = pSystemFunction036(&test, sizeof(int)); + ok(ret == TRUE, "Expected SystemFunction036 to return TRUE, got %d\n", ret); +} + START_TEST(crypt) { init_function_pointers(); @@ -1091,4 +1122,5 @@ START_TEST(crypt) test_enum_provider_types(); test_get_default_provider(); test_set_provider_ex(); + test_SystemFunction036(); }