wininet: Support the Cache-Control max-age directive for setting url cache entry...
[wine/testsucceed.git] / dlls / user32 / driver.c
blobd40789c4e0ee9aa59699e5130e0eea3fe800f494
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 "winuser.h"
26 #include "wine/debug.h"
28 #include "user_private.h"
30 static USER_DRIVER null_driver, lazy_load_driver;
32 const USER_DRIVER *USER_Driver = &lazy_load_driver;
33 static DWORD driver_load_error;
35 /* load the graphics driver */
36 static const USER_DRIVER *load_driver(void)
38 char buffer[MAX_PATH], libname[32], *name, *next;
39 HKEY hkey;
40 void *ptr;
41 HMODULE graphics_driver;
42 USER_DRIVER *driver, *prev;
44 strcpy( buffer, "x11" ); /* default value */
45 /* @@ Wine registry key: HKCU\Software\Wine\Drivers */
46 if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Drivers", &hkey ))
48 DWORD type, count = sizeof(buffer);
49 RegQueryValueExA( hkey, "Graphics", 0, &type, (LPBYTE) buffer, &count );
50 RegCloseKey( hkey );
53 name = buffer;
54 while (name)
56 next = strchr( name, ',' );
57 if (next) *next++ = 0;
59 snprintf( libname, sizeof(libname), "wine%s.drv", name );
60 if ((graphics_driver = LoadLibraryA( libname )) != 0) break;
61 name = next;
64 if (!graphics_driver)
65 driver_load_error = GetLastError();
67 driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
68 *driver = null_driver;
70 if (graphics_driver)
72 #define GET_USER_FUNC(name) \
73 do { if ((ptr = GetProcAddress( graphics_driver, #name ))) driver->p##name = ptr; } while(0)
75 GET_USER_FUNC(ActivateKeyboardLayout);
76 GET_USER_FUNC(Beep);
77 GET_USER_FUNC(GetAsyncKeyState);
78 GET_USER_FUNC(GetKeyNameText);
79 GET_USER_FUNC(GetKeyboardLayout);
80 GET_USER_FUNC(GetKeyboardLayoutName);
81 GET_USER_FUNC(LoadKeyboardLayout);
82 GET_USER_FUNC(MapVirtualKeyEx);
83 GET_USER_FUNC(ToUnicodeEx);
84 GET_USER_FUNC(UnloadKeyboardLayout);
85 GET_USER_FUNC(VkKeyScanEx);
86 GET_USER_FUNC(CreateCursorIcon);
87 GET_USER_FUNC(DestroyCursorIcon);
88 GET_USER_FUNC(SetCursor);
89 GET_USER_FUNC(GetCursorPos);
90 GET_USER_FUNC(SetCursorPos);
91 GET_USER_FUNC(ClipCursor);
92 GET_USER_FUNC(GetScreenSaveActive);
93 GET_USER_FUNC(SetScreenSaveActive);
94 GET_USER_FUNC(AcquireClipboard);
95 GET_USER_FUNC(EmptyClipboard);
96 GET_USER_FUNC(SetClipboardData);
97 GET_USER_FUNC(GetClipboardData);
98 GET_USER_FUNC(CountClipboardFormats);
99 GET_USER_FUNC(EnumClipboardFormats);
100 GET_USER_FUNC(IsClipboardFormatAvailable);
101 GET_USER_FUNC(RegisterClipboardFormat);
102 GET_USER_FUNC(EndClipboardUpdate);
103 GET_USER_FUNC(ChangeDisplaySettingsEx);
104 GET_USER_FUNC(EnumDisplayMonitors);
105 GET_USER_FUNC(EnumDisplaySettingsEx);
106 GET_USER_FUNC(GetMonitorInfo);
107 GET_USER_FUNC(CreateDesktopWindow);
108 GET_USER_FUNC(CreateWindow);
109 GET_USER_FUNC(DestroyWindow);
110 GET_USER_FUNC(GetDC);
111 GET_USER_FUNC(MsgWaitForMultipleObjectsEx);
112 GET_USER_FUNC(ReleaseDC);
113 GET_USER_FUNC(ScrollDC);
114 GET_USER_FUNC(SetCapture);
115 GET_USER_FUNC(SetFocus);
116 GET_USER_FUNC(SetLayeredWindowAttributes);
117 GET_USER_FUNC(SetParent);
118 GET_USER_FUNC(SetWindowRgn);
119 GET_USER_FUNC(SetWindowIcon);
120 GET_USER_FUNC(SetWindowStyle);
121 GET_USER_FUNC(SetWindowText);
122 GET_USER_FUNC(ShowWindow);
123 GET_USER_FUNC(SysCommand);
124 GET_USER_FUNC(WindowMessage);
125 GET_USER_FUNC(WindowPosChanging);
126 GET_USER_FUNC(WindowPosChanged);
127 #undef GET_USER_FUNC
130 prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
131 if (prev != &lazy_load_driver)
133 /* another thread beat us to it */
134 HeapFree( GetProcessHeap(), 0, driver );
135 FreeLibrary( graphics_driver );
136 driver = prev;
138 return driver;
141 /* unload the graphics driver on process exit */
142 void USER_unload_driver(void)
144 USER_DRIVER *prev;
145 /* make sure we don't try to call the driver after it has been detached */
146 prev = InterlockedExchangePointer( (void **)&USER_Driver, &null_driver );
147 if (prev != &lazy_load_driver && prev != &null_driver)
148 HeapFree( GetProcessHeap(), 0, prev );
152 /**********************************************************************
153 * Null user driver
155 * These are fallbacks for entry points that are not implemented in the real driver.
158 static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags )
160 return 0;
163 static void CDECL nulldrv_Beep(void)
167 static SHORT CDECL nulldrv_GetAsyncKeyState( INT key )
169 return -1;
172 static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
174 return 0;
177 static HKL CDECL nulldrv_GetKeyboardLayout( DWORD thread_id )
179 return 0;
182 static BOOL CDECL nulldrv_GetKeyboardLayoutName( LPWSTR name )
184 return FALSE;
187 static HKL CDECL nulldrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
189 return 0;
192 static UINT CDECL nulldrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
194 return 0;
197 static INT CDECL nulldrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
198 int size, UINT flags, HKL layout )
200 return 0;
203 static BOOL CDECL nulldrv_UnloadKeyboardLayout( HKL layout )
205 return 0;
208 static SHORT CDECL nulldrv_VkKeyScanEx( WCHAR ch, HKL layout )
210 return -1;
213 static void CDECL nulldrv_CreateCursorIcon( HCURSOR cursor )
217 static void CDECL nulldrv_DestroyCursorIcon( HCURSOR cursor )
221 static void CDECL nulldrv_SetCursor( HCURSOR cursor )
225 static BOOL CDECL nulldrv_GetCursorPos( LPPOINT pt )
227 return FALSE;
230 static BOOL CDECL nulldrv_SetCursorPos( INT x, INT y )
232 return FALSE;
235 static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip )
237 return FALSE;
240 static BOOL CDECL nulldrv_GetScreenSaveActive(void)
242 return FALSE;
245 static void CDECL nulldrv_SetScreenSaveActive( BOOL on )
249 static INT CDECL nulldrv_AcquireClipboard( HWND hwnd )
251 return 0;
254 static BOOL CDECL nulldrv_CountClipboardFormats(void)
256 return 0;
259 static void CDECL nulldrv_EmptyClipboard( BOOL keepunowned )
263 static void CDECL nulldrv_EndClipboardUpdate(void)
267 static UINT CDECL nulldrv_EnumClipboardFormats( UINT format )
269 return 0;
272 static HANDLE CDECL nulldrv_GetClipboardData( UINT format )
274 return 0;
277 static BOOL CDECL nulldrv_IsClipboardFormatAvailable( UINT format )
279 return FALSE;
282 static UINT CDECL nulldrv_RegisterClipboardFormat( LPCWSTR name )
284 return 0;
287 static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
289 return FALSE;
292 static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
293 DWORD flags, LPVOID lparam )
295 return DISP_CHANGE_FAILED;
298 static BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
300 return FALSE;
303 static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
305 return FALSE;
308 static BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
310 return FALSE;
313 static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
315 return TRUE;
318 static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
320 static int warned;
322 /* HWND_MESSAGE windows don't need a graphics driver */
323 if (GetAncestor( hwnd, GA_PARENT ) == get_user_thread_info()->msg_window) return TRUE;
324 if (warned++) return FALSE;
326 MESSAGE( "Application tried to create a window, but no driver could be loaded.\n");
327 switch (driver_load_error)
329 case ERROR_MOD_NOT_FOUND:
330 MESSAGE( "The X11 driver is missing. Check your build!\n" );
331 break;
332 case ERROR_DLL_INIT_FAILED:
333 MESSAGE( "Make sure that your X server is running and that $DISPLAY is set correctly.\n" );
334 break;
335 default:
336 MESSAGE( "Unknown error (%d).\n", driver_load_error );
339 return FALSE;
342 static void CDECL nulldrv_DestroyWindow( HWND hwnd )
346 static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
347 const RECT *top_rect, DWORD flags )
351 static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
352 DWORD mask, DWORD flags )
354 return WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL,
355 timeout, flags & MWMO_ALERTABLE );
358 static void CDECL nulldrv_ReleaseDC( HWND hwnd, HDC hdc )
362 static BOOL CDECL nulldrv_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip,
363 HRGN hrgn, LPRECT update )
365 return FALSE;
368 static void CDECL nulldrv_SetCapture( HWND hwnd, UINT flags )
372 static void CDECL nulldrv_SetFocus( HWND hwnd )
376 static void CDECL nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
380 static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent )
384 static int CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
386 return 1;
389 static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
393 static void CDECL nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
397 static void CDECL nulldrv_SetWindowText( HWND hwnd, LPCWSTR text )
401 static UINT CDECL nulldrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
403 return swp;
406 static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
408 return -1;
411 static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
413 return 0;
416 static void CDECL nulldrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
417 const RECT *window_rect, const RECT *client_rect,
418 RECT *visible_rect )
422 static void CDECL nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
423 const RECT *window_rect, const RECT *client_rect,
424 const RECT *visible_rect, const RECT *valid_rects )
428 static USER_DRIVER null_driver =
430 /* keyboard functions */
431 nulldrv_ActivateKeyboardLayout,
432 nulldrv_Beep,
433 nulldrv_GetAsyncKeyState,
434 nulldrv_GetKeyNameText,
435 nulldrv_GetKeyboardLayout,
436 nulldrv_GetKeyboardLayoutName,
437 nulldrv_LoadKeyboardLayout,
438 nulldrv_MapVirtualKeyEx,
439 nulldrv_ToUnicodeEx,
440 nulldrv_UnloadKeyboardLayout,
441 nulldrv_VkKeyScanEx,
442 /* cursor/icon functions */
443 nulldrv_CreateCursorIcon,
444 nulldrv_DestroyCursorIcon,
445 nulldrv_SetCursor,
446 nulldrv_GetCursorPos,
447 nulldrv_SetCursorPos,
448 nulldrv_ClipCursor,
449 /* screen saver functions */
450 nulldrv_GetScreenSaveActive,
451 nulldrv_SetScreenSaveActive,
452 /* clipboard functions */
453 nulldrv_AcquireClipboard,
454 nulldrv_CountClipboardFormats,
455 nulldrv_EmptyClipboard,
456 nulldrv_EndClipboardUpdate,
457 nulldrv_EnumClipboardFormats,
458 nulldrv_GetClipboardData,
459 nulldrv_IsClipboardFormatAvailable,
460 nulldrv_RegisterClipboardFormat,
461 nulldrv_SetClipboardData,
462 /* display modes */
463 nulldrv_ChangeDisplaySettingsEx,
464 nulldrv_EnumDisplayMonitors,
465 nulldrv_EnumDisplaySettingsEx,
466 nulldrv_GetMonitorInfo,
467 /* windowing functions */
468 nulldrv_CreateDesktopWindow,
469 nulldrv_CreateWindow,
470 nulldrv_DestroyWindow,
471 nulldrv_GetDC,
472 nulldrv_MsgWaitForMultipleObjectsEx,
473 nulldrv_ReleaseDC,
474 nulldrv_ScrollDC,
475 nulldrv_SetCapture,
476 nulldrv_SetFocus,
477 nulldrv_SetLayeredWindowAttributes,
478 nulldrv_SetParent,
479 nulldrv_SetWindowRgn,
480 nulldrv_SetWindowIcon,
481 nulldrv_SetWindowStyle,
482 nulldrv_SetWindowText,
483 nulldrv_ShowWindow,
484 nulldrv_SysCommand,
485 nulldrv_WindowMessage,
486 nulldrv_WindowPosChanging,
487 nulldrv_WindowPosChanged
491 /**********************************************************************
492 * Lazy loading user driver
494 * Initial driver used before another driver is loaded.
495 * Each entry point simply loads the real driver and chains to it.
498 static HKL CDECL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags )
500 return load_driver()->pActivateKeyboardLayout( layout, flags );
503 static void CDECL loaderdrv_Beep(void)
505 load_driver()->pBeep();
508 static SHORT CDECL loaderdrv_GetAsyncKeyState( INT key )
510 return load_driver()->pGetAsyncKeyState( key );
513 static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size )
515 return load_driver()->pGetKeyNameText( lparam, buffer, size );
518 static HKL CDECL loaderdrv_GetKeyboardLayout( DWORD thread_id )
520 return load_driver()->pGetKeyboardLayout( thread_id );
523 static BOOL CDECL loaderdrv_GetKeyboardLayoutName( LPWSTR name )
525 return load_driver()->pGetKeyboardLayoutName( name );
528 static HKL CDECL loaderdrv_LoadKeyboardLayout( LPCWSTR name, UINT flags )
530 return load_driver()->pLoadKeyboardLayout( name, flags );
533 static UINT CDECL loaderdrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout )
535 return load_driver()->pMapVirtualKeyEx( code, type, layout );
538 static INT CDECL loaderdrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str,
539 int size, UINT flags, HKL layout )
541 return load_driver()->pToUnicodeEx( virt, scan, state, str, size, flags, layout );
544 static BOOL CDECL loaderdrv_UnloadKeyboardLayout( HKL layout )
546 return load_driver()->pUnloadKeyboardLayout( layout );
549 static SHORT CDECL loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout )
551 return load_driver()->pVkKeyScanEx( ch, layout );
554 static void CDECL loaderdrv_CreateCursorIcon( HCURSOR cursor )
556 load_driver()->pCreateCursorIcon( cursor );
559 static void CDECL loaderdrv_DestroyCursorIcon( HCURSOR cursor )
561 load_driver()->pDestroyCursorIcon( cursor );
564 static void CDECL loaderdrv_SetCursor( HCURSOR cursor )
566 load_driver()->pSetCursor( cursor );
569 static BOOL CDECL loaderdrv_GetCursorPos( LPPOINT pt )
571 return load_driver()->pGetCursorPos( pt );
574 static BOOL CDECL loaderdrv_SetCursorPos( INT x, INT y )
576 return load_driver()->pSetCursorPos( x, y );
579 static BOOL CDECL loaderdrv_ClipCursor( LPCRECT clip )
581 return load_driver()->pClipCursor( clip );
584 static BOOL CDECL loaderdrv_GetScreenSaveActive(void)
586 return load_driver()->pGetScreenSaveActive();
589 static void CDECL loaderdrv_SetScreenSaveActive( BOOL on )
591 load_driver()->pSetScreenSaveActive( on );
594 static INT CDECL loaderdrv_AcquireClipboard( HWND hwnd )
596 return load_driver()->pAcquireClipboard( hwnd );
599 static BOOL CDECL loaderdrv_CountClipboardFormats(void)
601 return load_driver()->pCountClipboardFormats();
604 static void CDECL loaderdrv_EmptyClipboard( BOOL keepunowned )
606 load_driver()->pEmptyClipboard( keepunowned );
609 static void CDECL loaderdrv_EndClipboardUpdate(void)
611 load_driver()->pEndClipboardUpdate();
614 static UINT CDECL loaderdrv_EnumClipboardFormats( UINT format )
616 return load_driver()->pEnumClipboardFormats( format );
619 static HANDLE CDECL loaderdrv_GetClipboardData( UINT format )
621 return load_driver()->pGetClipboardData( format );
624 static BOOL CDECL loaderdrv_IsClipboardFormatAvailable( UINT format )
626 return load_driver()->pIsClipboardFormatAvailable( format );
629 static UINT CDECL loaderdrv_RegisterClipboardFormat( LPCWSTR name )
631 return load_driver()->pRegisterClipboardFormat( name );
634 static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE handle, BOOL owner )
636 return load_driver()->pSetClipboardData( format, handle, owner );
639 static LONG CDECL loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd,
640 DWORD flags, LPVOID lparam )
642 return load_driver()->pChangeDisplaySettingsEx( name, mode, hwnd, flags, lparam );
645 static BOOL CDECL loaderdrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp )
647 return load_driver()->pEnumDisplayMonitors( hdc, rect, proc, lp );
650 static BOOL CDECL loaderdrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags )
652 return load_driver()->pEnumDisplaySettingsEx( name, num, mode, flags );
655 static BOOL CDECL loaderdrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
657 return load_driver()->pGetMonitorInfo( handle, info );
660 static BOOL CDECL loaderdrv_CreateDesktopWindow( HWND hwnd )
662 return load_driver()->pCreateDesktopWindow( hwnd );
665 static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd )
667 return load_driver()->pCreateWindow( hwnd );
670 static void CDECL loaderdrv_DestroyWindow( HWND hwnd )
672 load_driver()->pDestroyWindow( hwnd );
675 static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
676 const RECT *top_rect, DWORD flags )
678 load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags );
681 static DWORD CDECL loaderdrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
682 DWORD mask, DWORD flags )
684 return load_driver()->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags );
687 static void CDECL loaderdrv_ReleaseDC( HWND hwnd, HDC hdc )
689 load_driver()->pReleaseDC( hwnd, hdc );
692 static BOOL CDECL loaderdrv_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip,
693 HRGN hrgn, LPRECT update )
695 return load_driver()->pScrollDC( hdc, dx, dy, scroll, clip, hrgn, update );
698 static void CDECL loaderdrv_SetCapture( HWND hwnd, UINT flags )
700 load_driver()->pSetCapture( hwnd, flags );
703 static void CDECL loaderdrv_SetFocus( HWND hwnd )
705 load_driver()->pSetFocus( hwnd );
708 static void CDECL loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
710 load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags );
713 static void CDECL loaderdrv_SetParent( HWND hwnd, HWND parent, HWND old_parent )
715 load_driver()->pSetParent( hwnd, parent, old_parent );
718 static int CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
720 return load_driver()->pSetWindowRgn( hwnd, hrgn, redraw );
723 static void CDECL loaderdrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
725 load_driver()->pSetWindowIcon( hwnd, type, icon );
728 static void CDECL loaderdrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style )
730 load_driver()->pSetWindowStyle( hwnd, offset, style );
733 static void CDECL loaderdrv_SetWindowText( HWND hwnd, LPCWSTR text )
735 load_driver()->pSetWindowText( hwnd, text );
738 static UINT CDECL loaderdrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp )
740 return load_driver()->pShowWindow( hwnd, cmd, rect, swp );
743 static LRESULT CDECL loaderdrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam )
745 return load_driver()->pSysCommand( hwnd, wparam, lparam );
748 static LRESULT CDECL loaderdrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
750 return load_driver()->pWindowMessage( hwnd, msg, wparam, lparam );
753 static void CDECL loaderdrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
754 const RECT *window_rect, const RECT *client_rect,
755 RECT *visible_rect )
757 load_driver()->pWindowPosChanging( hwnd, insert_after, swp_flags,
758 window_rect, client_rect, visible_rect );
761 static void CDECL loaderdrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
762 const RECT *window_rect, const RECT *client_rect,
763 const RECT *visible_rect, const RECT *valid_rects )
765 load_driver()->pWindowPosChanged( hwnd, insert_after, swp_flags, window_rect,
766 client_rect, visible_rect, valid_rects );
769 static USER_DRIVER lazy_load_driver =
771 /* keyboard functions */
772 loaderdrv_ActivateKeyboardLayout,
773 loaderdrv_Beep,
774 loaderdrv_GetAsyncKeyState,
775 loaderdrv_GetKeyNameText,
776 loaderdrv_GetKeyboardLayout,
777 loaderdrv_GetKeyboardLayoutName,
778 loaderdrv_LoadKeyboardLayout,
779 loaderdrv_MapVirtualKeyEx,
780 loaderdrv_ToUnicodeEx,
781 loaderdrv_UnloadKeyboardLayout,
782 loaderdrv_VkKeyScanEx,
783 /* cursor/icon functions */
784 loaderdrv_CreateCursorIcon,
785 loaderdrv_DestroyCursorIcon,
786 loaderdrv_SetCursor,
787 loaderdrv_GetCursorPos,
788 loaderdrv_SetCursorPos,
789 loaderdrv_ClipCursor,
790 /* screen saver functions */
791 loaderdrv_GetScreenSaveActive,
792 loaderdrv_SetScreenSaveActive,
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_RegisterClipboardFormat,
802 loaderdrv_SetClipboardData,
803 /* display modes */
804 loaderdrv_ChangeDisplaySettingsEx,
805 loaderdrv_EnumDisplayMonitors,
806 loaderdrv_EnumDisplaySettingsEx,
807 loaderdrv_GetMonitorInfo,
808 /* windowing functions */
809 loaderdrv_CreateDesktopWindow,
810 loaderdrv_CreateWindow,
811 loaderdrv_DestroyWindow,
812 loaderdrv_GetDC,
813 loaderdrv_MsgWaitForMultipleObjectsEx,
814 loaderdrv_ReleaseDC,
815 loaderdrv_ScrollDC,
816 loaderdrv_SetCapture,
817 loaderdrv_SetFocus,
818 loaderdrv_SetLayeredWindowAttributes,
819 loaderdrv_SetParent,
820 loaderdrv_SetWindowRgn,
821 loaderdrv_SetWindowIcon,
822 loaderdrv_SetWindowStyle,
823 loaderdrv_SetWindowText,
824 loaderdrv_ShowWindow,
825 loaderdrv_SysCommand,
826 loaderdrv_WindowMessage,
827 loaderdrv_WindowPosChanging,
828 loaderdrv_WindowPosChanged