阅读:961回复:0
Read.ByteOffset.QuadPart中的QuadPart是代表何种内容
Read.ByteOffset.QuadPart中的QuadPart是代表什么意思呢
因为程序中有几个不太明白 LONGLONG FilePointer = IrpStack->Parameters.Read.ByteOffset.QuadPart; ULONG ReadLen = IrpStack->Parameters.Read.Length; DebugPrint(\"Read %d bytes from file pointer %d\",(int)ReadLen,(int)FilePointer); // Get access to the shared buffer KIRQL irql; KeAcquireSpinLock(&BufferLock,&irql); // Check file pointer if( FilePointer<0) status = STATUS_INVALID_PARAMETER; if( FilePointer>=(LONGLONG)BufferSize) status = STATUS_END_OF_FILE; if( status==STATUS_SUCCESS) { // Get transfer count if( ((ULONG)FilePointer)+ReadLen>BufferSize) { BytesTxd = BufferSize - (ULONG)FilePointer; if( BytesTxd<0) BytesTxd = 0; } else BytesTxd = ReadLen; // Read from shared buffer if( BytesTxd>0 && Buffer!=NULL) RtlCopyMemory( Irp->AssociatedIrp.SystemBuffer, Buffer+FilePointer, BytesTxd); }为什么这里的源地址要用Buffer+FilePointer以其为什么BytesTxd = BufferSize - (ULONG)FilePointer; |
|