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