wanggang508
驱动小牛
驱动小牛
  • 注册日期2003-08-24
  • 最后登录2005-03-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:843回复:1

请教USB驱动程序中的一条指令的含义?

楼主#
更多 发布于:2004-09-15 21:50
谁能解释一下驱动程序自定义例程中这句话的意思:
if(I.IoctlOutputBufferSize()||I.IoctlInputBufferSize()||I.IoctlBuffer())和
if(!I.IoctlBuffer()||(I.IoctlInputBufferSize()!=sizeof(DWORD))||I.IoctlOutputBufferSize())        
 谢谢啦!!
多多交流,少走弯路!!!
wanggang508
驱动小牛
驱动小牛
  • 注册日期2003-08-24
  • 最后登录2005-03-01
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-09-15 22:41
这是一个例子:
__try
  {
// TODO: Verify that the input parameters are correct
//If not, return STATUS_INVALID_PARAMETER
if(I.IoctlOutputBufferSize()||I.IoctlInputBufferSize()
||I.IoctlBuffer())                              
__leave;
// TODO: Handle the the USBD12_IOCTL_START_AD request, or
//defer the processing of the IRP (i.e. by queuing) and set
//status to STATUS_PENDING.
PURB pUrb = m_Lower.BuildVendorRequest(
NULL,
0,
0,
D12×××,
0
);
status = m_Lower.SubmitUrb(pUrb,NULL,NULL,5000L);
  }
  __finally
  {

// TODO: Assuming that the request was handled here. Set I.Information
// to indicate how much data to copy back to the user.
I.Information() = 0;
I.Status()=status;

  }
  return status;
}
为啥I.IoctlOutputBufferSize()、I.IoctlInputBufferSize()
和I.IoctlBuffer()都不为1时才发送urb?
向各位大侠请教啦?先谢谢啦      
多多交流,少走弯路!!!
游客

返回顶部