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

MsiSequenceA

関数
指定したシーケンステーブルのアクションを順に実行する(ANSI版)。
DLLmsi.dll文字セットANSI (-A)呼出規約winapi対応OSwindows8.0

シグネチャ

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

DWORD MsiSequenceA(
    MSIHANDLE hInstall,
    LPCSTR szTable,
    INT iSequenceMode
);

パラメーター

名前方向
hInstallMSIHANDLEin
szTableLPCSTRin
iSequenceModeINTin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MsiSequenceA(
    MSIHANDLE hInstall,
    LPCSTR szTable,
    INT iSequenceMode
);
[DllImport("msi.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint MsiSequenceA(
    uint hInstall,   // MSIHANDLE
    [MarshalAs(UnmanagedType.LPStr)] string szTable,   // LPCSTR
    int iSequenceMode   // INT
);
<DllImport("msi.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function MsiSequenceA(
    hInstall As UInteger,   ' MSIHANDLE
    <MarshalAs(UnmanagedType.LPStr)> szTable As String,   ' LPCSTR
    iSequenceMode As Integer   ' INT
) As UInteger
End Function
' hInstall : MSIHANDLE
' szTable : LPCSTR
' iSequenceMode : INT
Declare PtrSafe Function MsiSequenceA Lib "msi" ( _
    ByVal hInstall As Long, _
    ByVal szTable As String, _
    ByVal iSequenceMode As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MsiSequenceA = ctypes.windll.msi.MsiSequenceA
MsiSequenceA.restype = wintypes.DWORD
MsiSequenceA.argtypes = [
    wintypes.DWORD,  # hInstall : MSIHANDLE
    wintypes.LPCSTR,  # szTable : LPCSTR
    ctypes.c_int,  # iSequenceMode : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('msi.dll')
MsiSequenceA = Fiddle::Function.new(
  lib['MsiSequenceA'],
  [
    -Fiddle::TYPE_INT,  # hInstall : MSIHANDLE
    Fiddle::TYPE_VOIDP,  # szTable : LPCSTR
    Fiddle::TYPE_INT,  # iSequenceMode : INT
  ],
  -Fiddle::TYPE_INT)
#[link(name = "msi")]
extern "system" {
    fn MsiSequenceA(
        hInstall: u32,  // MSIHANDLE
        szTable: *const u8,  // LPCSTR
        iSequenceMode: i32  // INT
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("msi.dll", CharSet = CharSet.Ansi)]
public static extern uint MsiSequenceA(uint hInstall, [MarshalAs(UnmanagedType.LPStr)] string szTable, int iSequenceMode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiSequenceA' -Namespace Win32 -PassThru
# $api::MsiSequenceA(hInstall, szTable, iSequenceMode)
#uselib "msi.dll"
#func global MsiSequenceA "MsiSequenceA" sptr, sptr, sptr
; MsiSequenceA hInstall, szTable, iSequenceMode   ; 戻り値は stat
; hInstall : MSIHANDLE -> "sptr"
; szTable : LPCSTR -> "sptr"
; iSequenceMode : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "msi.dll"
#cfunc global MsiSequenceA "MsiSequenceA" int, str, int
; res = MsiSequenceA(hInstall, szTable, iSequenceMode)
; hInstall : MSIHANDLE -> "int"
; szTable : LPCSTR -> "str"
; iSequenceMode : INT -> "int"
; DWORD MsiSequenceA(MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode)
#uselib "msi.dll"
#cfunc global MsiSequenceA "MsiSequenceA" int, str, int
; res = MsiSequenceA(hInstall, szTable, iSequenceMode)
; hInstall : MSIHANDLE -> "int"
; szTable : LPCSTR -> "str"
; iSequenceMode : INT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiSequenceA = msi.NewProc("MsiSequenceA")
)

// hInstall (MSIHANDLE), szTable (LPCSTR), iSequenceMode (INT)
r1, _, err := procMsiSequenceA.Call(
	uintptr(hInstall),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(szTable))),
	uintptr(iSequenceMode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function MsiSequenceA(
  hInstall: DWORD;   // MSIHANDLE
  szTable: PAnsiChar;   // LPCSTR
  iSequenceMode: Integer   // INT
): DWORD; stdcall;
  external 'msi.dll' name 'MsiSequenceA';
result := DllCall("msi\MsiSequenceA"
    , "UInt", hInstall   ; MSIHANDLE
    , "AStr", szTable   ; LPCSTR
    , "Int", iSequenceMode   ; INT
    , "UInt")   ; return: DWORD
●MsiSequenceA(hInstall, szTable, iSequenceMode) = DLL("msi.dll", "dword MsiSequenceA(dword, char*, int)")
# 呼び出し: MsiSequenceA(hInstall, szTable, iSequenceMode)
# hInstall : MSIHANDLE -> "dword"
# szTable : LPCSTR -> "char*"
# iSequenceMode : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。