reactos/subsystems/ntvdm/callback.h
David Quintana 8db8073cbb Sync with trunk r63270.
svn path=/branches/shell-experiments/; revision=63271
2014-05-13 12:11:12 +00:00

76 lines
1.9 KiB
C

/*
* COPYRIGHT: GPL - See COPYING in the top level directory
* PROJECT: ReactOS Virtual DOS Machine
* FILE: callback.h
* PURPOSE: 32-bit Interrupt Handlers
* PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
* Hermes Belusca-Maito (hermes.belusca@sfr.fr)
*/
#ifndef _CALLBACK_H_
#define _CALLBACK_H_
/* DEFINES ********************************************************************/
/* 32-bit Interrupt Identifiers */
#define EMULATOR_MAX_INT32_NUM 0xFF + 1
#define INT_HANDLER_OFFSET 0x1000
#define COMMON_STUB_OFFSET 0x2000
typedef struct _CALLBACK16
{
ULONG TrampolineFarPtr; // Where the trampoline zone is placed
USHORT Segment;
USHORT NextOffset;
} CALLBACK16, *PCALLBACK16;
/* FUNCTIONS ******************************************************************/
typedef VOID (WINAPI *EMULATOR_INT32_PROC)(LPWORD Stack);
VOID
InitializeContext(IN PCALLBACK16 Context,
IN USHORT Segment,
IN USHORT Offset);
VOID
Call16(IN USHORT Segment,
IN USHORT Offset);
ULONG
RegisterCallback16(IN ULONG FarPtr,
IN LPBYTE CallbackCode,
IN SIZE_T CallbackSize,
OUT PSIZE_T CodeSize OPTIONAL);
VOID
RunCallback16(IN PCALLBACK16 Context,
IN ULONG FarPtr);
ULONG
RegisterInt16(IN ULONG FarPtr,
IN BYTE IntNumber,
IN LPBYTE CallbackCode,
IN SIZE_T CallbackSize,
OUT PSIZE_T CodeSize OPTIONAL);
ULONG
RegisterInt32(IN ULONG FarPtr,
IN BYTE IntNumber,
IN EMULATOR_INT32_PROC IntHandler,
OUT PSIZE_T CodeSize OPTIONAL);
VOID
Int32Call(IN PCALLBACK16 Context,
IN BYTE IntNumber);
VOID WINAPI Int32Dispatch(LPWORD Stack);
VOID InitializeCallbacks(VOID);
#endif // _CALLBACK_H_
/* EOF */