ifsmgr.vxd: Load winedos dynamically.

This commit is contained in:
Alexandre Julliard 2009-03-13 11:59:32 +01:00
parent 75be87dd75
commit bc553a09ca
2 changed files with 23 additions and 5 deletions

View File

@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ifsmgr.vxd
IMPORTS = winedos kernel32
IMPORTS = kernel32
C_SRCS = \
ifsmgr.c

View File

@ -36,8 +36,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(vxd);
extern void WINAPI CallBuiltinHandler( CONTEXT86 *context, BYTE intnum ); /* from winedos */
/*
* IFSMgr DeviceIO service
*/
@ -99,6 +97,23 @@ static void CONTEXT_2_win32apieq(const CONTEXT86 *pCxt, struct win32apireq *pOut
/* 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.@)
*/
@ -119,6 +134,9 @@ BOOL WINAPI IFSMGR_DeviceIoControl(DWORD dwIoControlCode, LPVOID lpvInBuffer, DW
CONTEXT86 cxt;
struct win32apireq *pIn=lpvInBuffer;
struct win32apireq *pOut=lpvOutBuffer;
CallBuiltinHandler handler;
if (!(handler = load_builtin_handler())) return FALSE;
TRACE( "Control '%s': "
"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
win32apieq_2_CONTEXT(pIn,&cxt);
if(dwIoControlCode==IFS_IOCTL_21)
CallBuiltinHandler( &cxt, 0x21 );
handler( &cxt, 0x21 );
else
CallBuiltinHandler( &cxt, 0x2f );
handler( &cxt, 0x2f );
CONTEXT_2_win32apieq(&cxt,pOut);
return TRUE;