Commit c77d2e8a authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

user32: Fix AreDpiAwarenessContextsEqual behavior for DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2.

parent f541d947
......@@ -636,13 +636,20 @@ BOOL WINAPI SetProcessDpiAwarenessInternal( DPI_AWARENESS awareness )
return SetProcessDpiAwarenessContext( contexts[awareness] );
}
static ULONG_PTR map_awareness_context( DPI_AWARENESS_CONTEXT ctx )
{
if (ctx == DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 || ctx == (DPI_AWARENESS_CONTEXT)0x22 || ctx == (DPI_AWARENESS_CONTEXT)0x80000022)
return 0x22;
return GetAwarenessFromDpiAwarenessContext(ctx);
}
/***********************************************************************
* AreDpiAwarenessContextsEqual (USER32.@)
*/
BOOL WINAPI AreDpiAwarenessContextsEqual( DPI_AWARENESS_CONTEXT ctx1, DPI_AWARENESS_CONTEXT ctx2 )
{
DPI_AWARENESS aware1 = GetAwarenessFromDpiAwarenessContext( ctx1 );
DPI_AWARENESS aware2 = GetAwarenessFromDpiAwarenessContext( ctx2 );
DPI_AWARENESS aware1 = map_awareness_context( ctx1 );
DPI_AWARENESS aware2 = map_awareness_context( ctx2 );
return aware1 != DPI_AWARENESS_INVALID && aware1 == aware2;
}
......
......@@ -3866,7 +3866,6 @@ static void test_AreDpiAwarenessContextsEqual(ULONG_PTR flags)
int map_i = map_context(contexts[i], flags);
int map_j = map_context(contexts[j], flags);
BOOL equal_expected = map_i == map_j;
todo_wine_if((map_i == 0x22 && map_j == 0x12) || (map_j == 0x22 && map_i == 0x12))
ok(equal == equal_expected, "(%d, %d) (%p == %p) - Expected equal to be %d but got %d\n", i, j, (DPI_AWARENESS_CONTEXT)contexts[i], (DPI_AWARENESS_CONTEXT)contexts[j], equal_expected, equal);
}
}
......
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