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