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

FCIFlushFolder

関数
FCIで現在の圧縮フォルダを書き出し確定する。
DLLCabinet.dll呼出規約cdecl

シグネチャ

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

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

パラメーター

名前方向
hfcivoid*in
pfnfcigncPFNFCIGETNEXTCABINETin
pfnfcisPFNFCISTATUSin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL FCIFlushFolder(
    void* hfci,
    PFNFCIGETNEXTCABINET pfnfcignc,
    PFNFCISTATUS pfnfcis
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("Cabinet.dll", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
static extern bool FCIFlushFolder(
    IntPtr hfci,   // void*
    IntPtr pfnfcignc,   // PFNFCIGETNEXTCABINET
    IntPtr pfnfcis   // PFNFCISTATUS
);
<DllImport("Cabinet.dll", ExactSpelling:=True, CallingConvention:=CallingConvention.Cdecl)>
Public Shared Function FCIFlushFolder(
    hfci As IntPtr,   ' void*
    pfnfcignc As IntPtr,   ' PFNFCIGETNEXTCABINET
    pfnfcis As IntPtr   ' PFNFCISTATUS
) As Boolean
End Function
' hfci : void*
' pfnfcignc : PFNFCIGETNEXTCABINET
' pfnfcis : PFNFCISTATUS
Declare PtrSafe Function FCIFlushFolder Lib "cabinet" ( _
    ByVal hfci As LongPtr, _
    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

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

lib = Fiddle.dlopen('Cabinet.dll')
FCIFlushFolder = Fiddle::Function.new(
  lib['FCIFlushFolder'],
  [
    Fiddle::TYPE_VOIDP,  # hfci : void*
    Fiddle::TYPE_VOIDP,  # pfnfcignc : PFNFCIGETNEXTCABINET
    Fiddle::TYPE_VOIDP,  # pfnfcis : PFNFCISTATUS
  ],
  Fiddle::TYPE_INT, Fiddle::Function::CDECL)
#[link(name = "cabinet")]
extern "C" {
    fn FCIFlushFolder(
        hfci: *mut (),  // void*
        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 FCIFlushFolder(IntPtr hfci, IntPtr pfnfcignc, IntPtr pfnfcis);
"@
$api = Add-Type -MemberDefinition $sig -Name 'Cabinet_FCIFlushFolder' -Namespace Win32 -PassThru
# $api::FCIFlushFolder(hfci, pfnfcignc, pfnfcis)
#uselib "Cabinet.dll"
#func global FCIFlushFolder "FCIFlushFolder" sptr, sptr, sptr
; FCIFlushFolder hfci, pfnfcignc, pfnfcis   ; 戻り値は stat
; hfci : void* -> "sptr"
; pfnfcignc : PFNFCIGETNEXTCABINET -> "sptr"
; pfnfcis : PFNFCISTATUS -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "Cabinet.dll"
#cfunc global FCIFlushFolder "FCIFlushFolder" sptr, sptr, sptr
; res = FCIFlushFolder(hfci, pfnfcignc, pfnfcis)
; hfci : void* -> "sptr"
; pfnfcignc : PFNFCIGETNEXTCABINET -> "sptr"
; pfnfcis : PFNFCISTATUS -> "sptr"
; BOOL FCIFlushFolder(void* hfci, PFNFCIGETNEXTCABINET pfnfcignc, PFNFCISTATUS pfnfcis)
#uselib "Cabinet.dll"
#cfunc global FCIFlushFolder "FCIFlushFolder" intptr, intptr, intptr
; res = FCIFlushFolder(hfci, pfnfcignc, pfnfcis)
; hfci : void* -> "intptr"
; pfnfcignc : PFNFCIGETNEXTCABINET -> "intptr"
; pfnfcis : PFNFCISTATUS -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	cabinet = windows.NewLazySystemDLL("Cabinet.dll")
	procFCIFlushFolder = cabinet.NewProc("FCIFlushFolder")
)

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