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

ResUtilGetPropertiesToParameterBlock

関数
プロパティ値を読み取りパラメータブロックに格納する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

DWORD ResUtilGetPropertiesToParameterBlock(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    BYTE* pOutParams,
    BOOL bCheckForRequiredProperties,
    LPWSTR* pszNameOfPropInError
);

パラメーター

名前方向
hkeyClusterKeyHKEYin
pPropertyTableRESUTIL_PROPERTY_ITEM*in
pOutParamsBYTE*inout
bCheckForRequiredPropertiesBOOLin
pszNameOfPropInErrorLPWSTR*out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ResUtilGetPropertiesToParameterBlock(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    BYTE* pOutParams,
    BOOL bCheckForRequiredProperties,
    LPWSTR* pszNameOfPropInError
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilGetPropertiesToParameterBlock(
    IntPtr hkeyClusterKey,   // HKEY
    IntPtr pPropertyTable,   // RESUTIL_PROPERTY_ITEM*
    IntPtr pOutParams,   // BYTE* in/out
    bool bCheckForRequiredProperties,   // BOOL
    IntPtr pszNameOfPropInError   // LPWSTR* out
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilGetPropertiesToParameterBlock(
    hkeyClusterKey As IntPtr,   ' HKEY
    pPropertyTable As IntPtr,   ' RESUTIL_PROPERTY_ITEM*
    pOutParams As IntPtr,   ' BYTE* in/out
    bCheckForRequiredProperties As Boolean,   ' BOOL
    pszNameOfPropInError As IntPtr   ' LPWSTR* out
) As UInteger
End Function
' hkeyClusterKey : HKEY
' pPropertyTable : RESUTIL_PROPERTY_ITEM*
' pOutParams : BYTE* in/out
' bCheckForRequiredProperties : BOOL
' pszNameOfPropInError : LPWSTR* out
Declare PtrSafe Function ResUtilGetPropertiesToParameterBlock Lib "resutils" ( _
    ByVal hkeyClusterKey As LongPtr, _
    ByVal pPropertyTable As LongPtr, _
    ByVal pOutParams As LongPtr, _
    ByVal bCheckForRequiredProperties As Long, _
    ByVal pszNameOfPropInError As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ResUtilGetPropertiesToParameterBlock = ctypes.windll.resutils.ResUtilGetPropertiesToParameterBlock
ResUtilGetPropertiesToParameterBlock.restype = wintypes.DWORD
ResUtilGetPropertiesToParameterBlock.argtypes = [
    wintypes.HANDLE,  # hkeyClusterKey : HKEY
    ctypes.c_void_p,  # pPropertyTable : RESUTIL_PROPERTY_ITEM*
    ctypes.POINTER(ctypes.c_ubyte),  # pOutParams : BYTE* in/out
    wintypes.BOOL,  # bCheckForRequiredProperties : BOOL
    ctypes.c_void_p,  # pszNameOfPropInError : LPWSTR* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilGetPropertiesToParameterBlock = resutils.NewProc("ResUtilGetPropertiesToParameterBlock")
)

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