mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 00:33:38 +00:00
dssenh: Set last error in CPHashData.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c822cb995e
commit
603cb31633
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue