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

MsiRemovePatchesA

関数
製品から指定のパッチを削除する(ANSI版)。
DLLmsi.dll文字セットANSI (-A)呼出規約winapi対応OSwindows8.0

シグネチャ

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

DWORD MsiRemovePatchesA(
    LPCSTR szPatchList,
    LPCSTR szProductCode,
    INSTALLTYPE eUninstallType,
    LPCSTR szPropertyList   // optional
);

パラメーター

名前方向
szPatchListLPCSTRin
szProductCodeLPCSTRin
eUninstallTypeINSTALLTYPEin
szPropertyListLPCSTRinoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

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

MsiRemovePatchesA = ctypes.windll.msi.MsiRemovePatchesA
MsiRemovePatchesA.restype = wintypes.DWORD
MsiRemovePatchesA.argtypes = [
    wintypes.LPCSTR,  # szPatchList : LPCSTR
    wintypes.LPCSTR,  # szProductCode : LPCSTR
    ctypes.c_int,  # eUninstallType : INSTALLTYPE
    wintypes.LPCSTR,  # szPropertyList : LPCSTR optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiRemovePatchesA = msi.NewProc("MsiRemovePatchesA")
)

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