sys: driver.h: FSP_ENTER_IOC/FSP_LEAVE_IOC

This commit is contained in:
Bill Zissimopoulos 2015-11-27 13:33:26 -08:00
parent 3ea9a4242c
commit 7ec3e88cc6

View File

@ -35,6 +35,10 @@
DRIVER_NAME "!" __FUNCTION__ "(" fmt ") = !AbnormalTermination\n" :\ DRIVER_NAME "!" __FUNCTION__ "(" fmt ") = !AbnormalTermination\n" :\
DRIVER_NAME "!" __FUNCTION__ "(" fmt ")" rfmt "\n",\ DRIVER_NAME "!" __FUNCTION__ "(" fmt ")" rfmt "\n",\
__VA_ARGS__) __VA_ARGS__)
#define FSP_DEBUGLOG_NOCRIT_(fmt, rfmt, ...)\
DbgPrint( \
DRIVER_NAME "!" __FUNCTION__ "(" fmt ")" rfmt "\n",\
__VA_ARGS__)
#define FSP_DEBUGBRK_() \ #define FSP_DEBUGBRK_() \
do \ do \
{ \ { \
@ -43,6 +47,7 @@
} while (0,0) } while (0,0)
#else #else
#define FSP_DEBUGLOG_(fmt, rfmt, ...) ((void)0) #define FSP_DEBUGLOG_(fmt, rfmt, ...) ((void)0)
#define FSP_DEBUGLOG_NOCRIT_(fmt, rfmt, ...)((void)0)
#define FSP_DEBUGBRK_() ((void)0) #define FSP_DEBUGBRK_() ((void)0)
#endif #endif
#define FSP_ENTER_(...) \ #define FSP_ENTER_(...) \
@ -60,6 +65,15 @@
__VA_ARGS__; \ __VA_ARGS__; \
FsRtlExitFileSystem(); \ FsRtlExitFileSystem(); \
} }
#define FSP_ENTER_NOCRIT_(...) \
FSP_DEBUGBRK_(); \
{ \
__VA_ARGS__
#define FSP_LEAVE_NOCRIT_(...) \
goto fsp_leave_label; \
fsp_leave_label:; \
__VA_ARGS__; \
}
#define FSP_ENTER(...) \ #define FSP_ENTER(...) \
NTSTATUS Result = STATUS_SUCCESS; FSP_ENTER_(__VA_ARGS__) NTSTATUS Result = STATUS_SUCCESS; FSP_ENTER_(__VA_ARGS__)
#define FSP_LEAVE(fmt, ...) \ #define FSP_LEAVE(fmt, ...) \
@ -104,16 +118,18 @@
#define FSP_ENTER_IOC(...) \ #define FSP_ENTER_IOC(...) \
NTSTATUS Result = STATUS_SUCCESS; \ NTSTATUS Result = STATUS_SUCCESS; \
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); (VOID)IrpSp;\ PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp); (VOID)IrpSp;\
FSP_ENTER_(__VA_ARGS__) FSP_ENTER_NOCRIT_(__VA_ARGS__)
#define FSP_LEAVE_IOC(fmt, ...) \ #define FSP_LEAVE_IOC(fmt, ...) \
FSP_LEAVE_( \ FSP_LEAVE_NOCRIT_( \
FSP_DEBUGLOG_("%p, %c%c, %s%s, " fmt, "",\ FSP_DEBUGLOG_NOCRIT_("%p, %c%c, %s%s, " fmt, " = %s[%lld]",\
Irp, \ Irp, \
FspDeviceExtension(IrpSp->DeviceObject)->Kind,\ FspDeviceExtension(IrpSp->DeviceObject)->Kind,\
Irp->RequestorMode == KernelMode ? 'K' : 'U',\ Irp->RequestorMode == KernelMode ? 'K' : 'U',\
IrpMajorFunctionSym(IrpSp->MajorFunction),\ IrpMajorFunctionSym(IrpSp->MajorFunction),\
IrpMinorFunctionSym(IrpSp->MajorFunction, IrpSp->MajorFunction),\ IrpMinorFunctionSym(IrpSp->MajorFunction, IrpSp->MajorFunction),\
__VA_ARGS__); \ __VA_ARGS__, \
NtStatusSym(Result), \
(LONGLONG)Irp->IoStatus.Information);\
FspCompleteRequest(Irp, Result);\ FspCompleteRequest(Irp, Result);\
) )
#define FSP_ENTER_BOOL(...) \ #define FSP_ENTER_BOOL(...) \