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

MsiCreateTransformSummaryInfoW

関数
トランスフォームのサマリ情報を生成して検証条件を設定する。
DLLmsi.dll文字セットUnicode (-W)呼出規約winapi対応OSwindows8.0

シグネチャ

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

DWORD MsiCreateTransformSummaryInfoW(
    MSIHANDLE hDatabase,
    MSIHANDLE hDatabaseReference,
    LPCWSTR szTransformFile,
    MSITRANSFORM_ERROR iErrorConditions,
    MSITRANSFORM_VALIDATE iValidation
);

パラメーター

名前方向
hDatabaseMSIHANDLEin
hDatabaseReferenceMSIHANDLEin
szTransformFileLPCWSTRin
iErrorConditionsMSITRANSFORM_ERRORin
iValidationMSITRANSFORM_VALIDATEin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MsiCreateTransformSummaryInfoW(
    MSIHANDLE hDatabase,
    MSIHANDLE hDatabaseReference,
    LPCWSTR szTransformFile,
    MSITRANSFORM_ERROR iErrorConditions,
    MSITRANSFORM_VALIDATE iValidation
);
[DllImport("msi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint MsiCreateTransformSummaryInfoW(
    uint hDatabase,   // MSIHANDLE
    uint hDatabaseReference,   // MSIHANDLE
    [MarshalAs(UnmanagedType.LPWStr)] string szTransformFile,   // LPCWSTR
    int iErrorConditions,   // MSITRANSFORM_ERROR
    int iValidation   // MSITRANSFORM_VALIDATE
);
<DllImport("msi.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function MsiCreateTransformSummaryInfoW(
    hDatabase As UInteger,   ' MSIHANDLE
    hDatabaseReference As UInteger,   ' MSIHANDLE
    <MarshalAs(UnmanagedType.LPWStr)> szTransformFile As String,   ' LPCWSTR
    iErrorConditions As Integer,   ' MSITRANSFORM_ERROR
    iValidation As Integer   ' MSITRANSFORM_VALIDATE
) As UInteger
End Function
' hDatabase : MSIHANDLE
' hDatabaseReference : MSIHANDLE
' szTransformFile : LPCWSTR
' iErrorConditions : MSITRANSFORM_ERROR
' iValidation : MSITRANSFORM_VALIDATE
Declare PtrSafe Function MsiCreateTransformSummaryInfoW Lib "msi" ( _
    ByVal hDatabase As Long, _
    ByVal hDatabaseReference As Long, _
    ByVal szTransformFile As LongPtr, _
    ByVal iErrorConditions As Long, _
    ByVal iValidation 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

MsiCreateTransformSummaryInfoW = ctypes.windll.msi.MsiCreateTransformSummaryInfoW
MsiCreateTransformSummaryInfoW.restype = wintypes.DWORD
MsiCreateTransformSummaryInfoW.argtypes = [
    wintypes.DWORD,  # hDatabase : MSIHANDLE
    wintypes.DWORD,  # hDatabaseReference : MSIHANDLE
    wintypes.LPCWSTR,  # szTransformFile : LPCWSTR
    ctypes.c_int,  # iErrorConditions : MSITRANSFORM_ERROR
    ctypes.c_int,  # iValidation : MSITRANSFORM_VALIDATE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiCreateTransformSummaryInfoW = msi.NewProc("MsiCreateTransformSummaryInfoW")
)

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