DEVICE_OBJECT ;struct _DEVICE_OBJECT *AttachedDevice; // 附载的设备,与AttachedTo域构成双链表关系


DEVICE_OBJECT

  (2011-08-08 00:33:45)
转载
标签: 

杂谈

 

typedef struct _DEVICE_OBJECT { 

   CSHORT Type; 

   USHORT Size; 

   LONG ReferenceCount;                          // 引用计数值 

   struct _DRIVER_OBJECT *DriverObject;          // 指向关联的驱动程序对象 

   struct _DEVICE_OBJECT *NextDevice;     // 指向关联同一驱动程序对象的下一个设备对象 

   struct _DEVICE_OBJECT *AttachedDevice;  // 附载的设备,与AttachedTo域构成双链表关系 

   struct _IRP *CurrentIrp;                      // 当前正在处理的I/O请求包 

   PIO_TIMER Timer;                              // 设备对象的定时器 

   ULONG Flags;                         // 设备对象标志,以DO_作为前缀的一组常量 

   ULONG Characteristics;               // 设备的特征,以FILE_作为前缀的一组常量 

   PVPB Vpb;                            // 指向设备的卷参数块(Volumn Parameter Block) 

   PVOID DeviceExtension;              // 指向设备对象的扩展部分 

   DEVICE_TYPE DeviceType;             // 设备类型 

   CCHAR StackSize;                    // 设备栈的大小 

   union { 

      LIST_ENTRY ListEntry;            // 用于文件系统的设备对象,形成一个链表 

      WAIT_CONTEXT_BLOCK Wcb;          // 等待环境块,用于与控制器对象协作 

   } Queue; 

   ULONG AlignmentRequirement;         // 缓冲区的对齐要求,其值等于对齐边界减一 

   KDEVICE_QUEUE DeviceQueue;          // 设备队列,存放针对该设备的I/O请求 

   KDPC Dpc; 

   ULONG ActiveThreadCount;            // 用于文件系统:使用此设备对象的线程数 

   PSECURITY_DESCRIPTOR SecurityDescriptor;  // 设备的安全描述符 

   KEVENT DeviceLock;                  // 设备锁 

   USHORT SectorSize;                  // 扇区大小 

   USHORT Spare1; 

   struct _DEVOBJ_EXTENSION  *DeviceObjectExtension;  // 指向扩展部分 

   PVOID  Reserved; 

} DEVICE_OBJECT; 

typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; 

 

; Device Object structure definition

 

DEVICE_OBJECT STRUCT ; sizeof = 0B8h

_Type SWORD ? ; 0000h  (IO_TYPE_DEVICE = 3)  (original field name Type)

_Size WORD ? ; 0002h  (original name Size)

ReferenceCount SDWORD ? ; 0004h

DriverObject PVOID ? ; 0008h  PTR DRIVER_OBJECT

NextDevice PVOID ? ; 000Ch  PTR DEVICE_OBJECT

AttachedDevice PVOID ? ; 0010h  PTR DEVICE_OBJECT

CurrentIrp PVOID ? ; 0014h  PTR IRP

Timer PVOID ? ; 0018h  PTR IO_TIMER

Flags DWORD ? ; 001Ch  DO_*

Characteristics DWORD ? ; 0020h  FILE_*

Vpb PVOID ? ; 0024h  PTR VPB

DeviceExtension PVOID ? ; 0028h

DeviceType DWORD ? ; 002Ch  DEVICE_TYPE

StackSize BYTE ? ; 0030h

db 3 dup(?); padding

UNION Queue

ListEntry LIST_ENTRY <> ; 0034h

Wcb WAIT_CONTEXT_BLOCK <> ; 0034h

ENDS ; Queue

AlignmentRequirement DWORD ? ; 005Ch

DeviceQueue KDEVICE_QUEUE <>; 0060h

Dpc KDPC <> ; 0074h

 

; The following field is for exclusive use by the filesystem to keep

; track of the number of Fsp threads currently using the device

 

ActiveThreadCount DWORD ? ; 0094h

SecurityDescriptor PVOID ? ; 0098h  PSECURITY_DESCRIPTOR

DeviceLock KEVENT <> ; 009Ch

 

SectorSize WORD ? ; 00ACh

Spare1 WORD ? ; 00AEh

 

DeviceObjectExtension PVOID ? ; 00B0h PTR DEVOBJ_EXTENSION

Reserved PVOID ? ; 00B4h

DEVICE_OBJECT ENDS

PDEVICE_OBJECT typedef PTR DEVICE_OBJECT

 

typedef struct _DEVICE_OBJECT {
  CSHORT  Type;
  USHORT  Size;
  LONG  ReferenceCount;
  PDRIVER_OBJECT  DriverObject;
  PDEVICE_OBJECT  NextDevice;
  PDEVICE_OBJECT  AttachedDevice;
  PIRP  CurrentIrp;
  PIO_TIMER  Timer;
  ULONG  Flags;
  ULONG  Characteristics;
  __volatile PVPB  Vpb;
  PVOID  DeviceExtension;
  DEVICE_TYPE  DeviceType;
  CCHAR  StackSize;
  union {
    LIST_ENTRY  ListEntry;
    WAIT_CONTEXT_BLOCK  Wcb;
  } Queue;
  ULONG  AlignmentRequirement;
  KDEVICE_QUEUE  DeviceQueue;
  KDPC  Dpc;
  ULONG  ActiveThreadCount;
  PSECURITY_DESCRIPTOR  SecurityDescriptor;
  KEVENT  DeviceLock;
  USHORT  SectorSize;
  USHORT  Spare1;
  PDEVOBJ_EXTENSION  DeviceObjectExtension;
  PVOID  Reserved;
} DEVICE_OBJECT, *PDEVICE_OBJECT;

0

阅读 (5)   评论  (0) 收藏 (0)  转载 (0)   喜欢   打印 举报
已投稿到:
 排行榜  圈子
前一篇: 小白减肥记
后一篇: DRIVER_OBJECT


你可能感兴趣的:(DEVICE_OBJECT ;struct _DEVICE_OBJECT *AttachedDevice; // 附载的设备,与AttachedTo域构成双链表关系)