阅读:1059回复:2
如何获得KIrp中输入缓冲区中收到数据的数量?
NTSTATUS SYSTunerDevice::IOCTL_Tuner_Handler(KIrp I)
{ T.Trace(TraceInfo, __FUNCTION__"++. IRP %p\n", I); NTSTATUS status = STATUS_SUCCESS; ULONG inputSize = I.IoctlInputBufferSize();// ULONG outputSize = I.IoctlOutputBufferSize(); // Buffered ioctl - using the same buffer so read the buffer before writing the buffer PVOID inputBuffer = I.IoctlBuffer(); PVOID outputBuffer = I.IoctlBuffer(); // TODO: Validate the parameters of the IRP. Replace "FALSE" // in the following line with error checking code that // evaulates to TRUE if the request is not valid. if ( sizeof(TUNERPARA) != ????) //想在这里判断收到的数据数量是否等于期望得到的数据量sizeof(TUNERPARA) ,如何得到? { status = STATUS_INVALID_PARAMETER; I.Information() = 0; } else 如何获得KIrp中输入缓冲区中收到数据的数量? 查找了一下KIrp中好像也没有相关函数 |
|
沙发#
发布于:2008-01-08 09:21
如果你是在某个传输之后要看看KIrp中输入缓冲区中收到数据的数量,比如你用的是中断传输,那么你可以用sizeof(m_pUrb->UrbBulkOrInterruptTransfer.TransferBuffer),
其中m_pUrb是你创建的传输块。 |
|
|
板凳#
发布于:2008-01-08 10:03
可是我的数据是放在PVOID inputBuffer = I.IoctlBuffer()这个指针所表示的缓冲区中的,这个时候怎么办?
|
|