Commit b3878802 authored by Alexandre Julliard's avatar Alexandre Julliard

ntoskrnl: Duplicate the necessary part of instruction emulation to avoid importing kernel.

parent 442512d5
......@@ -743,9 +743,6 @@
# All functions must be prefixed with '__wine_' (for internal functions)
# or 'wine_' (for user-visible functions) to avoid namespace conflicts.
# 16-bit relays
@ cdecl -arch=win32 __wine_emulate_instruction(ptr ptr)
# VxDs
@ cdecl -arch=win32 -private __wine_vxd_open(wstr long ptr)
@ cdecl -arch=win32 -private __wine_vxd_get_proc(long)
......@@ -4,9 +4,10 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ntoskrnl.exe
IMPORTLIB = ntoskrnl.exe
IMPORTS = kernel32 kernel ntdll
IMPORTS = kernel32 ntdll
C_SRCS = \
instr.c \
ntoskrnl.c
RC_SRCS = ntoskrnl.rc
......
......@@ -40,6 +40,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl);
WINE_DECLARE_DEBUG_CHANNEL(relay);
extern LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs );
KSYSTEM_TIME KeTickCount = { 0, 0, 0 };
......@@ -121,27 +122,6 @@ static HANDLE get_device_manager(void)
return ret;
}
/* exception handler for emulation of privileged instructions */
static LONG CALLBACK vectored_handler( EXCEPTION_POINTERS *ptrs )
{
EXCEPTION_RECORD *record = ptrs->ExceptionRecord;
if (record->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ||
record->ExceptionCode == EXCEPTION_PRIV_INSTRUCTION)
{
#ifdef __i386__
CONTEXT *context = ptrs->ContextRecord;
extern DWORD __wine_emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context );
if (__wine_emulate_instruction( record, context ) == ExceptionContinueExecution)
return EXCEPTION_CONTINUE_EXECUTION;
#else
FIXME( "Privileged instruction emulation not implemented on this CPU\n" );
#endif
}
return EXCEPTION_CONTINUE_SEARCH;
}
/* process an ioctl request for a given device */
static NTSTATUS process_ioctl( DEVICE_OBJECT *device, ULONG code, void *in_buff, ULONG in_size,
void *out_buff, ULONG *out_size )
......@@ -1399,7 +1379,9 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( inst );
#ifdef __i386__
handler = RtlAddVectoredExceptionHandler( TRUE, vectored_handler );
#endif
KeQueryTickCount( &count ); /* initialize the global KeTickCount */
break;
case DLL_PROCESS_DETACH:
......
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