ホーム › System.ApplicationInstallationAndServicing › MsiDatabaseMergeW
MsiDatabaseMergeW
関数2つのデータベースをマージし競合を記録する。
シグネチャ
// msi.dll (Unicode / -W)
#include <windows.h>
DWORD MsiDatabaseMergeW(
MSIHANDLE hDatabase,
MSIHANDLE hDatabaseMerge,
LPCWSTR szTableName
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hDatabase | MSIHANDLE | in |
| hDatabaseMerge | MSIHANDLE | in |
| szTableName | LPCWSTR | in |
戻り値の型: DWORD
各言語での呼び出し定義
// msi.dll (Unicode / -W)
#include <windows.h>
DWORD MsiDatabaseMergeW(
MSIHANDLE hDatabase,
MSIHANDLE hDatabaseMerge,
LPCWSTR szTableName
);[DllImport("msi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint MsiDatabaseMergeW(
uint hDatabase, // MSIHANDLE
uint hDatabaseMerge, // MSIHANDLE
[MarshalAs(UnmanagedType.LPWStr)] string szTableName // LPCWSTR
);<DllImport("msi.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function MsiDatabaseMergeW(
hDatabase As UInteger, ' MSIHANDLE
hDatabaseMerge As UInteger, ' MSIHANDLE
<MarshalAs(UnmanagedType.LPWStr)> szTableName As String ' LPCWSTR
) As UInteger
End Function' hDatabase : MSIHANDLE
' hDatabaseMerge : MSIHANDLE
' szTableName : LPCWSTR
Declare PtrSafe Function MsiDatabaseMergeW Lib "msi" ( _
ByVal hDatabase As Long, _
ByVal hDatabaseMerge As Long, _
ByVal szTableName As LongPtr) 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
MsiDatabaseMergeW = ctypes.windll.msi.MsiDatabaseMergeW
MsiDatabaseMergeW.restype = wintypes.DWORD
MsiDatabaseMergeW.argtypes = [
wintypes.DWORD, # hDatabase : MSIHANDLE
wintypes.DWORD, # hDatabaseMerge : MSIHANDLE
wintypes.LPCWSTR, # szTableName : LPCWSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('msi.dll')
MsiDatabaseMergeW = Fiddle::Function.new(
lib['MsiDatabaseMergeW'],
[
-Fiddle::TYPE_INT, # hDatabase : MSIHANDLE
-Fiddle::TYPE_INT, # hDatabaseMerge : MSIHANDLE
Fiddle::TYPE_VOIDP, # szTableName : LPCWSTR
],
-Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "msi")]
extern "system" {
fn MsiDatabaseMergeW(
hDatabase: u32, // MSIHANDLE
hDatabaseMerge: u32, // MSIHANDLE
szTableName: *const u16 // LPCWSTR
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("msi.dll", CharSet = CharSet.Unicode)]
public static extern uint MsiDatabaseMergeW(uint hDatabase, uint hDatabaseMerge, [MarshalAs(UnmanagedType.LPWStr)] string szTableName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiDatabaseMergeW' -Namespace Win32 -PassThru
# $api::MsiDatabaseMergeW(hDatabase, hDatabaseMerge, szTableName)#uselib "msi.dll"
#func global MsiDatabaseMergeW "MsiDatabaseMergeW" wptr, wptr, wptr
; MsiDatabaseMergeW hDatabase, hDatabaseMerge, szTableName ; 戻り値は stat
; hDatabase : MSIHANDLE -> "wptr"
; hDatabaseMerge : MSIHANDLE -> "wptr"
; szTableName : LPCWSTR -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "msi.dll"
#cfunc global MsiDatabaseMergeW "MsiDatabaseMergeW" int, int, wstr
; res = MsiDatabaseMergeW(hDatabase, hDatabaseMerge, szTableName)
; hDatabase : MSIHANDLE -> "int"
; hDatabaseMerge : MSIHANDLE -> "int"
; szTableName : LPCWSTR -> "wstr"; DWORD MsiDatabaseMergeW(MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, LPCWSTR szTableName)
#uselib "msi.dll"
#cfunc global MsiDatabaseMergeW "MsiDatabaseMergeW" int, int, wstr
; res = MsiDatabaseMergeW(hDatabase, hDatabaseMerge, szTableName)
; hDatabase : MSIHANDLE -> "int"
; hDatabaseMerge : MSIHANDLE -> "int"
; szTableName : LPCWSTR -> "wstr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msi = windows.NewLazySystemDLL("msi.dll")
procMsiDatabaseMergeW = msi.NewProc("MsiDatabaseMergeW")
)
// hDatabase (MSIHANDLE), hDatabaseMerge (MSIHANDLE), szTableName (LPCWSTR)
r1, _, err := procMsiDatabaseMergeW.Call(
uintptr(hDatabase),
uintptr(hDatabaseMerge),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(szTableName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MsiDatabaseMergeW(
hDatabase: DWORD; // MSIHANDLE
hDatabaseMerge: DWORD; // MSIHANDLE
szTableName: PWideChar // LPCWSTR
): DWORD; stdcall;
external 'msi.dll' name 'MsiDatabaseMergeW';result := DllCall("msi\MsiDatabaseMergeW"
, "UInt", hDatabase ; MSIHANDLE
, "UInt", hDatabaseMerge ; MSIHANDLE
, "WStr", szTableName ; LPCWSTR
, "UInt") ; return: DWORD●MsiDatabaseMergeW(hDatabase, hDatabaseMerge, szTableName) = DLL("msi.dll", "dword MsiDatabaseMergeW(dword, dword, char*)")
# 呼び出し: MsiDatabaseMergeW(hDatabase, hDatabaseMerge, szTableName)
# hDatabase : MSIHANDLE -> "dword"
# hDatabaseMerge : MSIHANDLE -> "dword"
# szTableName : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。