Commit bc553a09 authored by Alexandre Julliard's avatar Alexandre Julliard

ifsmgr.vxd: Load winedos dynamically.

parent 75be87dd
...@@ -3,7 +3,7 @@ TOPOBJDIR = ../.. ...@@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = ifsmgr.vxd MODULE = ifsmgr.vxd
IMPORTS = winedos kernel32 IMPORTS = kernel32
C_SRCS = \ C_SRCS = \
ifsmgr.c ifsmgr.c
......
...@@ -36,8 +36,6 @@ ...@@ -36,8 +36,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(vxd); WINE_DEFAULT_DEBUG_CHANNEL(vxd);
extern void WINAPI CallBuiltinHandler( CONTEXT86 *context, BYTE intnum ); /* from winedos */
/* /*
* IFSMgr DeviceIO service * IFSMgr DeviceIO service
*/ */
...@@ -99,6 +97,23 @@ static void CONTEXT_2_win32apieq(const CONTEXT86 *pCxt, struct win32apireq *pOut ...@@ -99,6 +97,23 @@ static void CONTEXT_2_win32apieq(const CONTEXT86 *pCxt, struct win32apireq *pOut
/* FIXME: pOut->ar_pad ignored */ /* FIXME: pOut->ar_pad ignored */
} }
typedef void (WINAPI *CallBuiltinHandler)( CONTEXT *context, BYTE intnum );
static CallBuiltinHandler load_builtin_handler(void)
{
static CallBuiltinHandler handler;
static BOOL init_done;
if (!init_done)
{
HMODULE mod = LoadLibraryA( "winedos.dll" );
if (mod) handler = (void *)GetProcAddress( mod, "CallBuiltinHandler" );
if (!handler) FIXME( "DOS calls not supported\n" );
init_done = TRUE;
}
return handler;
}
/*********************************************************************** /***********************************************************************
* DeviceIoControl (IFSMGR.VXD.@) * DeviceIoControl (IFSMGR.VXD.@)
*/ */
...@@ -119,6 +134,9 @@ BOOL WINAPI IFSMGR_DeviceIoControl(DWORD dwIoControlCode, LPVOID lpvInBuffer, DW ...@@ -119,6 +134,9 @@ BOOL WINAPI IFSMGR_DeviceIoControl(DWORD dwIoControlCode, LPVOID lpvInBuffer, DW
CONTEXT86 cxt; CONTEXT86 cxt;
struct win32apireq *pIn=lpvInBuffer; struct win32apireq *pIn=lpvInBuffer;
struct win32apireq *pOut=lpvOutBuffer; struct win32apireq *pOut=lpvOutBuffer;
CallBuiltinHandler handler;
if (!(handler = load_builtin_handler())) return FALSE;
TRACE( "Control '%s': " TRACE( "Control '%s': "
"proid=0x%08lx, eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, " "proid=0x%08lx, eax=0x%08lx, ebx=0x%08lx, ecx=0x%08lx, "
...@@ -132,9 +150,9 @@ BOOL WINAPI IFSMGR_DeviceIoControl(DWORD dwIoControlCode, LPVOID lpvInBuffer, DW ...@@ -132,9 +150,9 @@ BOOL WINAPI IFSMGR_DeviceIoControl(DWORD dwIoControlCode, LPVOID lpvInBuffer, DW
win32apieq_2_CONTEXT(pIn,&cxt); win32apieq_2_CONTEXT(pIn,&cxt);
if(dwIoControlCode==IFS_IOCTL_21) if(dwIoControlCode==IFS_IOCTL_21)
CallBuiltinHandler( &cxt, 0x21 ); handler( &cxt, 0x21 );
else else
CallBuiltinHandler( &cxt, 0x2f ); handler( &cxt, 0x2f );
CONTEXT_2_win32apieq(&cxt,pOut); CONTEXT_2_win32apieq(&cxt,pOut);
return TRUE; return TRUE;
......
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