dmime: Remove the extraneous IUnknown from DMSegTriggerTrack.
[wine.git] / dlls / user32 / driver.c
blobced88368c8a2bad7636eed71832137c4738be53c
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(EmptyClipboard);
124 GET_USER_FUNC(SetClipboardData);
125 GET_USER_FUNC(GetClipboardData);
126 GET_USER_FUNC(CountClipboardFormats);
127 GET_USER_FUNC(EnumClipboardFormats);
128 GET_USER_FUNC(IsClipboardFormatAvailable);
129 GET_USER_FUNC(EndClipboardUpdate);
130 GET_USER_FUNC(ChangeDisplaySettingsEx);
131 GET_USER_FUNC(EnumDisplayMonitors);
132 GET_USER_FUNC(EnumDisplaySettingsEx);
133 GET_USER_FUNC(GetMonitorInfo);
134 GET_USER_FUNC(CreateDesktopWindow);
135 GET_USER_FUNC(CreateWindow);
136 GET_USER_FUNC(DestroyWindow);
137 GET_USER_FUNC(GetDC);
138 GET_USER_FUNC(MsgWaitForMultipleObjectsEx);
139 GET_USER_FUNC(ReleaseDC);
140 GET_USER_FUNC(ScrollDC);
141 GET_USER_FUNC(SetCapture);
142 GET_USER_FUNC(SetFocus);
143 GET_USER_FUNC(SetLayeredWindowAttributes);
144 GET_USER_FUNC(SetParent);
145 GET_USER_FUNC(SetWindowRgn);
146 GET_USER_FUNC(SetWindowIcon);
147 GET_USER_FUNC(SetWindowStyle);
148 GET_USER_FUNC(SetWindowText);
149 GET_USER_FUNC(ShowWindow);
150 GET_USER_FUNC(SysCommand);
151 GET_USER_FUNC(UpdateLayeredWindow);
152 GET_USER_FUNC(WindowMessage);
153 GET_USER_FUNC(WindowPosChanging);
154 GET_USER_FUNC(WindowPosChanged);
155 GET_USER_FUNC(SystemParametersInfo);
156 #undef GET_USER_FUNC
159 prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
160 if (prev != &lazy_load_driver)
162 /* another thread beat us to it */
163 HeapFree( GetProcessHeap(), 0, driver );
164 driver = prev;
166 else LdrAddRefDll( 0, graphics_driver );
168 __wine_set_display_driver( graphics_driver );
169 register_builtin_classes();
171 return driver;
174 /* unload the graphics driver on process exit */
175 void USER_unload_driver(void)
177 USER_DRIVER *prev;
178 /* make sure we don't try to call the driver after it has been detached */
179 prev = InterlockedExchangePointer( (void **)&USER_Driver, &null_driver );
180 if (prev != &lazy_load_driver && prev != &null_driver)
181 HeapFree( GetProcessHeap(), 0, prev );
185 /**********************************************************************
186 * Null user driver
188 * These are fallbacks for entry points that are not implemented in the real driver.
191 static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags )
193 return 0;
196 static void CDECL nulldrv_Beep(void)
200 static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
202 return -1;
205 static UINT CDECL nulldrv_GetKeyboardLayoutList( INT size, HKL *layouts )
207 HKEY hKeyKeyboard;
208 DWORD rc;
209 INT count = 0;
210 ULONG_PTR baselayout;
211 LANGID langid;
212 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};
214 baselayout = GetUserDefaultLCID();
215 langid = PRIMARYLANGID(LANGIDFROMLCID(baselayout));
216 if (langid == LANG_CHINESE || langid == LANG_JAPANESE || langid == LANG_KOREAN)
217 baselayout |= 0xe001 << 16; /* IME */
218 else
219 baselayout |= baselayout << 16;
221 /* Enumerate the Registry */
222 rc = RegOpenKeyW(HKEY_LOCAL_MACHINE,szKeyboardReg,&hKeyKeyboard);
223 if (rc == ERROR_SUCCESS)
225 do {
226 WCHAR szKeyName[9];
227 HKL layout;
228 rc = RegEnumKeyW(hKeyKeyboard, count, szKeyName, 9);
229 if (rc == ERROR_SUCCESS)
231 layout = (HKL)(ULONG_PTR)strtoulW(szKeyName,NULL,16);
232 if (baselayout != 0 && layout == (HKL)baselayout)
233 baselayout = 0; /* found in the registry do not add again */
234 if (size && layouts)
236 if (count >= size ) break;
237 layouts[count] = layout;
239 count ++;
241 } while (rc == ERROR_SUCCESS);
242 RegCloseKey(hKeyKeyboard);
245 /* make sure our base layout is on the list */
246 if (baselayout != 0)
248 if (size && layouts)
250 if (count < size)
252 layouts[count] = (HKL)baselayout;
253 count++;
256 else
257 count++;
260 return count;
263 static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
265 return 0;
268 static HKL CDECL nulldrv_GetKeyboardLayout( DWORD thread_id )
270 return 0;
273 static BOOL CDECL nulldrv_GetKeyboardLayoutName( LPWSTR name )
275 return FALSE;
278 static HKL CDECL nulldrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
280 return 0;
283 static UINT CDECL nulldrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
285 return 0;
288 static BOOL CDECL nulldrv_RegisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
290 return TRUE;
293 static INT CDECL nulldrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
294 int size, UINT flags, HKL layout )
296 return 0;
299 static BOOL CDECL nulldrv_UnloadKeyboardLayout( HKL layout )
301 return 0;
304 static void CDECL nulldrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
308 static SHORT CDECL nulldrv_VkKeyScanEx( WCHAR ch, HKL layout )
310 return -1;
313 static void CDECL nulldrv_DestroyCursorIcon( HCURSOR cursor )
317 static void CDECL nulldrv_SetCursor( HCURSOR cursor )
321 static BOOL CDECL nulldrv_GetCursorPos( LPPOINT pt )
323 return FALSE;
326 static BOOL CDECL nulldrv_SetCursorPos( INT x, INT y )
328 return FALSE;
331 static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip )
333 return FALSE;
336 static BOOL CDECL nulldrv_CountClipboardFormats(void)
338 return 0;
341 static void CDECL nulldrv_EmptyClipboard(void)
345 static void CDECL nulldrv_EndClipboardUpdate(void)
349 static UINT CDECL nulldrv_EnumClipboardFormats( UINT format )
351 return 0;
354 static HANDLE CDECL nulldrv_GetClipboardData( UINT format )
356 return 0;
359 static BOOL CDECL nulldrv_IsClipboardFormatAvailable( UINT format )
361 return FALSE;
364 static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
366 return FALSE;
369 static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
370 DWORD flags, LPVOID lparam )
372 return DISP_CHANGE_FAILED;
375 static BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
377 return FALSE;
380 static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
382 return FALSE;
385 static BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
387 return FALSE;
390 static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
392 return TRUE;
395 static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
397 static int warned;
398 HWND parent = GetAncestor( hwnd, GA_PARENT );
400 /* HWND_MESSAGE windows don't need a graphics driver */
401 if (!parent || parent == get_user_thread_info()->msg_window) return TRUE;
402 if (warned++) return FALSE;
404 MESSAGE( "Application tried to create a window, but no driver could be loaded.\n");
405 if (driver_load_error[0]) MESSAGE( "%s\n", driver_load_error );
406 return FALSE;
409 static void CDECL nulldrv_DestroyWindow( HWND hwnd )
413 static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
414 const RECT *top_rect, DWORD flags )
418 static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
419 DWORD mask, DWORD flags )
421 return WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL,
422 timeout, flags & MWMO_ALERTABLE );
425 static void CDECL nulldrv_ReleaseDC( HWND hwnd, HDC hdc )
429 static BOOL CDECL nulldrv_ScrollDC( HDC hdc, INT dx, INT dy, HRGN update )
431 RECT rect;
433 GetClipBox( hdc, &rect );
434 return BitBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
435 hdc, rect.left - dx, rect.top - dy, SRCCOPY );
438 static void CDECL nulldrv_SetCapture( HWND hwnd, UINT flags )
442 static void CDECL nulldrv_SetFocus( HWND hwnd )
446 static void CDECL nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
450 static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent )
454 static void CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
458 static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
462 static void CDECL nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
466 static void CDECL nulldrv_SetWindowText( HWND hwnd, LPCWSTR text )
470 static UINT CDECL nulldrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
472 return swp;
475 static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
477 return -1;
480 static BOOL CDECL nulldrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
481 const RECT *window_rect )
483 return TRUE;
486 static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
488 return 0;
491 static void CDECL nulldrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
492 const RECT *window_rect, const RECT *client_rect,
493 RECT *visible_rect, struct window_surface **surface )
497 static void CDECL nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
498 const RECT *window_rect, const RECT *client_rect,
499 const RECT *visible_rect, const RECT *valid_rects,
500 struct window_surface *surface )
504 static BOOL CDECL nulldrv_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, UINT flags )
506 return FALSE;
509 static USER_DRIVER null_driver =
511 /* keyboard functions */
512 nulldrv_ActivateKeyboardLayout,
513 nulldrv_Beep,
514 nulldrv_GetAsyncKeyState,
515 nulldrv_GetKeyNameText,
516 nulldrv_GetKeyboardLayout,
517 nulldrv_GetKeyboardLayoutList,
518 nulldrv_GetKeyboardLayoutName,
519 nulldrv_LoadKeyboardLayout,
520 nulldrv_MapVirtualKeyEx,
521 nulldrv_RegisterHotKey,
522 nulldrv_ToUnicodeEx,
523 nulldrv_UnloadKeyboardLayout,
524 nulldrv_UnregisterHotKey,
525 nulldrv_VkKeyScanEx,
526 /* cursor/icon functions */
527 nulldrv_DestroyCursorIcon,
528 nulldrv_SetCursor,
529 nulldrv_GetCursorPos,
530 nulldrv_SetCursorPos,
531 nulldrv_ClipCursor,
532 /* clipboard functions */
533 nulldrv_CountClipboardFormats,
534 nulldrv_EmptyClipboard,
535 nulldrv_EndClipboardUpdate,
536 nulldrv_EnumClipboardFormats,
537 nulldrv_GetClipboardData,
538 nulldrv_IsClipboardFormatAvailable,
539 nulldrv_SetClipboardData,
540 /* display modes */
541 nulldrv_ChangeDisplaySettingsEx,
542 nulldrv_EnumDisplayMonitors,
543 nulldrv_EnumDisplaySettingsEx,
544 nulldrv_GetMonitorInfo,
545 /* windowing functions */
546 nulldrv_CreateDesktopWindow,
547 nulldrv_CreateWindow,
548 nulldrv_DestroyWindow,
549 nulldrv_GetDC,
550 nulldrv_MsgWaitForMultipleObjectsEx,
551 nulldrv_ReleaseDC,
552 nulldrv_ScrollDC,
553 nulldrv_SetCapture,
554 nulldrv_SetFocus,
555 nulldrv_SetLayeredWindowAttributes,
556 nulldrv_SetParent,
557 nulldrv_SetWindowRgn,
558 nulldrv_SetWindowIcon,
559 nulldrv_SetWindowStyle,
560 nulldrv_SetWindowText,
561 nulldrv_ShowWindow,
562 nulldrv_SysCommand,
563 nulldrv_UpdateLayeredWindow,
564 nulldrv_WindowMessage,
565 nulldrv_WindowPosChanging,
566 nulldrv_WindowPosChanged,
567 /* system parameters */
568 nulldrv_SystemParametersInfo
572 /**********************************************************************
573 * Lazy loading user driver
575 * Initial driver used before another driver is loaded.
576 * Each entry point simply loads the real driver and chains to it.
579 static HKL CDECL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags )
581 return load_driver()->pActivateKeyboardLayout( layout, flags );
584 static void CDECL loaderdrv_Beep(void)
586 load_driver()->pBeep();
589 static SHORT CDECL loaderdrv_GetAsyncKeyState( INT key )
591 return load_driver()->pGetAsyncKeyState( key );
594 static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
596 return load_driver()->pGetKeyNameText( lparam, buffer, size );
599 static HKL CDECL loaderdrv_GetKeyboardLayout( DWORD thread_id )
601 return load_driver()->pGetKeyboardLayout( thread_id );
604 static UINT CDECL loaderdrv_GetKeyboardLayoutList( INT size, HKL *layouts )
606 return load_driver()->pGetKeyboardLayoutList( size, layouts );
609 static BOOL CDECL loaderdrv_GetKeyboardLayoutName( LPWSTR name )
611 return load_driver()->pGetKeyboardLayoutName( name );
614 static HKL CDECL loaderdrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
616 return load_driver()->pLoadKeyboardLayout( name, flags );
619 static UINT CDECL loaderdrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
621 return load_driver()->pMapVirtualKeyEx( code, type, layout );
624 static BOOL CDECL loaderdrv_RegisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
626 return load_driver()->pRegisterHotKey( hwnd, modifiers, vk );
629 static INT CDECL loaderdrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
630 int size, UINT flags, HKL layout )
632 return load_driver()->pToUnicodeEx( virt, scan, state, str, size, flags, layout );
635 static BOOL CDECL loaderdrv_UnloadKeyboardLayout( HKL layout )
637 return load_driver()->pUnloadKeyboardLayout( layout );
640 static void CDECL loaderdrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
642 load_driver()->pUnregisterHotKey( hwnd, modifiers, vk );
645 static SHORT CDECL loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout )
647 return load_driver()->pVkKeyScanEx( ch, layout );
650 static void CDECL loaderdrv_SetCursor( HCURSOR cursor )
652 load_driver()->pSetCursor( cursor );
655 static BOOL CDECL loaderdrv_GetCursorPos( LPPOINT pt )
657 return load_driver()->pGetCursorPos( pt );
660 static BOOL CDECL loaderdrv_SetCursorPos( INT x, INT y )
662 return load_driver()->pSetCursorPos( x, y );
665 static BOOL CDECL loaderdrv_ClipCursor( LPCRECT clip )
667 return load_driver()->pClipCursor( clip );
670 static BOOL CDECL loaderdrv_CountClipboardFormats(void)
672 return load_driver()->pCountClipboardFormats();
675 static void CDECL loaderdrv_EmptyClipboard(void)
677 load_driver()->pEmptyClipboard();
680 static void CDECL loaderdrv_EndClipboardUpdate(void)
682 load_driver()->pEndClipboardUpdate();
685 static UINT CDECL loaderdrv_EnumClipboardFormats( UINT format )
687 return load_driver()->pEnumClipboardFormats( format );
690 static HANDLE CDECL loaderdrv_GetClipboardData( UINT format )
692 return load_driver()->pGetClipboardData( format );
695 static BOOL CDECL loaderdrv_IsClipboardFormatAvailable( UINT format )
697 return load_driver()->pIsClipboardFormatAvailable( format );
700 static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
702 return load_driver()->pSetClipboardData( format, handle, owner );
705 static LONG CDECL loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
706 DWORD flags, LPVOID lparam )
708 return load_driver()->pChangeDisplaySettingsEx( name, mode, hwnd, flags, lparam );
711 static BOOL CDECL loaderdrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
713 return load_driver()->pEnumDisplayMonitors( hdc, rect, proc, lp );
716 static BOOL CDECL loaderdrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
718 return load_driver()->pEnumDisplaySettingsEx( name, num, mode, flags );
721 static BOOL CDECL loaderdrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
723 return load_driver()->pGetMonitorInfo( handle, info );
726 static BOOL CDECL loaderdrv_CreateDesktopWindow( HWND hwnd )
728 return load_driver()->pCreateDesktopWindow( hwnd );
731 static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd )
733 return load_driver()->pCreateWindow( hwnd );
736 static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
737 const RECT *top_rect, DWORD flags )
739 load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags );
742 static void CDECL loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
744 load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags );
747 static void CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
749 load_driver()->pSetWindowRgn( hwnd, hrgn, redraw );
752 static BOOL CDECL loaderdrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
753 const RECT *window_rect )
755 return load_driver()->pUpdateLayeredWindow( hwnd, info, window_rect );
758 static USER_DRIVER lazy_load_driver =
760 /* keyboard functions */
761 loaderdrv_ActivateKeyboardLayout,
762 loaderdrv_Beep,
763 loaderdrv_GetAsyncKeyState,
764 loaderdrv_GetKeyNameText,
765 loaderdrv_GetKeyboardLayout,
766 loaderdrv_GetKeyboardLayoutList,
767 loaderdrv_GetKeyboardLayoutName,
768 loaderdrv_LoadKeyboardLayout,
769 loaderdrv_MapVirtualKeyEx,
770 loaderdrv_RegisterHotKey,
771 loaderdrv_ToUnicodeEx,
772 loaderdrv_UnloadKeyboardLayout,
773 loaderdrv_UnregisterHotKey,
774 loaderdrv_VkKeyScanEx,
775 /* cursor/icon functions */
776 nulldrv_DestroyCursorIcon,
777 loaderdrv_SetCursor,
778 loaderdrv_GetCursorPos,
779 loaderdrv_SetCursorPos,
780 loaderdrv_ClipCursor,
781 /* clipboard functions */
782 loaderdrv_CountClipboardFormats,
783 loaderdrv_EmptyClipboard,
784 loaderdrv_EndClipboardUpdate,
785 loaderdrv_EnumClipboardFormats,
786 loaderdrv_GetClipboardData,
787 loaderdrv_IsClipboardFormatAvailable,
788 loaderdrv_SetClipboardData,
789 /* display modes */
790 loaderdrv_ChangeDisplaySettingsEx,
791 loaderdrv_EnumDisplayMonitors,
792 loaderdrv_EnumDisplaySettingsEx,
793 loaderdrv_GetMonitorInfo,
794 /* windowing functions */
795 loaderdrv_CreateDesktopWindow,
796 loaderdrv_CreateWindow,
797 nulldrv_DestroyWindow,
798 loaderdrv_GetDC,
799 nulldrv_MsgWaitForMultipleObjectsEx,
800 nulldrv_ReleaseDC,
801 nulldrv_ScrollDC,
802 nulldrv_SetCapture,
803 nulldrv_SetFocus,
804 loaderdrv_SetLayeredWindowAttributes,
805 nulldrv_SetParent,
806 loaderdrv_SetWindowRgn,
807 nulldrv_SetWindowIcon,
808 nulldrv_SetWindowStyle,
809 nulldrv_SetWindowText,
810 nulldrv_ShowWindow,
811 nulldrv_SysCommand,
812 loaderdrv_UpdateLayeredWindow,
813 nulldrv_WindowMessage,
814 nulldrv_WindowPosChanging,
815 nulldrv_WindowPosChanged,
816 /* system parameters */
817 nulldrv_SystemParametersInfo