- Thanks Thomas for having pointed me towards the fact that the NTVDM exports were really STDCALL and not CDECL (as I've thought first, because originally I was checking whether the getXX() functions were stdcall or not, and distinguishing VOID stdcall or cdecl functions without the symbols was hopeless).
- Halfplement and export Sim32pGetVDMPointer and MGetVdmPointer, needed to run correctly the RageStorm "galaxy" sample mentioned yesterday (see revision 61283). Now it loads and the dispatch call works \o/
- VDD_INIT_PROC and VDD_DISPATCH_PROC have the same signature --> rename them to VDD_PROC.

Have fun at testing!

svn path=/branches/ntvdm/; revision=61286
This commit is contained in:
Hermès Bélusca-Maïto 2013-12-17 22:10:58 +00:00
parent ed874b41fc
commit 90ab15cf66
5 changed files with 290 additions and 265 deletions

View file

@ -171,4 +171,25 @@ VOID EmulatorSetA20(BOOLEAN Enabled)
A20Line = Enabled;
}
PBYTE WINAPI Sim32pGetVDMPointer(ULONG Address, BOOL ProtectedMode)
{
// FIXME
UNREFERENCED_PARAMETER(ProtectedMode);
/*
* HIWORD(Address) == Segment (if ProtectedMode == FALSE)
* or Selector (if ProtectedMode == TRUE )
* LOWORD(Address) == Offset
*/
return SEG_OFF_TO_PTR(HIWORD(Address), LOWORD(Address));
}
PBYTE WINAPI MGetVdmPointer(ULONG Address, ULONG Size, BOOL ProtectedMode)
{
UNREFERENCED_PARAMETER(Size);
return Sim32pGetVDMPointer(Address, ProtectedMode);
}
/* EOF */

View file

