mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-27 11:53:32 +00:00
114 lines
3.5 KiB
C
114 lines
3.5 KiB
C
/*
|
|
* PROJECT: ReactOS SDK
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
* PURPOSE: Helper functions for driver debugging
|
|
* COPYRIGHT: 2020 Victor Perevertkin ([email protected])
|
|
*/
|
|
|
|
#ifndef _DBG_DRIVERDBG_H_
|
|
#define _DBG_DRIVERDBG_H_
|
|
|
|
FORCEINLINE
|
|
PCHAR
|
|
GetIRPMinorFunctionString(
|
|
UCHAR MinorFunction)
|
|
{
|
|
switch (MinorFunction)
|
|
{
|
|
case IRP_MN_START_DEVICE:
|
|
return "IRP_MN_START_DEVICE";
|
|
case IRP_MN_QUERY_REMOVE_DEVICE:
|
|
return "IRP_MN_QUERY_REMOVE_DEVICE";
|
|
case IRP_MN_REMOVE_DEVICE:
|
|
return "IRP_MN_REMOVE_DEVICE";
|
|
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
|
return "IRP_MN_CANCEL_REMOVE_DEVICE";
|
|
case IRP_MN_STOP_DEVICE:
|
|
return "IRP_MN_STOP_DEVICE";
|
|
case IRP_MN_QUERY_STOP_DEVICE:
|
|
return "IRP_MN_QUERY_STOP_DEVICE";
|
|
case IRP_MN_CANCEL_STOP_DEVICE:
|
|
return "IRP_MN_CANCEL_STOP_DEVICE";
|
|
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
|
return "IRP_MN_QUERY_DEVICE_RELATIONS";
|
|
case IRP_MN_QUERY_INTERFACE:
|
|
return "IRP_MN_QUERY_INTERFACE";
|
|
case IRP_MN_QUERY_CAPABILITIES:
|
|
return "IRP_MN_QUERY_CAPABILITIES";
|
|
case IRP_MN_QUERY_RESOURCES:
|
|
return "IRP_MN_QUERY_RESOURCES";
|
|
case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
|
|
return "IRP_MN_QUERY_RESOURCE_REQUIREMENTS";
|
|
case IRP_MN_QUERY_DEVICE_TEXT:
|
|
return "IRP_MN_QUERY_DEVICE_TEXT";
|
|
case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
|
|
return "IRP_MN_FILTER_RESOURCE_REQUIREMENTS";
|
|
case IRP_MN_READ_CONFIG:
|
|
return "IRP_MN_READ_CONFIG";
|
|
case IRP_MN_WRITE_CONFIG:
|
|
return "IRP_MN_WRITE_CONFIG";
|
|
case IRP_MN_EJECT:
|
|
return "IRP_MN_EJECT";
|
|
case IRP_MN_SET_LOCK:
|
|
return "IRP_MN_SET_LOCK";
|
|
case IRP_MN_QUERY_ID:
|
|
return "IRP_MN_QUERY_ID";
|
|
case IRP_MN_QUERY_PNP_DEVICE_STATE:
|
|
return "IRP_MN_QUERY_PNP_DEVICE_STATE";
|
|
case IRP_MN_QUERY_BUS_INFORMATION:
|
|
return "IRP_MN_QUERY_BUS_INFORMATION";
|
|
case IRP_MN_DEVICE_USAGE_NOTIFICATION:
|
|
return "IRP_MN_DEVICE_USAGE_NOTIFICATION";
|
|
case IRP_MN_SURPRISE_REMOVAL:
|
|
return "IRP_MN_SURPRISE_REMOVAL";
|
|
case IRP_MN_QUERY_LEGACY_BUS_INFORMATION:
|
|
return "IRP_MN_QUERY_LEGACY_BUS_INFORMATION";
|
|
default:
|
|
return "(unknown)IRP_MN";
|
|
}
|
|
}
|
|
|
|
inline
|
|
PCHAR
|
|
DbgGetDeviceRelationString(
|
|
DEVICE_RELATION_TYPE Type)
|
|
{
|
|
switch (Type)
|
|
{
|
|
case BusRelations:
|
|
return "BusRelations";
|
|
case EjectionRelations:
|
|
return "EjectionRelations";
|
|
case RemovalRelations:
|
|
return "RemovalRelations";
|
|
case TargetDeviceRelation:
|
|
return "TargetDeviceRelation";
|
|
default:
|
|
return "(unknown)Relation";
|
|
}
|
|
}
|
|
|
|
inline
|
|
PCHAR
|
|
DbgGetDeviceIDString(
|
|
BUS_QUERY_ID_TYPE Type)
|
|
{
|
|
switch (Type)
|
|
{
|
|
case BusQueryDeviceID:
|
|
return "BusQueryDeviceID";
|
|
case BusQueryHardwareIDs:
|
|
return "BusQueryHardwareIDs";
|
|
case BusQueryCompatibleIDs:
|
|
return "BusQueryCompatibleIDs";
|
|
case BusQueryInstanceID:
|
|
return "BusQueryInstanceID";
|
|
case BusQueryDeviceSerialNumber:
|
|
return "BusQueryDeviceSerialNumber";
|
|
default:
|
|
return "(unknown)QueryID";
|
|
}
|
|
}
|
|
|
|
#endif // _DBG_DRIVERDBG_H_
|