Commit af4294a9 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Allow creating windows using null driver for invisible winstations.

parent 440b9213
...@@ -39,6 +39,8 @@ static USER_DRIVER null_driver, lazy_load_driver; ...@@ -39,6 +39,8 @@ static USER_DRIVER null_driver, lazy_load_driver;
const USER_DRIVER *USER_Driver = &lazy_load_driver; const USER_DRIVER *USER_Driver = &lazy_load_driver;
static char driver_load_error[80]; static char driver_load_error[80];
static BOOL CDECL nodrv_CreateWindow( HWND hwnd );
static HMODULE load_desktop_driver( HWND hwnd ) static HMODULE load_desktop_driver( HWND hwnd )
{ {
static const WCHAR display_device_guid_propW[] = { static const WCHAR display_device_guid_propW[] = {
...@@ -152,6 +154,16 @@ static const USER_DRIVER *load_driver(void) ...@@ -152,6 +154,16 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC(ThreadDetach); GET_USER_FUNC(ThreadDetach);
#undef GET_USER_FUNC #undef GET_USER_FUNC
} }
else
{
USEROBJECTFLAGS flags;
HWINSTA winstation;
winstation = GetProcessWindowStation();
if (!GetUserObjectInformationA(winstation, UOI_FLAGS, &flags, sizeof(flags), NULL)
|| (flags.dwFlags & WSF_VISIBLE))
driver->pCreateWindow = nodrv_CreateWindow;
}
prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver ); prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
if (prev != &lazy_load_driver) if (prev != &lazy_load_driver)
...@@ -360,7 +372,7 @@ static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd ) ...@@ -360,7 +372,7 @@ static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
return TRUE; return TRUE;
} }
static BOOL CDECL nulldrv_CreateWindow( HWND hwnd ) static BOOL CDECL nodrv_CreateWindow( HWND hwnd )
{ {
static int warned; static int warned;
HWND parent = GetAncestor( hwnd, GA_PARENT ); HWND parent = GetAncestor( hwnd, GA_PARENT );
...@@ -374,6 +386,11 @@ static BOOL CDECL nulldrv_CreateWindow( HWND hwnd ) ...@@ -374,6 +386,11 @@ static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
return FALSE; return FALSE;
} }
static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
{
return TRUE;
}
static void CDECL nulldrv_DestroyWindow( HWND hwnd ) static void CDECL nulldrv_DestroyWindow( HWND hwnd )
{ {
} }
......
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