mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-24 09:23:37 -05:00
sys: DEBUGBREAK_EX
This commit is contained in:
parent
7e9accf68e
commit
319a0087f8
@ -198,7 +198,11 @@ VOID FspPropagateTopFlags(PIRP Irp, PIRP TopLevelIrp)
|
|||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
if (FSRTL_MAX_TOP_LEVEL_IRP_FLAG >= (UINT_PTR)TopLevelIrp)
|
if (FSRTL_MAX_TOP_LEVEL_IRP_FLAG >= (UINT_PTR)TopLevelIrp)
|
||||||
|
{
|
||||||
|
DEBUGBREAK_EX(iorecu);
|
||||||
|
|
||||||
FspIrpSetTopFlags(Irp, FspFileNodeAcquireFull);
|
FspIrpSetTopFlags(Irp, FspFileNodeAcquireFull);
|
||||||
|
}
|
||||||
else if (IO_TYPE_IRP == TopLevelIrp->Type)
|
else if (IO_TYPE_IRP == TopLevelIrp->Type)
|
||||||
{
|
{
|
||||||
PFILE_OBJECT FileObject = IoGetCurrentIrpStackLocation(Irp)->FileObject;
|
PFILE_OBJECT FileObject = IoGetCurrentIrpStackLocation(Irp)->FileObject;
|
||||||
@ -207,6 +211,8 @@ VOID FspPropagateTopFlags(PIRP Irp, PIRP TopLevelIrp)
|
|||||||
FileObject->FsContext == TopLevelFileObject->FsContext &&
|
FileObject->FsContext == TopLevelFileObject->FsContext &&
|
||||||
FspFileNodeIsValid(FileObject->FsContext))
|
FspFileNodeIsValid(FileObject->FsContext))
|
||||||
{
|
{
|
||||||
|
DEBUGBREAK_EX(iorecu);
|
||||||
|
|
||||||
FspIrpSetTopFlags(Irp, FspIrpFlags(TopLevelIrp));
|
FspIrpSetTopFlags(Irp, FspIrpFlags(TopLevelIrp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,12 @@ extern __declspec(selectany) int fsp_dp = 1;
|
|||||||
|
|
||||||
/* DEBUGBREAK */
|
/* DEBUGBREAK */
|
||||||
#if DBG
|
#if DBG
|
||||||
extern __declspec(selectany) int fsp_bp = 1;
|
extern __declspec(selectany) int fsp_bp = 1; /* generic breakpoint switch */
|
||||||
|
extern __declspec(selectany) int fsp_bp_ioentr = 1; /* I/O entry breakpoint switch */
|
||||||
|
extern __declspec(selectany) int fsp_bp_ioprep = 1; /* I/O prepare breakpoint switch */
|
||||||
|
extern __declspec(selectany) int fsp_bp_iocmpl = 1; /* I/O complete breakpoint switch */
|
||||||
|
extern __declspec(selectany) int fsp_bp_iocall = 1; /* I/O callback breakpoint switch */
|
||||||
|
extern __declspec(selectany) int fsp_bp_iorecu = 1; /* I/O recursive breakpoint switch */
|
||||||
#define DEBUGBREAK() \
|
#define DEBUGBREAK() \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
@ -67,8 +72,16 @@ extern __declspec(selectany) int fsp_bp = 1;
|
|||||||
if (bp && fsp_bp && !KD_DEBUGGER_NOT_PRESENT)\
|
if (bp && fsp_bp && !KD_DEBUGGER_NOT_PRESENT)\
|
||||||
DbgBreakPoint(); \
|
DbgBreakPoint(); \
|
||||||
} while (0,0)
|
} while (0,0)
|
||||||
|
#define DEBUGBREAK_EX(category) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
static int bp = 1; \
|
||||||
|
if (bp && fsp_bp && fsp_bp_ ## category && !KD_DEBUGGER_NOT_PRESENT)\
|
||||||
|
DbgBreakPoint(); \
|
||||||
|
} while (0,0)
|
||||||
#else
|
#else
|
||||||
#define DEBUGBREAK() do {} while (0,0)
|
#define DEBUGBREAK() do {} while (0,0)
|
||||||
|
#define DEBUGBREAK_EX(category) do {} while (0,0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* DEBUGTEST */
|
/* DEBUGTEST */
|
||||||
@ -95,8 +108,8 @@ extern __declspec(selectany) int fsp_dt = 1;
|
|||||||
#define FSP_DEBUGLOG_(fmt, rfmt, ...) ((void)0)
|
#define FSP_DEBUGLOG_(fmt, rfmt, ...) ((void)0)
|
||||||
#define FSP_DEBUGLOG_NOCRIT_(fmt, rfmt, ...)((void)0)
|
#define FSP_DEBUGLOG_NOCRIT_(fmt, rfmt, ...)((void)0)
|
||||||
#endif
|
#endif
|
||||||
#define FSP_ENTER_(...) \
|
#define FSP_ENTER_(bpcat, ...) \
|
||||||
DEBUGBREAK(); \
|
DEBUGBREAK_EX(bpcat); \
|
||||||
FsRtlEnterFileSystem(); \
|
FsRtlEnterFileSystem(); \
|
||||||
try \
|
try \
|
||||||
{ \
|
{ \
|
||||||
@ -110,8 +123,8 @@ extern __declspec(selectany) int fsp_dt = 1;
|
|||||||
__VA_ARGS__; \
|
__VA_ARGS__; \
|
||||||
FsRtlExitFileSystem(); \
|
FsRtlExitFileSystem(); \
|
||||||
}
|
}
|
||||||
#define FSP_ENTER_NOCRIT_(...) \
|
#define FSP_ENTER_NOCRIT_(bpcat, ...) \
|
||||||
DEBUGBREAK(); \
|
DEBUGBREAK_EX(bpcat); \
|
||||||
{ \
|
{ \
|
||||||
__VA_ARGS__
|
__VA_ARGS__
|
||||||
#define FSP_LEAVE_NOCRIT_(...) \
|
#define FSP_LEAVE_NOCRIT_(...) \
|
||||||
@ -120,7 +133,7 @@ extern __declspec(selectany) int fsp_dt = 1;
|
|||||||
__VA_ARGS__; \
|
__VA_ARGS__; \
|
||||||
}
|
}
|
||||||
#define FSP_ENTER(...) \
|
#define FSP_ENTER(...) \
|
||||||
NTSTATUS Result = STATUS_SUCCESS; FSP_ENTER_(__VA_ARGS__)
|
NTSTATUS Result = STATUS_SUCCESS; FSP_ENTER_(iocall, __VA_ARGS__)
|
||||||
#define FSP_LEAVE(fmt, ...) \
|
#define FSP_LEAVE(fmt, ...) \
|
||||||
FSP_LEAVE_(FSP_DEBUGLOG_(fmt, " = %s", __VA_ARGS__, NtStatusSym(Result))); return Result
|
FSP_LEAVE_(FSP_DEBUGLOG_(fmt, " = %s", __VA_ARGS__, NtStatusSym(Result))); return Result
|
||||||
#define FSP_ENTER_MJ(...) \
|
#define FSP_ENTER_MJ(...) \
|
||||||
@ -128,7 +141,7 @@ extern __declspec(selectany) int fsp_dt = 1;
|
|||||||
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);\
|
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);\
|
||||||
BOOLEAN fsp_device_deref = FALSE; \
|
BOOLEAN fsp_device_deref = FALSE; \
|
||||||
PIRP fsp_top_level_irp = IoGetTopLevelIrp();\
|
PIRP fsp_top_level_irp = IoGetTopLevelIrp();\
|
||||||
FSP_ENTER_(__VA_ARGS__); \
|
FSP_ENTER_(ioentr, __VA_ARGS__); \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
if (0 != fsp_top_level_irp) \
|
if (0 != fsp_top_level_irp) \
|
||||||
@ -176,7 +189,7 @@ extern __declspec(selectany) int fsp_dt = 1;
|
|||||||
#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_NOCRIT_(__VA_ARGS__)
|
FSP_ENTER_NOCRIT_(iocmpl, __VA_ARGS__)
|
||||||
#define FSP_LEAVE_IOC(fmt, ...) \
|
#define FSP_LEAVE_IOC(fmt, ...) \
|
||||||
FSP_LEAVE_NOCRIT_( \
|
FSP_LEAVE_NOCRIT_( \
|
||||||
if (STATUS_PENDING != Result) \
|
if (STATUS_PENDING != Result) \
|
||||||
@ -196,11 +209,11 @@ extern __declspec(selectany) int fsp_dt = 1;
|
|||||||
); \
|
); \
|
||||||
return Result
|
return Result
|
||||||
#define FSP_ENTER_BOOL(...) \
|
#define FSP_ENTER_BOOL(...) \
|
||||||
BOOLEAN Result = TRUE; FSP_ENTER_(__VA_ARGS__)
|
BOOLEAN Result = TRUE; FSP_ENTER_(iocall, __VA_ARGS__)
|
||||||
#define FSP_LEAVE_BOOL(fmt, ...) \
|
#define FSP_LEAVE_BOOL(fmt, ...) \
|
||||||
FSP_LEAVE_(FSP_DEBUGLOG_(fmt, " = %s", __VA_ARGS__, Result ? "TRUE" : "FALSE")); return Result
|
FSP_LEAVE_(FSP_DEBUGLOG_(fmt, " = %s", __VA_ARGS__, Result ? "TRUE" : "FALSE")); return Result
|
||||||
#define FSP_ENTER_VOID(...) \
|
#define FSP_ENTER_VOID(...) \
|
||||||
FSP_ENTER_(__VA_ARGS__)
|
FSP_ENTER_(iocall, __VA_ARGS__)
|
||||||
#define FSP_LEAVE_VOID(fmt, ...) \
|
#define FSP_LEAVE_VOID(fmt, ...) \
|
||||||
FSP_LEAVE_(FSP_DEBUGLOG_(fmt, "", __VA_ARGS__))
|
FSP_LEAVE_(FSP_DEBUGLOG_(fmt, "", __VA_ARGS__))
|
||||||
#define FSP_RETURN(...) \
|
#define FSP_RETURN(...) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user