rsaenh/tests: Add more AES encrypt/decrypt tests.
[wine.git] / dlls / user32 / driver.c
blobe0bc38ca50f48524bc945ea81cd0aea39425c488
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);
36 static USER_DRIVER null_driver, lazy_load_driver;
38 const USER_DRIVER *USER_Driver = &lazy_load_driver;
39 static char driver_load_error[80];
41 static HMODULE load_desktop_driver( HWND hwnd )
43 static const WCHAR display_device_guid_propW[] = {
44 '_','_','w','i','n','e','_','d','i','s','p','l','a','y','_',
45 'd','e','v','i','c','e','_','g','u','i','d',0 };
46 static const WCHAR key_pathW[] = {
47 'S','y','s','t','e','m','\\',
48 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
49 'C','o','n','t','r','o','l','\\',
50 'V','i','d','e','o','\\','{',0};
51 static const WCHAR displayW[] = {'}','\\','0','0','0','0',0};
52 static const WCHAR driverW[] = {'G','r','a','p','h','i','c','s','D','r','i','v','e','r',0};
53 HMODULE ret = 0;
54 HKEY hkey;
55 DWORD size;
56 WCHAR path[MAX_PATH];
57 WCHAR key[(sizeof(key_pathW) + sizeof(displayW)) / sizeof(WCHAR) + 40];
58 UINT guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
60 USER_CheckNotLock();
62 strcpy( driver_load_error, "The explorer process failed to start." ); /* default error */
64 if (!guid_atom)
66 SendMessageW( hwnd, WM_NULL, 0, 0 ); /* wait for the desktop process to be ready */
67 guid_atom = HandleToULong( GetPropW( hwnd, display_device_guid_propW ));
69 memcpy( key, key_pathW, sizeof(key_pathW) );
70 if (!GlobalGetAtomNameW( guid_atom, key + strlenW(key), 40 )) return 0;
71 strcatW( key, displayW );
72 if (RegOpenKeyW( HKEY_LOCAL_MACHINE, key, &hkey )) return 0;
73 size = sizeof(path);
74 if (!RegQueryValueExW( hkey, driverW, NULL, NULL, (BYTE *)path, &size ))
76 if (!(ret = LoadLibraryW( path ))) ERR( "failed to load %s\n", debugstr_w(path) );
77 TRACE( "%s %p\n", debugstr_w(path), ret );
79 else
81 size = sizeof(driver_load_error);
82 RegQueryValueExA( hkey, "DriverError", NULL, NULL, (BYTE *)driver_load_error, &size );
84 RegCloseKey( hkey );
85 return ret;
88 /* load the graphics driver */
89 static const USER_DRIVER *load_driver(void)
91 void *ptr;
92 HMODULE graphics_driver;
93 USER_DRIVER *driver, *prev;
95 driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
96 *driver = null_driver;
98 graphics_driver = load_desktop_driver( GetDesktopWindow() );
99 if (graphics_driver)
101 #define GET_USER_FUNC(name) \
102 do { if ((ptr = GetProcAddress( graphics_driver, #name ))) driver->p##name = ptr; } while(0)
104 GET_USER_FUNC(ActivateKeyboardLayout);
105 GET_USER_FUNC(Beep);
106 GET_USER_FUNC(GetAsyncKeyState);
107 GET_USER_FUNC(GetKeyNameText);
108 GET_USER_FUNC(GetKeyboardLayout);
109 GET_USER_FUNC(GetKeyboardLayoutList);
110 GET_USER_FUNC(GetKeyboardLayoutName);
111 GET_USER_FUNC(LoadKeyboardLayout);
112 GET_USER_FUNC(MapVirtualKeyEx);
113 GET_USER_FUNC(RegisterHotKey);
114 GET_USER_FUNC(ToUnicodeEx);
115 GET_USER_FUNC(UnloadKeyboardLayout);
116 GET_USER_FUNC(UnregisterHotKey);
117 GET_USER_FUNC(VkKeyScanEx);
118 GET_USER_FUNC(DestroyCursorIcon);
119 GET_USER_FUNC(SetCursor);
120 GET_USER_FUNC(GetCursorPos);
121 GET_USER_FUNC(SetCursorPos);
122 GET_USER_FUNC(ClipCursor);
123 GET_USER_FUNC(AcquireClipboard);
124 GET_USER_FUNC(EmptyClipboard);
125 GET_USER_FUNC(SetClipboardData);
126 GET_USER_FUNC(GetClipboardData);
127 GET_USER_FUNC(CountClipboardFormats);
128 GET_USER_FUNC(EnumClipboardFormats);
129 GET_USER_FUNC(IsClipboardFormatAvailable);
130 GET_USER_FUNC(EndClipboardUpdate);
131 GET_USER_FUNC(ChangeDisplaySettingsEx);
132 GET_USER_FUNC(EnumDisplayMonitors);
133 GET_USER_FUNC(EnumDisplaySettingsEx);
134 GET_USER_FUNC(GetMonitorInfo);
135 GET_USER_FUNC(CreateDesktopWindow);
136 GET_USER_FUNC(CreateWindow);
137 GET_USER_FUNC(DestroyWindow);
138 GET_USER_FUNC(GetDC);
139 GET_USER_FUNC(MsgWaitForMultipleObjectsEx);
140 GET_USER_FUNC(ReleaseDC);
141 GET_USER_FUNC(ScrollDC);
142 GET_USER_FUNC(SetCapture);
143 GET_USER_FUNC(SetFocus);
144 GET_USER_FUNC(SetLayeredWindowAttributes);
145 GET_USER_FUNC(SetParent);
146 GET_USER_FUNC(SetWindowRgn);
147 GET_USER_FUNC(SetWindowIcon);
148 GET_USER_FUNC(SetWindowStyle);
149 GET_USER_FUNC(SetWindowText);
150 GET_USER_FUNC(ShowWindow);
151 GET_USER_FUNC(SysCommand);
152 GET_USER_FUNC(UpdateLayeredWindow);
153 GET_USER_FUNC(WindowMessage);
154 GET_USER_FUNC(WindowPosChanging);
155 GET_USER_FUNC(WindowPosChanged);
156 GET_USER_FUNC(SystemParametersInfo);
157 #undef GET_USER_FUNC
160 prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
161 if (prev != &lazy_load_driver)
163 /* another thread beat us to it */
164 HeapFree( GetProcessHeap(), 0, driver );
165 driver = prev;
167 else LdrAddRefDll( 0, graphics_driver );
169 __wine_set_display_driver( graphics_driver );
170 register_builtin_classes();
172 return driver;
175 /* unload the graphics driver on process exit */
176 void USER_unload_driver(void)
178 USER_DRIVER *prev;
179 /* make sure we don't try to call the driver after it has been detached */
180 prev = InterlockedExchangePointer( (void **)&USER_Driver, &null_driver );
181 if (prev != &lazy_load_driver && prev != &null_driver)
182 HeapFree( GetProcessHeap(), 0, prev );
186 /**********************************************************************
187 * Null user driver
189 * These are fallbacks for entry points that are not implemented in the real driver.
192 static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags )
194 return 0;
197 static void CDECL nulldrv_Beep(void)
201 static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
203 return -1;
206 static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
208 HKEY hKeyKeyboard;
209 DWORD rc;
210 INT count = 0;
211 ULONG_PTR baselayout;
212 LANGID langid;
213 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};
215 baselayout = GetUserDefaultLCID();
216 langid = PRIMARYLANGID(LANGIDFROMLCID(baselayout));
217 if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN)
218 baselayout |= 0xe001 << 16; /* IME */
219 else
220 baselayout |= baselayout << 16;
222 /* Enumerate the Registry */
223 rc = RegOpenKeyW(HKEY_LOCAL_MACHINE,szKeyboardReg,&hKeyKeyboard);
224 if (rc == ERROR_SUCCESS)
226 do {
227 WCHAR szKeyName[9];
228 HKL layout;
229 rc = RegEnumKeyW(hKeyKeyboard, count, szKeyName, 9);
230 if (rc == ERROR_SUCCESS)
232 layout = (HKL)(ULONG_PTR)strtoulW(szKeyName,NULL,16);
233 if (baselayout != 0 && layout == (HKL)baselayout)
234 baselayout = 0; /* found in the registry do not add again */
235 if (size && layouts)
237 if (count >= size ) break;
238 layouts[count] = layout;
240 count ++;
242 } while (rc == ERROR_SUCCESS);
243 RegCloseKey(hKeyKeyboard);
246 /* make sure our base layout is on the list */
247 if (baselayout != 0)
249 if (size && layouts)
251 if (count < size)
253 layouts[count] = (HKL)baselayout;
254 count++;
257 else
258 count++;
261 return count;
264 static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
266 return 0;
269 static HKL CDECL nulldrv_GetKeyboardLayout( DWORD thread_id )
271 return 0;
274 static BOOL CDECL nulldrv_GetKeyboardLayoutName( LPWSTR name )
276 return FALSE;
279 static HKL CDECL nulldrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
281 return 0;
284 static UINT CDECL nulldrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
286 return 0;
289 static BOOL CDECL nulldrv_RegisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
291 return TRUE;
294 static INT CDECL nulldrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
295 int size, UINT flags, HKL layout )
297 return 0;
300 static BOOL CDECL nulldrv_UnloadKeyboardLayout( HKL layout )
302 return 0;
305 static void CDECL nulldrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
309 static SHORT CDECL nulldrv_VkKeyScanEx( WCHAR ch, HKL layout )
311 return -1;
314 static void CDECL nulldrv_DestroyCursorIcon( HCURSOR cursor )
318 static void CDECL nulldrv_SetCursor( HCURSOR cursor )
322 static BOOL CDECL nulldrv_GetCursorPos( LPPOINT pt )
324 return FALSE;
327 static BOOL CDECL nulldrv_SetCursorPos( INT x, INT y )
329 return FALSE;
332 static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip )
334 return FALSE;
337 static INT CDECL nulldrv_AcquireClipboard( HWND hwnd )
339 return 0;
342 static BOOL CDECL nulldrv_CountClipboardFormats(void)
344 return 0;
347 static void CDECL nulldrv_EmptyClipboard( BOOL keepunowned )
351 static void CDECL nulldrv_EndClipboardUpdate(void)
355 static UINT CDECL nulldrv_EnumClipboardFormats( UINT format )
357 return 0;
360 static HANDLE CDECL nulldrv_GetClipboardData( UINT format )
362 return 0;
365 static BOOL CDECL nulldrv_IsClipboardFormatAvailable( UINT format )
367 return FALSE;
370 static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
372 return FALSE;
375 static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
376 DWORD flags, LPVOID lparam )
378 return DISP_CHANGE_FAILED;
381 static BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
383 return FALSE;
386 static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
388 return FALSE;
391 static BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
393 return FALSE;
396 static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
398 return TRUE;
401 static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
403 static int warned;
404 HWND parent = GetAncestor( hwnd, GA_PARENT );
406 /* HWND_MESSAGE windows don't need a graphics driver */
407 if (!parent || parent == get_user_thread_info()->msg_window) return TRUE;
408 if (warned++) return FALSE;
410 MESSAGE( "Application tried to create a window, but no driver could be loaded.\n");
411 if (driver_load_error[0]) MESSAGE( "%s\n", driver_load_error );
412 return FALSE;
415 static void CDECL nulldrv_DestroyWindow( HWND hwnd )
419 static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
420 const RECT *top_rect, DWORD flags )
424 static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
425 DWORD mask, DWORD flags )
427 return WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL,
428 timeout, flags & MWMO_ALERTABLE );
431 static void CDECL nulldrv_ReleaseDC( HWND hwnd, HDC hdc )
435 static BOOL CDECL nulldrv_ScrollDC( HDC hdc, INT dx, INT dy, HRGN update )
437 RECT rect;
439 GetClipBox( hdc, &rect );
440 return BitBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
441 hdc, rect.left - dx, rect.top - dy, SRCCOPY );
444 static void CDECL nulldrv_SetCapture( HWND hwnd, UINT flags )
448 static void CDECL nulldrv_SetFocus( HWND hwnd )
452 static void CDECL nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
456 static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent )
460 static void CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
464 static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
468 static void CDECL nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
472 static void CDECL nulldrv_SetWindowText( HWND hwnd, LPCWSTR text )
476 static UINT CDECL nulldrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
478 return swp;
481 static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
483 return -1;
486 static BOOL CDECL nulldrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
487 const RECT *window_rect )
489 return TRUE;
492 static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
494 return 0;
497 static void CDECL nulldrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
498 const RECT *window_rect, const RECT *client_rect,
499 RECT *visible_rect, struct window_surface **surface )
503 static void CDECL nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
504 const RECT *window_rect, const RECT *client_rect,
505 const RECT *visible_rect, const RECT *valid_rects,
506 struct window_surface *surface )
510 static BOOL CDECL nulldrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, UINT flags )
512 return FALSE;
515 static USER_DRIVER null_driver =
517 /* keyboard functions */
518 nulldrv_ActivateKeyboardLayout,
519 nulldrv_Beep,
520 nulldrv_GetAsyncKeyState,
521 nulldrv_GetKeyNameText,
522 nulldrv_GetKeyboardLayout,
523 nulldrv_GetKeyboardLayoutList,
524 nulldrv_GetKeyboardLayoutName,
525 nulldrv_LoadKeyboardLayout,
526 nulldrv_MapVirtualKeyEx,
527 nulldrv_RegisterHotKey,
528 nulldrv_ToUnicodeEx,
529 nulldrv_UnloadKeyboardLayout,
530 nulldrv_UnregisterHotKey,
531 nulldrv_VkKeyScanEx,
532 /* cursor/icon functions */
533 nulldrv_DestroyCursorIcon,
534 nulldrv_SetCursor,
535 nulldrv_GetCursorPos,
536 nulldrv_SetCursorPos,
537 nulldrv_ClipCursor,
538 /* clipboard functions */
539 nulldrv_AcquireClipboard,
540 nulldrv_CountClipboardFormats,
541 nulldrv_EmptyClipboard,
542 nulldrv_EndClipboardUpdate,
543 nulldrv_EnumClipboardFormats,
544 nulldrv_GetClipboardData,
545 nulldrv_IsClipboardFormatAvailable,
546 nulldrv_SetClipboardData,
547 /* display modes */
548 nulldrv_ChangeDisplaySettingsEx,
549 nulldrv_EnumDisplayMonitors,
550 nulldrv_EnumDisplaySettingsEx,
551 nulldrv_GetMonitorInfo,
552 /* windowing functions */
553 nulldrv_CreateDesktopWindow,
554 nulldrv_CreateWindow,
555 nulldrv_DestroyWindow,
556 nulldrv_GetDC,
557 nulldrv_MsgWaitForMultipleObjectsEx,
558 nulldrv_ReleaseDC,
559 nulldrv_ScrollDC,
560 nulldrv_SetCapture,
561 nulldrv_SetFocus,
562 nulldrv_SetLayeredWindowAttributes,
563 nulldrv_SetParent,
564 nulldrv_SetWindowRgn,
565 nulldrv_SetWindowIcon,
566 nulldrv_SetWindowStyle,
567 nulldrv_SetWindowText,
568 nulldrv_ShowWindow,
569 nulldrv_SysCommand,
570 nulldrv_UpdateLayeredWindow,
571 nulldrv_WindowMessage,
572 nulldrv_WindowPosChanging,
573 nulldrv_WindowPosChanged,
574 /* system parameters */
575 nulldrv_SystemParametersInfo
579 /**********************************************************************
580 * Lazy loading user driver
582 * Initial driver used before another driver is loaded.
583 * Each entry point simply loads the real driver and chains to it.
586 static HKL CDECL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags )
588 return load_driver()->pActivateKeyboardLayout( layout, flags );
591 static void CDECL loaderdrv_Beep(void)
593 load_driver()->pBeep();
596 static SHORT CDECL loaderdrv_GetAsyncKeyState( INT key )
598 return load_driver()->pGetAsyncKeyState( key );
601 static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
603 return load_driver()->pGetKeyNameText( lparam, buffer, size );
606 static HKL CDECL loaderdrv_GetKeyboardLayout( DWORD thread_id )
608 return load_driver()->pGetKeyboardLayout( thread_id );
611 static UINT CDECL loaderdrv_GetKeyboardLayoutList( INT size, HKL *layouts )
613 return load_driver()->pGetKeyboardLayoutList( size, layouts );
616 static BOOL CDECL loaderdrv_GetKeyboardLayoutName( LPWSTR name )
618 return load_driver()->pGetKeyboardLayoutName( name );
621 static HKL CDECL loaderdrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
623 return load_driver()->pLoadKeyboardLayout( name, flags );
626 static UINT CDECL loaderdrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
628 return load_driver()->pMapVirtualKeyEx( code, type, layout );
631 static BOOL CDECL loaderdrv_RegisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
633 return load_driver()->pRegisterHotKey( hwnd, modifiers, vk );
636 static INT CDECL loaderdrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
637 int size, UINT flags, HKL layout )
639 return load_driver()->pToUnicodeEx( virt, scan, state, str, size, flags, layout );
642 static BOOL CDECL loaderdrv_UnloadKeyboardLayout( HKL layout )
644 return load_driver()->pUnloadKeyboardLayout( layout );
647 static void CDECL loaderdrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
649 load_driver()->pUnregisterHotKey( hwnd, modifiers, vk );
652 static SHORT CDECL loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout )
654 return load_driver()->pVkKeyScanEx( ch, layout );
657 static void CDECL loaderdrv_SetCursor( HCURSOR cursor )
659 load_driver()->pSetCursor( cursor );
662 static BOOL CDECL loaderdrv_GetCursorPos( LPPOINT pt )
664 return load_driver()->pGetCursorPos( pt );
667 static BOOL CDECL loaderdrv_SetCursorPos( INT x, INT y )
669 return load_driver()->pSetCursorPos( x, y );
672 static BOOL CDECL loaderdrv_ClipCursor( LPCRECT clip )
674 return load_driver()->pClipCursor( clip );
677 static INT CDECL loaderdrv_AcquireClipboard( HWND hwnd )
679 return load_driver()->pAcquireClipboard( hwnd );
682 static BOOL CDECL loaderdrv_CountClipboardFormats(void)
684 return load_driver()->pCountClipboardFormats();
687 static void CDECL loaderdrv_EmptyClipboard( BOOL keepunowned )
689 load_driver()->pEmptyClipboard( keepunowned );
692 static void CDECL loaderdrv_EndClipboardUpdate(void)
694 load_driver()->pEndClipboardUpdate();
697 static UINT CDECL loaderdrv_EnumClipboardFormats( UINT format )
699 return load_driver()->pEnumClipboardFormats( format );
702 static HANDLE CDECL loaderdrv_GetClipboardData( UINT format )
704 return load_driver()->pGetClipboardData( format );
707 static BOOL CDECL loaderdrv_IsClipboardFormatAvailable( UINT format )
709 return load_driver()->pIsClipboardFormatAvailable( format );
712 static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
714 return load_driver()->pSetClipboardData( format, handle, owner );
717 static LONG CDECL loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
718 DWORD flags, LPVOID lparam )
720 return load_driver()->pChangeDisplaySettingsEx( name, mode, hwnd, flags, lparam );
723 static BOOL CDECL loaderdrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
725 return load_driver()->pEnumDisplayMonitors( hdc, rect, proc, lp );
728 static BOOL CDECL loaderdrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
730 return load_driver()->pEnumDisplaySettingsEx( name, num, mode, flags );
733 static BOOL CDECL loaderdrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
735 return load_driver()->pGetMonitorInfo( handle, info );
738 static BOOL CDECL loaderdrv_CreateDesktopWindow( HWND hwnd )
740 return load_driver()->pCreateDesktopWindow( hwnd );
743 static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd )
745 return load_driver()->pCreateWindow( hwnd );
748 static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
749 const RECT *top_rect, DWORD flags )
751 load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags );
754 static void CDECL loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
756 load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags );
759 static void CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
761 load_driver()->pSetWindowRgn( hwnd, hrgn, redraw );
764 static BOOL CDECL loaderdrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
765 const RECT *window_rect )
767 return load_driver()->pUpdateLayeredWindow( hwnd, info, window_rect );
770 static USER_DRIVER lazy_load_driver =
772 /* keyboard functions */
773 loaderdrv_ActivateKeyboardLayout,
774 loaderdrv_Beep,
775 loaderdrv_GetAsyncKeyState,
776 loaderdrv_GetKeyNameText,
777 loaderdrv_GetKeyboardLayout,
778 loaderdrv_GetKeyboardLayoutList,
779 loaderdrv_GetKeyboardLayoutName,
780 loaderdrv_LoadKeyboardLayout,
781 loaderdrv_MapVirtualKeyEx,
782 loaderdrv_RegisterHotKey,
783 loaderdrv_ToUnicodeEx,
784 loaderdrv_UnloadKeyboardLayout,
785 loaderdrv_UnregisterHotKey,
786 loaderdrv_VkKeyScanEx,
787 /* cursor/icon functions */
788 nulldrv_DestroyCursorIcon,
789 loaderdrv_SetCursor,
790 loaderdrv_GetCursorPos,
791 loaderdrv_SetCursorPos,
792 loaderdrv_ClipCursor,
793 /* clipboard functions */
794 loaderdrv_AcquireClipboard,
795 loaderdrv_CountClipboardFormats,
796 loaderdrv_EmptyClipboard,
797 loaderdrv_EndClipboardUpdate,
798 loaderdrv_EnumClipboardFormats,
799 loaderdrv_GetClipboardData,
800 loaderdrv_IsClipboardFormatAvailable,
801 loaderdrv_SetClipboardData,
802 /* display modes */
803 loaderdrv_ChangeDisplaySettingsEx,
804 loaderdrv_EnumDisplayMonitors,
805 loaderdrv_EnumDisplaySettingsEx,
806 loaderdrv_GetMonitorInfo,
807 /* windowing functions */
808 loaderdrv_CreateDesktopWindow,
809 loaderdrv_CreateWindow,
810 nulldrv_DestroyWindow,
811 loaderdrv_GetDC,
812 nulldrv_MsgWaitForMultipleObjectsEx,
813 nulldrv_ReleaseDC,
814 nulldrv_ScrollDC,
815 nulldrv_SetCapture,
816 nulldrv_SetFocus,
817 loaderdrv_SetLayeredWindowAttributes,
818 nulldrv_SetParent,
819 loaderdrv_SetWindowRgn,
820 nulldrv_SetWindowIcon,
821 nulldrv_SetWindowStyle,
822 nulldrv_SetWindowText,
823 nulldrv_ShowWindow,
824 nulldrv_SysCommand,
825 loaderdrv_UpdateLayeredWindow,
826 nulldrv_WindowMessage,
827 nulldrv_WindowPosChanging,
828 nulldrv_WindowPosChanged,
829 /* system parameters */
830 nulldrv_SystemParametersInfo