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

ResUtilSetPropertyTable

関数
プロパティテーブルに従い値をクラスタキーに設定する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

DWORD ResUtilSetPropertyTable(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    void* Reserved,   // optional
    BOOL bAllowUnknownProperties,
    const void* pInPropertyList,
    DWORD cbInPropertyListSize,
    BYTE* pOutParams   // optional
);

パラメーター

名前方向
hkeyClusterKeyHKEYin
pPropertyTableRESUTIL_PROPERTY_ITEM*in
Reservedvoid*optional
bAllowUnknownPropertiesBOOLin
pInPropertyListvoid*in
cbInPropertyListSizeDWORDin
pOutParamsBYTE*outoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ResUtilSetPropertyTable(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    void* Reserved,   // optional
    BOOL bAllowUnknownProperties,
    const void* pInPropertyList,
    DWORD cbInPropertyListSize,
    BYTE* pOutParams   // optional
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilSetPropertyTable(
    IntPtr hkeyClusterKey,   // HKEY
    IntPtr pPropertyTable,   // RESUTIL_PROPERTY_ITEM*
    IntPtr Reserved,   // void* optional
    bool bAllowUnknownProperties,   // BOOL
    IntPtr pInPropertyList,   // void*
    uint cbInPropertyListSize,   // DWORD
    IntPtr pOutParams   // BYTE* optional, out
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilSetPropertyTable(
    hkeyClusterKey As IntPtr,   ' HKEY
    pPropertyTable As IntPtr,   ' RESUTIL_PROPERTY_ITEM*
    Reserved As IntPtr,   ' void* optional
    bAllowUnknownProperties As Boolean,   ' BOOL
    pInPropertyList As IntPtr,   ' void*
    cbInPropertyListSize As UInteger,   ' DWORD
    pOutParams As IntPtr   ' BYTE* optional, out
) As UInteger
End Function
' hkeyClusterKey : HKEY
' pPropertyTable : RESUTIL_PROPERTY_ITEM*
' Reserved : void* optional
' bAllowUnknownProperties : BOOL
' pInPropertyList : void*
' cbInPropertyListSize : DWORD
' pOutParams : BYTE* optional, out
Declare PtrSafe Function ResUtilSetPropertyTable Lib "resutils" ( _
    ByVal hkeyClusterKey As LongPtr, _
    ByVal pPropertyTable As LongPtr, _
    ByVal Reserved As LongPtr, _
    ByVal bAllowUnknownProperties As Long, _
    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

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

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

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilSetPropertyTable = resutils.NewProc("ResUtilSetPropertyTable")
)

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