ホーム › Storage.FileSystem › NTMS_IEDOORINFORMATION
NTMS_IEDOORINFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Number | DWORD | 4 | +0 | +0 | ドア番号。 |
| State | DWORD | 4 | +4 | +4 | ドアの状態を示す値。開/閉等。 |
| MaxOpenSecs | WORD | 2 | +8 | +8 | ドアを開いたままにできる最大時間。秒単位。 |
| Library | GUID | 16 | +12 | +12 | ドアが属するライブラリのGUID。 |
各言語での定義
#include <windows.h>
// NTMS_IEDOORINFORMATION (x64 28 / x86 28 バイト)
typedef struct NTMS_IEDOORINFORMATION {
DWORD Number;
DWORD State;
WORD MaxOpenSecs;
GUID Library;
} NTMS_IEDOORINFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NTMS_IEDOORINFORMATION
{
public uint Number;
public uint State;
public ushort MaxOpenSecs;
public Guid Library;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NTMS_IEDOORINFORMATION
Public Number As UInteger
Public State As UInteger
Public MaxOpenSecs As UShort
Public Library As Guid
End Structureimport ctypes
from ctypes import wintypes
class NTMS_IEDOORINFORMATION(ctypes.Structure):
_fields_ = [
("Number", wintypes.DWORD),
("State", wintypes.DWORD),
("MaxOpenSecs", ctypes.c_ushort),
("Library", GUID),
]#[repr(C)]
pub struct NTMS_IEDOORINFORMATION {
pub Number: u32,
pub State: u32,
pub MaxOpenSecs: u16,
pub Library: GUID,
}import "golang.org/x/sys/windows"
type NTMS_IEDOORINFORMATION struct {
Number uint32
State uint32
MaxOpenSecs uint16
Library windows.GUID
}type
NTMS_IEDOORINFORMATION = record
Number: DWORD;
State: DWORD;
MaxOpenSecs: Word;
Library: TGUID;
end;const NTMS_IEDOORINFORMATION = extern struct {
Number: u32,
State: u32,
MaxOpenSecs: u16,
Library: GUID,
};type
NTMS_IEDOORINFORMATION {.bycopy.} = object
Number: uint32
State: uint32
MaxOpenSecs: uint16
Library: GUIDstruct NTMS_IEDOORINFORMATION
{
uint Number;
uint State;
ushort MaxOpenSecs;
GUID Library;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NTMS_IEDOORINFORMATION サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Number : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; State : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; MaxOpenSecs : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; Library : GUID (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global NTMS_IEDOORINFORMATION
#field int Number
#field int State
#field short MaxOpenSecs
#field GUID Library
#endstruct
stdim st, NTMS_IEDOORINFORMATION ; NSTRUCT 変数を確保
st->Number = 100
mes "Number=" + st->Number