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

ResUtilSetPropertyParameterBlock

関数
パラメータブロックの値をプロパティとして設定する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

DWORD ResUtilSetPropertyParameterBlock(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    void* Reserved,
    const BYTE* pInParams,
    const void* pInPropertyList,
    DWORD cbInPropertyListSize,
    BYTE* pOutParams
);

パラメーター

名前方向
hkeyClusterKeyHKEYin
pPropertyTableRESUTIL_PROPERTY_ITEM*in
Reservedvoid*inout
pInParamsBYTE*in
pInPropertyListvoid*in
cbInPropertyListSizeDWORDin
pOutParamsBYTE*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

ResUtilSetPropertyParameterBlock = ctypes.windll.resutils.ResUtilSetPropertyParameterBlock
ResUtilSetPropertyParameterBlock.restype = wintypes.DWORD
ResUtilSetPropertyParameterBlock.argtypes = [
    wintypes.HANDLE,  # hkeyClusterKey : HKEY
    ctypes.c_void_p,  # pPropertyTable : RESUTIL_PROPERTY_ITEM*
    ctypes.POINTER(None),  # Reserved : void* in/out
    ctypes.POINTER(ctypes.c_ubyte),  # pInParams : BYTE*
    ctypes.POINTER(None),  # pInPropertyList : void*
    wintypes.DWORD,  # cbInPropertyListSize : DWORD
    ctypes.POINTER(ctypes.c_ubyte),  # pOutParams : BYTE* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilSetPropertyParameterBlock = resutils.NewProc("ResUtilSetPropertyParameterBlock")
)

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