diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec index 6e24afc656e..cec24355140 100644 --- a/dlls/kernel/kernel32.spec +++ b/dlls/kernel/kernel32.spec @@ -1048,28 +1048,11 @@ @ cdecl DOSMEM_Init(long) DOSMEM_Init @ cdecl INT_GetPMHandler(long) INT_GetPMHandler @ stdcall INT_Int11Handler(ptr) INT_Int11Handler -@ stdcall INT_Int12Handler(ptr) INT_Int12Handler -@ stdcall INT_Int13Handler(ptr) INT_Int13Handler @ stdcall INT_Int15Handler(ptr) INT_Int15Handler -@ stdcall INT_Int1aHandler(ptr) INT_Int1aHandler @ stdcall INT_Int25Handler(ptr) INT_Int25Handler @ stdcall INT_Int26Handler(ptr) INT_Int26Handler -@ stdcall INT_Int2aHandler(ptr) INT_Int2aHandler @ stdcall INT_Int2fHandler(ptr) INT_Int2fHandler @ stdcall INT_Int31Handler(ptr) INT_Int31Handler -@ stdcall INT_Int34Handler(ptr) INT_Int34Handler -@ stdcall INT_Int35Handler(ptr) INT_Int35Handler -@ stdcall INT_Int36Handler(ptr) INT_Int36Handler -@ stdcall INT_Int37Handler(ptr) INT_Int37Handler -@ stdcall INT_Int38Handler(ptr) INT_Int38Handler -@ stdcall INT_Int39Handler(ptr) INT_Int39Handler -@ stdcall INT_Int3aHandler(ptr) INT_Int3aHandler -@ stdcall INT_Int3bHandler(ptr) INT_Int3bHandler -@ stdcall INT_Int3cHandler(ptr) INT_Int3cHandler -@ stdcall INT_Int3dHandler(ptr) INT_Int3dHandler -@ stdcall INT_Int3eHandler(ptr) INT_Int3eHandler -@ stdcall INT_Int41Handler(ptr) INT_Int41Handler -@ stdcall INT_Int4bHandler(ptr) INT_Int4bHandler @ stdcall NetBIOSCall16(ptr) NetBIOSCall16 @ cdecl INT_SetPMHandler(long long) INT_SetPMHandler @ cdecl LOCAL_Alloc(long long long) LOCAL_Alloc diff --git a/dlls/kernel/wprocs.spec b/dlls/kernel/wprocs.spec index d5f3ae90e9d..e3845cdaee9 100644 --- a/dlls/kernel/wprocs.spec +++ b/dlls/kernel/wprocs.spec @@ -1,31 +1,14 @@ # Interrupt vectors 0-255 are ordinals 100-355 # The '-interrupt' keyword takes care of the flags pushed on the stack by the interrupt 117 pascal -interrupt INT_Int11Handler() INT_Int11Handler -118 pascal -interrupt INT_Int12Handler() INT_Int12Handler -119 pascal -interrupt INT_Int13Handler() INT_Int13Handler 121 pascal -interrupt INT_Int15Handler() INT_Int15Handler -126 pascal -interrupt INT_Int1aHandler() INT_Int1aHandler 132 pascal -interrupt INT_Int20Handler() INT_Int20Handler 133 pascal -interrupt INT_Int21Handler() DOS3Call # Note: int 25 and 26 don't pop the flags from the stack 137 pascal -register INT_Int25Handler() INT_Int25Handler 138 pascal -register INT_Int26Handler() INT_Int26Handler -142 pascal -interrupt INT_Int2aHandler() INT_Int2aHandler 147 pascal -interrupt INT_Int2fHandler() INT_Int2fHandler 149 pascal -interrupt INT_Int31Handler() INT_Int31Handler -152 pascal -interrupt INT_Int34Handler() INT_Int34Handler -153 pascal -interrupt INT_Int35Handler() INT_Int35Handler -154 pascal -interrupt INT_Int36Handler() INT_Int36Handler -155 pascal -interrupt INT_Int37Handler() INT_Int37Handler -156 pascal -interrupt INT_Int38Handler() INT_Int38Handler -157 pascal -interrupt INT_Int39Handler() INT_Int39Handler -158 pascal -interrupt INT_Int3aHandler() INT_Int3aHandler -159 pascal -interrupt INT_Int3bHandler() INT_Int3bHandler -160 pascal -interrupt INT_Int3cHandler() INT_Int3cHandler -161 pascal -interrupt INT_Int3dHandler() INT_Int3dHandler -162 pascal -interrupt INT_Int3eHandler() INT_Int3eHandler -165 pascal -interrupt INT_Int41Handler() INT_Int41Handler -175 pascal -interrupt INT_Int4bHandler() INT_Int4bHandler 192 pascal -interrupt INT_Int5cHandler() NetBIOSCall16 # default handler for unimplemented interrupts 356 pascal -interrupt INT_DefaultHandler() INT_DefaultHandler diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in index fdea1c50c2c..cf0895bbb1b 100644 --- a/dlls/ntdll/Makefile.in +++ b/dlls/ntdll/Makefile.in @@ -50,9 +50,7 @@ C_SRCS = \ $(TOPOBJDIR)/msdos/dosconf.c \ $(TOPOBJDIR)/msdos/dosmem.c \ $(TOPOBJDIR)/msdos/dpmi.c \ - $(TOPOBJDIR)/msdos/fpu.c \ $(TOPOBJDIR)/msdos/int11.c \ - $(TOPOBJDIR)/msdos/int12.c \ $(TOPOBJDIR)/msdos/int13.c \ $(TOPOBJDIR)/msdos/int15.c \ $(TOPOBJDIR)/msdos/int1a.c \ @@ -60,10 +58,7 @@ C_SRCS = \ $(TOPOBJDIR)/msdos/int21.c \ $(TOPOBJDIR)/msdos/int25.c \ $(TOPOBJDIR)/msdos/int26.c \ - $(TOPOBJDIR)/msdos/int2a.c \ $(TOPOBJDIR)/msdos/int2f.c \ - $(TOPOBJDIR)/msdos/int41.c \ - $(TOPOBJDIR)/msdos/int4b.c \ $(TOPOBJDIR)/msdos/int5c.c \ $(TOPOBJDIR)/msdos/interrupts.c \ $(TOPOBJDIR)/msdos/ioports.c \ diff --git a/dlls/winedos/Makefile.in b/dlls/winedos/Makefile.in index 46cb0657039..08157fd7692 100644 --- a/dlls/winedos/Makefile.in +++ b/dlls/winedos/Makefile.in @@ -15,16 +15,23 @@ C_SRCS = \ dma.c \ dosaspi.c \ dosvm.c \ + fpu.c \ int09.c \ int10.c \ + int12.c \ + int13.c \ int16.c \ int17.c \ int19.c \ + int1a.c \ int20.c \ int21.c \ int29.c \ + int2a.c \ int31.c \ int33.c \ + int41.c \ + int4b.c \ int67.c \ interrupts.c \ ioports.c \ diff --git a/dlls/winedos/dosexe.h b/dlls/winedos/dosexe.h index cd76d021d32..eef39e3bf90 100644 --- a/dlls/winedos/dosexe.h +++ b/dlls/winedos/dosexe.h @@ -83,6 +83,19 @@ extern int DMA_Transfer(int channel,int reqlength,void* buffer); extern void DMA_ioport_out( WORD port, BYTE val ); extern BYTE DMA_ioport_in( WORD port ); +/* fpu.c */ +extern void WINAPI DOSVM_Int34Handler(CONTEXT86*); +extern void WINAPI DOSVM_Int35Handler(CONTEXT86*); +extern void WINAPI DOSVM_Int36Handler(CONTEXT86*); +extern void WINAPI DOSVM_Int37Handler(CONTEXT86*); +extern void WINAPI DOSVM_Int38Handler(CONTEXT86*); +extern void WINAPI DOSVM_Int39Handler(CONTEXT86*); +extern void WINAPI DOSVM_Int3aHandler(CONTEXT86*); +extern void WINAPI DOSVM_Int3bHandler(CONTEXT86*); +extern void WINAPI DOSVM_Int3cHandler(CONTEXT86*); +extern void WINAPI DOSVM_Int3dHandler(CONTEXT86*); +extern void WINAPI DOSVM_Int3eHandler(CONTEXT86*); + /* int09.c */ extern void WINAPI DOSVM_Int09Handler(CONTEXT86*); extern void WINAPI DOSVM_Int09SendScan(BYTE scan,BYTE ascii); @@ -92,6 +105,15 @@ extern BYTE WINAPI DOSVM_Int09ReadScan(BYTE*ascii); extern void WINAPI DOSVM_Int10Handler(CONTEXT86*); extern void WINAPI DOSVM_PutChar(BYTE ascii); +/* int12.c */ +extern void WINAPI DOSVM_Int12Handler(CONTEXT86*); + +/* int13.c */ +extern void WINAPI DOSVM_Int13Handler(CONTEXT86*); + +/* int1a.c */ +extern void WINAPI DOSVM_Int1aHandler(CONTEXT86*); + /* int16.c */ extern void WINAPI DOSVM_Int16Handler(CONTEXT86*); extern int WINAPI DOSVM_Int16ReadChar(BYTE*ascii,BYTE*scan,BOOL peek); @@ -112,6 +134,9 @@ extern void WINAPI DOSVM_Int21Handler(CONTEXT86*); /* int29.c */ extern void WINAPI DOSVM_Int29Handler(CONTEXT86*); +/* int2a.c */ +extern void WINAPI DOSVM_Int2aHandler(CONTEXT86*); + /* int31.c */ extern void WINAPI DOSVM_Int31Handler(CONTEXT86*); extern BOOL DOSVM_IsDos32(void); @@ -121,6 +146,12 @@ extern void WINAPI DOSVM_Int33Handler(CONTEXT86*); extern void WINAPI DOSVM_Int33Message(UINT,WPARAM,LPARAM); extern void WINAPI DOSVM_Int33Console(MOUSE_EVENT_RECORD*); +/* int41.c */ +extern void WINAPI DOSVM_Int41Handler(CONTEXT86*); + +/* int4b.c */ +extern void WINAPI DOSVM_Int4bHandler(CONTEXT86*); + /* int67.c */ extern void WINAPI DOSVM_Int67Handler(CONTEXT86*); extern void WINAPI EMS_Ioctl_Handler(CONTEXT86*); diff --git a/msdos/fpu.c b/dlls/winedos/fpu.c similarity index 64% rename from msdos/fpu.c rename to dlls/winedos/fpu.c index 32cfa959248..390ad5a9e55 100644 --- a/msdos/fpu.c +++ b/dlls/winedos/fpu.c @@ -1,7 +1,6 @@ /* * DOS interrupt 34->3e handlers. All FPU interrupt code should be * moved into this file. - * int 3d is not activated yet... * * Copyright 2002 Robert 'Admiral' Coeyman * @@ -34,71 +33,68 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); static void FPU_ModifyCode(CONTEXT86 *context, BYTE Opcode); - /********************************************************************** - * INT_Int34Handler (WPROCS.152) + * DOSVM_Int34Handler (WINEDOS16.152) * * Handler for int 34 (FLOATING POINT EMULATION - Opcode 0xd8). * * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int34Handler(CONTEXT86 *context) +void WINAPI DOSVM_Int34Handler(CONTEXT86 *context) { - - TRACE("Int 0x34 called-- FP opcode 0xd8"); - FPU_ModifyCode(context, 0xd8); - + TRACE("Int 0x34 called-- FP opcode 0xd8"); + FPU_ModifyCode(context, 0xd8); } + /********************************************************************** - * INT_Int35Handler (WPROCS.153) + * DOSVM_Int35Handler (WINEDOS16.153) * * Handler for int 35 (FLOATING POINT EMULATION - Opcode 0xd9). * * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int35Handler(CONTEXT86 *context) +void WINAPI DOSVM_Int35Handler(CONTEXT86 *context) { - TRACE("Int 0x35 called-- FP opcode 0xd9"); - FPU_ModifyCode(context, 0xd9); - + TRACE("Int 0x35 called-- FP opcode 0xd9"); + FPU_ModifyCode(context, 0xd9); } /********************************************************************** - * INT_Int36Handler (WPROCS.154) + * DOSVM_Int36Handler (WINEDOS16.154) * * Handler for int 36 (FLOATING POINT EMULATION - Opcode 0xda). * * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int36Handler(CONTEXT86 *context) +void WINAPI DOSVM_Int36Handler(CONTEXT86 *context) { - TRACE("Int 0x36 called-- FP opcode 0xda"); - FPU_ModifyCode(context, 0xda); - + TRACE("Int 0x36 called-- FP opcode 0xda"); + FPU_ModifyCode(context, 0xda); } + /********************************************************************** - * INT_Int37Handler (WPROCS.155) + * DOSVM_Int37Handler (WINEDOS16.155) * * Handler for int 37 (FLOATING POINT EMULATION - Opcode 0xdb). * * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int37Handler(CONTEXT86 *context) +void WINAPI DOSVM_Int37Handler(CONTEXT86 *context) { - TRACE("Int 0x37 called-- FP opcode 0xdb"); - FPU_ModifyCode(context, 0xdb); - + TRACE("Int 0x37 called-- FP opcode 0xdb"); + FPU_ModifyCode(context, 0xdb); } + /********************************************************************** - * INT_Int38Handler (WPROCS.156) + * DOSVM_Int38Handler (WINEDOS16.156) * * Handler for int 38 (FLOATING POINT EMULATION - Opcode 0xdc). * @@ -108,62 +104,60 @@ void WINAPI INT_Int37Handler(CONTEXT86 *context) * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int38Handler(CONTEXT86 *context) +void WINAPI DOSVM_Int38Handler(CONTEXT86 *context) { - TRACE("Int 0x38 called-- FP opcode 0xdc"); - FPU_ModifyCode(context, 0xdc); - + TRACE("Int 0x38 called-- FP opcode 0xdc"); + FPU_ModifyCode(context, 0xdc); } + /********************************************************************** - * INT_Int39Handler (WPROCS.157) + * DOSVM_Int39Handler (WINEDOS16.157) * * Handler for int 39 (FLOATING POINT EMULATION - Opcode 0xdd). * * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int39Handler(CONTEXT86 *context) +void WINAPI DOSVM_Int39Handler(CONTEXT86 *context) { - TRACE("Int 0x39 called-- FP opcode 0xdd"); - FPU_ModifyCode(context, 0xdd); - + TRACE("Int 0x39 called-- FP opcode 0xdd"); + FPU_ModifyCode(context, 0xdd); } + /********************************************************************** - * INT_Int3aHandler (WPROCS.158) + * DOSVM_Int3aHandler (WINEDOS16.158) * * Handler for int 3a (FLOATING POINT EMULATION - Opcode 0xde). * * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int3aHandler(CONTEXT86 *context) +void WINAPI DOSVM_Int3aHandler(CONTEXT86 *context) { - TRACE("Int 0x3a called-- FP opcode 0xde"); - FPU_ModifyCode(context, 0xde); - + TRACE("Int 0x3a called-- FP opcode 0xde"); + FPU_ModifyCode(context, 0xde); } + /********************************************************************** - * INT_Int3bHandler (WPROCS.159) + * DOSVM_Int3bHandler (WINEDOS16.159) * * Handler for int 3B (FLOATING POINT EMULATION - Opcode 0xdf). * * The interrupt list isn't specific about what this interrupt * actually does. [ interrup.m ] */ -void WINAPI INT_Int3bHandler(CONTEXT86 *context) +void WINAPI DOSVM_Int3bHandler(CONTEXT86 *context) { - TRACE("Int 0x3b called-- FP opcode 0xdf"); - FPU_ModifyCode(context, 0xdf); - + TRACE("Int 0x3b called-- FP opcode 0xdf"); + FPU_ModifyCode(context, 0xdf); } - /********************************************************************** - * INT_Int3cHandler (WPROCS.160) + * DOSVM_Int3cHandler (WINEDOS16.160) * * Handler for int 3C (FLOATING POINT EMULATION - INSTRUCTIONS WITH SEGMENT OVERRIDE). * @@ -171,37 +165,36 @@ void WINAPI INT_Int3bHandler(CONTEXT86 *context) * xy is a modified ESC code and mm is the modR/M byte. * xy byte seems to be encoded as ss011xxx or ss000xxx * ss= segment override. - * 00 -> DS - * 01 -> SS - * 10 -> CS - * 11 -> ES + * 00 -> DS + * 01 -> SS + * 10 -> CS + * 11 -> ES * * 11011xxx should be the opcode instruction. */ -void WINAPI INT_Int3cHandler(CONTEXT86 *context) +void WINAPI DOSVM_Int3cHandler(CONTEXT86 *context) { - FIXME("Int 3C NOT Implemented"); - INT_BARF(context, 0x3c); + FIXME("Int 3C NOT Implemented"); + INT_BARF(context, 0x3c); } + /********************************************************************** - * INT_Int3dHandler (WPROCS.161) + * DOSVM_Int3dHandler (WINEDOS16.161) * * Handler for int 3D (FLOATING POINT EMULATION - Standalone FWAIT). * * Opcode 0x90 is a NOP. It just fills space where the 3D was. */ -void WINAPI INT_Int3dHandler(CONTEXT86 *context) +void WINAPI DOSVM_Int3dHandler(CONTEXT86 *context) { - TRACE("Int 0x3d called-- Standalone FWAIT"); - FPU_ModifyCode(context, 0x90); - + TRACE("Int 0x3d called-- Standalone FWAIT"); + FPU_ModifyCode(context, 0x90); } - /********************************************************************** - * INT_Int3eHandler (WPROCS.162) + * DOSVM_Int3eHandler (WINEDOS16.162) * * FLOATING POINT EMULATION -- Borland "Shortcut" call. * The two bytes following the int 3E instruction are @@ -211,12 +204,13 @@ void WINAPI INT_Int3dHandler(CONTEXT86 *context) * Direct access 4.0 modifies and does not restore this vector. * */ -void WINAPI INT_Int3eHandler(CONTEXT86 *context) +void WINAPI DOSVM_Int3eHandler(CONTEXT86 *context) { - FIXME("Int 3E NOT Implemented"); - INT_BARF(context, 0x3e); + FIXME("Int 3E NOT Implemented"); + INT_BARF(context, 0x3e); } + /********************************************************************** * FPU_ModifyCode * @@ -228,19 +222,19 @@ void WINAPI INT_Int3eHandler(CONTEXT86 *context) */ static void FPU_ModifyCode(CONTEXT86 *context, BYTE Opcode) { - WORD *stack = CTX_SEG_OFF_TO_LIN(context, context->SegSs, context->Esp); - BYTE *code = CTX_SEG_OFF_TO_LIN(context, stack[1], stack[0]); + WORD *stack = CTX_SEG_OFF_TO_LIN(context, context->SegSs, context->Esp); + BYTE *code = CTX_SEG_OFF_TO_LIN(context, stack[1], stack[0]); -/* - * All *NIX systems should have a real or kernel emulated FPU. - */ + /* + * All *NIX systems should have a real or kernel emulated FPU. + */ - code[-2] = 0x9b; /* The fwait instruction */ - code[-1] = Opcode; /* Insert the opcode */ + code[-2] = 0x9b; /* The fwait instruction */ + code[-1] = Opcode; /* Insert the opcode */ - if ( stack[0] < 2 ) FIXME("Backed up over a segment boundry in FPU code."); + if ( stack[0] < 2 ) FIXME("Backed up over a segment boundry in FPU code."); - stack[0] -= 2; /* back up the return address 2 bytes */ + stack[0] -= 2; /* back up the return address 2 bytes */ - TRACE("Modified code in FPU int call to 0x9b 0x%x",Opcode); + TRACE("Modified code in FPU int call to 0x9b 0x%x",Opcode); } diff --git a/msdos/int12.c b/dlls/winedos/int12.c similarity index 68% rename from msdos/int12.c rename to dlls/winedos/int12.c index 2b2e8040a9e..b76e51d5140 100644 --- a/msdos/int12.c +++ b/dlls/winedos/int12.c @@ -5,11 +5,11 @@ #include "miscemu.h" /********************************************************************** - * INT_Int12Handler (WPROCS.118) + * DOSVM_Int12Handler (WINEDOS16.118) * * Handler for int 12h (get memory size). */ -void WINAPI INT_Int12Handler( CONTEXT86 *context ) +void WINAPI DOSVM_Int12Handler( CONTEXT86 *context ) { SET_AX( context, 640 ); } diff --git a/dlls/winedos/int13.c b/dlls/winedos/int13.c new file mode 100644 index 00000000000..c4fcdb59017 --- /dev/null +++ b/dlls/winedos/int13.c @@ -0,0 +1,100 @@ +/* + * BIOS interrupt 13h handler + * + * Copyright 1997 Andreas Mohr + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" + +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "winbase.h" +#include "winioctl.h" +#include "miscemu.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(int); + +static void DIOCRegs_2_CONTEXT( DIOC_REGISTERS *pIn, CONTEXT86 *pCxt ) +{ + memset( pCxt, 0, sizeof(*pCxt) ); + /* Note: segment registers == 0 means that CTX_SEG_OFF_TO_LIN + will interpret 32-bit register contents as linear pointers */ + + pCxt->ContextFlags=CONTEXT86_INTEGER|CONTEXT86_CONTROL; + pCxt->Eax = pIn->reg_EAX; + pCxt->Ebx = pIn->reg_EBX; + pCxt->Ecx = pIn->reg_ECX; + pCxt->Edx = pIn->reg_EDX; + pCxt->Esi = pIn->reg_ESI; + pCxt->Edi = pIn->reg_EDI; + + /* FIXME: Only partial CONTEXT86_CONTROL */ + pCxt->EFlags = pIn->reg_Flags; +} + +static void CONTEXT_2_DIOCRegs( CONTEXT86 *pCxt, DIOC_REGISTERS *pOut ) +{ + memset( pOut, 0, sizeof(DIOC_REGISTERS) ); + + pOut->reg_EAX = pCxt->Eax; + pOut->reg_EBX = pCxt->Ebx; + pOut->reg_ECX = pCxt->Ecx; + pOut->reg_EDX = pCxt->Edx; + pOut->reg_ESI = pCxt->Esi; + pOut->reg_EDI = pCxt->Edi; + + /* FIXME: Only partial CONTEXT86_CONTROL */ + pOut->reg_Flags = pCxt->EFlags; +} + +/********************************************************************** + * DOSVM_Int13Handler (WINEDOS16.119) + * + * Handler for int 13h (disk I/O). + */ +void WINAPI DOSVM_Int13Handler( CONTEXT86 *context ) +{ + HANDLE hVWin32; + DIOC_REGISTERS regs; + DWORD dwRet; + + hVWin32 = CreateFileA("\\\\.\\VWIN32", GENERIC_READ|GENERIC_WRITE, + 0, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, 0); + + if(hVWin32!=INVALID_HANDLE_VALUE) + { + CONTEXT_2_DIOCRegs( context, ®s); + + if(!DeviceIoControl(hVWin32, VWIN32_DIOC_DOS_INT13, + ®s, sizeof regs, ®s, sizeof regs, &dwRet, NULL)) + DIOCRegs_2_CONTEXT(®s, context); + else + SET_CFLAG(context); + + CloseHandle(hVWin32); + } + else + { + ERR("Failed to open device VWIN32\n"); + SET_CFLAG(context); + } +} diff --git a/dlls/winedos/int1a.c b/dlls/winedos/int1a.c new file mode 100644 index 00000000000..8bf012260fb --- /dev/null +++ b/dlls/winedos/int1a.c @@ -0,0 +1,128 @@ +/* + * BIOS interrupt 1ah handler + * + * Copyright 1993 Erik Bos + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" +#include "wine/port.h" + +#include +#ifdef HAVE_SYS_TIME_H +# include +#endif +#include +#include "miscemu.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(int); + +#define BCD_TO_BIN(x) ((x&15) + (x>>4)*10) +#define BIN_TO_BCD(x) ((x%10) + ((x/10)<<4)) + + +/********************************************************************** + * INT1A_GetTicksSinceMidnight + * + * Return number of clock ticks since midnight. + */ +DWORD INT1A_GetTicksSinceMidnight(void) +{ + struct tm *bdtime; + struct timeval tvs; + time_t seconds; + + /* This should give us the (approximately) correct + * 18.206 clock ticks per second since midnight. + */ + gettimeofday( &tvs, NULL ); + seconds = tvs.tv_sec; + bdtime = localtime( &seconds ); + return (((bdtime->tm_hour * 3600 + bdtime->tm_min * 60 + + bdtime->tm_sec) * 18206) / 1000) + + (tvs.tv_usec / 54927); +} + + +/********************************************************************** + * DOSVM_Int1aHandler (WINEDOS16.126) + * + * Handler for int 1ah + * 0x00 - 0x07 - date and time + * 0x?? - 0x?? - Microsoft Real Time Compression Interface + */ +void WINAPI DOSVM_Int1aHandler( CONTEXT86 *context ) +{ + time_t ltime; + DWORD ticks; + struct tm *bdtime; + + switch(AH_reg(context)) + { + case 0x00: + ticks = INT1A_GetTicksSinceMidnight(); + SET_CX( context, HIWORD(ticks) ); + SET_DX( context, LOWORD(ticks) ); + SET_AX( context, 0 ); /* No midnight rollover */ + TRACE("int1a: AH=00 -- ticks=%ld\n", ticks); + break; + + case 0x02: + ltime = time(NULL); + bdtime = localtime(<ime); + + SET_CX( context, (BIN_TO_BCD(bdtime->tm_hour)<<8) | + BIN_TO_BCD(bdtime->tm_min) ); + SET_DX( context, (BIN_TO_BCD(bdtime->tm_sec)<<8) ); + + case 0x04: + ltime = time(NULL); + bdtime = localtime(<ime); + SET_CX( context, (BIN_TO_BCD(bdtime->tm_year/100)<<8) | + BIN_TO_BCD((bdtime->tm_year-1900)%100) ); + SET_DX( context, (BIN_TO_BCD(bdtime->tm_mon)<<8) | + BIN_TO_BCD(bdtime->tm_mday) ); + break; + + /* setting the time,date or RTC is not allow -EB */ + case 0x01: + /* set system time */ + case 0x03: + /* set RTC time */ + case 0x05: + /* set RTC date */ + case 0x06: + /* set ALARM */ + case 0x07: + /* cancel ALARM */ + break; + + case 0xb0: /* Microsoft Real Time Compression */ + switch AL_reg(context) + { + case 0x01: + /* not present */ + break; + default: + INT_BARF(context, 0x1a); + } + break; + + default: + INT_BARF( context, 0x1a ); + } +} diff --git a/msdos/int2a.c b/dlls/winedos/int2a.c similarity index 75% rename from msdos/int2a.c rename to dlls/winedos/int2a.c index a170a567af2..8e7350fe99b 100644 --- a/msdos/int2a.c +++ b/dlls/winedos/int2a.c @@ -10,11 +10,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); /********************************************************************** - * INT_Int2aHandler (WPROCS.142) + * DOSVM_Int2aHandler (WINEDOS16.142) * * Handler for int 2ah (network). */ -void WINAPI INT_Int2aHandler( CONTEXT86 *context ) +void WINAPI DOSVM_Int2aHandler( CONTEXT86 *context ) { switch(AH_reg(context)) { @@ -22,6 +22,6 @@ void WINAPI INT_Int2aHandler( CONTEXT86 *context ) break; default: - INT_BARF( context, 0x2a ); + INT_BARF( context, 0x2a ); } } diff --git a/msdos/int41.c b/dlls/winedos/int41.c similarity index 94% rename from msdos/int41.c rename to dlls/winedos/int41.c index 1506dad100f..fe8e005e093 100644 --- a/msdos/int41.c +++ b/dlls/winedos/int41.c @@ -27,10 +27,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); /*********************************************************************** - * INT_Int41Handler (WPROCS.165) + * DOSVM_Int41Handler (WINEDOS16.165) * */ -void WINAPI INT_Int41Handler( CONTEXT86 *context ) +void WINAPI DOSVM_Int41Handler( CONTEXT86 *context ) { if ( ISV86(context) ) { @@ -68,4 +68,3 @@ void WINAPI INT_Int41Handler( CONTEXT86 *context ) } } } - diff --git a/msdos/int4b.c b/dlls/winedos/int4b.c similarity index 84% rename from msdos/int4b.c rename to dlls/winedos/int4b.c index 532a6e50f4c..882413a9874 100644 --- a/msdos/int4b.c +++ b/dlls/winedos/int4b.c @@ -9,10 +9,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); /*********************************************************************** - * INT_Int4bHandler (WPROCS.175) + * DOSVM_Int4bHandler (WINEDOS16.175) * */ -void WINAPI INT_Int4bHandler( CONTEXT86 *context ) +void WINAPI DOSVM_Int4bHandler( CONTEXT86 *context ) { switch(AH_reg(context)) { diff --git a/dlls/winedos/interrupts.c b/dlls/winedos/interrupts.c index 0a9727b4704..5f13705538f 100644 --- a/dlls/winedos/interrupts.c +++ b/dlls/winedos/interrupts.c @@ -26,27 +26,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); /*********************************************************************** * DOSVM_Int11Handler (WINEDOS16.117) - * DOSVM_Int12Handler (WINEDOS16.118) - * DOSVM_Int13Handler (WINEDOS16.119) * DOSVM_Int15Handler (WINEDOS16.121) - * DOSVM_Int1aHandler (WINEDOS16.126) * DOSVM_Int25Handler (WINEDOS16.137) * DOSVM_Int26Handler (WINEDOS16.138) - * DOSVM_Int2aHandler (WINEDOS16.142) * DOSVM_Int2fHandler (WINEDOS16.147) - * DOSVM_Int34Handler (WINEDOS16.152) - * DOSVM_Int35Handler (WINEDOS16.153) - * DOSVM_Int36Handler (WINEDOS16.154) - * DOSVM_Int37Handler (WINEDOS16.155) - * DOSVM_Int38Handler (WINEDOS16.156) - * DOSVM_Int39Handler (WINEDOS16.157) - * DOSVM_Int3aHandler (WINEDOS16.158) - * DOSVM_Int3bHandler (WINEDOS16.159) - * DOSVM_Int3cHandler (WINEDOS16.160) - * DOSVM_Int3dHandler (WINEDOS16.161) - * DOSVM_Int3eHandler (WINEDOS16.162) - * DOSVM_Int41Handler (WINEDOS16.165) - * DOSVM_Int4bHandler (WINEDOS16.175) * DOSVM_Int5cHandler (WINEDOS16.192) * * FIXME: Interrupt handlers for interrupts implemented in other DLLs. @@ -54,27 +37,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(int); * been moved to winedos. */ void WINAPI DOSVM_Int11Handler( CONTEXT86 *context ) { INT_Int11Handler(context); } -void WINAPI DOSVM_Int12Handler( CONTEXT86 *context ) { INT_Int12Handler(context); } -void WINAPI DOSVM_Int13Handler( CONTEXT86 *context ) { INT_Int13Handler(context); } void WINAPI DOSVM_Int15Handler( CONTEXT86 *context ) { INT_Int15Handler(context); } -void WINAPI DOSVM_Int1aHandler( CONTEXT86 *context ) { INT_Int1aHandler(context); } void WINAPI DOSVM_Int25Handler( CONTEXT86 *context ) { INT_Int25Handler(context); } void WINAPI DOSVM_Int26Handler( CONTEXT86 *context ) { INT_Int26Handler(context); } -void WINAPI DOSVM_Int2aHandler( CONTEXT86 *context ) { INT_Int2aHandler(context); } void WINAPI DOSVM_Int2fHandler( CONTEXT86 *context ) { INT_Int2fHandler(context); } -void WINAPI DOSVM_Int34Handler( CONTEXT86 *context ) { INT_Int34Handler(context); } -void WINAPI DOSVM_Int35Handler( CONTEXT86 *context ) { INT_Int35Handler(context); } -void WINAPI DOSVM_Int36Handler( CONTEXT86 *context ) { INT_Int36Handler(context); } -void WINAPI DOSVM_Int37Handler( CONTEXT86 *context ) { INT_Int37Handler(context); } -void WINAPI DOSVM_Int38Handler( CONTEXT86 *context ) { INT_Int38Handler(context); } -void WINAPI DOSVM_Int39Handler( CONTEXT86 *context ) { INT_Int39Handler(context); } -void WINAPI DOSVM_Int3aHandler( CONTEXT86 *context ) { INT_Int3aHandler(context); } -void WINAPI DOSVM_Int3bHandler( CONTEXT86 *context ) { INT_Int3bHandler(context); } -void WINAPI DOSVM_Int3cHandler( CONTEXT86 *context ) { INT_Int3cHandler(context); } -void WINAPI DOSVM_Int3dHandler( CONTEXT86 *context ) { INT_Int3dHandler(context); } -void WINAPI DOSVM_Int3eHandler( CONTEXT86 *context ) { INT_Int3eHandler(context); } -void WINAPI DOSVM_Int41Handler( CONTEXT86 *context ) { INT_Int41Handler(context); } -void WINAPI DOSVM_Int4bHandler( CONTEXT86 *context ) { INT_Int4bHandler(context); } void WINAPI DOSVM_Int5cHandler( CONTEXT86 *context ) { NetBIOSCall16(context); } static FARPROC16 DOSVM_Vectors16[256];