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