-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdriver.h
102 lines (74 loc) · 2.21 KB
/
driver.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef DRIVER_H
#define DRIVER_H
#define DRIVERNAME "FDRAWCMD" // for use in messages
///////////////////////////////////////////////////////////////////////////////
// Device extension structure
enum { FIDO_EXTENSION, EDO_EXTENSION };
typedef struct _COMMON_DEVICE_EXTENSION
{
BOOLEAN IsEdo;
} COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
typedef struct _DEVICE_EXTENSION : public _COMMON_DEVICE_EXTENSION
{
struct _EXTRA_DEVICE_EXTENSION* edx;
PDEVICE_OBJECT DeviceObject; // device object this extension belongs to
PDEVICE_OBJECT LowerDeviceObject; // next lower driver in same stack
PDEVICE_OBJECT Pdo; // the PDO
IO_REMOVE_LOCK RemoveLock;
UCHAR DeviceUnit;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
typedef struct _EXTRA_DEVICE_EXTENSION: public _COMMON_DEVICE_EXTENSION
{
PDEVICE_EXTENSION pdx;
PDEVICE_OBJECT DeviceObject;
UNICODE_STRING SymbolicName;
BOOLEAN killthread;
KSEMAPHORE semaphore;
PKTHREAD thread;
KEVENT dmasync;
PKTHREAD dmathread;
BOOLEAN StopDmaThread;
PDMA_ADAPTER* ppAdapterObject;
ULONG MaxTransferSize;
NTSTATUS Status;
IO_CSQ IrpQueue;
LIST_ENTRY IrpQueueAnchor;
KSPIN_LOCK IrpQueueLock;
PUCHAR IoBuffer;
PMDL IoBufferMdl;
ULONG IoBufferSize;
UCHAR FifoIn[16];
UCHAR FifoOut[16];
BOOLEAN Acquired;
BOOLEAN Enabled;
BOOLEAN NeedReset;
BOOLEAN NeedInit;
BOOLEAN NeedRecalibrate;
BOOLEAN NeedDisk;
ULONG SpinTime;
LONG AcquireCount;
ULONG PhysCyl;
UCHAR DeviceUnit;
UCHAR DriveOnValue;
// Drive-specific configuration below
BOOLEAN WaitSector;
UCHAR WaitSectorCount;
BOOLEAN ShortWrite;
ULONG DmaThreshold;
ULONG DmaDelay;
UCHAR MotorTimeout;
// USHORT MotorSettleTimeRead;
USHORT MotorSettleTimeWrite;
UCHAR HeadSettleTime;
UCHAR EisEfifoPollFifothr; // Configure
UCHAR PreTrk; // Configure
UCHAR StepRateHeadUnloadTime; // Specify
UCHAR HeadLoadTimeNoDMA; // Specify
UCHAR PerpendicularMode;
UCHAR DataRate;
} EXTRA_DEVICE_EXTENSION, *PEXTRA_DEVICE_EXTENSION;
///////////////////////////////////////////////////////////////////////////////
// Global functions
VOID RemoveDevice(IN PDEVICE_OBJECT fdo);
NTSTATUS CompleteRequest(IN PIRP Irp, IN NTSTATUS status, IN ULONG_PTR info=0, IN CCHAR boost=IO_NO_INCREMENT);
#endif // DRIVER_H