ReactOS 0.4.16-dev-297-gc569aee
nt_vdd.h
Go to the documentation of this file.
1/*
2 * nt_vdd.h
3 *
4 * Windows NT Device Driver Kit
5 *
6 * This file is part of the ReactOS DDK package.
7 *
8 * Contributors:
9 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23#pragma once
24
25#define _NT_VDD
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/* VDM Control */
32
33VOID
36
37VOID
40
41
42/* VDD User Hooks */
43
44typedef VOID
46
47typedef VOID
49
50typedef VOID
52
53typedef VOID
55
56// NOTE: Kept there for WinDDK compatibility, but it is in any case unused.
57#ifndef NO_NTVDD_COMPAT
58typedef struct _VDD_USER_HANDLERS {
66#endif
67
68BOOL
76
77BOOL
81
82
83/* IRQ services */
84
85WORD
89 _In_ WORD IrqLine);
90
91BOOL
95 _In_ WORD IrqLine);
96
97
98/* I/O Port services */
99
100typedef VOID
102 WORD iport,
103 PBYTE data);
104
105typedef VOID
107 WORD iport,
108 PWORD data);
109
110typedef VOID
112 WORD iport,
113 PBYTE data,
114 WORD count);
115
116typedef VOID
118 WORD iport,
119 PWORD data,
120 WORD count);
121
122typedef VOID
124 WORD iport,
125 BYTE data);
126
127typedef VOID
129 WORD iport,
130 WORD data);
131
132typedef VOID
134 WORD iport,
135 PBYTE data,
136 WORD count);
137
138typedef VOID
140 WORD iport,
141 PWORD data,
142 WORD count);
143
144typedef struct _VDD_IO_HANDLERS {
154
155typedef struct _VDD_IO_PORTRANGE {
159
160BOOL
161WINAPI
164 _In_ WORD cPortRange,
165 _In_ PVDD_IO_PORTRANGE pPortRange,
166 _In_ PVDD_IO_HANDLERS IoHandlers);
167
168VOID
169WINAPI
172 _In_ WORD cPortRange,
173 _In_ PVDD_IO_PORTRANGE pPortRange);
174
175
176/* DMA services */
177
178typedef struct _VDD_DMA_INFO {
186
187#define VDD_DMA_ADDR 0x01
188#define VDD_DMA_COUNT 0x02
189#define VDD_DMA_PAGE 0x04
190#define VDD_DMA_STATUS 0x08
191#define VDD_DMA_ALL (VDD_DMA_ADDR | VDD_DMA_COUNT | VDD_DMA_PAGE | VDD_DMA_STATUS)
192
193DWORD
194WINAPI
197 _In_ WORD iChannel,
200
201BOOL
202WINAPI
205 _In_ WORD iChannel,
206 _In_ PVDD_DMA_INFO pDmaInfo);
207
208BOOL
209WINAPI
212 _In_ WORD iChannel,
213 _In_ WORD fDMA,
214 _In_ PVDD_DMA_INFO pDmaInfo);
215
216
217/* Memory services */
218
219typedef enum {
221 VDM_PM
223
224#ifndef MSW_PE
225#define MSW_PE 0x0001
226#endif
227
228#define getMODE() ((getMSW() & MSW_PE) ? VDM_PM : VDM_V86)
229
230typedef VOID
232 PVOID FaultAddress,
233 ULONG RWMode);
234
235PVOID
236WINAPI
241
242#ifdef _X86_
243
244#define VdmFlushCache(sel, off, len, mode) TRUE
245#define VdmUnmapFlat(sel, off, buf, mode) TRUE
246
247#else
248
249BOOL
250WINAPI
256
257BOOL
258WINAPI
264
265#endif
266
267BOOL
268WINAPI
271 _In_ PVOID pStart,
272 _In_ DWORD dwCount,
274
275BOOL
276WINAPI
279 _In_ PVOID pStart,
280 _In_ DWORD dwCount);
281
282BOOL
283WINAPI
287 _In_ ULONG Size);
288
289BOOL
290WINAPI
294 _In_ ULONG Size);
295
296BOOL
297WINAPI
301 _In_ ULONG Size);
302
303BOOL
304WINAPI
308 _In_ ULONG Size);
309
310#ifdef __cplusplus
311}
312#endif
313
314/* EOF */
#define VOID
Definition: acefi.h:82
Definition: bufpool.h:45
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
_In_ ULONG Mode
Definition: hubbusif.h:303
#define _Inout_
Definition: no_sal2.h:162
#define _In_
Definition: no_sal2.h:158
VOID(WINAPI * PVDD_MEMORY_HANDLER)(PVOID FaultAddress, ULONG RWMode)
Definition: nt_vdd.h:231
struct _VDD_USER_HANDLERS * PVDD_USER_HANDLERS
BOOL WINAPI VDDInstallUserHook(_In_ HANDLE hVdd, _In_ PFNVDD_UCREATE Ucr_Handler, _In_ PFNVDD_UTERMINATE Uterm_Handler, _In_ PFNVDD_UBLOCK Ublock_Handler, _In_ PFNVDD_URESUME Uresume_Handler)
VOID(WINAPI * PFNVDD_URESUME)(VOID)
Definition: nt_vdd.h:54
VOID(WINAPI * PFNVDD_OUTSB)(WORD iport, PBYTE data, WORD count)
Definition: nt_vdd.h:133
VOID(WINAPI * PFNVDD_UTERMINATE)(USHORT DosPDB)
Definition: nt_vdd.h:48
VOID(WINAPI * PFNVDD_UCREATE)(USHORT DosPDB)
Definition: nt_vdd.h:45
VOID(WINAPI * PFNVDD_OUTW)(WORD iport, WORD data)
Definition: nt_vdd.h:128
VOID(WINAPI * PFNVDD_INW)(WORD iport, PWORD data)
Definition: nt_vdd.h:106
struct _VDD_DMA_INFO * PVDD_DMA_INFO
struct _VDD_IO_HANDLERS * PVDD_IO_HANDLERS
VOID WINAPI VDDTerminateVDM(VOID)
Definition: emulator.c:677
VOID WINAPI VDDSimulate16(VOID)
Definition: emulator.c:670
struct _VDD_IO_PORTRANGE VDD_IO_PORTRANGE
VOID(WINAPI * PFNVDD_UBLOCK)(VOID)
Definition: nt_vdd.h:51
VOID(WINAPI * PFNVDD_OUTB)(WORD iport, BYTE data)
Definition: nt_vdd.h:123
DWORD WINAPI VDDRequestDMA(_In_ HANDLE hVdd, _In_ WORD iChannel, _Inout_ PVOID Buffer, _In_ DWORD length)
VOID(WINAPI * PFNVDD_INSB)(WORD iport, PBYTE data, WORD count)
Definition: nt_vdd.h:111
BOOL WINAPI VDDInstallIOHook(_In_ HANDLE hVdd, _In_ WORD cPortRange, _In_ PVDD_IO_PORTRANGE pPortRange, _In_ PVDD_IO_HANDLERS IoHandlers)
VOID(WINAPI * PFNVDD_OUTSW)(WORD iport, PWORD data, WORD count)
Definition: nt_vdd.h:139
BOOL WINAPI VDDIncludeMem(_In_ HANDLE hVdd, _In_ PVOID Address, _In_ ULONG Size)
BOOL WINAPI VDDQueryDMA(_In_ HANDLE hVdd, _In_ WORD iChannel, _In_ PVDD_DMA_INFO pDmaInfo)
struct _VDD_DMA_INFO VDD_DMA_INFO
WORD WINAPI VDDReserveIrqLine(_In_ HANDLE hVdd, _In_ WORD IrqLine)
BOOL WINAPI VDDDeInstallUserHook(_In_ HANDLE hVdd)
struct _VDD_USER_HANDLERS VDD_USER_HANDLERS
PVOID WINAPI VdmMapFlat(_In_ USHORT Segment, _In_ ULONG Offset, _In_ VDM_MODE Mode)
BOOL WINAPI VDDInstallMemoryHook(_In_ HANDLE hVdd, _In_ PVOID pStart, _In_ DWORD dwCount, _In_ PVDD_MEMORY_HANDLER MemoryHandler)
BOOL WINAPI VDDFreeMem(_In_ HANDLE hVdd, _In_ PVOID Address, _In_ ULONG Size)
VOID(WINAPI * PFNVDD_INSW)(WORD iport, PWORD data, WORD count)
Definition: nt_vdd.h:117
BOOL WINAPI VdmFlushCache(_In_ USHORT Segment, _In_ ULONG Offset, _In_ ULONG Size, _In_ VDM_MODE Mode)
VOID WINAPI VDDDeInstallIOHook(_In_ HANDLE hVdd, _In_ WORD cPortRange, _In_ PVDD_IO_PORTRANGE pPortRange)
VOID(WINAPI * PFNVDD_INB)(WORD iport, PBYTE data)
Definition: nt_vdd.h:101
BOOL WINAPI VDDDeInstallMemoryHook(_In_ HANDLE hVdd, _In_ PVOID pStart, _In_ DWORD dwCount)
BOOL WINAPI VDDSetDMA(_In_ HANDLE hVdd, _In_ WORD iChannel, _In_ WORD fDMA, _In_ PVDD_DMA_INFO pDmaInfo)
struct _VDD_IO_HANDLERS VDD_IO_HANDLERS
struct _VDD_IO_PORTRANGE * PVDD_IO_PORTRANGE
VDM_MODE
Definition: nt_vdd.h:219
@ VDM_PM
Definition: nt_vdd.h:221
@ VDM_V86
Definition: nt_vdd.h:220
BOOL WINAPI VdmUnmapFlat(_In_ USHORT Segment, _In_ ULONG Offset, _In_ PVOID Buffer, _In_ VDM_MODE Mode)
BOOL WINAPI VDDExcludeMem(_In_ HANDLE hVdd, _In_ PVOID Address, _In_ ULONG Size)
BOOL WINAPI VDDReleaseIrqLine(_In_ HANDLE hVdd, _In_ WORD IrqLine)
BOOL WINAPI VDDAllocMem(_In_ HANDLE hVdd, _In_ PVOID Address, _In_ ULONG Size)
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
WORD * PWORD
Definition: pedump.c:67
BYTE * PBYTE
Definition: pedump.c:66
unsigned short USHORT
Definition: pedump.c:61
static WCHAR Address[46]
Definition: ping.c:68
BYTE status
Definition: nt_vdd.h:182
WORD addr
Definition: nt_vdd.h:179
BYTE mask
Definition: nt_vdd.h:184
WORD count
Definition: nt_vdd.h:180
WORD page
Definition: nt_vdd.h:181
BYTE mode
Definition: nt_vdd.h:183
PFNVDD_INW inw_handler
Definition: nt_vdd.h:146
PFNVDD_OUTSB outsb_handler
Definition: nt_vdd.h:151
PFNVDD_OUTW outw_handler
Definition: nt_vdd.h:150
PFNVDD_OUTB outb_handler
Definition: nt_vdd.h:149
PFNVDD_INSW insw_handler
Definition: nt_vdd.h:148
PFNVDD_INB inb_handler
Definition: nt_vdd.h:145
PFNVDD_INSB insb_handler
Definition: nt_vdd.h:147
PFNVDD_OUTSW outsw_handler
Definition: nt_vdd.h:152
PFNVDD_UBLOCK Ublock_Handler
Definition: vddsup.c:40
struct _VDD_USER_HANDLERS * next
Definition: nt_vdd.h:64
PFNVDD_URESUME uresume_handler
Definition: nt_vdd.h:63
PFNVDD_UTERMINATE Uterm_Handler
Definition: vddsup.c:39
PFNVDD_UCREATE ucr_handler
Definition: nt_vdd.h:60
PFNVDD_UTERMINATE uterm_handler
Definition: nt_vdd.h:61
PFNVDD_UCREATE Ucr_Handler
Definition: vddsup.c:38
PFNVDD_UBLOCK ublock_handler
Definition: nt_vdd.h:62
PFNVDD_URESUME Uresume_Handler
Definition: vddsup.c:41
VOID WINAPI MemoryHandler(IN PVOID FaultAddress, IN ULONG RWMode)
Definition: testvdd.c:217
HANDLE hVdd
Definition: testvdd.c:87
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define WINAPI
Definition: msvc.h:6
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
unsigned char BYTE
Definition: xxhash.c:193