Commit b49e1c29 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

advapi32/tests: Don't test function directly when reporting GetLastError().

parent 45e2bd7c
...@@ -2318,9 +2318,9 @@ static void test_process_security_child(void) ...@@ -2318,9 +2318,9 @@ static void test_process_security_child(void)
ok(handle != NULL, "OpenProcess(PROCESS_TERMINATE) with err:%d\n", GetLastError()); ok(handle != NULL, "OpenProcess(PROCESS_TERMINATE) with err:%d\n", GetLastError());
TEST_GRANTED_ACCESS( handle, PROCESS_TERMINATE ); TEST_GRANTED_ACCESS( handle, PROCESS_TERMINATE );
ok(DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(), ret = DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(),
&handle1, 0, TRUE, DUPLICATE_SAME_ACCESS ), &handle1, 0, TRUE, DUPLICATE_SAME_ACCESS );
"duplicating handle err:%d\n", GetLastError()); ok(ret, "duplicating handle err:%d\n", GetLastError());
TEST_GRANTED_ACCESS( handle1, PROCESS_TERMINATE ); TEST_GRANTED_ACCESS( handle1, PROCESS_TERMINATE );
CloseHandle( handle1 ); CloseHandle( handle1 );
...@@ -2344,23 +2344,23 @@ static void test_process_security_child(void) ...@@ -2344,23 +2344,23 @@ static void test_process_security_child(void)
ok(handle == NULL, "OpenProcess(PROCESS_ALL_ACCESS) should have failed\n"); ok(handle == NULL, "OpenProcess(PROCESS_ALL_ACCESS) should have failed\n");
/* Documented privilege elevation */ /* Documented privilege elevation */
ok(DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), ret = DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(),
&handle, 0, TRUE, DUPLICATE_SAME_ACCESS ), &handle, 0, TRUE, DUPLICATE_SAME_ACCESS );
"duplicating handle err:%d\n", GetLastError()); ok(ret, "duplicating handle err:%d\n", GetLastError());
TEST_GRANTED_ACCESS2( handle, PROCESS_ALL_ACCESS, TEST_GRANTED_ACCESS2( handle, PROCESS_ALL_ACCESS,
STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL ); STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL );
CloseHandle( handle ); CloseHandle( handle );
/* Same only explicitly asking for all access rights */ /* Same only explicitly asking for all access rights */
ok(DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), ret = DuplicateHandle( GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(),
&handle, PROCESS_ALL_ACCESS, TRUE, 0 ), &handle, PROCESS_ALL_ACCESS, TRUE, 0 );
"duplicating handle err:%d\n", GetLastError()); ok(ret, "duplicating handle err:%d\n", GetLastError());
TEST_GRANTED_ACCESS2( handle, PROCESS_ALL_ACCESS, TEST_GRANTED_ACCESS2( handle, PROCESS_ALL_ACCESS,
PROCESS_ALL_ACCESS | PROCESS_QUERY_LIMITED_INFORMATION ); PROCESS_ALL_ACCESS | PROCESS_QUERY_LIMITED_INFORMATION );
ok(DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(), ret = DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(),
&handle1, PROCESS_VM_READ, TRUE, 0 ), &handle1, PROCESS_VM_READ, TRUE, 0 );
"duplicating handle err:%d\n", GetLastError()); ok(ret, "duplicating handle err:%d\n", GetLastError());
TEST_GRANTED_ACCESS( handle1, PROCESS_VM_READ ); TEST_GRANTED_ACCESS( handle1, PROCESS_VM_READ );
CloseHandle( handle1 ); CloseHandle( handle1 );
CloseHandle( handle ); CloseHandle( handle );
......
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