flashstar
驱动牛犊
驱动牛犊
  • 注册日期2007-06-26
  • 最后登录2008-02-25
  • 粉丝0
  • 关注0
  • 积分270分
  • 威望28点
  • 贡献值0点
  • 好评度27点
  • 原创分0分
  • 专家分0分
阅读:1256回复:1

求助:关于IoAttachDevice函数

楼主#
更多 发布于:2007-07-06 10:55
MSDN中关于IoAttachDevice的解释如下:
NTSTATUS
  IoAttachDevice(
    IN PDEVICE_OBJECT  SourceDevice,
    IN PUNICODE_STRING  TargetDevice,
    OUT PDEVICE_OBJECT  *AttachedDevice
    );

The caller can be layered only at the top of an existing chain of layered drivers. IoAttachDevice searches for the highest device object layered over TargetDevice and attaches to that object (that can be the TargetDevice). Therefore, this routine must not be called if a driver that must be higher-level has already layered itself over the target device.
大概意思是:调用该函数的的驱动只能处于已存在驱动层的最顶部,IoAttachDevice 函数会查询那些比目标设备更高层中最上层的设备,并且把当前驱动绑定到该设备。因此,这个函数不能被调用如果一个更高层的驱动已经处于目标设备的上层。

感觉没看懂这些话,好像有点前后矛盾,假设把 A绑定到 B上,按照 第一句的意思,A应该处于最顶层,这好像与最后一句话意思相反,请哪位大侠帮忙解释一下
zhaock
驱动太牛
驱动太牛
  • 注册日期2002-01-26
  • 最后登录2018-06-02
  • 粉丝3
  • 关注2
  • 积分73328分
  • 威望362317点
  • 贡献值1点
  • 好评度226点
  • 原创分0分
  • 专家分0分
  • 社区居民
沙发#
发布于:2007-07-06 11:12
你的理解不对
 Therefore, this routine must not be called if a driver that must be higher-level has already layered itself over the target device.
这句话的意思是,这个必须位于最上层的驱动,已经位于目标设备之上了(之前调用过IoAttacheDevice),就不能再调用IoAttacheDevice了(不能多次调用)
游客

返回顶部