ReactOS 0.4.16-dev-197-g92996da
callback.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GPL - See COPYING in the top level directory
3 * PROJECT: ReactOS Virtual DOS Machine
4 * FILE: subsystems/mvdm/ntvdm/cpu/callback.h
5 * PURPOSE: 32-bit Interrupt Handlers
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10#ifndef _CALLBACK_H_
11#define _CALLBACK_H_
12
13/* DEFINES ********************************************************************/
14
15#define BOP(num) LOBYTE(EMULATOR_BOP), HIBYTE(EMULATOR_BOP), (num)
16#define UnSimulate16(trap) \
17do { \
18 *(PUSHORT)(trap) = EMULATOR_BOP; \
19 (trap) += sizeof(USHORT); \
20 *(trap) = BOP_UNSIMULATE; \
21} while(0)
22// #define UnSimulate16 MAKELONG(EMULATOR_BOP, BOP_UNSIMULATE) // BOP(BOP_UNSIMULATE)
23
24#define TRAMPOLINE_SIZE sizeof(ULONGLONG)
25
26typedef struct _CALLBACK16
27{
28 ULONG TrampolineFarPtr; // Where the trampoline zone is placed
29 ULONG TrampolineSize; // Size of the trampoline zone
33
34/* FUNCTIONS ******************************************************************/
35
36VOID
38 IN ULONG TrampolineSize,
41
42VOID
46
47VOID
50
51VOID
53 IN ULONG FarPtr);
54
57 IN LPBYTE CallbackCode,
58 IN SIZE_T CallbackSize,
59 OUT PSIZE_T CodeSize OPTIONAL);
60
61#endif /* _CALLBACK_H_ */
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned short USHORT
Definition: pedump.c:61
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
ULONG TrampolineFarPtr
Definition: callback.h:28
USHORT Segment
Definition: callback.h:30
ULONG TrampolineSize
Definition: callback.h:29
USHORT NextOffset
Definition: callback.h:31
struct _CALLBACK16 * PCALLBACK16
VOID InitializeContext(IN PCALLBACK16 Context, IN USHORT Segment, IN USHORT Offset)
Definition: callback.c:60
VOID RunCallback16(IN PCALLBACK16 Context, IN ULONG FarPtr)
Definition: callback.c:93
ULONG RegisterCallback16(IN ULONG FarPtr, IN LPBYTE CallbackCode, IN SIZE_T CallbackSize, OUT PSIZE_T CodeSize OPTIONAL)
Definition: callback.c:120
struct _CALLBACK16 CALLBACK16
VOID Call16(IN USHORT Segment, IN USHORT Offset)
Definition: callback.c:71
VOID InitializeContextEx(IN PCALLBACK16 Context, IN ULONG TrampolineSize, IN USHORT Segment, IN USHORT Offset)
Definition: callback.c:48
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
unsigned char * LPBYTE
Definition: typedefs.h:53
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Inout_ PVOID Segment
Definition: exfuncs.h:1101