Win32 API 日本語リファレンス
ホームDevices.DeviceAndDriverInstallation › SetupCommitFileQueueA

SetupCommitFileQueueA

関数
キューに登録された全ファイル操作を実行する(ANSI)。
DLLSETUPAPI.dll文字セットANSI (-A)呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

// SETUPAPI.dll  (ANSI / -A)
#include <windows.h>

BOOL SetupCommitFileQueueA(
    HWND Owner,   // optional
    void* QueueHandle,
    PSP_FILE_CALLBACK_A MsgHandler,
    void* Context
);

パラメーター

名前方向
OwnerHWNDinoptional
QueueHandlevoid*in
MsgHandlerPSP_FILE_CALLBACK_Ain
Contextvoid*in

戻り値の型: BOOL

各言語での呼び出し定義

// SETUPAPI.dll  (ANSI / -A)
#include <windows.h>

BOOL SetupCommitFileQueueA(
    HWND Owner,   // optional
    void* QueueHandle,
    PSP_FILE_CALLBACK_A MsgHandler,
    void* Context
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SETUPAPI.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
static extern bool SetupCommitFileQueueA(
    IntPtr Owner,   // HWND optional
    IntPtr QueueHandle,   // void*
    IntPtr MsgHandler,   // PSP_FILE_CALLBACK_A
    IntPtr Context   // void*
);
<DllImport("SETUPAPI.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SetupCommitFileQueueA(
    Owner As IntPtr,   ' HWND optional
    QueueHandle As IntPtr,   ' void*
    MsgHandler As IntPtr,   ' PSP_FILE_CALLBACK_A
    Context As IntPtr   ' void*
) As Boolean
End Function
' Owner : HWND optional
' QueueHandle : void*
' MsgHandler : PSP_FILE_CALLBACK_A
' Context : void*
Declare PtrSafe Function SetupCommitFileQueueA Lib "setupapi" ( _
    ByVal Owner As LongPtr, _
    ByVal QueueHandle As LongPtr, _
    ByVal MsgHandler As LongPtr, _
    ByVal Context As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SetupCommitFileQueueA = ctypes.windll.setupapi.SetupCommitFileQueueA
SetupCommitFileQueueA.restype = wintypes.BOOL
SetupCommitFileQueueA.argtypes = [
    wintypes.HANDLE,  # Owner : HWND optional
    ctypes.POINTER(None),  # QueueHandle : void*
    ctypes.c_void_p,  # MsgHandler : PSP_FILE_CALLBACK_A
    ctypes.POINTER(None),  # Context : void*
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SETUPAPI.dll')
SetupCommitFileQueueA = Fiddle::Function.new(
  lib['SetupCommitFileQueueA'],
  [
    Fiddle::TYPE_VOIDP,  # Owner : HWND optional
    Fiddle::TYPE_VOIDP,  # QueueHandle : void*
    Fiddle::TYPE_VOIDP,  # MsgHandler : PSP_FILE_CALLBACK_A
    Fiddle::TYPE_VOIDP,  # Context : void*
  ],
  Fiddle::TYPE_INT)
#[link(name = "setupapi")]
extern "system" {
    fn SetupCommitFileQueueA(
        Owner: *mut core::ffi::c_void,  // HWND optional
        QueueHandle: *mut (),  // void*
        MsgHandler: *const core::ffi::c_void,  // PSP_FILE_CALLBACK_A
        Context: *mut ()  // void*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SETUPAPI.dll", CharSet = CharSet.Ansi, SetLastError = true)]
public static extern bool SetupCommitFileQueueA(IntPtr Owner, IntPtr QueueHandle, IntPtr MsgHandler, IntPtr Context);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SETUPAPI_SetupCommitFileQueueA' -Namespace Win32 -PassThru
# $api::SetupCommitFileQueueA(Owner, QueueHandle, MsgHandler, Context)
#uselib "SETUPAPI.dll"
#func global SetupCommitFileQueueA "SetupCommitFileQueueA" sptr, sptr, sptr, sptr
; SetupCommitFileQueueA Owner, QueueHandle, MsgHandler, Context   ; 戻り値は stat
; Owner : HWND optional -> "sptr"
; QueueHandle : void* -> "sptr"
; MsgHandler : PSP_FILE_CALLBACK_A -> "sptr"
; Context : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SETUPAPI.dll"
#cfunc global SetupCommitFileQueueA "SetupCommitFileQueueA" sptr, sptr, sptr, sptr
; res = SetupCommitFileQueueA(Owner, QueueHandle, MsgHandler, Context)
; Owner : HWND optional -> "sptr"
; QueueHandle : void* -> "sptr"
; MsgHandler : PSP_FILE_CALLBACK_A -> "sptr"
; Context : void* -> "sptr"
; BOOL SetupCommitFileQueueA(HWND Owner, void* QueueHandle, PSP_FILE_CALLBACK_A MsgHandler, void* Context)
#uselib "SETUPAPI.dll"
#cfunc global SetupCommitFileQueueA "SetupCommitFileQueueA" intptr, intptr, intptr, intptr
; res = SetupCommitFileQueueA(Owner, QueueHandle, MsgHandler, Context)
; Owner : HWND optional -> "intptr"
; QueueHandle : void* -> "intptr"
; MsgHandler : PSP_FILE_CALLBACK_A -> "intptr"
; Context : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	setupapi = windows.NewLazySystemDLL("SETUPAPI.dll")
	procSetupCommitFileQueueA = setupapi.NewProc("SetupCommitFileQueueA")
)

// Owner (HWND optional), QueueHandle (void*), MsgHandler (PSP_FILE_CALLBACK_A), Context (void*)
r1, _, err := procSetupCommitFileQueueA.Call(
	uintptr(Owner),
	uintptr(QueueHandle),
	uintptr(MsgHandler),
	uintptr(Context),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function SetupCommitFileQueueA(
  Owner: THandle;   // HWND optional
  QueueHandle: Pointer;   // void*
  MsgHandler: Pointer;   // PSP_FILE_CALLBACK_A
  Context: Pointer   // void*
): BOOL; stdcall;
  external 'SETUPAPI.dll' name 'SetupCommitFileQueueA';
result := DllCall("SETUPAPI\SetupCommitFileQueueA"
    , "Ptr", Owner   ; HWND optional
    , "Ptr", QueueHandle   ; void*
    , "Ptr", MsgHandler   ; PSP_FILE_CALLBACK_A
    , "Ptr", Context   ; void*
    , "Int")   ; return: BOOL
●SetupCommitFileQueueA(Owner, QueueHandle, MsgHandler, Context) = DLL("SETUPAPI.dll", "bool SetupCommitFileQueueA(void*, void*, void*, void*)")
# 呼び出し: SetupCommitFileQueueA(Owner, QueueHandle, MsgHandler, Context)
# Owner : HWND optional -> "void*"
# QueueHandle : void* -> "void*"
# MsgHandler : PSP_FILE_CALLBACK_A -> "void*"
# Context : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。