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

MsiSequenceW

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

シグネチャ

// msi.dll  (Unicode / -W)
#include <windows.h>

DWORD MsiSequenceW(
    MSIHANDLE hInstall,
    LPCWSTR szTable,
    INT iSequenceMode
);

パラメーター

名前方向
hInstallMSIHANDLEin
szTableLPCWSTRin
iSequenceModeINTin

戻り値の型: DWORD

各言語での呼び出し定義

// msi.dll  (Unicode / -W)
#include <windows.h>

DWORD MsiSequenceW(
    MSIHANDLE hInstall,
    LPCWSTR szTable,
    INT iSequenceMode
);
[DllImport("msi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint MsiSequenceW(
    uint hInstall,   // MSIHANDLE
    [MarshalAs(UnmanagedType.LPWStr)] string szTable,   // LPCWSTR
    int iSequenceMode   // INT
);
<DllImport("msi.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function MsiSequenceW(
    hInstall As UInteger,   ' MSIHANDLE
    <MarshalAs(UnmanagedType.LPWStr)> szTable As String,   ' LPCWSTR
    iSequenceMode As Integer   ' INT
) As UInteger
End Function
' hInstall : MSIHANDLE
' szTable : LPCWSTR
' iSequenceMode : INT
Declare PtrSafe Function MsiSequenceW Lib "msi" ( _
    ByVal hInstall As Long, _
    ByVal szTable As LongPtr, _
    ByVal iSequenceMode As Long) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

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

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

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiSequenceW = msi.NewProc("MsiSequenceW")
)

// hInstall (MSIHANDLE), szTable (LPCWSTR), iSequenceMode (INT)
r1, _, err := procMsiSequenceW.Call(
	uintptr(hInstall),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(szTable))),
	uintptr(iSequenceMode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function MsiSequenceW(
  hInstall: DWORD;   // MSIHANDLE
  szTable: PWideChar;   // LPCWSTR
  iSequenceMode: Integer   // INT
): DWORD; stdcall;
  external 'msi.dll' name 'MsiSequenceW';
result := DllCall("msi\MsiSequenceW"
    , "UInt", hInstall   ; MSIHANDLE
    , "WStr", szTable   ; LPCWSTR
    , "Int", iSequenceMode   ; INT
    , "UInt")   ; return: DWORD
●MsiSequenceW(hInstall, szTable, iSequenceMode) = DLL("msi.dll", "dword MsiSequenceW(dword, char*, int)")
# 呼び出し: MsiSequenceW(hInstall, szTable, iSequenceMode)
# hInstall : MSIHANDLE -> "dword"
# szTable : LPCWSTR -> "char*"
# iSequenceMode : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。