ホーム › Storage.IscsiDisc › DUMP_DRIVER
DUMP_DRIVER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| DumpDriverList | void* | 8/4 | +0 | +0 | ダンプドライバーのリストへのポインタ。 |
| DriverName | WCHAR | 30 | +8 | +4 | ダンプドライバーのファイル名(WCHAR配列)。 |
| BaseName | WCHAR | 30 | +38 | +34 | ダンプドライバーのベース名(WCHAR配列)。 |
各言語での定義
#include <windows.h>
// DUMP_DRIVER (x64 72 / x86 64 バイト)
typedef struct DUMP_DRIVER {
void* DumpDriverList;
WCHAR DriverName[15];
WCHAR BaseName[15];
} DUMP_DRIVER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DUMP_DRIVER
{
public IntPtr DumpDriverList;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 15)] public string DriverName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 15)] public string BaseName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DUMP_DRIVER
Public DumpDriverList As IntPtr
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=15)> Public DriverName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=15)> Public BaseName As String
End Structureimport ctypes
from ctypes import wintypes
class DUMP_DRIVER(ctypes.Structure):
_fields_ = [
("DumpDriverList", ctypes.c_void_p),
("DriverName", ctypes.c_wchar * 15),
("BaseName", ctypes.c_wchar * 15),
]#[repr(C)]
pub struct DUMP_DRIVER {
pub DumpDriverList: *mut core::ffi::c_void,
pub DriverName: [u16; 15],
pub BaseName: [u16; 15],
}import "golang.org/x/sys/windows"
type DUMP_DRIVER struct {
DumpDriverList uintptr
DriverName [15]uint16
BaseName [15]uint16
}type
DUMP_DRIVER = record
DumpDriverList: Pointer;
DriverName: array[0..14] of WideChar;
BaseName: array[0..14] of WideChar;
end;const DUMP_DRIVER = extern struct {
DumpDriverList: ?*anyopaque,
DriverName: [15]u16,
BaseName: [15]u16,
};type
DUMP_DRIVER {.bycopy.} = object
DumpDriverList: pointer
DriverName: array[15, uint16]
BaseName: array[15, uint16]struct DUMP_DRIVER
{
void* DumpDriverList;
wchar[15] DriverName;
wchar[15] BaseName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DUMP_DRIVER サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; DumpDriverList : void* (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DriverName : WCHAR (+4, 30byte) varptr(st)+4 を基点に操作(30byte:入れ子/配列)
; BaseName : WCHAR (+34, 30byte) varptr(st)+34 を基点に操作(30byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DUMP_DRIVER サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; DumpDriverList : void* (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; DriverName : WCHAR (+8, 30byte) varptr(st)+8 を基点に操作(30byte:入れ子/配列)
; BaseName : WCHAR (+38, 30byte) varptr(st)+38 を基点に操作(30byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DUMP_DRIVER
#field intptr DumpDriverList
#field wchar DriverName 15
#field wchar BaseName 15
#endstruct
stdim st, DUMP_DRIVER ; NSTRUCT 変数を確保