Win32 API 日本語リファレンス
ホームStorage.InstallableFileSystems › INSTANCE_PARTIAL_INFORMATION

INSTANCE_PARTIAL_INFORMATION

構造体
サイズx64: 12 バイト / x86: 12 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
NextEntryOffsetDWORD4+0+0次のエントリへのバイトオフセット。0なら最終エントリ。
InstanceNameLengthWORD2+4+4インスタンス名のバイト長。
InstanceNameBufferOffsetWORD2+6+6構造体先頭からインスタンス名文字列までのバイトオフセット。
AltitudeLengthWORD2+8+8アルティチュード文字列のバイト長。
AltitudeBufferOffsetWORD2+10+10構造体先頭からアルティチュード文字列までのバイトオフセット。

各言語での定義

#include <windows.h>

// INSTANCE_PARTIAL_INFORMATION  (x64 12 / x86 12 バイト)
typedef struct INSTANCE_PARTIAL_INFORMATION {
    DWORD NextEntryOffset;
    WORD InstanceNameLength;
    WORD InstanceNameBufferOffset;
    WORD AltitudeLength;
    WORD AltitudeBufferOffset;
} INSTANCE_PARTIAL_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct INSTANCE_PARTIAL_INFORMATION
{
    public uint NextEntryOffset;
    public ushort InstanceNameLength;
    public ushort InstanceNameBufferOffset;
    public ushort AltitudeLength;
    public ushort AltitudeBufferOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure INSTANCE_PARTIAL_INFORMATION
    Public NextEntryOffset As UInteger
    Public InstanceNameLength As UShort
    Public InstanceNameBufferOffset As UShort
    Public AltitudeLength As UShort
    Public AltitudeBufferOffset As UShort
End Structure
import ctypes
from ctypes import wintypes

class INSTANCE_PARTIAL_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("NextEntryOffset", wintypes.DWORD),
        ("InstanceNameLength", ctypes.c_ushort),
        ("InstanceNameBufferOffset", ctypes.c_ushort),
        ("AltitudeLength", ctypes.c_ushort),
        ("AltitudeBufferOffset", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct INSTANCE_PARTIAL_INFORMATION {
    pub NextEntryOffset: u32,
    pub InstanceNameLength: u16,
    pub InstanceNameBufferOffset: u16,
    pub AltitudeLength: u16,
    pub AltitudeBufferOffset: u16,
}
import "golang.org/x/sys/windows"

type INSTANCE_PARTIAL_INFORMATION struct {
	NextEntryOffset uint32
	InstanceNameLength uint16
	InstanceNameBufferOffset uint16
	AltitudeLength uint16
	AltitudeBufferOffset uint16
}
type
  INSTANCE_PARTIAL_INFORMATION = record
    NextEntryOffset: DWORD;
    InstanceNameLength: Word;
    InstanceNameBufferOffset: Word;
    AltitudeLength: Word;
    AltitudeBufferOffset: Word;
  end;
const INSTANCE_PARTIAL_INFORMATION = extern struct {
    NextEntryOffset: u32,
    InstanceNameLength: u16,
    InstanceNameBufferOffset: u16,
    AltitudeLength: u16,
    AltitudeBufferOffset: u16,
};
type
  INSTANCE_PARTIAL_INFORMATION {.bycopy.} = object
    NextEntryOffset: uint32
    InstanceNameLength: uint16
    InstanceNameBufferOffset: uint16
    AltitudeLength: uint16
    AltitudeBufferOffset: uint16
struct INSTANCE_PARTIAL_INFORMATION
{
    uint NextEntryOffset;
    ushort InstanceNameLength;
    ushort InstanceNameBufferOffset;
    ushort AltitudeLength;
    ushort AltitudeBufferOffset;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; INSTANCE_PARTIAL_INFORMATION サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; NextEntryOffset : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; InstanceNameLength : WORD (+4, 2byte)  wpoke st,4,値  /  値 = wpeek(st,4)
; InstanceNameBufferOffset : WORD (+6, 2byte)  wpoke st,6,値  /  値 = wpeek(st,6)
; AltitudeLength : WORD (+8, 2byte)  wpoke st,8,値  /  値 = wpeek(st,8)
; AltitudeBufferOffset : WORD (+10, 2byte)  wpoke st,10,値  /  値 = wpeek(st,10)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global INSTANCE_PARTIAL_INFORMATION
    #field int NextEntryOffset
    #field short InstanceNameLength
    #field short InstanceNameBufferOffset
    #field short AltitudeLength
    #field short AltitudeBufferOffset
#endstruct

stdim st, INSTANCE_PARTIAL_INFORMATION        ; NSTRUCT 変数を確保
st->NextEntryOffset = 100
mes "NextEntryOffset=" + st->NextEntryOffset