Commit 603cb316 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

dssenh: Set last error in CPHashData.

parent c822cb99
......@@ -641,8 +641,12 @@ BOOL WINAPI CPHashData( HCRYPTPROV hprov, HCRYPTHASH hhash, const BYTE *data, DW
if (hash->magic != MAGIC_HASH) return FALSE;
if (hash->finished || BCryptHashData( hash->handle, (UCHAR *)data, len, 0 )) return FALSE;
return TRUE;
if (hash->finished)
{
SetLastError( NTE_BAD_HASH_STATE );
return FALSE;
}
return !BCryptHashData( hash->handle, (UCHAR *)data, len, 0 );
}
BOOL WINAPI CPGetHashParam( HCRYPTPROV hprov, HCRYPTHASH hhash, DWORD param, BYTE *data, DWORD *len, DWORD flags )
......
......@@ -1440,7 +1440,7 @@ static void test_duplicate_hash(void)
SetLastError(0xdeadbeef);
result = CryptHashData(hhash, (const BYTE *)"winetest", sizeof("winetest"), 0);
ok(!result, "success\n");
todo_wine ok(GetLastError() == NTE_BAD_HASH_STATE, "got %08x\n", GetLastError());
ok(GetLastError() == NTE_BAD_HASH_STATE, "got %08x\n", GetLastError());
result = CryptDuplicateHash(hhash, NULL, 0, &hhash2);
ok(result, "got %08x\n", GetLastError());
......@@ -1448,7 +1448,7 @@ static void test_duplicate_hash(void)
SetLastError(0xdeadbeef);
result = CryptHashData(hhash2, (const BYTE *)"winetest", sizeof("winetest"), 0);
ok(!result, "success\n");
todo_wine ok(GetLastError() == NTE_BAD_HASH_STATE, "got %08x\n", GetLastError());
ok(GetLastError() == NTE_BAD_HASH_STATE, "got %08x\n", GetLastError());
len = sizeof(buf);
result = CryptGetHashParam(hhash2, HP_HASHVAL, buf, &len, 0);
......
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