@ -1,88 +1,93 @@
@ cdecl getAF()
@ cdecl getAH()
@ cdecl getAL()
@ cdecl getAX()
@ cdecl getBH()
@ cdecl getBL()
@ cdecl getBP()
@ cdecl getBX()
@ cdecl getCF()
@ cdecl getCH()
@ cdecl getCL()
@ cdecl getCS()
@ cdecl getCX()
@ cdecl getDF()
@ cdecl getDH()
@ cdecl getDI()
@ cdecl getDL()
@ cdecl getDS()
@ cdecl getDX()
@ cdecl getEAX()
@ cdecl getEBP()
@ cdecl getEBX()
@ cdecl getECX()
@ cdecl getEDI()
@ cdecl getEDX()
@ cdecl getEFLAGS()
@ cdecl getEIP()
@ cdecl getES()
@ cdecl getESI()
@ cdecl getESP()
@ cdecl getFS()
@ cdecl getGS()
@ cdecl getIF()
; @ cdecl getIntelRegistersPointer()
@ cdecl getIP()
@ cdecl getMSW()
@ cdecl getOF()
@ cdecl getPF()
@ cdecl getSF()
@ cdecl getSI()
@ cdecl getSP()
@ cdecl getSS()
@ cdecl getZF()
@ stdcall getAF()
@ stdcall getAH()
@ stdcall getAL()
@ stdcall getAX()
@ stdcall getBH()
@ stdcall getBL()
@ stdcall getBP()
@ stdcall getBX()
@ stdcall getCF()
@ stdcall getCH()
@ stdcall getCL()
@ stdcall getCS()
@ stdcall getCX()
@ stdcall getDF()
@ stdcall getDH()
@ stdcall getDI()
@ stdcall getDL()
@ stdcall getDS()
@ stdcall getDX()
@ stdcall getEAX()
@ stdcall getEBP()
@ stdcall getEBX()
@ stdcall getECX()
@ stdcall getEDI()
@ stdcall getEDX()
@ stdcall getEFLAGS()
@ stdcall getEIP()
@ stdcall getES()
@ stdcall getESI()
@ stdcall getESP()
@ stdcall getFS()
@ stdcall getGS()
@ stdcall getIF()
; @ stdcall getIntelRegistersPointer()
@ stdcall getIP()
@ stdcall getMSW()
@ stdcall getOF()
@ stdcall getPF()
@ stdcall getSF()
@ stdcall getSI()
@ stdcall getSP()
@ stdcall getSS()
@ stdcall getZF()
@ cdecl setAF(long)
@ cdecl setAH(long)
@ cdecl setAL(long)
@ cdecl setAX(long)
@ cdecl setBH(long)
@ cdecl setBL(long)
@ cdecl setBP(long)
@ cdecl setBX(long)
@ cdecl setCF(long)
@ cdecl setCH(long)
@ cdecl setCL(long)
@ cdecl setCS(long)
@ cdecl setCX(long)
@ cdecl setDF(long)
@ cdecl setDH(long)
@ cdecl setDI(long)
@ cdecl setDL(long)
@ cdecl setDS(long)
@ cdecl setDX(long)
@ cdecl setEAX(long)
@ cdecl setEBP(long)
@ cdecl setEBX(long)
@ cdecl setECX(long)
@ cdecl setEDI(long)
@ cdecl setEDX(long)
@ cdecl setEFLAGS(long)
@ cdecl setEIP(long)
@ cdecl setES(long)
@ cdecl setESI(long)
@ cdecl setESP(long)
@ cdecl setFS(long)
@ cdecl setGS(long)
@ cdecl setIF(long)
@ cdecl setIP(long)
@ cdecl setMSW(long)
@ cdecl setOF(long)
@ cdecl setPF(long)
@ cdecl setSF(long)
@ cdecl setSI(long)
@ cdecl setSP(long)
@ cdecl setSS(long)
@ cdecl setZF(long)
@ stdcall setAF(long)
@ stdcall setAH(long)
@ stdcall setAL(long)
@ stdcall setAX(long)
@ stdcall setBH(long)
@ stdcall setBL(long)
@ stdcall setBP(long)
@ stdcall setBX(long)
@ stdcall setCF(long)
@ stdcall setCH(long)
@ stdcall setCL(long)
@ stdcall setCS(long)
@ stdcall setCX(long)
@ stdcall setDF(long)
@ stdcall setDH(long)
@ stdcall setDI(long)
@ stdcall setDL(long)
@ stdcall setDS(long)
@ stdcall setDX(long)
@ stdcall setEAX(long)
@ stdcall setEBP(long)
@ stdcall setEBX(long)
@ stdcall setECX(long)
@ stdcall setEDI(long)
@ stdcall setEDX(long)
@ stdcall setEFLAGS(long)
@ stdcall setEIP(long)
@ stdcall setES(long)
@ stdcall setESI(long)
@ stdcall setESP(long)
@ stdcall setFS(long)
@ stdcall setGS(long)
@ stdcall setIF(long)
@ stdcall setIP(long)
@ stdcall setMSW(long)
@ stdcall setOF(long)
@ stdcall setPF(long)
@ stdcall setSF(long)
@ stdcall setSI(long)
@ stdcall setSP(long)
@ stdcall setSS(long)
@ stdcall setZF(long)
@ stdcall MGetVdmPointer(long long long)
@ stdcall Sim32pGetVDMPointer(long long)

View file

