Commit 701932a6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wow64win: Add initial user callbacks support.

parent 21a3690a
......@@ -53,6 +53,8 @@ SYSTEM_SERVICE_TABLE sdwhwin32 =
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
{
if (reason == DLL_PROCESS_ATTACH) LdrDisableThreadCalloutsForDll( inst );
if (reason != DLL_PROCESS_ATTACH) return TRUE;
LdrDisableThreadCalloutsForDll( inst );
NtCurrentTeb()->Peb->KernelCallbackTable = user_callbacks;
return TRUE;
}
......@@ -189,6 +189,232 @@ static struct client_menu_name32 *client_menu_name_64to32( const struct client_m
return name32;
}
static NTSTATUS dispatch_callback( ULONG id, void *args, ULONG len )
{
void *ret_ptr;
ULONG ret_len;
NTSTATUS status = Wow64KiUserCallbackDispatcher( id, args, len, &ret_ptr, &ret_len );
return NtCallbackReturn( ret_ptr, ret_len, status );
}
static NTSTATUS WINAPI wow64_NtUserCallEnumDisplayMonitor( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserCallSendAsyncCallback( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserCallWinEventHook( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserCallWinProc( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserCallWindowsHook( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserCopyImage( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserDrawScrollBar( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserDrawText( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserFreeCachedClipboardData( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserImmProcessKey( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserImmTranslateMessage( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserInitBuiltinClasses( void *arg, ULONG size )
{
return dispatch_callback( NtUserInitBuiltinClasses, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserLoadDriver( void *arg, ULONG size )
{
return dispatch_callback( NtUserLoadDriver, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserLoadImage( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserLoadSysMenu( void *arg, ULONG size )
{
return dispatch_callback( NtUserLoadSysMenu, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserPostDDEMessage( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserRenderSynthesizedFormat( void *arg, ULONG size )
{
return dispatch_callback( NtUserRenderSynthesizedFormat, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserUnpackDDEMessage( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserCallFreeIcon( void *arg, ULONG size )
{
return dispatch_callback( NtUserCallFreeIcon, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserThunkLock( void *arg, ULONG size )
{
return dispatch_callback( NtUserThunkLock, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserCallVulkanDebugReportCallback( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserCallVulkanDebugUtilsCallback( void *arg, ULONG size )
{
FIXME( "\n" );
return 0;
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst0( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 0, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst1( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 1, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst2( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 2, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst3( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 3, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst4( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 4, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst5( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 5, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst6( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 6, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst7( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 7, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst8( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 8, arg, size );
}
static NTSTATUS WINAPI wow64_NtUserDriverCallbackFirst9( void *arg, ULONG size )
{
return dispatch_callback( NtUserDriverCallbackFirst + 9, arg, size );
}
user_callback user_callbacks[] =
{
/* user32 callbacks */
wow64_NtUserCallEnumDisplayMonitor,
wow64_NtUserCallSendAsyncCallback,
wow64_NtUserCallWinEventHook,
wow64_NtUserCallWinProc,
wow64_NtUserCallWindowsHook,
wow64_NtUserCopyImage,
wow64_NtUserDrawScrollBar,
wow64_NtUserDrawText,
wow64_NtUserFreeCachedClipboardData,
wow64_NtUserImmProcessKey,
wow64_NtUserImmTranslateMessage,
wow64_NtUserInitBuiltinClasses,
wow64_NtUserLoadDriver,
wow64_NtUserLoadImage,
wow64_NtUserLoadSysMenu,
wow64_NtUserPostDDEMessage,
wow64_NtUserRenderSynthesizedFormat,
wow64_NtUserUnpackDDEMessage,
/* win16 hooks */
wow64_NtUserCallFreeIcon,
wow64_NtUserThunkLock,
/* Vulkan support */
wow64_NtUserCallVulkanDebugReportCallback,
wow64_NtUserCallVulkanDebugUtilsCallback,
/* Driver-specific callbacks */
wow64_NtUserDriverCallbackFirst0,
wow64_NtUserDriverCallbackFirst1,
wow64_NtUserDriverCallbackFirst2,
wow64_NtUserDriverCallbackFirst3,
wow64_NtUserDriverCallbackFirst4,
wow64_NtUserDriverCallbackFirst5,
wow64_NtUserDriverCallbackFirst6,
wow64_NtUserDriverCallbackFirst7,
wow64_NtUserDriverCallbackFirst8,
wow64_NtUserDriverCallbackFirst9,
};
C_ASSERT( ARRAYSIZE(user_callbacks) == NtUserCallCount );
NTSTATUS WINAPI wow64_NtUserActivateKeyboardLayout( UINT *args )
{
HKL layout = get_handle( &args );
......
......@@ -27,7 +27,12 @@
ALL_WIN32_SYSCALLS
#undef SYSCALL_ENTRY
typedef NTSTATUS (WINAPI *user_callback)( void *params, ULONG size );
extern user_callback user_callbacks[] DECLSPEC_HIDDEN;
void * WINAPI Wow64AllocateTemp( SIZE_T size );
NTSTATUS WINAPI Wow64KiUserCallbackDispatcher( ULONG id, void *args, ULONG len,
void **ret_ptr, ULONG *ret_len );
struct object_attr64
{
......
......@@ -54,7 +54,7 @@ enum
NtUserCallVulkanDebugUtilsCallback,
/* Driver-specific callbacks */
NtUserDriverCallbackFirst,
NtUserDriverCallbackLast = NtUserDriverCallbackFirst + 10,
NtUserDriverCallbackLast = NtUserDriverCallbackFirst + 9,
NtUserCallCount
};
......
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