Module: wine Branch: master Commit: 425098974a83c2646acfeff656cf9eada3d73c20 URL: https://source.winehq.org/git/wine.git/?a=commit;h=425098974a83c2646acfeff65...
Author: Alex Henrie alexhenrie24@gmail.com Date: Sun Jan 2 00:11:44 2022 -0700
faultrep/tests: Check for registry virtualization.
If registry virtualization is enabled, AddERExcludedApplicationA succeeds on Windows 8 even if the user does not really have permission to write to HKLM\Software. The behind-the-scenes writes to HLKM\Software are treated like any other writes: They are silently redirected to HKCU\Software\Classes\VirtualStore\Machine\Software. Since AddERExcludedApplicationA still fails even with registry virtualization enabled on Vista, 7, and 10, Windows 8's behavior is clearly broken.
Fixes a testbot failure on 32-bit Windows 8 with a non-elevated administrator account.
Signed-off-by: Alex Henrie alexhenrie24@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/faultrep/tests/faultrep.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/dlls/faultrep/tests/faultrep.c b/dlls/faultrep/tests/faultrep.c index 30664bd29be..c71db80cdbb 100644 --- a/dlls/faultrep/tests/faultrep.c +++ b/dlls/faultrep/tests/faultrep.c @@ -47,6 +47,19 @@ static BOOL is_process_limited(void) return type == TokenElevationTypeLimited; }
+static BOOL is_registry_virtualization_enabled(void) +{ + HANDLE token; + DWORD enabled = FALSE; + DWORD size; + + OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token); + GetTokenInformation(token, TokenVirtualizationEnabled, &enabled, sizeof(enabled), &size); + CloseHandle(token); + + return enabled; +} +
/* ###### */
@@ -86,7 +99,8 @@ static void test_AddERExcludedApplicationA(void) if (is_process_limited()) { /* LastError is not set! */ - ok(!res, "AddERExcludedApplicationA should have failed got %d\n", res); + ok(!res || broken(is_registry_virtualization_enabled()) /* win8 */, + "AddERExcludedApplicationA should have failed, got %d\n", res); } else {