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

MsiSummaryInfoSetPropertyA

関数
サマリ情報の指定プロパティに値を設定する。
DLLmsi.dll文字セットANSI (-A)呼出規約winapi対応OSwindows8.0

シグネチャ

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

DWORD MsiSummaryInfoSetPropertyA(
    MSIHANDLE hSummaryInfo,
    DWORD uiProperty,
    DWORD uiDataType,
    INT iValue,
    FILETIME* pftValue,
    LPCSTR szValue
);

パラメーター

名前方向説明
hSummaryInfoMSIHANDLEin対象サマリ情報のハンドルを指定する。
uiPropertyDWORDin設定するプロパティのID(PID)を指定する。
uiDataTypeDWORDin値のデータ型(VT_I4/VT_LPSTR/VT_FILETIMEなど)を指定する。
iValueINTin整数型プロパティの値を指定する。整数型以外では無視される。
pftValueFILETIME*inoutFILETIME型プロパティの値ポインタ。該当しない場合はNULL。
szValueLPCSTRin文字列型プロパティの値(ANSI)。該当しない場合はNULL。

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD MsiSummaryInfoSetPropertyA(
    MSIHANDLE hSummaryInfo,
    DWORD uiProperty,
    DWORD uiDataType,
    INT iValue,
    FILETIME* pftValue,
    LPCSTR szValue
);
[DllImport("msi.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint MsiSummaryInfoSetPropertyA(
    uint hSummaryInfo,   // MSIHANDLE
    uint uiProperty,   // DWORD
    uint uiDataType,   // DWORD
    int iValue,   // INT
    IntPtr pftValue,   // FILETIME* in/out
    [MarshalAs(UnmanagedType.LPStr)] string szValue   // LPCSTR
);
<DllImport("msi.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function MsiSummaryInfoSetPropertyA(
    hSummaryInfo As UInteger,   ' MSIHANDLE
    uiProperty As UInteger,   ' DWORD
    uiDataType As UInteger,   ' DWORD
    iValue As Integer,   ' INT
    pftValue As IntPtr,   ' FILETIME* in/out
    <MarshalAs(UnmanagedType.LPStr)> szValue As String   ' LPCSTR
) As UInteger
End Function
' hSummaryInfo : MSIHANDLE
' uiProperty : DWORD
' uiDataType : DWORD
' iValue : INT
' pftValue : FILETIME* in/out
' szValue : LPCSTR
Declare PtrSafe Function MsiSummaryInfoSetPropertyA Lib "msi" ( _
    ByVal hSummaryInfo As Long, _
    ByVal uiProperty As Long, _
    ByVal uiDataType As Long, _
    ByVal iValue As Long, _
    ByVal pftValue As LongPtr, _
    ByVal szValue As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

MsiSummaryInfoSetPropertyA = ctypes.windll.msi.MsiSummaryInfoSetPropertyA
MsiSummaryInfoSetPropertyA.restype = wintypes.DWORD
MsiSummaryInfoSetPropertyA.argtypes = [
    wintypes.DWORD,  # hSummaryInfo : MSIHANDLE
    wintypes.DWORD,  # uiProperty : DWORD
    wintypes.DWORD,  # uiDataType : DWORD
    ctypes.c_int,  # iValue : INT
    ctypes.c_void_p,  # pftValue : FILETIME* in/out
    wintypes.LPCSTR,  # szValue : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('msi.dll')
MsiSummaryInfoSetPropertyA = Fiddle::Function.new(
  lib['MsiSummaryInfoSetPropertyA'],
  [
    -Fiddle::TYPE_INT,  # hSummaryInfo : MSIHANDLE
    -Fiddle::TYPE_INT,  # uiProperty : DWORD
    -Fiddle::TYPE_INT,  # uiDataType : DWORD
    Fiddle::TYPE_INT,  # iValue : INT
    Fiddle::TYPE_VOIDP,  # pftValue : FILETIME* in/out
    Fiddle::TYPE_VOIDP,  # szValue : LPCSTR
  ],
  -Fiddle::TYPE_INT)
#[link(name = "msi")]
extern "system" {
    fn MsiSummaryInfoSetPropertyA(
        hSummaryInfo: u32,  // MSIHANDLE
        uiProperty: u32,  // DWORD
        uiDataType: u32,  // DWORD
        iValue: i32,  // INT
        pftValue: *mut FILETIME,  // FILETIME* in/out
        szValue: *const u8  // LPCSTR
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("msi.dll", CharSet = CharSet.Ansi)]
public static extern uint MsiSummaryInfoSetPropertyA(uint hSummaryInfo, uint uiProperty, uint uiDataType, int iValue, IntPtr pftValue, [MarshalAs(UnmanagedType.LPStr)] string szValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiSummaryInfoSetPropertyA' -Namespace Win32 -PassThru
# $api::MsiSummaryInfoSetPropertyA(hSummaryInfo, uiProperty, uiDataType, iValue, pftValue, szValue)
#uselib "msi.dll"
#func global MsiSummaryInfoSetPropertyA "MsiSummaryInfoSetPropertyA" sptr, sptr, sptr, sptr, sptr, sptr
; MsiSummaryInfoSetPropertyA hSummaryInfo, uiProperty, uiDataType, iValue, varptr(pftValue), szValue   ; 戻り値は stat
; hSummaryInfo : MSIHANDLE -> "sptr"
; uiProperty : DWORD -> "sptr"
; uiDataType : DWORD -> "sptr"
; iValue : INT -> "sptr"
; pftValue : FILETIME* in/out -> "sptr"
; szValue : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "msi.dll"
#cfunc global MsiSummaryInfoSetPropertyA "MsiSummaryInfoSetPropertyA" int, int, int, int, var, str
; res = MsiSummaryInfoSetPropertyA(hSummaryInfo, uiProperty, uiDataType, iValue, pftValue, szValue)
; hSummaryInfo : MSIHANDLE -> "int"
; uiProperty : DWORD -> "int"
; uiDataType : DWORD -> "int"
; iValue : INT -> "int"
; pftValue : FILETIME* in/out -> "var"
; szValue : LPCSTR -> "str"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD MsiSummaryInfoSetPropertyA(MSIHANDLE hSummaryInfo, DWORD uiProperty, DWORD uiDataType, INT iValue, FILETIME* pftValue, LPCSTR szValue)
#uselib "msi.dll"
#cfunc global MsiSummaryInfoSetPropertyA "MsiSummaryInfoSetPropertyA" int, int, int, int, var, str
; res = MsiSummaryInfoSetPropertyA(hSummaryInfo, uiProperty, uiDataType, iValue, pftValue, szValue)
; hSummaryInfo : MSIHANDLE -> "int"
; uiProperty : DWORD -> "int"
; uiDataType : DWORD -> "int"
; iValue : INT -> "int"
; pftValue : FILETIME* in/out -> "var"
; szValue : LPCSTR -> "str"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msi = windows.NewLazySystemDLL("msi.dll")
	procMsiSummaryInfoSetPropertyA = msi.NewProc("MsiSummaryInfoSetPropertyA")
)

// hSummaryInfo (MSIHANDLE), uiProperty (DWORD), uiDataType (DWORD), iValue (INT), pftValue (FILETIME* in/out), szValue (LPCSTR)
r1, _, err := procMsiSummaryInfoSetPropertyA.Call(
	uintptr(hSummaryInfo),
	uintptr(uiProperty),
	uintptr(uiDataType),
	uintptr(iValue),
	uintptr(pftValue),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(szValue))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function MsiSummaryInfoSetPropertyA(
  hSummaryInfo: DWORD;   // MSIHANDLE
  uiProperty: DWORD;   // DWORD
  uiDataType: DWORD;   // DWORD
  iValue: Integer;   // INT
  pftValue: Pointer;   // FILETIME* in/out
  szValue: PAnsiChar   // LPCSTR
): DWORD; stdcall;
  external 'msi.dll' name 'MsiSummaryInfoSetPropertyA';
result := DllCall("msi\MsiSummaryInfoSetPropertyA"
    , "UInt", hSummaryInfo   ; MSIHANDLE
    , "UInt", uiProperty   ; DWORD
    , "UInt", uiDataType   ; DWORD
    , "Int", iValue   ; INT
    , "Ptr", pftValue   ; FILETIME* in/out
    , "AStr", szValue   ; LPCSTR
    , "UInt")   ; return: DWORD
●MsiSummaryInfoSetPropertyA(hSummaryInfo, uiProperty, uiDataType, iValue, pftValue, szValue) = DLL("msi.dll", "dword MsiSummaryInfoSetPropertyA(dword, dword, dword, int, void*, char*)")
# 呼び出し: MsiSummaryInfoSetPropertyA(hSummaryInfo, uiProperty, uiDataType, iValue, pftValue, szValue)
# hSummaryInfo : MSIHANDLE -> "dword"
# uiProperty : DWORD -> "dword"
# uiDataType : DWORD -> "dword"
# iValue : INT -> "int"
# pftValue : FILETIME* in/out -> "void*"
# szValue : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。