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