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

MsiCreateTransformSummaryInfoA

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

シグネチャ

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

DWORD MsiCreateTransformSummaryInfoA(
    MSIHANDLE hDatabase,
    MSIHANDLE hDatabaseReference,
    LPCSTR szTransformFile,
    MSITRANSFORM_ERROR iErrorConditions,
    MSITRANSFORM_VALIDATE iValidation
);

パラメーター

名前方向
hDatabaseMSIHANDLEin
hDatabaseReferenceMSIHANDLEin
szTransformFileLPCSTRin
iErrorConditionsMSITRANSFORM_ERRORin
iValidationMSITRANSFORM_VALIDATEin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

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

lib = Fiddle.dlopen('msi.dll')
MsiCreateTransformSummaryInfoA = Fiddle::Function.new(
  lib['MsiCreateTransformSummaryInfoA'],
  [
    -Fiddle::TYPE_INT,  # hDatabase : MSIHANDLE
    -Fiddle::TYPE_INT,  # hDatabaseReference : MSIHANDLE
    Fiddle::TYPE_VOIDP,  # szTransformFile : LPCSTR
    Fiddle::TYPE_INT,  # iErrorConditions : MSITRANSFORM_ERROR
    Fiddle::TYPE_INT,  # iValidation : MSITRANSFORM_VALIDATE
  ],
  -Fiddle::TYPE_INT)
#[link(name = "msi")]
extern "system" {
    fn MsiCreateTransformSummaryInfoA(
        hDatabase: u32,  // MSIHANDLE
        hDatabaseReference: u32,  // MSIHANDLE
        szTransformFile: *const u8,  // LPCSTR
        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.Ansi)]
public static extern uint MsiCreateTransformSummaryInfoA(uint hDatabase, uint hDatabaseReference, [MarshalAs(UnmanagedType.LPStr)] string szTransformFile, int iErrorConditions, int iValidation);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiCreateTransformSummaryInfoA' -Namespace Win32 -PassThru
# $api::MsiCreateTransformSummaryInfoA(hDatabase, hDatabaseReference, szTransformFile, iErrorConditions, iValidation)
#uselib "msi.dll"
#func global MsiCreateTransformSummaryInfoA "MsiCreateTransformSummaryInfoA" sptr, sptr, sptr, sptr, sptr
; MsiCreateTransformSummaryInfoA hDatabase, hDatabaseReference, szTransformFile, iErrorConditions, iValidation   ; 戻り値は stat
; hDatabase : MSIHANDLE -> "sptr"
; hDatabaseReference : MSIHANDLE -> "sptr"
; szTransformFile : LPCSTR -> "sptr"
; iErrorConditions : MSITRANSFORM_ERROR -> "sptr"
; iValidation : MSITRANSFORM_VALIDATE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "msi.dll"
#cfunc global MsiCreateTransformSummaryInfoA "MsiCreateTransformSummaryInfoA" int, int, str, int, int
; res = MsiCreateTransformSummaryInfoA(hDatabase, hDatabaseReference, szTransformFile, iErrorConditions, iValidation)
; hDatabase : MSIHANDLE -> "int"
; hDatabaseReference : MSIHANDLE -> "int"
; szTransformFile : LPCSTR -> "str"
; iErrorConditions : MSITRANSFORM_ERROR -> "int"
; iValidation : MSITRANSFORM_VALIDATE -> "int"
; DWORD MsiCreateTransformSummaryInfoA(MSIHANDLE hDatabase, MSIHANDLE hDatabaseReference, LPCSTR szTransformFile, MSITRANSFORM_ERROR iErrorConditions, MSITRANSFORM_VALIDATE iValidation)
#uselib "msi.dll"
#cfunc global MsiCreateTransformSummaryInfoA "MsiCreateTransformSummaryInfoA" int, int, str, int, int
; res = MsiCreateTransformSummaryInfoA(hDatabase, hDatabaseReference, szTransformFile, iErrorConditions, iValidation)
; hDatabase : MSIHANDLE -> "int"
; hDatabaseReference : MSIHANDLE -> "int"
; szTransformFile : LPCSTR -> "str"
; iErrorConditions : MSITRANSFORM_ERROR -> "int"
; iValidation : MSITRANSFORM_VALIDATE -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiCreateTransformSummaryInfoA = msi.NewProc("MsiCreateTransformSummaryInfoA")
)

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