Win32 API 日本語リファレンス
ホームNetworking.Clustering › ResUtilGetAllProperties

ResUtilGetAllProperties

関数
既定値を含む全プロパティをプロパティリストとして取得する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

// RESUTILS.dll
#include <windows.h>

DWORD ResUtilGetAllProperties(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    void* pOutPropertyList,
    DWORD cbOutPropertyListSize,
    DWORD* pcbBytesReturned,
    DWORD* pcbRequired
);

パラメーター

名前方向
hkeyClusterKeyHKEYin
pPropertyTableRESUTIL_PROPERTY_ITEM*in
pOutPropertyListvoid*out
cbOutPropertyListSizeDWORDin
pcbBytesReturnedDWORD*out
pcbRequiredDWORD*out

戻り値の型: DWORD

各言語での呼び出し定義

// RESUTILS.dll
#include <windows.h>

DWORD ResUtilGetAllProperties(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    void* pOutPropertyList,
    DWORD cbOutPropertyListSize,
    DWORD* pcbBytesReturned,
    DWORD* pcbRequired
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilGetAllProperties(
    IntPtr hkeyClusterKey,   // HKEY
    IntPtr pPropertyTable,   // RESUTIL_PROPERTY_ITEM*
    IntPtr pOutPropertyList,   // void* out
    uint cbOutPropertyListSize,   // DWORD
    out uint pcbBytesReturned,   // DWORD* out
    out uint pcbRequired   // DWORD* out
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilGetAllProperties(
    hkeyClusterKey As IntPtr,   ' HKEY
    pPropertyTable As IntPtr,   ' RESUTIL_PROPERTY_ITEM*
    pOutPropertyList As IntPtr,   ' void* out
    cbOutPropertyListSize As UInteger,   ' DWORD
    <Out> ByRef pcbBytesReturned As UInteger,   ' DWORD* out
    <Out> ByRef pcbRequired As UInteger   ' DWORD* out
) As UInteger
End Function
' hkeyClusterKey : HKEY
' pPropertyTable : RESUTIL_PROPERTY_ITEM*
' pOutPropertyList : void* out
' cbOutPropertyListSize : DWORD
' pcbBytesReturned : DWORD* out
' pcbRequired : DWORD* out
Declare PtrSafe Function ResUtilGetAllProperties Lib "resutils" ( _
    ByVal hkeyClusterKey As LongPtr, _
    ByVal pPropertyTable As LongPtr, _
    ByVal pOutPropertyList As LongPtr, _
    ByVal cbOutPropertyListSize As Long, _
    ByRef pcbBytesReturned As Long, _
    ByRef pcbRequired As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ResUtilGetAllProperties = ctypes.windll.resutils.ResUtilGetAllProperties
ResUtilGetAllProperties.restype = wintypes.DWORD
ResUtilGetAllProperties.argtypes = [
    wintypes.HANDLE,  # hkeyClusterKey : HKEY
    ctypes.c_void_p,  # pPropertyTable : RESUTIL_PROPERTY_ITEM*
    ctypes.POINTER(None),  # pOutPropertyList : void* out
    wintypes.DWORD,  # cbOutPropertyListSize : DWORD
    ctypes.POINTER(wintypes.DWORD),  # pcbBytesReturned : DWORD* out
    ctypes.POINTER(wintypes.DWORD),  # pcbRequired : DWORD* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilGetAllProperties = Fiddle::Function.new(
  lib['ResUtilGetAllProperties'],
  [
    Fiddle::TYPE_VOIDP,  # hkeyClusterKey : HKEY
    Fiddle::TYPE_VOIDP,  # pPropertyTable : RESUTIL_PROPERTY_ITEM*
    Fiddle::TYPE_VOIDP,  # pOutPropertyList : void* out
    -Fiddle::TYPE_INT,  # cbOutPropertyListSize : DWORD
    Fiddle::TYPE_VOIDP,  # pcbBytesReturned : DWORD* out
    Fiddle::TYPE_VOIDP,  # pcbRequired : DWORD* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "resutils")]
extern "system" {
    fn ResUtilGetAllProperties(
        hkeyClusterKey: *mut core::ffi::c_void,  // HKEY
        pPropertyTable: *const RESUTIL_PROPERTY_ITEM,  // RESUTIL_PROPERTY_ITEM*
        pOutPropertyList: *mut (),  // void* out
        cbOutPropertyListSize: u32,  // DWORD
        pcbBytesReturned: *mut u32,  // DWORD* out
        pcbRequired: *mut u32  // DWORD* out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RESUTILS.dll")]
public static extern uint ResUtilGetAllProperties(IntPtr hkeyClusterKey, IntPtr pPropertyTable, IntPtr pOutPropertyList, uint cbOutPropertyListSize, out uint pcbBytesReturned, out uint pcbRequired);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilGetAllProperties' -Namespace Win32 -PassThru
# $api::ResUtilGetAllProperties(hkeyClusterKey, pPropertyTable, pOutPropertyList, cbOutPropertyListSize, pcbBytesReturned, pcbRequired)
#uselib "RESUTILS.dll"
#func global ResUtilGetAllProperties "ResUtilGetAllProperties" sptr, sptr, sptr, sptr, sptr, sptr
; ResUtilGetAllProperties hkeyClusterKey, varptr(pPropertyTable), pOutPropertyList, cbOutPropertyListSize, varptr(pcbBytesReturned), varptr(pcbRequired)   ; 戻り値は stat
; hkeyClusterKey : HKEY -> "sptr"
; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "sptr"
; pOutPropertyList : void* out -> "sptr"
; cbOutPropertyListSize : DWORD -> "sptr"
; pcbBytesReturned : DWORD* out -> "sptr"
; pcbRequired : DWORD* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RESUTILS.dll"
#cfunc global ResUtilGetAllProperties "ResUtilGetAllProperties" sptr, var, sptr, int, var, var
; res = ResUtilGetAllProperties(hkeyClusterKey, pPropertyTable, pOutPropertyList, cbOutPropertyListSize, pcbBytesReturned, pcbRequired)
; hkeyClusterKey : HKEY -> "sptr"
; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var"
; pOutPropertyList : void* out -> "sptr"
; cbOutPropertyListSize : DWORD -> "int"
; pcbBytesReturned : DWORD* out -> "var"
; pcbRequired : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD ResUtilGetAllProperties(HKEY hkeyClusterKey, RESUTIL_PROPERTY_ITEM* pPropertyTable, void* pOutPropertyList, DWORD cbOutPropertyListSize, DWORD* pcbBytesReturned, DWORD* pcbRequired)
#uselib "RESUTILS.dll"
#cfunc global ResUtilGetAllProperties "ResUtilGetAllProperties" intptr, var, intptr, int, var, var
; res = ResUtilGetAllProperties(hkeyClusterKey, pPropertyTable, pOutPropertyList, cbOutPropertyListSize, pcbBytesReturned, pcbRequired)
; hkeyClusterKey : HKEY -> "intptr"
; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var"
; pOutPropertyList : void* out -> "intptr"
; cbOutPropertyListSize : DWORD -> "int"
; pcbBytesReturned : DWORD* out -> "var"
; pcbRequired : DWORD* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilGetAllProperties = resutils.NewProc("ResUtilGetAllProperties")
)

// hkeyClusterKey (HKEY), pPropertyTable (RESUTIL_PROPERTY_ITEM*), pOutPropertyList (void* out), cbOutPropertyListSize (DWORD), pcbBytesReturned (DWORD* out), pcbRequired (DWORD* out)
r1, _, err := procResUtilGetAllProperties.Call(
	uintptr(hkeyClusterKey),
	uintptr(pPropertyTable),
	uintptr(pOutPropertyList),
	uintptr(cbOutPropertyListSize),
	uintptr(pcbBytesReturned),
	uintptr(pcbRequired),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ResUtilGetAllProperties(
  hkeyClusterKey: THandle;   // HKEY
  pPropertyTable: Pointer;   // RESUTIL_PROPERTY_ITEM*
  pOutPropertyList: Pointer;   // void* out
  cbOutPropertyListSize: DWORD;   // DWORD
  pcbBytesReturned: Pointer;   // DWORD* out
  pcbRequired: Pointer   // DWORD* out
): DWORD; stdcall;
  external 'RESUTILS.dll' name 'ResUtilGetAllProperties';
result := DllCall("RESUTILS\ResUtilGetAllProperties"
    , "Ptr", hkeyClusterKey   ; HKEY
    , "Ptr", pPropertyTable   ; RESUTIL_PROPERTY_ITEM*
    , "Ptr", pOutPropertyList   ; void* out
    , "UInt", cbOutPropertyListSize   ; DWORD
    , "Ptr", pcbBytesReturned   ; DWORD* out
    , "Ptr", pcbRequired   ; DWORD* out
    , "UInt")   ; return: DWORD
●ResUtilGetAllProperties(hkeyClusterKey, pPropertyTable, pOutPropertyList, cbOutPropertyListSize, pcbBytesReturned, pcbRequired) = DLL("RESUTILS.dll", "dword ResUtilGetAllProperties(void*, void*, void*, dword, void*, void*)")
# 呼び出し: ResUtilGetAllProperties(hkeyClusterKey, pPropertyTable, pOutPropertyList, cbOutPropertyListSize, pcbBytesReturned, pcbRequired)
# hkeyClusterKey : HKEY -> "void*"
# pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "void*"
# pOutPropertyList : void* out -> "void*"
# cbOutPropertyListSize : DWORD -> "dword"
# pcbBytesReturned : DWORD* out -> "void*"
# pcbRequired : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。