rpcrt4: Store all active connections in RpcServerProtseq.
[wine.git] / dlls / user32 / driver.c
blobd59a2eacf5d6793b0a706a77ade613581384c701
1 /*
2 * USER driver support
4 * Copyright 2000, 2005 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wingdi.h"
26 #include "winuser.h"
27 #include "wine/debug.h"
28 #include "wine/gdi_driver.h"
29 #include "wine/unicode.h"
31 #include "user_private.h"
32 #include "controls.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(user);
35 WINE_DECLARE_DEBUG_CHANNEL(winediag);
37 static USER_DRIVER null_driver, lazy_load_driver;
39 const USER_DRIVER *USER_Driver = &lazy_load_driver;
40 static char driver_load_error[80];
42 static BOOL CDECL nodrv_CreateWindow( HWND hwnd );
44 static HMODULE load_desktop_driver( HWND hwnd )
46 static const WCHAR display_device_guid_propW[] = {
47 '_','_','w','i','n','e','_','d','i','s','p','l','a','y','_',
48 'd','e','v','i','c','e','_','g','u','i','d',0 };
49 static const WCHAR key_pathW[] = {
50 'S','y','s','t','e','m','\\',
51 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
52 'C','o','n','t','r','o','l','\\',
53 'V','i','d','e','o','\\','{',0};
54 static const WCHAR displayW[] = {'}','\\','0','0','0','0',0};
55 static const WCHAR driverW[] = {'G','r','a','p','h','i','c','s','D','r','i','v','e','r',0};
56 HMODULE ret = 0;
57 HKEY hkey;
58 DWORD size;
59 WCHAR path[MAX_PATH];
60 WCHAR key[(sizeof(key_pathW) + sizeof(displayW)) / sizeof(WCHAR) + 40];
61 UINT guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
63 USER_CheckNotLock();
65 strcpy( driver_load_error, "The explorer process failed to start." ); /* default error */
67 if (!guid_atom)
69 SendMessageW( hwnd, WM_NULL, 0, 0 ); /* wait for the desktop process to be ready */
70 guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
72 memcpy( key, key_pathW, sizeof(key_pathW) );
73 if (!GlobalGetAtomNameW( guid_atom, key + strlenW(key), 40 )) return 0;
74 strcatW( key, displayW );
75 if (RegOpenKeyW( HKEY_LOCAL_MACHINE, key, &hkey )) return 0;
76 size = sizeof(path);
77 if (!RegQueryValueExW( hkey, driverW, NULL, NULL, (BYTE *)path, &size ))
79 if (!(ret = LoadLibraryW( path ))) ERR( "failed to load %s\n", debugstr_w(path) );
80 TRACE( "%s %p\n", debugstr_w(path), ret );
82 else
84 size = sizeof(driver_load_error);
85 RegQueryValueExA( hkey, "DriverError", NULL, NULL, (BYTE *)driver_load_error, &size );
87 RegCloseKey( hkey );
88 return ret;
91 /* load the graphics driver */
92 static const USER_DRIVER *load_driver(void)
94 void *ptr;
95 HMODULE graphics_driver;
96 USER_DRIVER *driver, *prev;
98 driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
99 *driver = null_driver;
101 graphics_driver = load_desktop_driver( GetDesktopWindow() );
102 if (graphics_driver)
104 #define GET_USER_FUNC(name) \
105 do { if ((ptr = GetProcAddress( graphics_driver, #name ))) driver->p##name = ptr; } while(0)
107 GET_USER_FUNC(ActivateKeyboardLayout);
108 GET_USER_FUNC(Beep);
109 GET_USER_FUNC(GetAsyncKeyState);
110 GET_USER_FUNC(GetKeyNameText);
111 GET_USER_FUNC(GetKeyboardLayout);
112 GET_USER_FUNC(GetKeyboardLayoutList);
113 GET_USER_FUNC(GetKeyboardLayoutName);
114 GET_USER_FUNC(LoadKeyboardLayout);
115 GET_USER_FUNC(MapVirtualKeyEx);
116 GET_USER_FUNC(RegisterHotKey);
117 GET_USER_FUNC(ToUnicodeEx);
118 GET_USER_FUNC(UnloadKeyboardLayout);
119 GET_USER_FUNC(UnregisterHotKey);
120 GET_USER_FUNC(VkKeyScanEx);
121 GET_USER_FUNC(DestroyCursorIcon);
122 GET_USER_FUNC(SetCursor);
123 GET_USER_FUNC(GetCursorPos);
124 GET_USER_FUNC(SetCursorPos);
125 GET_USER_FUNC(ClipCursor);
126 GET_USER_FUNC(UpdateClipboard);
127 GET_USER_FUNC(ChangeDisplaySettingsEx);
128 GET_USER_FUNC(EnumDisplayMonitors);
129 GET_USER_FUNC(EnumDisplaySettingsEx);
130 GET_USER_FUNC(GetMonitorInfo);
131 GET_USER_FUNC(CreateDesktopWindow);
132 GET_USER_FUNC(CreateWindow);
133 GET_USER_FUNC(DestroyWindow);
134 GET_USER_FUNC(FlashWindowEx);
135 GET_USER_FUNC(GetDC);
136 GET_USER_FUNC(MsgWaitForMultipleObjectsEx);
137 GET_USER_FUNC(ReleaseDC);
138 GET_USER_FUNC(ScrollDC);
139 GET_USER_FUNC(SetCapture);
140 GET_USER_FUNC(SetFocus);
141 GET_USER_FUNC(SetLayeredWindowAttributes);
142 GET_USER_FUNC(SetParent);
143 GET_USER_FUNC(SetWindowRgn);
144 GET_USER_FUNC(SetWindowIcon);
145 GET_USER_FUNC(SetWindowStyle);
146 GET_USER_FUNC(SetWindowText);
147 GET_USER_FUNC(ShowWindow);
148 GET_USER_FUNC(SysCommand);
149 GET_USER_FUNC(UpdateLayeredWindow);
150 GET_USER_FUNC(WindowMessage);
151 GET_USER_FUNC(WindowPosChanging);
152 GET_USER_FUNC(WindowPosChanged);
153 GET_USER_FUNC(SystemParametersInfo);
154 GET_USER_FUNC(ThreadDetach);
155 #undef GET_USER_FUNC
157 else
159 USEROBJECTFLAGS flags;
160 HWINSTA winstation;
162 winstation = GetProcessWindowStation();
163 if (!GetUserObjectInformationA(winstation, UOI_FLAGS, &flags, sizeof(flags), NULL)
164 || (flags.dwFlags & WSF_VISIBLE))
165 driver->pCreateWindow = nodrv_CreateWindow;
168 prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
169 if (prev != &lazy_load_driver)
171 /* another thread beat us to it */
172 HeapFree( GetProcessHeap(), 0, driver );
173 driver = prev;
175 else LdrAddRefDll( 0, graphics_driver );
177 __wine_set_display_driver( graphics_driver );
178 register_builtin_classes();
180 return driver;
183 /* unload the graphics driver on process exit */
184 void USER_unload_driver(void)
186 USER_DRIVER *prev;
187 /* make sure we don't try to call the driver after it has been detached */
188 prev = InterlockedExchangePointer( (void **)&USER_Driver, &null_driver );
189 if (prev != &lazy_load_driver && prev != &null_driver)
190 HeapFree( GetProcessHeap(), 0, prev );
194 /**********************************************************************
195 * Null user driver
197 * These are fallbacks for entry points that are not implemented in the real driver.
200 static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags )
202 return 0;
205 static void CDECL nulldrv_Beep(void)
209 static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
211 return -1;
214 static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
216 HKEY hKeyKeyboard;
217 DWORD rc;
218 INT count = 0;
219 ULONG_PTR baselayout;
220 LANGID langid;
221 static const WCHAR szKeyboardReg[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s',0};
223 baselayout = GetUserDefaultLCID();
224 langid = PRIMARYLANGID(LANGIDFROMLCID(baselayout));
225 if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN)
226 baselayout = MAKELONG( baselayout, 0xe001 ); /* IME */
227 else
228 baselayout |= baselayout << 16;
230 /* Enumerate the Registry */
231 rc = RegOpenKeyW(HKEY_LOCAL_MACHINE,szKeyboardReg,&hKeyKeyboard);
232 if (rc == ERROR_SUCCESS)
234 do {
235 WCHAR szKeyName[9];
236 HKL layout;
237 rc = RegEnumKeyW(hKeyKeyboard, count, szKeyName, 9);
238 if (rc == ERROR_SUCCESS)
240 layout = (HKL)(ULONG_PTR)strtoulW(szKeyName,NULL,16);
241 if (baselayout != 0 && layout == (HKL)baselayout)
242 baselayout = 0; /* found in the registry do not add again */
243 if (size && layouts)
245 if (count >= size ) break;
246 layouts[count] = layout;
248 count ++;
250 } while (rc == ERROR_SUCCESS);
251 RegCloseKey(hKeyKeyboard);
254 /* make sure our base layout is on the list */
255 if (baselayout != 0)
257 if (size && layouts)
259 if (count < size)
261 layouts[count] = (HKL)baselayout;
262 count++;
265 else
266 count++;
269 return count;
272 static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
274 return 0;
277 static HKL CDECL nulldrv_GetKeyboardLayout( DWORD thread_id )
279 return 0;
282 static BOOL CDECL nulldrv_GetKeyboardLayoutName( LPWSTR name )
284 return FALSE;
287 static HKL CDECL nulldrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
289 return 0;
292 static UINT CDECL nulldrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
294 return 0;
297 static BOOL CDECL nulldrv_RegisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
299 return TRUE;
302 static INT CDECL nulldrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
303 int size, UINT flags, HKL layout )
305 return 0;
308 static BOOL CDECL nulldrv_UnloadKeyboardLayout( HKL layout )
310 return 0;
313 static void CDECL nulldrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
317 static SHORT CDECL nulldrv_VkKeyScanEx( WCHAR ch, HKL layout )
319 return -1;
322 static void CDECL nulldrv_DestroyCursorIcon( HCURSOR cursor )
326 static void CDECL nulldrv_SetCursor( HCURSOR cursor )
330 static BOOL CDECL nulldrv_GetCursorPos( LPPOINT pt )
332 return FALSE;
335 static BOOL CDECL nulldrv_SetCursorPos( INT x, INT y )
337 return FALSE;
340 static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip )
342 return FALSE;
345 static void CDECL nulldrv_UpdateClipboard(void)
349 static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
350 DWORD flags, LPVOID lparam )
352 return DISP_CHANGE_FAILED;
355 static BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
357 return FALSE;
360 static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
362 return FALSE;
365 static BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
367 return FALSE;
370 static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
372 return TRUE;
375 static BOOL CDECL nodrv_CreateWindow( HWND hwnd )
377 static int warned;
378 HWND parent = GetAncestor( hwnd, GA_PARENT );
380 /* HWND_MESSAGE windows don't need a graphics driver */
381 if (!parent || parent == get_user_thread_info()->msg_window) return TRUE;
382 if (warned++) return FALSE;
384 ERR_(winediag)( "Application tried to create a window, but no driver could be loaded.\n" );
385 if (driver_load_error[0]) ERR_(winediag)( "%s\n", driver_load_error );
386 return FALSE;
389 static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
391 return TRUE;
394 static void CDECL nulldrv_DestroyWindow( HWND hwnd )
398 static void CDECL nulldrv_FlashWindowEx( FLASHWINFO *info )
402 static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
403 const RECT *top_rect, DWORD flags )
407 static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
408 DWORD mask, DWORD flags )
410 return WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL,
411 timeout, flags & MWMO_ALERTABLE );
414 static void CDECL nulldrv_ReleaseDC( HWND hwnd, HDC hdc )
418 static BOOL CDECL nulldrv_ScrollDC( HDC hdc, INT dx, INT dy, HRGN update )
420 RECT rect;
422 GetClipBox( hdc, &rect );
423 return BitBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
424 hdc, rect.left - dx, rect.top - dy, SRCCOPY );
427 static void CDECL nulldrv_SetCapture( HWND hwnd, UINT flags )
431 static void CDECL nulldrv_SetFocus( HWND hwnd )
435 static void CDECL nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
439 static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent )
443 static void CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
447 static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
451 static void CDECL nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
455 static void CDECL nulldrv_SetWindowText( HWND hwnd, LPCWSTR text )
459 static UINT CDECL nulldrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
461 return swp;
464 static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
466 return -1;
469 static BOOL CDECL nulldrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
470 const RECT *window_rect )
472 return TRUE;
475 static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
477 return 0;
480 static void CDECL nulldrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
481 const RECT *window_rect, const RECT *client_rect,
482 RECT *visible_rect, struct window_surface **surface )
486 static void CDECL nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
487 const RECT *window_rect, const RECT *client_rect,
488 const RECT *visible_rect, const RECT *valid_rects,
489 struct window_surface *surface )
493 static BOOL CDECL nulldrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, UINT flags )
495 return FALSE;
498 static void CDECL nulldrv_ThreadDetach( void )
502 static USER_DRIVER null_driver =
504 /* keyboard functions */
505 nulldrv_ActivateKeyboardLayout,
506 nulldrv_Beep,
507 nulldrv_GetAsyncKeyState,
508 nulldrv_GetKeyNameText,
509 nulldrv_GetKeyboardLayout,
510 nulldrv_GetKeyboardLayoutList,
511 nulldrv_GetKeyboardLayoutName,
512 nulldrv_LoadKeyboardLayout,
513 nulldrv_MapVirtualKeyEx,
514 nulldrv_RegisterHotKey,
515 nulldrv_ToUnicodeEx,
516 nulldrv_UnloadKeyboardLayout,
517 nulldrv_UnregisterHotKey,
518 nulldrv_VkKeyScanEx,
519 /* cursor/icon functions */
520 nulldrv_DestroyCursorIcon,
521 nulldrv_SetCursor,
522 nulldrv_GetCursorPos,
523 nulldrv_SetCursorPos,
524 nulldrv_ClipCursor,
525 /* clipboard functions */
526 nulldrv_UpdateClipboard,
527 /* display modes */
528 nulldrv_ChangeDisplaySettingsEx,
529 nulldrv_EnumDisplayMonitors,
530 nulldrv_EnumDisplaySettingsEx,
531 nulldrv_GetMonitorInfo,
532 /* windowing functions */
533 nulldrv_CreateDesktopWindow,
534 nulldrv_CreateWindow,
535 nulldrv_DestroyWindow,
536 nulldrv_FlashWindowEx,
537 nulldrv_GetDC,
538 nulldrv_MsgWaitForMultipleObjectsEx,
539 nulldrv_ReleaseDC,
540 nulldrv_ScrollDC,
541 nulldrv_SetCapture,
542 nulldrv_SetFocus,
543 nulldrv_SetLayeredWindowAttributes,
544 nulldrv_SetParent,
545 nulldrv_SetWindowRgn,
546 nulldrv_SetWindowIcon,
547 nulldrv_SetWindowStyle,
548 nulldrv_SetWindowText,
549 nulldrv_ShowWindow,
550 nulldrv_SysCommand,
551 nulldrv_UpdateLayeredWindow,
552 nulldrv_WindowMessage,
553 nulldrv_WindowPosChanging,
554 nulldrv_WindowPosChanged,
555 /* system parameters */
556 nulldrv_SystemParametersInfo,
557 /* thread management */
558 nulldrv_ThreadDetach
562 /**********************************************************************
563 * Lazy loading user driver
565 * Initial driver used before another driver is loaded.
566 * Each entry point simply loads the real driver and chains to it.
569 static HKL CDECL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags )
571 return load_driver()->pActivateKeyboardLayout( layout, flags );
574 static void CDECL loaderdrv_Beep(void)
576 load_driver()->pBeep();
579 static SHORT CDECL loaderdrv_GetAsyncKeyState( INT key )
581 return load_driver()->pGetAsyncKeyState( key );
584 static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
586 return load_driver()->pGetKeyNameText( lparam, buffer, size );
589 static HKL CDECL loaderdrv_GetKeyboardLayout( DWORD thread_id )
591 return load_driver()->pGetKeyboardLayout( thread_id );
594 static UINT CDECL loaderdrv_GetKeyboardLayoutList( INT size, HKL *layouts )
596 return load_driver()->pGetKeyboardLayoutList( size, layouts );
599 static BOOL CDECL loaderdrv_GetKeyboardLayoutName( LPWSTR name )
601 return load_driver()->pGetKeyboardLayoutName( name );
604 static HKL CDECL loaderdrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
606 return load_driver()->pLoadKeyboardLayout( name, flags );
609 static UINT CDECL loaderdrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
611 return load_driver()->pMapVirtualKeyEx( code, type, layout );
614 static BOOL CDECL loaderdrv_RegisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
616 return load_driver()->pRegisterHotKey( hwnd, modifiers, vk );
619 static INT CDECL loaderdrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
620 int size, UINT flags, HKL layout )
622 return load_driver()->pToUnicodeEx( virt, scan, state, str, size, flags, layout );
625 static BOOL CDECL loaderdrv_UnloadKeyboardLayout( HKL layout )
627 return load_driver()->pUnloadKeyboardLayout( layout );
630 static void CDECL loaderdrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
632 load_driver()->pUnregisterHotKey( hwnd, modifiers, vk );
635 static SHORT CDECL loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout )
637 return load_driver()->pVkKeyScanEx( ch, layout );
640 static void CDECL loaderdrv_SetCursor( HCURSOR cursor )
642 load_driver()->pSetCursor( cursor );
645 static BOOL CDECL loaderdrv_GetCursorPos( LPPOINT pt )
647 return load_driver()->pGetCursorPos( pt );
650 static BOOL CDECL loaderdrv_SetCursorPos( INT x, INT y )
652 return load_driver()->pSetCursorPos( x, y );
655 static BOOL CDECL loaderdrv_ClipCursor( LPCRECT clip )
657 return load_driver()->pClipCursor( clip );
660 static void CDECL loaderdrv_UpdateClipboard(void)
662 load_driver()->pUpdateClipboard();
665 static LONG CDECL loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
666 DWORD flags, LPVOID lparam )
668 return load_driver()->pChangeDisplaySettingsEx( name, mode, hwnd, flags, lparam );
671 static BOOL CDECL loaderdrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
673 return load_driver()->pEnumDisplayMonitors( hdc, rect, proc, lp );
676 static BOOL CDECL loaderdrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
678 return load_driver()->pEnumDisplaySettingsEx( name, num, mode, flags );
681 static BOOL CDECL loaderdrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
683 return load_driver()->pGetMonitorInfo( handle, info );
686 static BOOL CDECL loaderdrv_CreateDesktopWindow( HWND hwnd )
688 return load_driver()->pCreateDesktopWindow( hwnd );
691 static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd )
693 return load_driver()->pCreateWindow( hwnd );
696 static void CDECL loaderdrv_FlashWindowEx( FLASHWINFO *info )
698 load_driver()->pFlashWindowEx( info );
701 static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
702 const RECT *top_rect, DWORD flags )
704 load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags );
707 static void CDECL loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
709 load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags );
712 static void CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
714 load_driver()->pSetWindowRgn( hwnd, hrgn, redraw );
717 static BOOL CDECL loaderdrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
718 const RECT *window_rect )
720 return load_driver()->pUpdateLayeredWindow( hwnd, info, window_rect );
723 static USER_DRIVER lazy_load_driver =
725 /* keyboard functions */
726 loaderdrv_ActivateKeyboardLayout,
727 loaderdrv_Beep,
728 loaderdrv_GetAsyncKeyState,
729 loaderdrv_GetKeyNameText,
730 loaderdrv_GetKeyboardLayout,
731 loaderdrv_GetKeyboardLayoutList,
732 loaderdrv_GetKeyboardLayoutName,
733 loaderdrv_LoadKeyboardLayout,
734 loaderdrv_MapVirtualKeyEx,
735 loaderdrv_RegisterHotKey,
736 loaderdrv_ToUnicodeEx,
737 loaderdrv_UnloadKeyboardLayout,
738 loaderdrv_UnregisterHotKey,
739 loaderdrv_VkKeyScanEx,
740 /* cursor/icon functions */
741 nulldrv_DestroyCursorIcon,
742 loaderdrv_SetCursor,
743 loaderdrv_GetCursorPos,
744 loaderdrv_SetCursorPos,
745 loaderdrv_ClipCursor,
746 /* clipboard functions */
747 loaderdrv_UpdateClipboard,
748 /* display modes */
749 loaderdrv_ChangeDisplaySettingsEx,
750 loaderdrv_EnumDisplayMonitors,
751 loaderdrv_EnumDisplaySettingsEx,
752 loaderdrv_GetMonitorInfo,
753 /* windowing functions */
754 loaderdrv_CreateDesktopWindow,
755 loaderdrv_CreateWindow,
756 nulldrv_DestroyWindow,
757 loaderdrv_FlashWindowEx,
758 loaderdrv_GetDC,
759 nulldrv_MsgWaitForMultipleObjectsEx,
760 nulldrv_ReleaseDC,
761 nulldrv_ScrollDC,
762 nulldrv_SetCapture,
763 nulldrv_SetFocus,
764 loaderdrv_SetLayeredWindowAttributes,
765 nulldrv_SetParent,
766 loaderdrv_SetWindowRgn,
767 nulldrv_SetWindowIcon,
768 nulldrv_SetWindowStyle,
769 nulldrv_SetWindowText,
770 nulldrv_ShowWindow,
771 nulldrv_SysCommand,
772 loaderdrv_UpdateLayeredWindow,
773 nulldrv_WindowMessage,
774 nulldrv_WindowPosChanging,
775 nulldrv_WindowPosChanged,
776 /* system parameters */
777 nulldrv_SystemParametersInfo,
778 /* thread management */
779 nulldrv_ThreadDetach