advapi32: Test some other cases of process access rights mapping.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
This commit is contained in:
Eric Pouech 2024-11-05 12:22:10 +01:00 committed by Alexandre Julliard
parent a7900c4594
commit fb47740214
Notes: Alexandre Julliard 2024-11-12 22:01:31 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6767

View file

@ -6154,6 +6154,41 @@ static void test_process_access(void)
"expected PROCESS_QUERY_INFORMATION|PROCESS_QUERY_LIMITED_INFORMATION, got %#lx\n", access);
CloseHandle(dup);
SetLastError( 0xdeadbeef );
ret = DuplicateHandle(GetCurrentProcess(), process, GetCurrentProcess(), &dup,
PROCESS_VM_OPERATION, FALSE, 0);
ok(ret, "DuplicateHandle error %ld\n", GetLastError());
access = get_obj_access(dup);
ok(access == PROCESS_VM_OPERATION, "unexpected access right %lx\n", access);
CloseHandle(dup);
SetLastError( 0xdeadbeef );
ret = DuplicateHandle(GetCurrentProcess(), process, GetCurrentProcess(), &dup,
PROCESS_VM_WRITE, FALSE, 0);
ok(ret, "DuplicateHandle error %ld\n", GetLastError());
access = get_obj_access(dup);
ok(access == PROCESS_VM_WRITE, "unexpected access right %lx\n", access);
CloseHandle(dup);
SetLastError( 0xdeadbeef );
ret = DuplicateHandle(GetCurrentProcess(), process, GetCurrentProcess(), &dup,
PROCESS_VM_OPERATION | PROCESS_VM_WRITE, FALSE, 0);
ok(ret, "DuplicateHandle error %ld\n", GetLastError());
access = get_obj_access(dup);
todo_wine
ok(access == (PROCESS_VM_OPERATION | PROCESS_VM_WRITE | PROCESS_QUERY_LIMITED_INFORMATION) ||
broken(access == (PROCESS_VM_OPERATION | PROCESS_VM_WRITE)) /* Win8 and before */,
"expected PROCESS_VM_OPERATION|PROCESS_VM_WRITE|PROCESS_QUERY_LIMITED_INFORMATION, got %#lx\n", access);
CloseHandle(dup);
SetLastError( 0xdeadbeef );
ret = DuplicateHandle(GetCurrentProcess(), process, GetCurrentProcess(), &dup,
PROCESS_VM_OPERATION | PROCESS_VM_READ, FALSE, 0);
ok(ret, "DuplicateHandle error %ld\n", GetLastError());
access = get_obj_access(dup);
ok(access == (PROCESS_VM_OPERATION | PROCESS_VM_READ), "unexpected access right %lx\n", access);
CloseHandle(dup);
TerminateProcess(process, 0);
CloseHandle(process);
}