ntdll: Temporarily allow KeUserModeCallback calls from client stack.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a34e8c2bc3
commit
1facdbbdcb
|
@ -700,6 +700,14 @@ NTSTATUS WINAPI KeUserModeCallback( ULONG id, const void *args, ULONG len, void
|
|||
{
|
||||
struct user_callback_frame callback_frame = { { 0 }, ret_ptr, ret_len };
|
||||
|
||||
/* if we have no syscall frame, call the callback directly */
|
||||
if ((char *)&callback_frame < (char *)ntdll_get_thread_data()->kernel_stack ||
|
||||
(char *)&callback_frame > (char *)arm_thread_data()->syscall_frame)
|
||||
{
|
||||
NTSTATUS (WINAPI *func)(const void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
|
||||
return func( args, len );
|
||||
}
|
||||
|
||||
if ((char *)ntdll_get_thread_data()->kernel_stack + min_kernel_stack > (char *)&callback_frame)
|
||||
return STATUS_STACK_OVERFLOW;
|
||||
|
||||
|
|
|
@ -738,6 +738,14 @@ NTSTATUS WINAPI KeUserModeCallback( ULONG id, const void *args, ULONG len, void
|
|||
{
|
||||
struct user_callback_frame callback_frame = { {{ 0 }}, ret_ptr, ret_len };
|
||||
|
||||
/* if we have no syscall frame, call the callback directly */
|
||||
if ((char *)&callback_frame < (char *)ntdll_get_thread_data()->kernel_stack ||
|
||||
(char *)&callback_frame > (char *)arm64_thread_data()->syscall_frame)
|
||||
{
|
||||
NTSTATUS (WINAPI *func)(const void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
|
||||
return func( args, len );
|
||||
}
|
||||
|
||||
if ((char *)ntdll_get_thread_data()->kernel_stack + min_kernel_stack > (char *)&callback_frame)
|
||||
return STATUS_STACK_OVERFLOW;
|
||||
|
||||
|
|
|
@ -1569,6 +1569,14 @@ NTSTATUS WINAPI KeUserModeCallback( ULONG id, const void *args, ULONG len, void
|
|||
{
|
||||
struct user_callback_frame callback_frame = { { 0 }, ret_ptr, ret_len };
|
||||
|
||||
/* if we have no syscall frame, call the callback directly */
|
||||
if ((char *)&callback_frame < (char *)ntdll_get_thread_data()->kernel_stack ||
|
||||
(char *)&callback_frame > (char *)x86_thread_data()->syscall_frame)
|
||||
{
|
||||
NTSTATUS (WINAPI *func)(const void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
|
||||
return func( args, len );
|
||||
}
|
||||
|
||||
if ((char *)ntdll_get_thread_data()->kernel_stack + min_kernel_stack > (char *)&callback_frame)
|
||||
return STATUS_STACK_OVERFLOW;
|
||||
|
||||
|
|
|
@ -2293,6 +2293,14 @@ NTSTATUS WINAPI KeUserModeCallback( ULONG id, const void *args, ULONG len, void
|
|||
{
|
||||
struct user_callback_frame callback_frame = { { 0 }, ret_ptr, ret_len };
|
||||
|
||||
/* if we have no syscall frame, call the callback directly */
|
||||
if ((char *)&callback_frame < (char *)ntdll_get_thread_data()->kernel_stack ||
|
||||
(char *)&callback_frame > (char *)amd64_thread_data()->syscall_frame)
|
||||
{
|
||||
NTSTATUS (WINAPI *func)(const void *, ULONG) = ((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[id];
|
||||
return func( args, len );
|
||||
}
|
||||
|
||||
if ((char *)ntdll_get_thread_data()->kernel_stack + min_kernel_stack > (char *)&callback_frame)
|
||||
return STATUS_STACK_OVERFLOW;
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@ extern void ntdll_set_exception_jmp_buf( __wine_jmp_buf *jmp );
|
|||
} \
|
||||
} while (0);
|
||||
|
||||
NTSTATUS WINAPI KeUserModeCallback( ULONG id, const void *args, ULONG len, void **ret_ptr, ULONG *ret_len );
|
||||
|
||||
/* wide char string functions */
|
||||
|
||||
static inline size_t ntdll_wcslen( const WCHAR *str )
|
||||
|
|
Loading…
Reference in New Issue