ホーム › System.ApplicationInstallationAndServicing › MsiSummaryInfoGetPropertyW
MsiSummaryInfoGetPropertyW
関数サマリ情報の指定プロパティの型と値を取得する。
シグネチャ
// msi.dll (Unicode / -W)
#include <windows.h>
DWORD MsiSummaryInfoGetPropertyW(
MSIHANDLE hSummaryInfo,
DWORD uiProperty,
DWORD* puiDataType,
INT* piValue,
FILETIME* pftValue, // optional
LPWSTR szValueBuf, // optional
DWORD* pcchValueBuf // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hSummaryInfo | MSIHANDLE | in |
| uiProperty | DWORD | in |
| puiDataType | DWORD* | out |
| piValue | INT* | out |
| pftValue | FILETIME* | outoptional |
| szValueBuf | LPWSTR | outoptional |
| pcchValueBuf | DWORD* | inoutoptional |
戻り値の型: DWORD
各言語での呼び出し定義
// msi.dll (Unicode / -W)
#include <windows.h>
DWORD MsiSummaryInfoGetPropertyW(
MSIHANDLE hSummaryInfo,
DWORD uiProperty,
DWORD* puiDataType,
INT* piValue,
FILETIME* pftValue, // optional
LPWSTR szValueBuf, // optional
DWORD* pcchValueBuf // optional
);[DllImport("msi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint MsiSummaryInfoGetPropertyW(
uint hSummaryInfo, // MSIHANDLE
uint uiProperty, // DWORD
out uint puiDataType, // DWORD* out
out int piValue, // INT* out
IntPtr pftValue, // FILETIME* optional, out
[MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder szValueBuf, // LPWSTR optional, out
IntPtr pcchValueBuf // DWORD* optional, in/out
);<DllImport("msi.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function MsiSummaryInfoGetPropertyW(
hSummaryInfo As UInteger, ' MSIHANDLE
uiProperty As UInteger, ' DWORD
<Out> ByRef puiDataType As UInteger, ' DWORD* out
<Out> ByRef piValue As Integer, ' INT* out
pftValue As IntPtr, ' FILETIME* optional, out
<MarshalAs(UnmanagedType.LPWStr)> szValueBuf As System.Text.StringBuilder, ' LPWSTR optional, out
pcchValueBuf As IntPtr ' DWORD* optional, in/out
) As UInteger
End Function' hSummaryInfo : MSIHANDLE
' uiProperty : DWORD
' puiDataType : DWORD* out
' piValue : INT* out
' pftValue : FILETIME* optional, out
' szValueBuf : LPWSTR optional, out
' pcchValueBuf : DWORD* optional, in/out
Declare PtrSafe Function MsiSummaryInfoGetPropertyW Lib "msi" ( _
ByVal hSummaryInfo As Long, _
ByVal uiProperty As Long, _
ByRef puiDataType As Long, _
ByRef piValue As Long, _
ByVal pftValue As LongPtr, _
ByVal szValueBuf As LongPtr, _
ByVal pcchValueBuf 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
MsiSummaryInfoGetPropertyW = ctypes.windll.msi.MsiSummaryInfoGetPropertyW
MsiSummaryInfoGetPropertyW.restype = wintypes.DWORD
MsiSummaryInfoGetPropertyW.argtypes = [
wintypes.DWORD, # hSummaryInfo : MSIHANDLE
wintypes.DWORD, # uiProperty : DWORD
ctypes.POINTER(wintypes.DWORD), # puiDataType : DWORD* out
ctypes.POINTER(ctypes.c_int), # piValue : INT* out
ctypes.c_void_p, # pftValue : FILETIME* optional, out
wintypes.LPWSTR, # szValueBuf : LPWSTR optional, out
ctypes.POINTER(wintypes.DWORD), # pcchValueBuf : DWORD* optional, in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('msi.dll')
MsiSummaryInfoGetPropertyW = Fiddle::Function.new(
lib['MsiSummaryInfoGetPropertyW'],
[
-Fiddle::TYPE_INT, # hSummaryInfo : MSIHANDLE
-Fiddle::TYPE_INT, # uiProperty : DWORD
Fiddle::TYPE_VOIDP, # puiDataType : DWORD* out
Fiddle::TYPE_VOIDP, # piValue : INT* out
Fiddle::TYPE_VOIDP, # pftValue : FILETIME* optional, out
Fiddle::TYPE_VOIDP, # szValueBuf : LPWSTR optional, out
Fiddle::TYPE_VOIDP, # pcchValueBuf : DWORD* optional, in/out
],
-Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "msi")]
extern "system" {
fn MsiSummaryInfoGetPropertyW(
hSummaryInfo: u32, // MSIHANDLE
uiProperty: u32, // DWORD
puiDataType: *mut u32, // DWORD* out
piValue: *mut i32, // INT* out
pftValue: *mut FILETIME, // FILETIME* optional, out
szValueBuf: *mut u16, // LPWSTR optional, out
pcchValueBuf: *mut u32 // DWORD* optional, in/out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("msi.dll", CharSet = CharSet.Unicode)]
public static extern uint MsiSummaryInfoGetPropertyW(uint hSummaryInfo, uint uiProperty, out uint puiDataType, out int piValue, IntPtr pftValue, [MarshalAs(UnmanagedType.LPWStr)] System.Text.StringBuilder szValueBuf, IntPtr pcchValueBuf);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiSummaryInfoGetPropertyW' -Namespace Win32 -PassThru
# $api::MsiSummaryInfoGetPropertyW(hSummaryInfo, uiProperty, puiDataType, piValue, pftValue, szValueBuf, pcchValueBuf)#uselib "msi.dll"
#func global MsiSummaryInfoGetPropertyW "MsiSummaryInfoGetPropertyW" wptr, wptr, wptr, wptr, wptr, wptr, wptr
; MsiSummaryInfoGetPropertyW hSummaryInfo, uiProperty, varptr(puiDataType), varptr(piValue), varptr(pftValue), varptr(szValueBuf), varptr(pcchValueBuf) ; 戻り値は stat
; hSummaryInfo : MSIHANDLE -> "wptr"
; uiProperty : DWORD -> "wptr"
; puiDataType : DWORD* out -> "wptr"
; piValue : INT* out -> "wptr"
; pftValue : FILETIME* optional, out -> "wptr"
; szValueBuf : LPWSTR optional, out -> "wptr"
; pcchValueBuf : DWORD* optional, in/out -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyW "MsiSummaryInfoGetPropertyW" int, int, var, var, var, var, var ; res = MsiSummaryInfoGetPropertyW(hSummaryInfo, uiProperty, puiDataType, piValue, pftValue, szValueBuf, pcchValueBuf) ; hSummaryInfo : MSIHANDLE -> "int" ; uiProperty : DWORD -> "int" ; puiDataType : DWORD* out -> "var" ; piValue : INT* out -> "var" ; pftValue : FILETIME* optional, out -> "var" ; szValueBuf : LPWSTR optional, out -> "var" ; pcchValueBuf : DWORD* optional, in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyW "MsiSummaryInfoGetPropertyW" int, int, sptr, sptr, sptr, sptr, sptr ; res = MsiSummaryInfoGetPropertyW(hSummaryInfo, uiProperty, varptr(puiDataType), varptr(piValue), varptr(pftValue), varptr(szValueBuf), varptr(pcchValueBuf)) ; hSummaryInfo : MSIHANDLE -> "int" ; uiProperty : DWORD -> "int" ; puiDataType : DWORD* out -> "sptr" ; piValue : INT* out -> "sptr" ; pftValue : FILETIME* optional, out -> "sptr" ; szValueBuf : LPWSTR optional, out -> "sptr" ; pcchValueBuf : DWORD* optional, in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD MsiSummaryInfoGetPropertyW(MSIHANDLE hSummaryInfo, DWORD uiProperty, DWORD* puiDataType, INT* piValue, FILETIME* pftValue, LPWSTR szValueBuf, DWORD* pcchValueBuf) #uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyW "MsiSummaryInfoGetPropertyW" int, int, var, var, var, var, var ; res = MsiSummaryInfoGetPropertyW(hSummaryInfo, uiProperty, puiDataType, piValue, pftValue, szValueBuf, pcchValueBuf) ; hSummaryInfo : MSIHANDLE -> "int" ; uiProperty : DWORD -> "int" ; puiDataType : DWORD* out -> "var" ; piValue : INT* out -> "var" ; pftValue : FILETIME* optional, out -> "var" ; szValueBuf : LPWSTR optional, out -> "var" ; pcchValueBuf : DWORD* optional, in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD MsiSummaryInfoGetPropertyW(MSIHANDLE hSummaryInfo, DWORD uiProperty, DWORD* puiDataType, INT* piValue, FILETIME* pftValue, LPWSTR szValueBuf, DWORD* pcchValueBuf) #uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyW "MsiSummaryInfoGetPropertyW" int, int, intptr, intptr, intptr, intptr, intptr ; res = MsiSummaryInfoGetPropertyW(hSummaryInfo, uiProperty, varptr(puiDataType), varptr(piValue), varptr(pftValue), varptr(szValueBuf), varptr(pcchValueBuf)) ; hSummaryInfo : MSIHANDLE -> "int" ; uiProperty : DWORD -> "int" ; puiDataType : DWORD* out -> "intptr" ; piValue : INT* out -> "intptr" ; pftValue : FILETIME* optional, out -> "intptr" ; szValueBuf : LPWSTR optional, out -> "intptr" ; pcchValueBuf : DWORD* optional, in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msi = windows.NewLazySystemDLL("msi.dll")
procMsiSummaryInfoGetPropertyW = msi.NewProc("MsiSummaryInfoGetPropertyW")
)
// hSummaryInfo (MSIHANDLE), uiProperty (DWORD), puiDataType (DWORD* out), piValue (INT* out), pftValue (FILETIME* optional, out), szValueBuf (LPWSTR optional, out), pcchValueBuf (DWORD* optional, in/out)
r1, _, err := procMsiSummaryInfoGetPropertyW.Call(
uintptr(hSummaryInfo),
uintptr(uiProperty),
uintptr(puiDataType),
uintptr(piValue),
uintptr(pftValue),
uintptr(szValueBuf),
uintptr(pcchValueBuf),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MsiSummaryInfoGetPropertyW(
hSummaryInfo: DWORD; // MSIHANDLE
uiProperty: DWORD; // DWORD
puiDataType: Pointer; // DWORD* out
piValue: Pointer; // INT* out
pftValue: Pointer; // FILETIME* optional, out
szValueBuf: PWideChar; // LPWSTR optional, out
pcchValueBuf: Pointer // DWORD* optional, in/out
): DWORD; stdcall;
external 'msi.dll' name 'MsiSummaryInfoGetPropertyW';result := DllCall("msi\MsiSummaryInfoGetPropertyW"
, "UInt", hSummaryInfo ; MSIHANDLE
, "UInt", uiProperty ; DWORD
, "Ptr", puiDataType ; DWORD* out
, "Ptr", piValue ; INT* out
, "Ptr", pftValue ; FILETIME* optional, out
, "Ptr", szValueBuf ; LPWSTR optional, out
, "Ptr", pcchValueBuf ; DWORD* optional, in/out
, "UInt") ; return: DWORD●MsiSummaryInfoGetPropertyW(hSummaryInfo, uiProperty, puiDataType, piValue, pftValue, szValueBuf, pcchValueBuf) = DLL("msi.dll", "dword MsiSummaryInfoGetPropertyW(dword, dword, void*, void*, void*, char*, void*)")
# 呼び出し: MsiSummaryInfoGetPropertyW(hSummaryInfo, uiProperty, puiDataType, piValue, pftValue, szValueBuf, pcchValueBuf)
# hSummaryInfo : MSIHANDLE -> "dword"
# uiProperty : DWORD -> "dword"
# puiDataType : DWORD* out -> "void*"
# piValue : INT* out -> "void*"
# pftValue : FILETIME* optional, out -> "void*"
# szValueBuf : LPWSTR optional, out -> "char*"
# pcchValueBuf : DWORD* optional, in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。