[PATCH 0/1] MR7996: advapi32/tests: Skip a token elevation test if OpenProcess fails.
Which will happen if the user is not an administrator. --- Addressing [test failures](https://test.winehq.org/data/patterns.html#advapi32:security) from !7972, pointed out by Rémi. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7996
From: Tim Clem <tclem(a)codeweavers.com> Which will happen if the user is not an administrator. --- dlls/advapi32/tests/security.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index f21778587d8..dba7955f2ea 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -8577,7 +8577,11 @@ static void test_admin_elevation(void) ok(tid, "got error %lu\n", GetLastError()); hproc = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid); - ok(hproc != NULL, "got error %lu\n", GetLastError()); + if (!hproc) + { + skip("could not open process, error %lu\n", GetLastError()); + return; + } ret = OpenProcessToken(hproc, TOKEN_READ, &htok); ok(ret, "got error %lu\n", GetLastError()); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7996
Jinoh Kang (@iamahuman) commented about dlls/advapi32/tests/security.c:
ok(tid, "got error %lu\n", GetLastError());
hproc = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid); - ok(hproc != NULL, "got error %lu\n", GetLastError()); + if (!hproc) + { + skip("could not open process, error %lu\n", GetLastError());
```suggestion:-0+0 ok(GetLastError() == ERROR_ACCESS_DENIED, "got error %lu.\n", GetLastError()); skip("could not open process, error %lu\n", GetLastError()); ``` (Untested) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7996#note_102906
participants (3)
-
Jinoh Kang (@iamahuman) -
Tim Clem -
Tim Clem (@tclem)