阅读:2900回复:0
关于设备对象相关的DEVOBJ_EXTENSION 结构中没有AttachedTo成员
请问设备对象中 struct _DEVOBJ_EXTENSION *DeviceObjectExtension这个成员在2k以上系统有一个AttachedTo指针,但是我的winxp ddk中ntddk.h没有这个定义啊,
请问是要自己定义还是打ddk补丁. 我的ddk中 _DEVOBJ_EXTENSION 结构定义如下 typedef struct _DEVOBJ_EXTENSION { CSHORT Type; USHORT Size; // // Public part of the DeviceObjectExtension structure // PDEVICE_OBJECT DeviceObject; // owning device object } DEVOBJ_EXTENSION, *PDEVOBJ_EXTENSION; 顺便问一下,我想动态把我的设备插入设备栈,但是不堆叠到栈顶,类似这样手工更新指针可不可行? PDEVICE_OBJECT IoInsertDeviceToDeviceStack( IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice ) { PDEVICE_OBJECT DeviceObject= TargetDevice->AttachedDevice; SourceDevice->AttachedDevice = TargetDevice-> AttachedDevice; SourceDevice-> DeviceObjectExtension -> DeviceObject = TargetDevice; //这里发现没有定义AttachedTo, 这个DeviceObject 指针是什么?? //SourceDevice-> DeviceObjectExtension -> AttachedTo= TargetDevice; SourceDevice-> StackSize= TargetDevice->StackSize +1; SourceDevice-> AlignmentRequirement= TargetDevice-> AlignmentRequirement; while(DeviceObject->AttachedDevice) { DeviceObject->StackSize ++; DeviceObject = DeviceObject->AttachedDevice; } return TargetDevice; } |
|