ホーム › System.ApplicationInstallationAndServicing › MsiSummaryInfoGetPropertyCount
MsiSummaryInfoGetPropertyCount
関数サマリ情報ストリーム内のプロパティ数を取得する。
シグネチャ
// msi.dll
#include <windows.h>
DWORD MsiSummaryInfoGetPropertyCount(
MSIHANDLE hSummaryInfo,
DWORD* puiPropertyCount
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hSummaryInfo | MSIHANDLE | in |
| puiPropertyCount | DWORD* | inout |
戻り値の型: DWORD
各言語での呼び出し定義
// msi.dll
#include <windows.h>
DWORD MsiSummaryInfoGetPropertyCount(
MSIHANDLE hSummaryInfo,
DWORD* puiPropertyCount
);[DllImport("msi.dll", ExactSpelling = true)]
static extern uint MsiSummaryInfoGetPropertyCount(
uint hSummaryInfo, // MSIHANDLE
ref uint puiPropertyCount // DWORD* in/out
);<DllImport("msi.dll", ExactSpelling:=True)>
Public Shared Function MsiSummaryInfoGetPropertyCount(
hSummaryInfo As UInteger, ' MSIHANDLE
ByRef puiPropertyCount As UInteger ' DWORD* in/out
) As UInteger
End Function' hSummaryInfo : MSIHANDLE
' puiPropertyCount : DWORD* in/out
Declare PtrSafe Function MsiSummaryInfoGetPropertyCount Lib "msi" ( _
ByVal hSummaryInfo As Long, _
ByRef puiPropertyCount As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MsiSummaryInfoGetPropertyCount = ctypes.windll.msi.MsiSummaryInfoGetPropertyCount
MsiSummaryInfoGetPropertyCount.restype = wintypes.DWORD
MsiSummaryInfoGetPropertyCount.argtypes = [
wintypes.DWORD, # hSummaryInfo : MSIHANDLE
ctypes.POINTER(wintypes.DWORD), # puiPropertyCount : DWORD* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('msi.dll')
MsiSummaryInfoGetPropertyCount = Fiddle::Function.new(
lib['MsiSummaryInfoGetPropertyCount'],
[
-Fiddle::TYPE_INT, # hSummaryInfo : MSIHANDLE
Fiddle::TYPE_VOIDP, # puiPropertyCount : DWORD* in/out
],
-Fiddle::TYPE_INT)#[link(name = "msi")]
extern "system" {
fn MsiSummaryInfoGetPropertyCount(
hSummaryInfo: u32, // MSIHANDLE
puiPropertyCount: *mut u32 // DWORD* in/out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("msi.dll")]
public static extern uint MsiSummaryInfoGetPropertyCount(uint hSummaryInfo, ref uint puiPropertyCount);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiSummaryInfoGetPropertyCount' -Namespace Win32 -PassThru
# $api::MsiSummaryInfoGetPropertyCount(hSummaryInfo, puiPropertyCount)#uselib "msi.dll"
#func global MsiSummaryInfoGetPropertyCount "MsiSummaryInfoGetPropertyCount" sptr, sptr
; MsiSummaryInfoGetPropertyCount hSummaryInfo, varptr(puiPropertyCount) ; 戻り値は stat
; hSummaryInfo : MSIHANDLE -> "sptr"
; puiPropertyCount : DWORD* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyCount "MsiSummaryInfoGetPropertyCount" int, var ; res = MsiSummaryInfoGetPropertyCount(hSummaryInfo, puiPropertyCount) ; hSummaryInfo : MSIHANDLE -> "int" ; puiPropertyCount : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyCount "MsiSummaryInfoGetPropertyCount" int, sptr ; res = MsiSummaryInfoGetPropertyCount(hSummaryInfo, varptr(puiPropertyCount)) ; hSummaryInfo : MSIHANDLE -> "int" ; puiPropertyCount : DWORD* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo, DWORD* puiPropertyCount) #uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyCount "MsiSummaryInfoGetPropertyCount" int, var ; res = MsiSummaryInfoGetPropertyCount(hSummaryInfo, puiPropertyCount) ; hSummaryInfo : MSIHANDLE -> "int" ; puiPropertyCount : DWORD* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD MsiSummaryInfoGetPropertyCount(MSIHANDLE hSummaryInfo, DWORD* puiPropertyCount) #uselib "msi.dll" #cfunc global MsiSummaryInfoGetPropertyCount "MsiSummaryInfoGetPropertyCount" int, intptr ; res = MsiSummaryInfoGetPropertyCount(hSummaryInfo, varptr(puiPropertyCount)) ; hSummaryInfo : MSIHANDLE -> "int" ; puiPropertyCount : DWORD* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msi = windows.NewLazySystemDLL("msi.dll")
procMsiSummaryInfoGetPropertyCount = msi.NewProc("MsiSummaryInfoGetPropertyCount")
)
// hSummaryInfo (MSIHANDLE), puiPropertyCount (DWORD* in/out)
r1, _, err := procMsiSummaryInfoGetPropertyCount.Call(
uintptr(hSummaryInfo),
uintptr(puiPropertyCount),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MsiSummaryInfoGetPropertyCount(
hSummaryInfo: DWORD; // MSIHANDLE
puiPropertyCount: Pointer // DWORD* in/out
): DWORD; stdcall;
external 'msi.dll' name 'MsiSummaryInfoGetPropertyCount';result := DllCall("msi\MsiSummaryInfoGetPropertyCount"
, "UInt", hSummaryInfo ; MSIHANDLE
, "Ptr", puiPropertyCount ; DWORD* in/out
, "UInt") ; return: DWORD●MsiSummaryInfoGetPropertyCount(hSummaryInfo, puiPropertyCount) = DLL("msi.dll", "dword MsiSummaryInfoGetPropertyCount(dword, void*)")
# 呼び出し: MsiSummaryInfoGetPropertyCount(hSummaryInfo, puiPropertyCount)
# hSummaryInfo : MSIHANDLE -> "dword"
# puiPropertyCount : DWORD* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。