summaryrefslogtreecommitdiff
path: root/tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.h
blob: 854e3217e18a122a0f7b5bef49a6c343d27e00f3 (plain)
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
/*++

Copyright (c) Microsoft Corporation.  All rights reserved.

Module Name:

    fail_driver1.h

Environment:

    Kernel mode

--*/

#ifdef __cplusplus
extern "C" {
#endif
#include <wdm.h>
#ifdef __cplusplus
}
#endif
// suppress these warning for this fail_driver
// SDV can find defects without annotations
#pragma warning(disable:6387)
#pragma warning(disable:28166)
#pragma warning(disable:28165)
#pragma warning(disable:28121)
#pragma warning(disable:28150)
#pragma warning(disable:28160)
#pragma warning(disable:26135)
#pragma warning(disable:26165)
#pragma warning(disable:28930)
#pragma warning(disable:28931)

typedef struct _DRIVER_DEVICE_EXTENSION
{
    PKSPIN_LOCK queueLock; 
    PRKEVENT  Event;
    KPRIORITY  Increment;
    PIRP Irp;
    PDEVICE_OBJECT DeviceObject;
    ULONG ControllerVector;  
    PKINTERRUPT InterruptObject;
}
DRIVER_DEVICE_EXTENSION,*PDRIVER_DEVICE_EXTENSION;

#ifdef __cplusplus
extern "C"
#endif
DRIVER_INITIALIZE DriverEntry;

DRIVER_ADD_DEVICE DriverAddDevice;

_Dispatch_type_(IRP_MJ_CREATE)
DRIVER_DISPATCH DispatchCreate;

_Dispatch_type_(IRP_MJ_READ)
DRIVER_DISPATCH DispatchRead;

_Dispatch_type_(IRP_MJ_POWER)
DRIVER_DISPATCH DispatchPower;

_Dispatch_type_(IRP_MJ_SYSTEM_CONTROL)
DRIVER_DISPATCH DispatchSystemControl;

_Dispatch_type_(IRP_MJ_PNP)
DRIVER_DISPATCH DispatchPnp;

IO_COMPLETION_ROUTINE CompletionRoutine;

KSERVICE_ROUTINE InterruptServiceRoutine;

IO_DPC_ROUTINE DpcForIsrRoutine;

DRIVER_UNLOAD DriverUnload;