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

FDICABINETINFO

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

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

フィールド

フィールドサイズx64x86説明
cbCabinetINT4+0+0キャビネットファイル全体のバイトサイズを表す。
cFoldersWORD2+4+4キャビネット内のフォルダー数を表す。
cFilesWORD2+6+6キャビネット内のファイル数を表す。
setIDWORD2+8+8キャビネットセットを識別するID。
iCabinetWORD2+10+10セット内でのキャビネットの連番を表す。
fReserveBOOL4+12+12予約領域が存在するかを示すフラグ。
hasprevBOOL4+16+16前のキャビネットに続くファイルがあるかを示すフラグ。
hasnextBOOL4+20+20次のキャビネットに続くファイルがあるかを示すフラグ。

各言語での定義

#include <windows.h>

// FDICABINETINFO  (x64 24 / x86 24 バイト)
typedef struct FDICABINETINFO {
    INT cbCabinet;
    WORD cFolders;
    WORD cFiles;
    WORD setID;
    WORD iCabinet;
    BOOL fReserve;
    BOOL hasprev;
    BOOL hasnext;
} FDICABINETINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FDICABINETINFO
{
    public int cbCabinet;
    public ushort cFolders;
    public ushort cFiles;
    public ushort setID;
    public ushort iCabinet;
    [MarshalAs(UnmanagedType.Bool)] public bool fReserve;
    [MarshalAs(UnmanagedType.Bool)] public bool hasprev;
    [MarshalAs(UnmanagedType.Bool)] public bool hasnext;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FDICABINETINFO
    Public cbCabinet As Integer
    Public cFolders As UShort
    Public cFiles As UShort
    Public setID As UShort
    Public iCabinet As UShort
    <MarshalAs(UnmanagedType.Bool)> Public fReserve As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public hasprev As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public hasnext As Boolean
End Structure
import ctypes
from ctypes import wintypes

class FDICABINETINFO(ctypes.Structure):
    _fields_ = [
        ("cbCabinet", ctypes.c_int),
        ("cFolders", ctypes.c_ushort),
        ("cFiles", ctypes.c_ushort),
        ("setID", ctypes.c_ushort),
        ("iCabinet", ctypes.c_ushort),
        ("fReserve", wintypes.BOOL),
        ("hasprev", wintypes.BOOL),
        ("hasnext", wintypes.BOOL),
    ]
#[repr(C)]
pub struct FDICABINETINFO {
    pub cbCabinet: i32,
    pub cFolders: u16,
    pub cFiles: u16,
    pub setID: u16,
    pub iCabinet: u16,
    pub fReserve: i32,
    pub hasprev: i32,
    pub hasnext: i32,
}
import "golang.org/x/sys/windows"

type FDICABINETINFO struct {
	cbCabinet int32
	cFolders uint16
	cFiles uint16
	setID uint16
	iCabinet uint16
	fReserve int32
	hasprev int32
	hasnext int32
}
type
  FDICABINETINFO = record
    cbCabinet: Integer;
    cFolders: Word;
    cFiles: Word;
    setID: Word;
    iCabinet: Word;
    fReserve: BOOL;
    hasprev: BOOL;
    hasnext: BOOL;
  end;
const FDICABINETINFO = extern struct {
    cbCabinet: i32,
    cFolders: u16,
    cFiles: u16,
    setID: u16,
    iCabinet: u16,
    fReserve: i32,
    hasprev: i32,
    hasnext: i32,
};
type
  FDICABINETINFO {.bycopy.} = object
    cbCabinet: int32
    cFolders: uint16
    cFiles: uint16
    setID: uint16
    iCabinet: uint16
    fReserve: int32
    hasprev: int32
    hasnext: int32
struct FDICABINETINFO
{
    int cbCabinet;
    ushort cFolders;
    ushort cFiles;
    ushort setID;
    ushort iCabinet;
    int fReserve;
    int hasprev;
    int hasnext;
}

HSP用 定義

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

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

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