dlianghui
驱动牛犊
驱动牛犊
  • 注册日期2003-02-16
  • 最后登录2003-09-19
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:962回复:0

Read.ByteOffset.QuadPart中的QuadPart是代表何种内容

楼主#
更多 发布于:2003-09-18 10:55
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;
游客

返回顶部