Win32 API 日本語リファレンス
ホームSystem.Ioctl › QUERY_FILE_LAYOUT_OUTPUT

QUERY_FILE_LAYOUT_OUTPUT

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

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

フィールド

フィールドサイズx64x86説明
FileEntryCountDWORD4+0+0返されたファイルレイアウトエントリの数。
FirstFileOffsetDWORD4+4+4最初のFILE_LAYOUT_ENTRYへのオフセット(バイト)。
FlagsDWORD4+8+8問い合わせ結果に関するフラグ。
ReservedDWORD4+12+12予約領域。0でなければならない。

各言語での定義

#include <windows.h>

// QUERY_FILE_LAYOUT_OUTPUT  (x64 16 / x86 16 バイト)
typedef struct QUERY_FILE_LAYOUT_OUTPUT {
    DWORD FileEntryCount;
    DWORD FirstFileOffset;
    DWORD Flags;
    DWORD Reserved;
} QUERY_FILE_LAYOUT_OUTPUT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct QUERY_FILE_LAYOUT_OUTPUT
{
    public uint FileEntryCount;
    public uint FirstFileOffset;
    public uint Flags;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure QUERY_FILE_LAYOUT_OUTPUT
    Public FileEntryCount As UInteger
    Public FirstFileOffset As UInteger
    Public Flags As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class QUERY_FILE_LAYOUT_OUTPUT(ctypes.Structure):
    _fields_ = [
        ("FileEntryCount", wintypes.DWORD),
        ("FirstFileOffset", wintypes.DWORD),
        ("Flags", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct QUERY_FILE_LAYOUT_OUTPUT {
    pub FileEntryCount: u32,
    pub FirstFileOffset: u32,
    pub Flags: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type QUERY_FILE_LAYOUT_OUTPUT struct {
	FileEntryCount uint32
	FirstFileOffset uint32
	Flags uint32
	Reserved uint32
}
type
  QUERY_FILE_LAYOUT_OUTPUT = record
    FileEntryCount: DWORD;
    FirstFileOffset: DWORD;
    Flags: DWORD;
    Reserved: DWORD;
  end;
const QUERY_FILE_LAYOUT_OUTPUT = extern struct {
    FileEntryCount: u32,
    FirstFileOffset: u32,
    Flags: u32,
    Reserved: u32,
};
type
  QUERY_FILE_LAYOUT_OUTPUT {.bycopy.} = object
    FileEntryCount: uint32
    FirstFileOffset: uint32
    Flags: uint32
    Reserved: uint32
struct QUERY_FILE_LAYOUT_OUTPUT
{
    uint FileEntryCount;
    uint FirstFileOffset;
    uint Flags;
    uint Reserved;
}

HSP用 定義

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

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

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