/* create the desktop and the associated driver window, and make it the current desktop */ static BOOL create_desktop( HMODULE driver, const WCHAR *name, unsigned int width, unsigned int height ) { static const WCHAR rootW[] = {'r','o','o','t',0}; BOOL ret = FALSE; BOOL (CDECL *create_desktop_func)(unsigned int, unsigned int); /* magic: desktop "root" means use the root window */ if (driver && strcmpiW( name, rootW )) { create_desktop_func = (void *)GetProcAddress( driver, "wine_create_desktop" ); if (create_desktop_func) ret = create_desktop_func( width, height ); } return ret; }
/* create the desktop and the associated X11 window, and make it the current desktop */ static unsigned long create_desktop( const WCHAR *name, unsigned int width, unsigned int height ) { static const WCHAR rootW[] = {'r','o','o','t',0}; HMODULE x11drv = GetModuleHandleA( "winex11.drv" ); HDESK desktop; unsigned long xwin = 0; unsigned long (CDECL *create_desktop_func)(unsigned int, unsigned int); desktop = CreateDesktopW( name, NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); if (!desktop) { WINE_ERR( "failed to create desktop %s error %d\n", wine_dbgstr_w(name), GetLastError() ); ExitProcess( 1 ); } /* magic: desktop "root" means use the X11 root window */ if (x11drv && strcmpiW( name, rootW )) { create_desktop_func = (void *)GetProcAddress( x11drv, "wine_create_desktop" ); if (create_desktop_func) xwin = create_desktop_func( width, height ); } SetThreadDesktop( desktop ); return xwin; }