ホーム › System.Ioctl › DEVICE_DSM_LOST_QUERY_OUTPUT
DEVICE_DSM_LOST_QUERY_OUTPUT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | 構造体のバージョン番号。 |
| Size | DWORD | 4 | +4 | +4 | この構造体のサイズをバイト単位で示す。 |
| Alignment | ULONGLONG | 8 | +8 | +8 | ビットマップが表す範囲のアライメントをバイト単位で示す。 |
| NumberOfBits | DWORD | 4 | +16 | +16 | BitMapの有効ビット数。 |
| BitMap | DWORD | 4 | +20 | +20 | 各粒度単位のデータ喪失状態を表すビットマップの可変長配列。 |
各言語での定義
#include <windows.h>
// DEVICE_DSM_LOST_QUERY_OUTPUT (x64 24 / x86 24 バイト)
typedef struct DEVICE_DSM_LOST_QUERY_OUTPUT {
DWORD Version;
DWORD Size;
ULONGLONG Alignment;
DWORD NumberOfBits;
DWORD BitMap[1];
} DEVICE_DSM_LOST_QUERY_OUTPUT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEVICE_DSM_LOST_QUERY_OUTPUT
{
public uint Version;
public uint Size;
public ulong Alignment;
public uint NumberOfBits;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public uint[] BitMap;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEVICE_DSM_LOST_QUERY_OUTPUT
Public Version As UInteger
Public Size As UInteger
Public Alignment As ULong
Public NumberOfBits As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public BitMap() As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DEVICE_DSM_LOST_QUERY_OUTPUT(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("Size", wintypes.DWORD),
("Alignment", ctypes.c_ulonglong),
("NumberOfBits", wintypes.DWORD),
("BitMap", wintypes.DWORD * 1),
]#[repr(C)]
pub struct DEVICE_DSM_LOST_QUERY_OUTPUT {
pub Version: u32,
pub Size: u32,
pub Alignment: u64,
pub NumberOfBits: u32,
pub BitMap: [u32; 1],
}import "golang.org/x/sys/windows"
type DEVICE_DSM_LOST_QUERY_OUTPUT struct {
Version uint32
Size uint32
Alignment uint64
NumberOfBits uint32
BitMap [1]uint32
}type
DEVICE_DSM_LOST_QUERY_OUTPUT = record
Version: DWORD;
Size: DWORD;
Alignment: UInt64;
NumberOfBits: DWORD;
BitMap: array[0..0] of DWORD;
end;const DEVICE_DSM_LOST_QUERY_OUTPUT = extern struct {
Version: u32,
Size: u32,
Alignment: u64,
NumberOfBits: u32,
BitMap: [1]u32,
};type
DEVICE_DSM_LOST_QUERY_OUTPUT {.bycopy.} = object
Version: uint32
Size: uint32
Alignment: uint64
NumberOfBits: uint32
BitMap: array[1, uint32]struct DEVICE_DSM_LOST_QUERY_OUTPUT
{
uint Version;
uint Size;
ulong Alignment;
uint NumberOfBits;
uint[1] BitMap;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEVICE_DSM_LOST_QUERY_OUTPUT サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Alignment : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; NumberOfBits : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; BitMap : DWORD (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEVICE_DSM_LOST_QUERY_OUTPUT
#field int Version
#field int Size
#field int64 Alignment
#field int NumberOfBits
#field int BitMap 1
#endstruct
stdim st, DEVICE_DSM_LOST_QUERY_OUTPUT ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version