DeviceExtenson和DeviceObjectExtension关系猜测
2011-06-17 14:28
393 查看
用WinDbg顺便看了下_DEVICE_OBJECT结构,看到了之前疑惑的2个结构:
kd> dt _device_object 0x821899c8
nt!_DEVICE_OBJECT
+0x000 Type : 0n3
+0x002 Size : 0xd0
+0x004 ReferenceCount : 0n0
+0x008 DriverObject : 0x82339f38 _DRIVER_OBJECT
+0x00c NextDevice : (null)
+0x010 AttachedDevice : (null)
+0x014 CurrentIrp : (null)
+0x018 Timer : (null)
+0x01c Flags : 0x2044
+0x020 Characteristics : 0
+0x024 Vpb : (null)
+0x028 DeviceExtension : 0x82189a80 Void
+0x02c DeviceType : 0x22
+0x030 StackSize : 2 ''
+0x034 Queue : __unnamed
+0x05c AlignmentRequirement : 0
+0x060 DeviceQueue : _KDEVICE_QUEUE
+0x074 Dpc : _KDPC
+0x094 ActiveThreadCount : 0
+0x098 SecurityDescriptor : 0xe1333cf0 Void
+0x09c DeviceLock : _KEVENT
+0x0ac SectorSize : 0
+0x0ae Spare1 : 0
+0x0b0 DeviceObjectExtension : 0x82189a98 _DEVOBJ_EXTENSION
+0x0b4 Reserved : (null)
自己注册的DEVICE_EXTENSION结构如下,IoCreateDevice函数的第2个参数DeviceExtensionSize就是这个结构的大小,我的定义如下:
typedef struct _DEVICE_EXTENSION
{
PDEVICE_OBJECT fdo;
PDEVICE_OBJECT NextStackDevice;
UNICODE_STRING ustrDeviceName; // 设备名
UNICODE_STRING ustrSymLinkName; // 符号链接名
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
占用了0x18 bytes
结合上面WinDbg打印数据看,应该是DeviceObjectExtension直接跟在DeviceExtension后面,统一存在一块内存中组成完整的一块设备扩展。
kd> dt _device_object 0x821899c8
nt!_DEVICE_OBJECT
+0x000 Type : 0n3
+0x002 Size : 0xd0
+0x004 ReferenceCount : 0n0
+0x008 DriverObject : 0x82339f38 _DRIVER_OBJECT
+0x00c NextDevice : (null)
+0x010 AttachedDevice : (null)
+0x014 CurrentIrp : (null)
+0x018 Timer : (null)
+0x01c Flags : 0x2044
+0x020 Characteristics : 0
+0x024 Vpb : (null)
+0x028 DeviceExtension : 0x82189a80 Void
+0x02c DeviceType : 0x22
+0x030 StackSize : 2 ''
+0x034 Queue : __unnamed
+0x05c AlignmentRequirement : 0
+0x060 DeviceQueue : _KDEVICE_QUEUE
+0x074 Dpc : _KDPC
+0x094 ActiveThreadCount : 0
+0x098 SecurityDescriptor : 0xe1333cf0 Void
+0x09c DeviceLock : _KEVENT
+0x0ac SectorSize : 0
+0x0ae Spare1 : 0
+0x0b0 DeviceObjectExtension : 0x82189a98 _DEVOBJ_EXTENSION
+0x0b4 Reserved : (null)
自己注册的DEVICE_EXTENSION结构如下,IoCreateDevice函数的第2个参数DeviceExtensionSize就是这个结构的大小,我的定义如下:
typedef struct _DEVICE_EXTENSION
{
PDEVICE_OBJECT fdo;
PDEVICE_OBJECT NextStackDevice;
UNICODE_STRING ustrDeviceName; // 设备名
UNICODE_STRING ustrSymLinkName; // 符号链接名
} DEVICE_EXTENSION, *PDEVICE_EXTENSION;
占用了0x18 bytes
结合上面WinDbg打印数据看,应该是DeviceObjectExtension直接跟在DeviceExtension后面,统一存在一块内存中组成完整的一块设备扩展。
相关文章推荐
- DeviceExtenson和DeviceObjectExtension关系猜测
- DeviceExtenson和DeviceObjectExtension关系猜测
- DRIVER_OBJECT和DEVICE_OBJECT的关系
- DEVICE_OBJECT ;struct _DEVICE_OBJECT *AttachedDevice; // 附载的设备,与AttachedTo域构成双链表关系
- Device_object_extension 方便反汇编
- Class、Object的关系
- linux bus、driver、device及三者的关系
- JAVA_对象一对一关系 ObjectOneToOneRelationship.java
- Object,GameObject,Behaviour,Component,等各组件直接的关系图
- 23对接收数组参数的成员方法进行反射24 数组与Object的关系及其反射类型25 数组的反射应用
- VirtualBox Guest Addtions and USB Extension Pack,Ghost and Host share USB device
- IoGetRelatedDeviceObject学习
- 一个差点被IoGetDeviceObjectPointer搞死的菜鸟
- linux resouce,platform_device和platform_driver驱动的关系
- 一步一步学Ruby(五): Class, Module, Object,Kernel的关系
- 顿悟JAVA,自己实现Object的Clone的约束关系(上)
- [原创]Object/DataSet Relational Mapping(对象/数据集关系映射)
- bus, device, driver 三者之间的关系
- Javascript中的函数(Function)与对象(Object)的关系
- Interface与Object之间的关系问题