Commit 1fe7b8dd authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Use a proper Unix syscall for unwind_builtin_dll().

parent 1d169078
...@@ -4602,12 +4602,6 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) ...@@ -4602,12 +4602,6 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
} }
static NTSTATUS CDECL unwind_builtin_dll_fallback( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context )
{
return STATUS_UNSUCCESSFUL;
}
static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void) static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void)
{ {
LARGE_INTEGER now; LARGE_INTEGER now;
...@@ -4617,7 +4611,6 @@ static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void) ...@@ -4617,7 +4611,6 @@ static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void)
static const struct unix_funcs unix_fallbacks = static const struct unix_funcs unix_fallbacks =
{ {
unwind_builtin_dll_fallback,
RtlGetSystemTimePrecise_fallback, RtlGetSystemTimePrecise_fallback,
}; };
......
...@@ -163,7 +163,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX ...@@ -163,7 +163,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX
if (!module || (module->Flags & LDR_WINE_INTERNAL)) if (!module || (module->Flags & LDR_WINE_INTERNAL))
{ {
status = unix_funcs->unwind_builtin_dll( type, dispatch, context ); struct unwind_builtin_dll_params params = { type, dispatch, context };
status = NTDLL_UNIX_CALL( unwind_builtin_dll, &params );
if (status != STATUS_SUCCESS) return status; if (status != STATUS_SUCCESS) return status;
if (dispatch->EstablisherFrame) if (dispatch->EstablisherFrame)
......
...@@ -197,7 +197,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX ...@@ -197,7 +197,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX
if (!module || (module->Flags & LDR_WINE_INTERNAL)) if (!module || (module->Flags & LDR_WINE_INTERNAL))
{ {
status = unix_funcs->unwind_builtin_dll( type, dispatch, context ); struct unwind_builtin_dll_params params = { type, dispatch, context };
status = NTDLL_UNIX_CALL( unwind_builtin_dll, &params );
if (status != STATUS_SUCCESS) return status; if (status != STATUS_SUCCESS) return status;
if (dispatch->EstablisherFrame) if (dispatch->EstablisherFrame)
......
...@@ -280,8 +280,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX ...@@ -280,8 +280,9 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX
if (!module || (module->Flags & LDR_WINE_INTERNAL)) if (!module || (module->Flags & LDR_WINE_INTERNAL))
{ {
status = unix_funcs->unwind_builtin_dll( type, dispatch, context ); struct unwind_builtin_dll_params params = { type, dispatch, context };
status = NTDLL_UNIX_CALL( unwind_builtin_dll, &params );
if (!status && dispatch->LanguageHandler && !module) if (!status && dispatch->LanguageHandler && !module)
{ {
FIXME( "calling personality routine in system library not supported yet\n" ); FIXME( "calling personality routine in system library not supported yet\n" );
......
...@@ -2155,7 +2155,6 @@ static ULONG_PTR get_image_address(void) ...@@ -2155,7 +2155,6 @@ static ULONG_PTR get_image_address(void)
*/ */
static struct unix_funcs unix_funcs = static struct unix_funcs unix_funcs =
{ {
unwind_builtin_dll,
RtlGetSystemTimePrecise, RtlGetSystemTimePrecise,
}; };
...@@ -2167,11 +2166,13 @@ const unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -2167,11 +2166,13 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
{ {
load_so_dll, load_so_dll,
init_builtin_dll, init_builtin_dll,
unwind_builtin_dll,
}; };
static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; } static NTSTATUS wow64_load_so_dll( void *args ) { return STATUS_INVALID_IMAGE_FORMAT; }
static NTSTATUS wow64_init_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; } static NTSTATUS wow64_init_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; }
static NTSTATUS wow64_unwind_builtin_dll( void *args ) { return STATUS_UNSUCCESSFUL; }
/*********************************************************************** /***********************************************************************
* __wine_unix_call_wow64_funcs * __wine_unix_call_wow64_funcs
...@@ -2180,6 +2181,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = ...@@ -2180,6 +2181,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{ {
wow64_load_so_dll, wow64_load_so_dll,
wow64_init_builtin_dll, wow64_init_builtin_dll,
wow64_unwind_builtin_dll,
}; };
......
...@@ -728,8 +728,11 @@ static NTSTATUS libunwind_virtual_unwind( DWORD ip, DWORD *frame, CONTEXT *conte ...@@ -728,8 +728,11 @@ static NTSTATUS libunwind_virtual_unwind( DWORD ip, DWORD *frame, CONTEXT *conte
/*********************************************************************** /***********************************************************************
* unwind_builtin_dll * unwind_builtin_dll
*/ */
NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) NTSTATUS unwind_builtin_dll( void *args )
{ {
struct unwind_builtin_dll_params *params = args;
DISPATCHER_CONTEXT *dispatch = params->dispatch;
CONTEXT *context = params->context;
DWORD ip = context->Pc - (dispatch->ControlPcIsUnwound ? 2 : 0); DWORD ip = context->Pc - (dispatch->ControlPcIsUnwound ? 2 : 0);
#ifdef linux #ifdef linux
const struct exidx_entry *entry = find_exidx_entry( (void *)ip ); const struct exidx_entry *entry = find_exidx_entry( (void *)ip );
......
...@@ -458,8 +458,11 @@ static NTSTATUS libunwind_virtual_unwind( ULONG_PTR ip, ULONG_PTR *frame, CONTEX ...@@ -458,8 +458,11 @@ static NTSTATUS libunwind_virtual_unwind( ULONG_PTR ip, ULONG_PTR *frame, CONTEX
* *
* Equivalent of RtlVirtualUnwind for builtin modules. * Equivalent of RtlVirtualUnwind for builtin modules.
*/ */
NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) NTSTATUS unwind_builtin_dll( void *args )
{ {
struct unwind_builtin_dll_params *params = args;
DISPATCHER_CONTEXT *dispatch = params->dispatch;
CONTEXT *context = params->context;
struct dwarf_eh_bases bases; struct dwarf_eh_bases bases;
const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context->Pc - 1), &bases ); const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context->Pc - 1), &bases );
......
...@@ -512,7 +512,7 @@ static inline void set_gs( WORD val ) { __asm__( "mov %0,%%gs" :: "r" (val)); } ...@@ -512,7 +512,7 @@ static inline void set_gs( WORD val ) { __asm__( "mov %0,%%gs" :: "r" (val)); }
/*********************************************************************** /***********************************************************************
* unwind_builtin_dll * unwind_builtin_dll
*/ */
NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) NTSTATUS unwind_builtin_dll( void *args )
{ {
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
......
...@@ -746,8 +746,11 @@ static NTSTATUS libunwind_virtual_unwind( ULONG64 ip, ULONG64 *frame, CONTEXT *c ...@@ -746,8 +746,11 @@ static NTSTATUS libunwind_virtual_unwind( ULONG64 ip, ULONG64 *frame, CONTEXT *c
/*********************************************************************** /***********************************************************************
* unwind_builtin_dll * unwind_builtin_dll
*/ */
NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEXT *context ) NTSTATUS unwind_builtin_dll( void *args )
{ {
struct unwind_builtin_dll_params *params = args;
DISPATCHER_CONTEXT *dispatch = params->dispatch;
CONTEXT *context = params->context;
struct dwarf_eh_bases bases; struct dwarf_eh_bases bases;
const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context->Rip - 1), &bases ); const struct dwarf_fde *fde = _Unwind_Find_FDE( (void *)(context->Rip - 1), &bases );
......
...@@ -108,9 +108,6 @@ extern void (WINAPI *p__wine_ctrl_routine)(void *) DECLSPEC_HIDDEN; ...@@ -108,9 +108,6 @@ extern void (WINAPI *p__wine_ctrl_routine)(void *) DECLSPEC_HIDDEN;
extern SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock DECLSPEC_HIDDEN; extern SYSTEM_DLL_INIT_BLOCK *pLdrSystemDllInitBlock DECLSPEC_HIDDEN;
extern LONGLONG CDECL fast_RtlGetSystemTimePrecise(void) DECLSPEC_HIDDEN; extern LONGLONG CDECL fast_RtlGetSystemTimePrecise(void) DECLSPEC_HIDDEN;
extern NTSTATUS CDECL unwind_builtin_dll( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context ) DECLSPEC_HIDDEN;
struct _FILE_FS_DEVICE_INFORMATION; struct _FILE_FS_DEVICE_INFORMATION;
extern const char wine_build[] DECLSPEC_HIDDEN; extern const char wine_build[] DECLSPEC_HIDDEN;
...@@ -230,6 +227,7 @@ extern void virtual_fill_image_information( const pe_image_info_t *pe_info, ...@@ -230,6 +227,7 @@ extern void virtual_fill_image_information( const pe_image_info_t *pe_info,
extern void release_builtin_module( void *module ) DECLSPEC_HIDDEN; extern void release_builtin_module( void *module ) DECLSPEC_HIDDEN;
extern void *get_builtin_so_handle( void *module ) DECLSPEC_HIDDEN; extern void *get_builtin_so_handle( void *module ) DECLSPEC_HIDDEN;
extern NTSTATUS load_builtin_unixlib( void *module, const char *name ) DECLSPEC_HIDDEN; extern NTSTATUS load_builtin_unixlib( void *module, const char *name ) DECLSPEC_HIDDEN;
extern NTSTATUS unwind_builtin_dll( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_len ) DECLSPEC_HIDDEN; extern NTSTATUS get_thread_ldt_entry( HANDLE handle, void *data, ULONG len, ULONG *ret_len ) DECLSPEC_HIDDEN;
extern void *get_native_context( CONTEXT *context ) DECLSPEC_HIDDEN; extern void *get_native_context( CONTEXT *context ) DECLSPEC_HIDDEN;
......
...@@ -31,10 +31,18 @@ struct load_so_dll_params ...@@ -31,10 +31,18 @@ struct load_so_dll_params
void **module; void **module;
}; };
struct unwind_builtin_dll_params
{
ULONG type;
struct _DISPATCHER_CONTEXT *dispatch;
CONTEXT *context;
};
enum ntdll_unix_funcs enum ntdll_unix_funcs
{ {
unix_load_so_dll, unix_load_so_dll,
unix_init_builtin_dll, unix_init_builtin_dll,
unix_unwind_builtin_dll,
}; };
extern unixlib_handle_t ntdll_unix_handle; extern unixlib_handle_t ntdll_unix_handle;
...@@ -42,14 +50,10 @@ extern unixlib_handle_t ntdll_unix_handle; ...@@ -42,14 +50,10 @@ extern unixlib_handle_t ntdll_unix_handle;
#define NTDLL_UNIX_CALL( func, params ) __wine_unix_call( ntdll_unix_handle, unix_ ## func, params ) #define NTDLL_UNIX_CALL( func, params ) __wine_unix_call( ntdll_unix_handle, unix_ ## func, params )
/* increment this when you change the function table */ /* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 137 #define NTDLL_UNIXLIB_VERSION 138
struct unix_funcs struct unix_funcs
{ {
/* loader functions */
NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context );
/* other Win32 API functions */
LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void); LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void);
}; };
......
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