ホーム › System.ApplicationInstallationAndServicing › MsiSourceListClearAllA
MsiSourceListClearAllA
関数製品のネットワークソースリストをすべて削除する。
シグネチャ
// msi.dll (ANSI / -A)
#include <windows.h>
DWORD MsiSourceListClearAllA(
LPCSTR szProduct,
LPCSTR szUserName, // optional
DWORD dwReserved // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| szProduct | LPCSTR | in |
| szUserName | LPCSTR | inoptional |
| dwReserved | DWORD | optional |
戻り値の型: DWORD
各言語での呼び出し定義
// msi.dll (ANSI / -A)
#include <windows.h>
DWORD MsiSourceListClearAllA(
LPCSTR szProduct,
LPCSTR szUserName, // optional
DWORD dwReserved // optional
);[DllImport("msi.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint MsiSourceListClearAllA(
[MarshalAs(UnmanagedType.LPStr)] string szProduct, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string szUserName, // LPCSTR optional
uint dwReserved // DWORD optional
);<DllImport("msi.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function MsiSourceListClearAllA(
<MarshalAs(UnmanagedType.LPStr)> szProduct As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> szUserName As String, ' LPCSTR optional
dwReserved As UInteger ' DWORD optional
) As UInteger
End Function' szProduct : LPCSTR
' szUserName : LPCSTR optional
' dwReserved : DWORD optional
Declare PtrSafe Function MsiSourceListClearAllA Lib "msi" ( _
ByVal szProduct As String, _
ByVal szUserName As String, _
ByVal dwReserved As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MsiSourceListClearAllA = ctypes.windll.msi.MsiSourceListClearAllA
MsiSourceListClearAllA.restype = wintypes.DWORD
MsiSourceListClearAllA.argtypes = [
wintypes.LPCSTR, # szProduct : LPCSTR
wintypes.LPCSTR, # szUserName : LPCSTR optional
wintypes.DWORD, # dwReserved : DWORD optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('msi.dll')
MsiSourceListClearAllA = Fiddle::Function.new(
lib['MsiSourceListClearAllA'],
[
Fiddle::TYPE_VOIDP, # szProduct : LPCSTR
Fiddle::TYPE_VOIDP, # szUserName : LPCSTR optional
-Fiddle::TYPE_INT, # dwReserved : DWORD optional
],
-Fiddle::TYPE_INT)#[link(name = "msi")]
extern "system" {
fn MsiSourceListClearAllA(
szProduct: *const u8, // LPCSTR
szUserName: *const u8, // LPCSTR optional
dwReserved: u32 // DWORD optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("msi.dll", CharSet = CharSet.Ansi)]
public static extern uint MsiSourceListClearAllA([MarshalAs(UnmanagedType.LPStr)] string szProduct, [MarshalAs(UnmanagedType.LPStr)] string szUserName, uint dwReserved);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiSourceListClearAllA' -Namespace Win32 -PassThru
# $api::MsiSourceListClearAllA(szProduct, szUserName, dwReserved)#uselib "msi.dll"
#func global MsiSourceListClearAllA "MsiSourceListClearAllA" sptr, sptr, sptr
; MsiSourceListClearAllA szProduct, szUserName, dwReserved ; 戻り値は stat
; szProduct : LPCSTR -> "sptr"
; szUserName : LPCSTR optional -> "sptr"
; dwReserved : DWORD optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "msi.dll"
#cfunc global MsiSourceListClearAllA "MsiSourceListClearAllA" str, str, int
; res = MsiSourceListClearAllA(szProduct, szUserName, dwReserved)
; szProduct : LPCSTR -> "str"
; szUserName : LPCSTR optional -> "str"
; dwReserved : DWORD optional -> "int"; DWORD MsiSourceListClearAllA(LPCSTR szProduct, LPCSTR szUserName, DWORD dwReserved)
#uselib "msi.dll"
#cfunc global MsiSourceListClearAllA "MsiSourceListClearAllA" str, str, int
; res = MsiSourceListClearAllA(szProduct, szUserName, dwReserved)
; szProduct : LPCSTR -> "str"
; szUserName : LPCSTR optional -> "str"
; dwReserved : DWORD optional -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msi = windows.NewLazySystemDLL("msi.dll")
procMsiSourceListClearAllA = msi.NewProc("MsiSourceListClearAllA")
)
// szProduct (LPCSTR), szUserName (LPCSTR optional), dwReserved (DWORD optional)
r1, _, err := procMsiSourceListClearAllA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(szProduct))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(szUserName))),
uintptr(dwReserved),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MsiSourceListClearAllA(
szProduct: PAnsiChar; // LPCSTR
szUserName: PAnsiChar; // LPCSTR optional
dwReserved: DWORD // DWORD optional
): DWORD; stdcall;
external 'msi.dll' name 'MsiSourceListClearAllA';result := DllCall("msi\MsiSourceListClearAllA"
, "AStr", szProduct ; LPCSTR
, "AStr", szUserName ; LPCSTR optional
, "UInt", dwReserved ; DWORD optional
, "UInt") ; return: DWORD●MsiSourceListClearAllA(szProduct, szUserName, dwReserved) = DLL("msi.dll", "dword MsiSourceListClearAllA(char*, char*, dword)")
# 呼び出し: MsiSourceListClearAllA(szProduct, szUserName, dwReserved)
# szProduct : LPCSTR -> "char*"
# szUserName : LPCSTR optional -> "char*"
# dwReserved : DWORD optional -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。