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

MsiCloseAllHandles

関数
開いているすべてのMSIハンドルを閉じる。
DLLmsi.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

DWORD MsiCloseAllHandles(void);

パラメーターなし。戻り値: DWORD

各言語での呼び出し定義

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

DWORD MsiCloseAllHandles(void);
[DllImport("msi.dll", ExactSpelling = true)]
static extern uint MsiCloseAllHandles();
<DllImport("msi.dll", ExactSpelling:=True)>
Public Shared Function MsiCloseAllHandles() As UInteger
End Function
Declare PtrSafe Function MsiCloseAllHandles Lib "msi" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MsiCloseAllHandles = ctypes.windll.msi.MsiCloseAllHandles
MsiCloseAllHandles.restype = wintypes.DWORD
MsiCloseAllHandles.argtypes = []
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('msi.dll')
MsiCloseAllHandles = Fiddle::Function.new(
  lib['MsiCloseAllHandles'],
  [],
  -Fiddle::TYPE_INT)
#[link(name = "msi")]
extern "system" {
    fn MsiCloseAllHandles() -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("msi.dll")]
public static extern uint MsiCloseAllHandles();
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiCloseAllHandles' -Namespace Win32 -PassThru
# $api::MsiCloseAllHandles()
#uselib "msi.dll"
#func global MsiCloseAllHandles "MsiCloseAllHandles"
; MsiCloseAllHandles   ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "msi.dll"
#cfunc global MsiCloseAllHandles "MsiCloseAllHandles"
; res = MsiCloseAllHandles()
; DWORD MsiCloseAllHandles()
#uselib "msi.dll"
#cfunc global MsiCloseAllHandles "MsiCloseAllHandles"
; res = MsiCloseAllHandles()
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiCloseAllHandles = msi.NewProc("MsiCloseAllHandles")
)

r1, _, err := procMsiCloseAllHandles.Call()
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function MsiCloseAllHandles: DWORD; stdcall;
  external 'msi.dll' name 'MsiCloseAllHandles';
result := DllCall("msi\MsiCloseAllHandles", "UInt")
●MsiCloseAllHandles() = DLL("msi.dll", "dword MsiCloseAllHandles()")
# 呼び出し: MsiCloseAllHandles()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。