Commit bc12c971 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Provide partial null driver.

Provide functions that we still call from user32 to avoid crashes on wow64. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ac9119ba
...@@ -119,10 +119,46 @@ void USER_unload_driver(void) ...@@ -119,10 +119,46 @@ void USER_unload_driver(void)
* These are fallbacks for entry points that are not implemented in the real driver. * These are fallbacks for entry points that are not implemented in the real driver.
*/ */
static void CDECL nulldrv_Beep(void)
{
}
static BOOL CDECL nulldrv_RegisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
{
return TRUE;
}
static void CDECL nulldrv_UnregisterHotKey( HWND hwnd, UINT modifiers, UINT vk )
{
}
static void CDECL nulldrv_DestroyCursorIcon( HCURSOR cursor ) static void CDECL nulldrv_DestroyCursorIcon( HCURSOR cursor )
{ {
} }
static void CDECL nulldrv_SetCursor( HCURSOR cursor )
{
}
static BOOL CDECL nulldrv_GetCursorPos( LPPOINT pt )
{
return TRUE;
}
static BOOL CDECL nulldrv_SetCursorPos( INT x, INT y )
{
return TRUE;
}
static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip )
{
return TRUE;
}
static void CDECL nulldrv_UpdateClipboard(void)
{
}
static BOOL CDECL nodrv_CreateWindow( HWND hwnd ) static BOOL CDECL nodrv_CreateWindow( HWND hwnd )
{ {
static int warned; static int warned;
...@@ -137,10 +173,29 @@ static BOOL CDECL nodrv_CreateWindow( HWND hwnd ) ...@@ -137,10 +173,29 @@ static BOOL CDECL nodrv_CreateWindow( HWND hwnd )
return FALSE; return FALSE;
} }
static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd )
{
return TRUE;
}
static BOOL CDECL nulldrv_CreateWindow( HWND hwnd )
{
return TRUE;
}
static void CDECL nulldrv_DestroyWindow( HWND hwnd ) static void CDECL nulldrv_DestroyWindow( HWND hwnd )
{ {
} }
static void CDECL nulldrv_FlashWindowEx( FLASHWINFO *info )
{
}
static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect,
const RECT *top_rect, DWORD flags )
{
}
static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
DWORD mask, DWORD flags ) DWORD mask, DWORD flags )
{ {
...@@ -161,10 +216,18 @@ static void CDECL nulldrv_SetFocus( HWND hwnd ) ...@@ -161,10 +216,18 @@ static void CDECL nulldrv_SetFocus( HWND hwnd )
{ {
} }
static void CDECL nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags )
{
}
static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent )
{ {
} }
static void CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
{
}
static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon )
{ {
} }
...@@ -187,6 +250,12 @@ static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ...@@ -187,6 +250,12 @@ static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam
return -1; return -1;
} }
static BOOL CDECL nulldrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect )
{
return TRUE;
}
static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{ {
return 0; return 0;
...@@ -367,6 +436,43 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v ...@@ -367,6 +436,43 @@ void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT v
driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) ); driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
*driver = *funcs; *driver = *funcs;
#define SET_USER_FUNC(name) \
do { if (!driver->p##name) driver->p##name = nulldrv_##name; } while(0)
SET_USER_FUNC(Beep);
SET_USER_FUNC(RegisterHotKey);
SET_USER_FUNC(UnregisterHotKey);
SET_USER_FUNC(DestroyCursorIcon);
SET_USER_FUNC(SetCursor);
SET_USER_FUNC(GetCursorPos);
SET_USER_FUNC(SetCursorPos);
SET_USER_FUNC(ClipCursor);
SET_USER_FUNC(UpdateClipboard);
SET_USER_FUNC(CreateDesktopWindow);
SET_USER_FUNC(CreateWindow);
SET_USER_FUNC(DestroyWindow);
SET_USER_FUNC(FlashWindowEx);
SET_USER_FUNC(GetDC);
SET_USER_FUNC(MsgWaitForMultipleObjectsEx);
SET_USER_FUNC(ReleaseDC);
SET_USER_FUNC(SetCapture);
SET_USER_FUNC(SetFocus);
SET_USER_FUNC(SetLayeredWindowAttributes);
SET_USER_FUNC(SetParent);
SET_USER_FUNC(SetWindowRgn);
SET_USER_FUNC(SetWindowIcon);
SET_USER_FUNC(SetWindowStyle);
SET_USER_FUNC(SetWindowText);
SET_USER_FUNC(ShowWindow);
SET_USER_FUNC(SysCommand);
SET_USER_FUNC(UpdateLayeredWindow);
SET_USER_FUNC(WindowMessage);
SET_USER_FUNC(WindowPosChanging);
SET_USER_FUNC(WindowPosChanged);
SET_USER_FUNC(SystemParametersInfo);
SET_USER_FUNC(ThreadDetach);
#undef SET_USER_FUNC
prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver ); prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
if (prev != &lazy_load_driver) if (prev != &lazy_load_driver)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment