Commit 42509897 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

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: 's avatarAlex Henrie <alexhenrie24@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e69d218d
......@@ -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
{
......
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