ホーム › System.Diagnostics.Debug.Extensions › DEBUG_DEVICE_OBJECT_INFO
DEBUG_DEVICE_OBJECT_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| SizeOfStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。呼び出し前に設定する。 |
| DevObjAddress | ULONGLONG | 8 | +8 | +8 | デバイスオブジェクトのアドレス。 |
| ReferenceCount | DWORD | 4 | +16 | +16 | デバイスオブジェクトの参照カウント。 |
| QBusy | BOOL | 4 | +20 | +20 | デバイスキューがビジー状態かを示すブール値。 |
| DriverObject | ULONGLONG | 8 | +24 | +24 | 関連付けられたドライバオブジェクトのアドレス。 |
| CurrentIrp | ULONGLONG | 8 | +32 | +32 | 現在処理中のIRPのアドレス。なければ0。 |
| DevExtension | ULONGLONG | 8 | +40 | +40 | デバイス拡張領域のアドレス。 |
| DevObjExtension | ULONGLONG | 8 | +48 | +48 | デバイスオブジェクト拡張のアドレス。 |
各言語での定義
#include <windows.h>
// DEBUG_DEVICE_OBJECT_INFO (x64 56 / x86 56 バイト)
typedef struct DEBUG_DEVICE_OBJECT_INFO {
DWORD SizeOfStruct;
ULONGLONG DevObjAddress;
DWORD ReferenceCount;
BOOL QBusy;
ULONGLONG DriverObject;
ULONGLONG CurrentIrp;
ULONGLONG DevExtension;
ULONGLONG DevObjExtension;
} DEBUG_DEVICE_OBJECT_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_DEVICE_OBJECT_INFO
{
public uint SizeOfStruct;
public ulong DevObjAddress;
public uint ReferenceCount;
[MarshalAs(UnmanagedType.Bool)] public bool QBusy;
public ulong DriverObject;
public ulong CurrentIrp;
public ulong DevExtension;
public ulong DevObjExtension;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_DEVICE_OBJECT_INFO
Public SizeOfStruct As UInteger
Public DevObjAddress As ULong
Public ReferenceCount As UInteger
<MarshalAs(UnmanagedType.Bool)> Public QBusy As Boolean
Public DriverObject As ULong
Public CurrentIrp As ULong
Public DevExtension As ULong
Public DevObjExtension As ULong
End Structureimport ctypes
from ctypes import wintypes
class DEBUG_DEVICE_OBJECT_INFO(ctypes.Structure):
_fields_ = [
("SizeOfStruct", wintypes.DWORD),
("DevObjAddress", ctypes.c_ulonglong),
("ReferenceCount", wintypes.DWORD),
("QBusy", wintypes.BOOL),
("DriverObject", ctypes.c_ulonglong),
("CurrentIrp", ctypes.c_ulonglong),
("DevExtension", ctypes.c_ulonglong),
("DevObjExtension", ctypes.c_ulonglong),
]#[repr(C)]
pub struct DEBUG_DEVICE_OBJECT_INFO {
pub SizeOfStruct: u32,
pub DevObjAddress: u64,
pub ReferenceCount: u32,
pub QBusy: i32,
pub DriverObject: u64,
pub CurrentIrp: u64,
pub DevExtension: u64,
pub DevObjExtension: u64,
}import "golang.org/x/sys/windows"
type DEBUG_DEVICE_OBJECT_INFO struct {
SizeOfStruct uint32
DevObjAddress uint64
ReferenceCount uint32
QBusy int32
DriverObject uint64
CurrentIrp uint64
DevExtension uint64
DevObjExtension uint64
}type
DEBUG_DEVICE_OBJECT_INFO = record
SizeOfStruct: DWORD;
DevObjAddress: UInt64;
ReferenceCount: DWORD;
QBusy: BOOL;
DriverObject: UInt64;
CurrentIrp: UInt64;
DevExtension: UInt64;
DevObjExtension: UInt64;
end;const DEBUG_DEVICE_OBJECT_INFO = extern struct {
SizeOfStruct: u32,
DevObjAddress: u64,
ReferenceCount: u32,
QBusy: i32,
DriverObject: u64,
CurrentIrp: u64,
DevExtension: u64,
DevObjExtension: u64,
};type
DEBUG_DEVICE_OBJECT_INFO {.bycopy.} = object
SizeOfStruct: uint32
DevObjAddress: uint64
ReferenceCount: uint32
QBusy: int32
DriverObject: uint64
CurrentIrp: uint64
DevExtension: uint64
DevObjExtension: uint64struct DEBUG_DEVICE_OBJECT_INFO
{
uint SizeOfStruct;
ulong DevObjAddress;
uint ReferenceCount;
int QBusy;
ulong DriverObject;
ulong CurrentIrp;
ulong DevExtension;
ulong DevObjExtension;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_DEVICE_OBJECT_INFO サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DevObjAddress : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ReferenceCount : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; QBusy : BOOL (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; DriverObject : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; CurrentIrp : ULONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; DevExtension : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; DevObjExtension : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_DEVICE_OBJECT_INFO
#field int SizeOfStruct
#field int64 DevObjAddress
#field int ReferenceCount
#field bool QBusy
#field int64 DriverObject
#field int64 CurrentIrp
#field int64 DevExtension
#field int64 DevObjExtension
#endstruct
stdim st, DEBUG_DEVICE_OBJECT_INFO ; NSTRUCT 変数を確保
st->SizeOfStruct = 100
mes "SizeOfStruct=" + st->SizeOfStruct