@ -38,112 +38,112 @@ VOID EmulatorSetStack(WORD Segment, DWORD Offset)
ULONG
CDECL
WINAPI
getEAX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long;
}
VOID
CDECL
WINAPI
setEAX(ULONG Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EAX].Long = Value;
}
USHORT
CDECL
WINAPI
getAX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowWord;
}
VOID
CDECL
WINAPI
setAX(USHORT Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowWord = Value;
}
UCHAR
CDECL
WINAPI
getAH(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte;
}
VOID
CDECL
WINAPI
setAH(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EAX].HighByte = Value;
}
UCHAR
CDECL
WINAPI
getAL(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowByte;
}
VOID
CDECL
WINAPI
setAL(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EAX].LowByte = Value;
}
ULONG
CDECL
WINAPI
getEBX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long;
}
VOID
CDECL
WINAPI
setEBX(ULONG Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EBX].Long = Value;
}
USHORT
CDECL
WINAPI
getBX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowWord;
}
VOID
CDECL
WINAPI
setBX(USHORT Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowWord = Value;
}
UCHAR
CDECL
WINAPI
getBH(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte;
}
VOID
CDECL
WINAPI
setBH(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EBX].HighByte = Value;
}
UCHAR
CDECL
WINAPI
getBL(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte;
}
VOID
CDECL
WINAPI
setBL(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EBX].LowByte = Value;
@ -152,56 +152,56 @@ setBL(UCHAR Value)
ULONG
CDECL
WINAPI
getECX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long;
}
VOID
CDECL
WINAPI
setECX(ULONG Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_ECX].Long = Value;
}
USHORT
CDECL
WINAPI
getCX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowWord;
}
VOID
CDECL
WINAPI
setCX(USHORT Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowWord = Value;
}
UCHAR
CDECL
WINAPI
getCH(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte;
}
VOID
CDECL
WINAPI
setCH(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_ECX].HighByte = Value;
}
UCHAR
CDECL
WINAPI
getCL(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte;
}
VOID
CDECL
WINAPI
setCL(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_ECX].LowByte = Value;
@ -210,56 +210,56 @@ setCL(UCHAR Value)
ULONG
CDECL
WINAPI
getEDX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long;
}
VOID
CDECL
WINAPI
setEDX(ULONG Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EDX].Long = Value;
}
USHORT
CDECL
WINAPI
getDX(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowWord;
}
VOID
CDECL
WINAPI
setDX(USHORT Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowWord = Value;
}
UCHAR
CDECL
WINAPI
getDH(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte;
}
VOID
CDECL
WINAPI
setDH(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EDX].HighByte = Value;
}
UCHAR
CDECL
WINAPI
getDL(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte;
}
VOID
CDECL
WINAPI
setDL(UCHAR Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EDX].LowByte = Value;
@ -268,28 +268,28 @@ setDL(UCHAR Value)
ULONG
CDECL
WINAPI
getESP(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ESP].Long;
}
VOID
CDECL
WINAPI
setESP(ULONG Value)
{
EmulatorSetStack(getSS(), Value);
}
USHORT
CDECL
WINAPI
getSP(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ESP].LowWord;
}
VOID
CDECL
WINAPI
setSP(USHORT Value)
{
EmulatorSetStack(getSS(), Value);
@ -298,28 +298,28 @@ setSP(USHORT Value)
ULONG
CDECL
WINAPI
getEBP(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long;
}
VOID
CDECL
WINAPI
setEBP(ULONG Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EBP].Long = Value;
}
USHORT
CDECL
WINAPI
getBP(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord;
}
VOID
CDECL
WINAPI
setBP(USHORT Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EBP].LowWord = Value;
@ -328,28 +328,28 @@ setBP(USHORT Value)
ULONG
CDECL
WINAPI
getESI(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long;
}
VOID
CDECL
WINAPI
setESI(ULONG Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_ESI].Long = Value;
}
USHORT
CDECL
WINAPI
getSI(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord;
}
VOID
CDECL
WINAPI
setSI(USHORT Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_ESI].LowWord = Value;
@ -358,28 +358,28 @@ setSI(USHORT Value)
ULONG
CDECL
WINAPI
getEDI(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long;
}
VOID
CDECL
WINAPI
setEDI(ULONG Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EDI].Long = Value;
}
USHORT
CDECL
WINAPI
getDI(VOID)
{
return EmulatorContext.GeneralRegs[FAST486_REG_EDI].LowWord;
}
VOID
CDECL
WINAPI
setDI(USHORT Value)
{
EmulatorContext.GeneralRegs[FAST486_REG_EDI].LowWord = Value;
@ -388,28 +388,28 @@ setDI(USHORT Value)
ULONG
CDECL
WINAPI
getEIP(VOID)
{
return EmulatorContext.InstPtr.Long;
}
VOID
CDECL
WINAPI
setEIP(ULONG Value)
{
EmulatorExecute(getCS(), Value);
}
USHORT
CDECL
WINAPI
getIP(VOID)
{
return EmulatorContext.InstPtr.LowWord;
}
VOID
CDECL
WINAPI
setIP(USHORT Value)
{
EmulatorExecute(getCS(), Value);
@ -418,84 +418,84 @@ setIP(USHORT Value)
USHORT
CDECL
WINAPI
getCS(VOID)
{
return EmulatorContext.SegmentRegs[FAST486_REG_CS].Selector;
}
VOID
CDECL
WINAPI
setCS(USHORT Value)
{
Fast486SetSegment(&EmulatorContext, FAST486_REG_CS, Value);
}
USHORT
CDECL
WINAPI
getSS(VOID)
{
return EmulatorContext.SegmentRegs[FAST486_REG_SS].Selector;
}
VOID
CDECL
WINAPI
setSS(USHORT Value)
{
Fast486SetSegment(&EmulatorContext, FAST486_REG_SS, Value);
}
USHORT
CDECL
WINAPI
getDS(VOID)
{
return EmulatorContext.SegmentRegs[FAST486_REG_DS].Selector;
}
VOID
CDECL
WINAPI
setDS(USHORT Value)
{
Fast486SetSegment(&EmulatorContext, FAST486_REG_DS, Value);
}
USHORT
CDECL
WINAPI
getES(VOID)
{
return EmulatorContext.SegmentRegs[FAST486_REG_ES].Selector;
}
VOID
CDECL
WINAPI
setES(USHORT Value)
{
Fast486SetSegment(&EmulatorContext, FAST486_REG_ES, Value);
}
USHORT
CDECL
WINAPI
getFS(VOID)
{
return EmulatorContext.SegmentRegs[FAST486_REG_FS].Selector;
}
VOID
CDECL
WINAPI
setFS(USHORT Value)
{
Fast486SetSegment(&EmulatorContext, FAST486_REG_FS, Value);
}
USHORT
CDECL
WINAPI
getGS(VOID)
{
return EmulatorContext.SegmentRegs[FAST486_REG_GS].Selector;
}
VOID
CDECL
WINAPI
setGS(USHORT Value)
{
Fast486SetSegment(&EmulatorContext, FAST486_REG_GS, Value);
@ -504,14 +504,14 @@ setGS(USHORT Value)
ULONG
CDECL
WINAPI
getCF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_CF);
}
VOID
CDECL
WINAPI
setCF(ULONG Flag)
{
if (Flag & 1)
@ -521,14 +521,14 @@ setCF(ULONG Flag)
}
ULONG
CDECL
WINAPI
getPF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_PF);
}
VOID
CDECL
WINAPI
setPF(ULONG Flag)
{
if (Flag & 1)
@ -538,14 +538,14 @@ setPF(ULONG Flag)
}
ULONG
CDECL
WINAPI
getAF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_AF);
}
VOID
CDECL
WINAPI
setAF(ULONG Flag)
{
if (Flag & 1)
@ -555,14 +555,14 @@ setAF(ULONG Flag)
}
ULONG
CDECL
WINAPI
getZF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_ZF);
}
VOID
CDECL
WINAPI
setZF(ULONG Flag)
{
if (Flag & 1)
@ -572,14 +572,14 @@ setZF(ULONG Flag)
}
ULONG
CDECL
WINAPI
getSF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_SF);
}
VOID
CDECL
WINAPI
setSF(ULONG Flag)
{
if (Flag & 1)
@ -589,14 +589,14 @@ setSF(ULONG Flag)
}
ULONG
CDECL
WINAPI
getIF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_IF);
}
VOID
CDECL
WINAPI
setIF(ULONG Flag)
{
if (Flag & 1)
@ -606,14 +606,14 @@ setIF(ULONG Flag)
}
ULONG
CDECL
WINAPI
getDF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_DF);
}
VOID
CDECL
WINAPI
setDF(ULONG Flag)
{
if (Flag & 1)
@ -623,14 +623,14 @@ setDF(ULONG Flag)
}
ULONG
CDECL
WINAPI
getOF(VOID)
{
return EmulatorGetFlag(EMULATOR_FLAG_OF);
}
VOID
CDECL
WINAPI
setOF(ULONG Flag)
{
if (Flag & 1)
@ -642,14 +642,14 @@ setOF(ULONG Flag)
ULONG
CDECL
WINAPI
getEFLAGS(VOID)
{
return EmulatorContext.Flags.Long;
}
VOID
CDECL
WINAPI
setEFLAGS(ULONG Flags)
{
EmulatorContext.Flags.Long = Flags;
@ -658,14 +658,14 @@ setEFLAGS(ULONG Flags)
USHORT
CDECL
WINAPI
getMSW(VOID)
{
return LOWORD(EmulatorContext.ControlRegisters[FAST486_REG_CR0]);
}
VOID
CDECL
WINAPI
setMSW(USHORT Value)
{
/* Set the lower 16 bits (Machine Status Word) of CR0 */

View file

@ -14,104 +14,104 @@
VOID EmulatorSetStack(WORD Segment, DWORD Offset);
ULONG getEAX(VOID);
VOID setEAX(ULONG);
USHORT getAX(VOID);
VOID setAX(USHORT);
UCHAR getAH(VOID);
VOID setAH(UCHAR);
UCHAR getAL(VOID);
VOID setAL(UCHAR);
ULONG WINAPI getEAX(VOID);
VOID WINAPI setEAX(ULONG);
USHORT WINAPI getAX(VOID);
VOID WINAPI setAX(USHORT);
UCHAR WINAPI getAH(VOID);
VOID WINAPI setAH(UCHAR);
UCHAR WINAPI getAL(VOID);
VOID WINAPI setAL(UCHAR);
ULONG getEBX(VOID);
VOID setEBX(ULONG);
USHORT getBX(VOID);
VOID setBX(USHORT);
UCHAR getBH(VOID);
VOID setBH(UCHAR);
UCHAR getBL(VOID);
VOID setBL(UCHAR);
ULONG WINAPI getEBX(VOID);
VOID WINAPI setEBX(ULONG);
USHORT WINAPI getBX(VOID);
VOID WINAPI setBX(USHORT);
UCHAR WINAPI getBH(VOID);
VOID WINAPI setBH(UCHAR);
UCHAR WINAPI getBL(VOID);
VOID WINAPI setBL(UCHAR);
ULONG getECX(VOID);
VOID setECX(ULONG);
USHORT getCX(VOID);
VOID setCX(USHORT);
UCHAR getCH(VOID);
VOID setCH(UCHAR);
UCHAR getCL(VOID);
VOID setCL(UCHAR);
ULONG WINAPI getECX(VOID);
VOID WINAPI setECX(ULONG);
USHORT WINAPI getCX(VOID);
VOID WINAPI setCX(USHORT);
UCHAR WINAPI getCH(VOID);
VOID WINAPI setCH(UCHAR);
UCHAR WINAPI getCL(VOID);
VOID WINAPI setCL(UCHAR);
ULONG getEDX(VOID);
VOID setEDX(ULONG);
USHORT getDX(VOID);
VOID setDX(USHORT);
UCHAR getDH(VOID);
VOID setDH(UCHAR);
UCHAR getDL(VOID);
VOID setDL(UCHAR);
ULONG WINAPI getEDX(VOID);
VOID WINAPI setEDX(ULONG);
USHORT WINAPI getDX(VOID);
VOID WINAPI setDX(USHORT);
UCHAR WINAPI getDH(VOID);
VOID WINAPI setDH(UCHAR);
UCHAR WINAPI getDL(VOID);
VOID WINAPI setDL(UCHAR);
ULONG getESP(VOID);
VOID setESP(ULONG);
USHORT getSP(VOID);
VOID setSP(USHORT);
ULONG WINAPI getESP(VOID);
VOID WINAPI setESP(ULONG);
USHORT WINAPI getSP(VOID);
VOID WINAPI setSP(USHORT);
ULONG getEBP(VOID);
VOID setEBP(ULONG);
USHORT getBP(VOID);
VOID setBP(USHORT);
ULONG WINAPI getEBP(VOID);
VOID WINAPI setEBP(ULONG);
USHORT WINAPI getBP(VOID);
VOID WINAPI setBP(USHORT);
ULONG getESI(VOID);
VOID setESI(ULONG);
USHORT getSI(VOID);
VOID setSI(USHORT);
ULONG WINAPI getESI(VOID);
VOID WINAPI setESI(ULONG);
USHORT WINAPI getSI(VOID);
VOID WINAPI setSI(USHORT);
ULONG getEDI(VOID);
VOID setEDI(ULONG);
USHORT getDI(VOID);
VOID setDI(USHORT);
ULONG WINAPI getEDI(VOID);
VOID WINAPI setEDI(ULONG);
USHORT WINAPI getDI(VOID);
VOID WINAPI setDI(USHORT);
ULONG getEIP(VOID);
VOID setEIP(ULONG);
USHORT getIP(VOID);
VOID setIP(USHORT);
ULONG WINAPI getEIP(VOID);
VOID WINAPI setEIP(ULONG);
USHORT WINAPI getIP(VOID);
VOID WINAPI setIP(USHORT);
USHORT getCS(VOID);
VOID setCS(USHORT);
USHORT getSS(VOID);
VOID setSS(USHORT);
USHORT getDS(VOID);
VOID setDS(USHORT);
USHORT getES(VOID);
VOID setES(USHORT);
USHORT getFS(VOID);
VOID setFS(USHORT);
USHORT getGS(VOID);
VOID setGS(USHORT);
USHORT WINAPI getCS(VOID);
VOID WINAPI setCS(USHORT);
USHORT WINAPI getSS(VOID);
VOID WINAPI setSS(USHORT);
USHORT WINAPI getDS(VOID);
VOID WINAPI setDS(USHORT);
USHORT WINAPI getES(VOID);
VOID WINAPI setES(USHORT);
USHORT WINAPI getFS(VOID);
VOID WINAPI setFS(USHORT);
USHORT WINAPI getGS(VOID);
VOID WINAPI setGS(USHORT);
ULONG getCF(VOID);
VOID setCF(ULONG);
ULONG getPF(VOID);
VOID setPF(ULONG);
ULONG getAF(VOID);
VOID setAF(ULONG);
ULONG getZF(VOID);
VOID setZF(ULONG);
ULONG getSF(VOID);
VOID setSF(ULONG);
ULONG getIF(VOID);
VOID setIF(ULONG);
ULONG getDF(VOID);
VOID setDF(ULONG);
ULONG getOF(VOID);
VOID setOF(ULONG);
ULONG WINAPI getCF(VOID);
VOID WINAPI setCF(ULONG);
ULONG WINAPI getPF(VOID);
VOID WINAPI setPF(ULONG);
ULONG WINAPI getAF(VOID);
VOID WINAPI setAF(ULONG);
ULONG WINAPI getZF(VOID);
VOID WINAPI setZF(ULONG);
ULONG WINAPI getSF(VOID);
VOID WINAPI setSF(ULONG);
ULONG WINAPI getIF(VOID);
VOID WINAPI setIF(ULONG);
ULONG WINAPI getDF(VOID);
VOID WINAPI setDF(ULONG);
ULONG WINAPI getOF(VOID);
VOID WINAPI setOF(ULONG);
ULONG getEFLAGS(VOID);
VOID setEFLAGS(ULONG);
ULONG WINAPI getEFLAGS(VOID);
VOID WINAPI setEFLAGS(ULONG);
USHORT getMSW(VOID);
VOID setMSW(USHORT);
USHORT WINAPI getMSW(VOID);
VOID WINAPI setMSW(USHORT);
#endif // _REGISTERS_H_

View file

@ -16,13 +16,12 @@
#include "bop.h"
#include "registers.h"
typedef VOID (CDECL *VDD_INIT_PROC)(VOID);
typedef VOID (CDECL *VDD_DISPATCH_PROC)(VOID);
typedef VOID (WINAPI *VDD_PROC)(VOID);
typedef struct _VDD_MODULE
{
HMODULE hDll;
VDD_DISPATCH_PROC DispatchRoutine;
HMODULE hDll;
VDD_PROC DispatchRoutine;
} VDD_MODULE, *PVDD_MODULE;
/* BOP Identifiers */
@ -30,7 +29,7 @@ typedef struct _VDD_MODULE
/* PRIVATE VARIABLES **********************************************************/
#define MAX_VDD_MODULES 0xFF
#define MAX_VDD_MODULES 0xFF + 1
VDD_MODULE VDDList[MAX_VDD_MODULES] = {{NULL}}; // TODO: Maybe use a linked list.
// But the number of elements must be <= MAXUSHORT
@ -58,14 +57,14 @@ VOID WINAPI ThirdPartyVDDBop(LPWORD Stack)
case 0:
{
BOOL Success = TRUE;
WORD RetVal = 0;
WORD Entry = 0;
WORD RetVal = 0;
WORD Entry = 0;
LPCSTR DllName = NULL,
InitRoutineName = NULL,
InitRoutineName = NULL,
DispatchRoutineName = NULL;
HMODULE hDll = NULL;
VDD_INIT_PROC InitRoutine = NULL;
VDD_DISPATCH_PROC DispatchRoutine = NULL;
VDD_PROC InitRoutine = NULL,
DispatchRoutine = NULL;
DPRINT1("RegisterModule() called\n");
@ -111,7 +110,7 @@ VOID WINAPI ThirdPartyVDDBop(LPWORD Stack)
/* Load the initialization routine if needed */
if (InitRoutineName)
{
InitRoutine = (VDD_INIT_PROC)GetProcAddress(hDll, InitRoutineName);
InitRoutine = (VDD_PROC)GetProcAddress(hDll, InitRoutineName);
if (InitRoutine == NULL)
{
DPRINT1("Failed to load the initialization routine '%s'\n", InitRoutineName);
@ -122,7 +121,7 @@ VOID WINAPI ThirdPartyVDDBop(LPWORD Stack)
}
/* Load the dispatch routine */
DispatchRoutine = (VDD_DISPATCH_PROC)GetProcAddress(hDll, DispatchRoutineName);
DispatchRoutine = (VDD_PROC)GetProcAddress(hDll, DispatchRoutineName);
if (DispatchRoutine == NULL)
{
DPRINT1("Failed to load the dispatch routine '%s'\n", DispatchRoutineName);