Commit 0b0621c8 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wintrust: Open test file with share mode FILE_SHARE_READ.

parent a6216ab9
...@@ -285,10 +285,11 @@ static void test_calchash(void) ...@@ -285,10 +285,11 @@ static void test_calchash(void)
CloseHandle(file); CloseHandle(file);
/* All OK, requesting the size of the hash */ /* All OK, requesting the size of the hash */
file = CreateFileA(selfname, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); file = CreateFileA(selfname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
ok(file != INVALID_HANDLE_VALUE, "CreateFile failed %u\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, NULL, 0); ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, NULL, 0);
ok(ret, "Expected success\n"); ok(ret, "Expected success %u\n", GetLastError());
todo_wine todo_wine
{ {
ok(hashsize == 20," Expected a hash size of 20, got %d\n", hashsize); ok(hashsize == 20," Expected a hash size of 20, got %d\n", hashsize);
...@@ -300,12 +301,12 @@ static void test_calchash(void) ...@@ -300,12 +301,12 @@ static void test_calchash(void)
/* All OK, retrieve the hash /* All OK, retrieve the hash
* Double the hash buffer to see what happens to the size parameter * Double the hash buffer to see what happens to the size parameter
*/ */
file = CreateFileA(selfname, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); file = CreateFileA(selfname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
hashsize *= 2; hashsize *= 2;
hash = HeapAlloc(GetProcessHeap(), 0, hashsize); hash = HeapAlloc(GetProcessHeap(), 0, hashsize);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, hash, 0); ret = pCryptCATAdminCalcHashFromFileHandle(file, &hashsize, hash, 0);
ok(ret, "Expected success\n"); ok(ret, "Expected success %u\n", GetLastError());
todo_wine todo_wine
{ {
ok(hashsize == 20," Expected a hash size of 20, got %d\n", hashsize); ok(hashsize == 20," Expected a hash size of 20, got %d\n", hashsize);
......
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