Commit 3031f157 authored by Alexandre Julliard's avatar Alexandre Julliard

include: Add a typedef for user callback function pointers.

parent c7c86242
......@@ -581,7 +581,7 @@ void WINAPI dispatch_callback( void *args, ULONG len, ULONG id )
__TRY
{
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id];
status = NtCallbackReturn( NULL, 0, func( args, len ));
}
__EXCEPT_ALL
......
......@@ -611,7 +611,7 @@ void WINAPI dispatch_callback( void *args, ULONG len, ULONG id )
__TRY
{
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id];
status = NtCallbackReturn( NULL, 0, func( args, len ));
}
__EXCEPT_ALL
......
......@@ -1722,7 +1722,7 @@ void WINAPI dispatch_callback( void *args, ULONG len, ULONG id )
__TRY
{
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id];
status = NtCallbackReturn( NULL, 0, func( args, len ));
}
__EXCEPT_ALL
......
......@@ -298,7 +298,7 @@ void WINAPI KiUserCallbackDispatcher( ULONG id, void *args, ULONG len )
__TRY
{
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id];
status = NtCallbackReturn( NULL, 0, func( args, len ));
}
__EXCEPT_ALL
......
......@@ -697,7 +697,7 @@ void WINAPI dispatch_callback( void *args, ULONG len, ULONG id )
__TRY
{
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id];
status = NtCallbackReturn( NULL, 0, func( args, len ));
}
__EXCEPT_ALL
......
......@@ -2176,7 +2176,7 @@ static void test_KiUserApcDispatcher(void)
static void CDECL hook_KiUserCallbackDispatcher( void *eip, ULONG id, ULONG *args, ULONG len,
ULONG unk1, ULONG unk2, ULONG arg0, ULONG arg1 )
{
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[id];
trace( "eip %p id %lx args %p (%x) len %lx unk1 %lx unk2 %lx args %lx,%lx\n",
eip, id, args, (char *)args - (char *)&eip, len, unk1, unk2, arg0, arg1 );
......@@ -5164,7 +5164,7 @@ static void WINAPI hook_KiUserCallbackDispatcher(void *rsp)
BYTE args_data[0];
} *stack = rsp;
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[stack->id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[stack->id];
trace( "rsp %p args %p (%#Ix) len %lu id %lu\n", stack, stack->args,
(char *)stack->args - (char *)stack, stack->len, stack->id );
......@@ -7561,7 +7561,7 @@ static void WINAPI hook_KiUserCallbackDispatcher(void *sp)
BYTE args_data[0];
} *stack = sp;
ULONG_PTR redzone = (BYTE *)stack->sp - &stack->args_data[stack->len];
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[stack->id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[stack->id];
trace( "stack=%p len=%lx id=%lx lr=%lx sp=%lx pc=%lx\n",
stack, stack->len, stack->id, stack->lr, stack->sp, stack->pc );
......@@ -9200,7 +9200,7 @@ static void WINAPI hook_KiUserCallbackDispatcher(void *sp)
BYTE args_data[0];
} *stack = sp;
ULONG_PTR redzone = (BYTE *)stack->sp - &stack->args_data[stack->len];
NTSTATUS (WINAPI *func)(void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[stack->id];
KERNEL_CALLBACK_PROC func = NtCurrentTeb()->Peb->KernelCallbackTable[stack->id];
trace( "stack=%p len=%lx id=%lx unk=%Ix lr=%Ix sp=%Ix pc=%Ix\n",
stack, stack->len, stack->id, stack->unknown, stack->lr, stack->sp, stack->pc );
......
......@@ -1298,7 +1298,7 @@ static NTSTATUS WINAPI call_opengl_debug_message_callback( void *args, ULONG siz
*/
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
{
void **kernel_callback_table;
KERNEL_CALLBACK_PROC *kernel_callback_table;
NTSTATUS status;
switch(reason)
......
......@@ -2607,7 +2607,7 @@ static NTSTATUS WINAPI User16ThunkLock( void *args, ULONG size )
void register_wow_handlers(void)
{
void **callback_table = NtCurrentTeb()->Peb->KernelCallbackTable;
KERNEL_CALLBACK_PROC *callback_table = NtCurrentTeb()->Peb->KernelCallbackTable;
static const struct wow_handlers16 handlers16 =
{
button_proc16,
......
......@@ -108,15 +108,17 @@ static NTSTATUS WINAPI User32CopyImage( void *args, ULONG size )
return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS );
}
static NTSTATUS WINAPI User32DrawNonClientButton( const struct draw_non_client_button_params *params, ULONG size )
static NTSTATUS WINAPI User32DrawNonClientButton( void *args, ULONG size )
{
const struct draw_non_client_button_params *params = args;
user_api->pNonClientButtonDraw( params->hwnd, params->hdc, params->type, params->rect,
params->down, params->grayed );
return STATUS_SUCCESS;
}
static NTSTATUS WINAPI User32DrawScrollBar( const struct draw_scroll_bar_params *params, ULONG size )
static NTSTATUS WINAPI User32DrawScrollBar( void *args, ULONG size )
{
const struct draw_scroll_bar_params *params = args;
RECT rect = params->rect;
user_api->pScrollBarDraw( params->hwnd, params->hdc, params->bar, params->hit_test,
&params->tracking_info, params->arrows, params->interior,
......@@ -169,22 +171,23 @@ static NTSTATUS WINAPI User32LoadSysMenu( void *args, ULONG size )
return NtCallbackReturn( &ret, sizeof(ret), STATUS_SUCCESS );
}
static NTSTATUS WINAPI User32FreeCachedClipboardData( const struct free_cached_data_params *params,
ULONG size )
static NTSTATUS WINAPI User32FreeCachedClipboardData( void *args, ULONG size )
{
const struct free_cached_data_params *params = args;
free_cached_data( params->format, params->handle );
return STATUS_SUCCESS;
}
static NTSTATUS WINAPI User32PostDDEMessage( const struct post_dde_message_params *params, ULONG size )
static NTSTATUS WINAPI User32PostDDEMessage( void *args, ULONG size )
{
const struct post_dde_message_params *params = args;
return post_dde_message( params->hwnd, params->msg, params->wparam, params->lparam,
params->dest_tid, params->type );
}
static NTSTATUS WINAPI User32RenderSsynthesizedFormat( const struct render_synthesized_format_params *params,
ULONG size )
static NTSTATUS WINAPI User32RenderSsynthesizedFormat( void *args, ULONG size )
{
const struct render_synthesized_format_params *params = args;
render_synthesized_format( params->format, params->from );
return STATUS_SUCCESS;
}
......@@ -212,7 +215,7 @@ static NTSTATUS WINAPI User32UnpackDDEMessage( void *args, ULONG size )
return NtCallbackReturn( &result, sizeof(result), STATUS_SUCCESS );
}
static const void *kernel_callback_table[NtUserCallCount] =
static KERNEL_CALLBACK_PROC kernel_callback_table[NtUserCallCount] =
{
User32CallEnumDisplayMonitor,
User32CallSendAsyncCallback,
......
......@@ -116,7 +116,7 @@ static void CALLBACK register_window_callback( ULONG_PTR arg1, ULONG_PTR arg2, U
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{
struct init_params params;
void **callback_table;
KERNEL_CALLBACK_PROC *callback_table;
if (reason != DLL_PROCESS_ATTACH) return TRUE;
......
......@@ -368,8 +368,7 @@ cleanup:
return NtCallbackReturn(entries, count * sizeof(entries[0]), 0);
}
typedef NTSTATUS (WINAPI *kernel_callback)(void *params, ULONG size);
static const kernel_callback kernel_callbacks[] =
static const KERNEL_CALLBACK_PROC kernel_callbacks[] =
{
macdrv_app_icon,
macdrv_app_quit_request,
......@@ -384,7 +383,7 @@ C_ASSERT(NtUserDriverCallbackFirst + ARRAYSIZE(kernel_callbacks) == client_func_
static BOOL process_attach(void)
{
struct init_params params;
void **callback_table;
KERNEL_CALLBACK_PROC *callback_table;
struct localized_string *str;
struct localized_string strings[] = {
......
......@@ -619,7 +619,7 @@ static NTSTATUS WINAPI call_vulkan_debug_utils_callback( void *args, ULONG size
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
{
void **kernel_callback_table;
KERNEL_CALLBACK_PROC *kernel_callback_table;
TRACE("%p, %lu, %p\n", hinst, reason, reserved);
......
......@@ -25,8 +25,7 @@
HMODULE x11drv_module = 0;
typedef NTSTATUS (WINAPI *kernel_callback)( void *params, ULONG size );
static const kernel_callback kernel_callbacks[] =
static const KERNEL_CALLBACK_PROC kernel_callbacks[] =
{
x11drv_dnd_enter_event,
x11drv_dnd_position_event,
......@@ -40,7 +39,7 @@ C_ASSERT( NtUserDriverCallbackFirst + ARRAYSIZE(kernel_callbacks) == client_func
BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
{
void **callback_table;
KERNEL_CALLBACK_PROC *callback_table;
struct init_params params =
{
foreign_window_proc,
......
......@@ -307,6 +307,8 @@ typedef struct _CHPE_V2_CPU_AREA_INFO
#define TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED 0x00000001
#define TEB_ACTIVE_FRAME_FLAG_EXTENDED 0x00000001
typedef NTSTATUS (WINAPI *KERNEL_CALLBACK_PROC)(void *, ULONG); /* FIXME: not the correct name */
/***********************************************************************
* PEB data structure
*/
......@@ -341,7 +343,7 @@ typedef struct _PEB
ULONG ProcessCurrentlyThrottled : 1;
ULONG ProcessImagesHotPatched : 1;
ULONG ReservedBits0 : 24;
PVOID KernelCallbackTable; /* 02c/058 */
KERNEL_CALLBACK_PROC *KernelCallbackTable; /* 02c/058 */
ULONG Reserved; /* 030/060 */
ULONG AtlThunkSListPtr32; /* 034/064 */
PVOID ApiSetMap; /* 038/068 */
......
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