Windows Driver中的IoCancelIrp源码如下:
相关宏定义如下:
//
// MessageId: CANCEL_STATE_IN_COMPLETED_IRP //IRP Cancel错误标识
//
// MessageText:
//
// CANCEL_STATE_IN_COMPLETED_IRP
//
#define CANCEL_STATE_IN_COMPLETED_IRP ((ULONG)0x00000048L)
#define IOV_CANCEL_IRP(Irp, ReturnValue) \
IovCancelIrp((Irp), (ReturnValue))
#define InterlockedExchangePointer(Target, Value) \
(PVOID)InterlockedExchange((PLONG)(Target), (LONG)(Value))
IoCancelIrp接口代码如下:
IoCancelIrp(
IN PIRP Irp
)
/*++
Routine Description:
This routine is invoked to cancel an individual I/O Request Packet.
It acquires the cancel spin lock, sets the cancel flag in the IRP, and
&nb