-
Notifications
You must be signed in to change notification settings - Fork 3
/
winio_nt.h
69 lines (53 loc) · 1.61 KB
/
winio_nt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef WINIONT_H
#define WINIONT_H
// Define the various device type values. Note that values used by Microsoft
// Corporation are in the range 0-32767, and 32768-65535 are reserved for use
// by customers.
#define FILE_DEVICE_WINIO 0x00008010
// Macro definition for defining IOCTL and FSCTL function control codes.
// Note that function codes 0-2047 are reserved for Microsoft Corporation,
// and 2048-4095 are reserved for customers.
#define WINIO_IOCTL_INDEX 0x810
// Define our own private IOCTL
#define IOCTL_WINIO_MAPPHYSTOLIN CTL_CODE(FILE_DEVICE_WINIO, \
WINIO_IOCTL_INDEX, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
#define IOCTL_WINIO_UNMAPPHYSADDR CTL_CODE(FILE_DEVICE_WINIO, \
WINIO_IOCTL_INDEX + 1, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
#define IOCTL_WINIO_ENABLEDIRECTIO CTL_CODE(FILE_DEVICE_WINIO, \
WINIO_IOCTL_INDEX + 2, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
#define IOCTL_WINIO_DISABLEDIRECTIO CTL_CODE(FILE_DEVICE_WINIO, \
WINIO_IOCTL_INDEX + 3, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
#define IOCTL_WINIO_READPORT CTL_CODE(FILE_DEVICE_WINIO, \
WINIO_IOCTL_INDEX + 4, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
#define IOCTL_WINIO_WRITEPORT CTL_CODE(FILE_DEVICE_WINIO, \
WINIO_IOCTL_INDEX + 5, \
METHOD_BUFFERED, \
FILE_ANY_ACCESS)
#pragma pack(push)
#pragma pack(1)
struct tagPhysStruct
{
DWORD64 dwPhysMemSizeInBytes;
DWORD64 pvPhysAddress;
DWORD64 PhysicalMemoryHandle;
DWORD64 pvPhysMemLin;
DWORD64 pvPhysSection;
};
struct tagPortStruct
{
USHORT wPortAddr;
ULONG dwPortVal;
UCHAR bSize;
};
#pragma pack(pop)
#endif