Commit 46ebd667 authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

Make rsaenh_crosstest.exe loadable on NT 4.0.

parent a6044154
......@@ -31,6 +31,8 @@ static const char szContainer[] = "winetest";
static const unsigned char pbData[] = "Wine rocks totally!";
static const char szProvider[] = MS_ENHANCED_PROV_A;
static BOOL (WINAPI *pCryptDuplicateHash) (HCRYPTHASH, DWORD*, DWORD, HCRYPTHASH*);
/*
static void trace_hex(BYTE *pbData, DWORD dwLen) {
char szTemp[256];
......@@ -54,6 +56,8 @@ static int init_environment(void)
HCRYPTKEY hKey;
BOOL result;
pCryptDuplicateHash = (void *)GetProcAddress(GetModuleHandleA("advapi32.dll"), "CryptDuplicateHash");
hProv = (HCRYPTPROV)INVALID_HANDLE_VALUE;
result = CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
......@@ -246,7 +250,8 @@ static void test_hashes(void)
result = CryptHashData(hHash, (BYTE*)pbData, 5, 0);
ok(result, "%08lx\n", GetLastError());
result = CryptDuplicateHash(hHash, 0, 0, &hHashClone);
if(pCryptDuplicateHash) {
result = pCryptDuplicateHash(hHash, 0, 0, &hHashClone);
ok(result, "%08lx\n", GetLastError());
result = CryptHashData(hHashClone, (BYTE*)pbData+5, sizeof(pbData)-5, 0);
......@@ -264,6 +269,7 @@ static void test_hashes(void)
result = CryptDestroyHash(hHashClone);
ok(result, "%08lx\n", GetLastError());
}
result = CryptDestroyHash(hHash);
ok(result, "%08lx\n", GetLastError());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment