ReactOS 0.4.15-dev-8222-g9164419
driverdbg.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS SDK
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Helper functions for driver debugging
5 * COPYRIGHT: 2020 Victor Perevertkin (victor.perevertkin@reactos.org)
6 */
7
8#ifndef _DBG_DRIVERDBG_H_
9#define _DBG_DRIVERDBG_H_
10
15{
16 switch (MinorFunction)
17 {
19 return "IRP_MN_START_DEVICE";
21 return "IRP_MN_QUERY_REMOVE_DEVICE";
23 return "IRP_MN_REMOVE_DEVICE";
25 return "IRP_MN_CANCEL_REMOVE_DEVICE";
27 return "IRP_MN_STOP_DEVICE";
29 return "IRP_MN_QUERY_STOP_DEVICE";
31 return "IRP_MN_CANCEL_STOP_DEVICE";
33 return "IRP_MN_QUERY_DEVICE_RELATIONS";
35 return "IRP_MN_QUERY_INTERFACE";
37 return "IRP_MN_QUERY_CAPABILITIES";
39 return "IRP_MN_QUERY_RESOURCES";
41 return "IRP_MN_QUERY_RESOURCE_REQUIREMENTS";
43 return "IRP_MN_QUERY_DEVICE_TEXT";
45 return "IRP_MN_FILTER_RESOURCE_REQUIREMENTS";
47 return "IRP_MN_READ_CONFIG";
49 return "IRP_MN_WRITE_CONFIG";
50 case IRP_MN_EJECT:
51 return "IRP_MN_EJECT";
52 case IRP_MN_SET_LOCK:
53 return "IRP_MN_SET_LOCK";
54 case IRP_MN_QUERY_ID:
55 return "IRP_MN_QUERY_ID";
57 return "IRP_MN_QUERY_PNP_DEVICE_STATE";
59 return "IRP_MN_QUERY_BUS_INFORMATION";
61 return "IRP_MN_DEVICE_USAGE_NOTIFICATION";
63 return "IRP_MN_SURPRISE_REMOVAL";
65 return "IRP_MN_QUERY_LEGACY_BUS_INFORMATION";
66 default:
67 return "(unknown)IRP_MN";
68 }
69}
70
71inline
75{
76 switch (Type)
77 {
78 case BusRelations:
79 return "BusRelations";
81 return "EjectionRelations";
83 return "RemovalRelations";
85 return "TargetDeviceRelation";
86 default:
87 return "(unknown)Relation";
88 }
89}
90
91inline
95{
96 switch (Type)
97 {
99 return "BusQueryDeviceID";
101 return "BusQueryHardwareIDs";
103 return "BusQueryCompatibleIDs";
105 return "BusQueryInstanceID";
107 return "BusQueryDeviceSerialNumber";
108 default:
109 return "(unknown)QueryID";
110 }
111}
112
113#endif // _DBG_DRIVERDBG_H_
Type
Definition: Type.h:7
PCHAR DbgGetDeviceRelationString(DEVICE_RELATION_TYPE Type)
Definition: driverdbg.h:73
FORCEINLINE PCHAR GetIRPMinorFunctionString(UCHAR MinorFunction)
Definition: driverdbg.h:13
PCHAR DbgGetDeviceIDString(BUS_QUERY_ID_TYPE Type)
Definition: driverdbg.h:93
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
char * PCHAR
Definition: typedefs.h:51
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1699
#define FORCEINLINE
Definition: wdftypes.h:67
#define IRP_MN_CANCEL_STOP_DEVICE
@ EjectionRelations
Definition: iotypes.h:2153
@ RemovalRelations
Definition: iotypes.h:2155
@ BusRelations
Definition: iotypes.h:2152
@ TargetDeviceRelation
Definition: iotypes.h:2156
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define IRP_MN_EJECT
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
#define IRP_MN_QUERY_INTERFACE
#define IRP_MN_START_DEVICE
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
#define IRP_MN_READ_CONFIG
#define IRP_MN_WRITE_CONFIG
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_ID
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_QUERY_DEVICE_TEXT
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MN_QUERY_RESOURCES
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_STOP_DEVICE
#define IRP_MN_SET_LOCK
@ BusQueryCompatibleIDs
Definition: iotypes.h:2938
@ BusQueryDeviceSerialNumber
Definition: iotypes.h:2940
@ BusQueryInstanceID
Definition: iotypes.h:2939
@ BusQueryDeviceID
Definition: iotypes.h:2936
@ BusQueryHardwareIDs
Definition: iotypes.h:2937
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION
Definition: iotypes.h:4427
#define IRP_MN_QUERY_BUS_INFORMATION
#define IRP_MN_QUERY_REMOVE_DEVICE
unsigned char UCHAR
Definition: xmlstorage.h:181