Commit cd771fa7 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

server: Allow creating a real explorer desktop window for invisible window stations.

The graphics driver information is stored as a property in the desktop window. When the server get_desktop_window handler simply returns a window handle when the window station is invisible, the window handle doesn't have the graphics driver property, which is set in desktop_window_proc() when handling WM_NCCREATE. Removing the invisible window station check allows an invisible explorer desktop window to be created and with the required property.
parent d3c3f42c
......@@ -1049,7 +1049,6 @@ static void test_invisible_winstation_child(char *expected_info)
ok(!!hwnd, "GetDesktopWindow failed, error %lu.\n", GetLastError());
ret = SendMessageW(hwnd, WM_NCHITTEST, 0, 0);
todo_wine
ok(ret == HTCLIENT, "SendMessageW failed, error %lu.\n", GetLastError());
}
......
......@@ -420,14 +420,24 @@ static inline TEB64 *NtCurrentTeb64(void) { return (TEB64 *)NtCurrentTeb()->GdiB
HWND get_desktop_window(void)
{
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};
struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
WCHAR name[MAX_PATH];
BOOL is_service;
if (thread_info->top_window) return UlongToHandle( thread_info->top_window );
/* don't create an actual explorer desktop window for services */
if (NtUserGetObjectInformation( NtUserGetProcessWindowStation(), UOI_NAME, name, sizeof(name), NULL )
&& !wcscmp( name, wine_service_station_name ))
is_service = TRUE;
else
is_service = FALSE;
SERVER_START_REQ( get_desktop_window )
{
req->force = 0;
req->force = is_service;
if (!wine_server_call( req ))
{
thread_info->top_window = reply->top_window;
......
......@@ -2151,14 +2151,10 @@ DECL_HANDLER(destroy_window)
DECL_HANDLER(get_desktop_window)
{
struct desktop *desktop = get_thread_desktop( current, 0 );
int force;
if (!desktop) return;
/* if winstation is invisible, then avoid roundtrip */
force = req->force || !(desktop->winstation->flags & WSF_VISIBLE);
if (!desktop->top_window && force) /* create it */
if (!desktop->top_window && req->force) /* create it */
{
if ((desktop->top_window = create_window( NULL, NULL, DESKTOP_ATOM, 0 )))
{
......@@ -2167,7 +2163,7 @@ DECL_HANDLER(get_desktop_window)
}
}
if (!desktop->msg_window && force) /* create it */
if (!desktop->msg_window && req->force) /* create it */
{
static const WCHAR messageW[] = {'M','e','s','s','a','g','e'};
static const struct unicode_str name = { messageW, sizeof(messageW) };
......
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