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

FCIFlushCabinet

関数
FCIで現在のキャビネットを書き出し確定する。
DLLCabinet.dll呼出規約cdecl

シグネチャ

// Cabinet.dll
#include <windows.h>

BOOL FCIFlushCabinet(
    void* hfci,
    BOOL fGetNextCab,
    PFNFCIGETNEXTCABINET pfnfcignc,
    PFNFCISTATUS pfnfcis
);

パラメーター

名前方向説明
hfcivoid*inFCICreateで取得したFCIコンテキストハンドル。
fGetNextCabBOOLin次のキャビネット情報を取得するかどうかのフラグ。TRUEで分割継続を促す。
pfnfcigncPFNFCIGETNEXTCABINETin次のキャビネットを取得するためのコールバック関数ポインタ。
pfnfcisPFNFCISTATUSin進捗状況を通知するステータスコールバック関数ポインタ。

戻り値の型: BOOL

各言語での呼び出し定義

// Cabinet.dll
#include <windows.h>

BOOL FCIFlushCabinet(
    void* hfci,
    BOOL fGetNextCab,
    PFNFCIGETNEXTCABINET pfnfcignc,
    PFNFCISTATUS pfnfcis
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("Cabinet.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern bool FCIFlushCabinet(
    IntPtr hfci,   // void*
    bool fGetNextCab,   // BOOL
    IntPtr pfnfcignc,   // PFNFCIGETNEXTCABINET
    IntPtr pfnfcis   // PFNFCISTATUS
);
<DllImport("Cabinet.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function FCIFlushCabinet(
    hfci As IntPtr,   ' void*
    fGetNextCab As Boolean,   ' BOOL
    pfnfcignc As IntPtr,   ' PFNFCIGETNEXTCABINET
    pfnfcis As IntPtr   ' PFNFCISTATUS
) As Boolean
End Function
' hfci : void*
' fGetNextCab : BOOL
' pfnfcignc : PFNFCIGETNEXTCABINET
' pfnfcis : PFNFCISTATUS
Declare PtrSafe Function FCIFlushCabinet Lib "cabinet" ( _
    ByVal hfci As LongPtr, _
    ByVal fGetNextCab As Long, _
    ByVal pfnfcignc As LongPtr, _
    ByVal pfnfcis As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FCIFlushCabinet = ctypes.cdll.cabinet.FCIFlushCabinet
FCIFlushCabinet.restype = wintypes.BOOL
FCIFlushCabinet.argtypes = [
    ctypes.POINTER(None),  # hfci : void*
    wintypes.BOOL,  # fGetNextCab : BOOL
    ctypes.c_void_p,  # pfnfcignc : PFNFCIGETNEXTCABINET
    ctypes.c_void_p,  # pfnfcis : PFNFCISTATUS
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('Cabinet.dll')
FCIFlushCabinet = Fiddle::Function.new(
  lib['FCIFlushCabinet'],
  [
    Fiddle::TYPE_VOIDP,  # hfci : void*
    Fiddle::TYPE_INT,  # fGetNextCab : BOOL
    Fiddle::TYPE_VOIDP,  # pfnfcignc : PFNFCIGETNEXTCABINET
    Fiddle::TYPE_VOIDP,  # pfnfcis : PFNFCISTATUS
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "cabinet")]
extern "C" {
    fn FCIFlushCabinet(
        hfci: *mut (),  // void*
        fGetNextCab: i32,  // BOOL
        pfnfcignc: *const core::ffi::c_void,  // PFNFCIGETNEXTCABINET
        pfnfcis: *const core::ffi::c_void  // PFNFCISTATUS
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("Cabinet.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern bool FCIFlushCabinet(IntPtr hfci, bool fGetNextCab, IntPtr pfnfcignc, IntPtr pfnfcis);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Cabinet_FCIFlushCabinet' -Namespace Win32 -PassThru
# $api::FCIFlushCabinet(hfci, fGetNextCab, pfnfcignc, pfnfcis)
#uselib "Cabinet.dll"
#func global FCIFlushCabinet "FCIFlushCabinet" sptr, sptr, sptr, sptr
; FCIFlushCabinet hfci, fGetNextCab, pfnfcignc, pfnfcis   ; 戻り値は stat
; hfci : void* -> "sptr"
; fGetNextCab : BOOL -> "sptr"
; pfnfcignc : PFNFCIGETNEXTCABINET -> "sptr"
; pfnfcis : PFNFCISTATUS -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "Cabinet.dll"
#cfunc global FCIFlushCabinet "FCIFlushCabinet" sptr, int, sptr, sptr
; res = FCIFlushCabinet(hfci, fGetNextCab, pfnfcignc, pfnfcis)
; hfci : void* -> "sptr"
; fGetNextCab : BOOL -> "int"
; pfnfcignc : PFNFCIGETNEXTCABINET -> "sptr"
; pfnfcis : PFNFCISTATUS -> "sptr"
; BOOL FCIFlushCabinet(void* hfci, BOOL fGetNextCab, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis)
#uselib "Cabinet.dll"
#cfunc global FCIFlushCabinet "FCIFlushCabinet" intptr, int, intptr, intptr
; res = FCIFlushCabinet(hfci, fGetNextCab, pfnfcignc, pfnfcis)
; hfci : void* -> "intptr"
; fGetNextCab : BOOL -> "int"
; pfnfcignc : PFNFCIGETNEXTCABINET -> "intptr"
; pfnfcis : PFNFCISTATUS -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	cabinet = windows.NewLazySystemDLL("Cabinet.dll")
	procFCIFlushCabinet = cabinet.NewProc("FCIFlushCabinet")
)

// hfci (void*), fGetNextCab (BOOL), pfnfcignc (PFNFCIGETNEXTCABINET), pfnfcis (PFNFCISTATUS)
r1, _, err := procFCIFlushCabinet.Call(
	uintptr(hfci),
	uintptr(fGetNextCab),
	uintptr(pfnfcignc),
	uintptr(pfnfcis),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function FCIFlushCabinet(
  hfci: Pointer;   // void*
  fGetNextCab: BOOL;   // BOOL
  pfnfcignc: Pointer;   // PFNFCIGETNEXTCABINET
  pfnfcis: Pointer   // PFNFCISTATUS
): BOOL; cdecl;
  external 'Cabinet.dll' name 'FCIFlushCabinet';
result := DllCall("Cabinet\FCIFlushCabinet"
    , "Ptr", hfci   ; void*
    , "Int", fGetNextCab   ; BOOL
    , "Ptr", pfnfcignc   ; PFNFCIGETNEXTCABINET
    , "Ptr", pfnfcis   ; PFNFCISTATUS
    , "Cdecl Int")   ; return: BOOL
●FCIFlushCabinet(hfci, fGetNextCab, pfnfcignc, pfnfcis) = DLL("Cabinet.dll", "bool FCIFlushCabinet(void*, bool, void*, void*)")
# 呼び出し: FCIFlushCabinet(hfci, fGetNextCab, pfnfcignc, pfnfcis)
# hfci : void* -> "void*"
# fGetNextCab : BOOL -> "bool"
# pfnfcignc : PFNFCIGETNEXTCABINET -> "void*"
# pfnfcis : PFNFCISTATUS -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※cdecl関数。DLL()宣言はstdcall前提。cdeclは EXEC_PTR(`cdecl`,…) を使用。