Commit 213ac0de authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

win32u: Use the window station name to check if an application is running as a service.

Having an invisible window station doesn't mean an application is running in a service context. For example, Chromium creates a sandbox process to run in an invisible window station and still expect the physical monitor information to be returned, instead of the virtual monitor information for services.
parent 38d843d1
......@@ -1042,7 +1042,6 @@ static void test_invisible_winstation_child(char *expected_info)
sprintf(buffer, "%d,%d,%d,%d,%d", GetSystemMetrics(SM_XVIRTUALSCREEN),
GetSystemMetrics(SM_YVIRTUALSCREEN), GetSystemMetrics(SM_CXVIRTUALSCREEN),
GetSystemMetrics(SM_CYVIRTUALSCREEN), GetSystemMetrics(SM_CMONITORS));
todo_wine_if(strcmp(buffer, "0,0,1024,768,1"))
ok(!strcmp(buffer, expected_info), "Expected %s, got %s.\n", expected_info, buffer);
}
......
......@@ -1994,14 +1994,16 @@ static BOOL desktop_update_display_devices( BOOL force, struct device_manager_ct
BOOL update_display_cache( BOOL force )
{
static const WCHAR wine_service_station_name[] =
{'_','_','w','i','n','e','s','e','r','v','i','c','e','_','w','i','n','s','t','a','t','i','o','n',0};
HWINSTA winstation = NtUserGetProcessWindowStation();
struct device_manager_ctx ctx = {0};
BOOL was_virtual_desktop, ret;
USEROBJECTFLAGS flags;
WCHAR name[MAX_PATH];
/* services do not have any adapters, only a virtual monitor */
if (NtUserGetObjectInformation( winstation, UOI_FLAGS, &flags, sizeof(flags), NULL )
&& !(flags.dwFlags & WSF_VISIBLE))
if (NtUserGetObjectInformation( winstation, UOI_NAME, name, sizeof(name), NULL )
&& !wcscmp( name, wine_service_station_name ))
{
pthread_mutex_lock( &display_lock );
clear_display_devices();
......
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