ホーム › Networking.Clustering › ResUtilSetPropertyTableEx
ResUtilSetPropertyTableEx
関数強制書き込み指定でプロパティテーブルの値を設定する。
シグネチャ
// RESUTILS.dll
#include <windows.h>
DWORD ResUtilSetPropertyTableEx(
HKEY hkeyClusterKey,
const RESUTIL_PROPERTY_ITEM* pPropertyTable,
void* Reserved,
BOOL bAllowUnknownProperties,
const void* pInPropertyList,
DWORD cbInPropertyListSize,
BOOL bForceWrite,
BYTE* pOutParams
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hkeyClusterKey | HKEY | in |
| pPropertyTable | RESUTIL_PROPERTY_ITEM* | in |
| Reserved | void* | inout |
| bAllowUnknownProperties | BOOL | in |
| pInPropertyList | void* | in |
| cbInPropertyListSize | DWORD | in |
| bForceWrite | BOOL | in |
| pOutParams | BYTE* | inout |
戻り値の型: DWORD
各言語での呼び出し定義
// RESUTILS.dll
#include <windows.h>
DWORD ResUtilSetPropertyTableEx(
HKEY hkeyClusterKey,
const RESUTIL_PROPERTY_ITEM* pPropertyTable,
void* Reserved,
BOOL bAllowUnknownProperties,
const void* pInPropertyList,
DWORD cbInPropertyListSize,
BOOL bForceWrite,
BYTE* pOutParams
);[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilSetPropertyTableEx(
IntPtr hkeyClusterKey, // HKEY
IntPtr pPropertyTable, // RESUTIL_PROPERTY_ITEM*
IntPtr Reserved, // void* in/out
bool bAllowUnknownProperties, // BOOL
IntPtr pInPropertyList, // void*
uint cbInPropertyListSize, // DWORD
bool bForceWrite, // BOOL
IntPtr pOutParams // BYTE* in/out
);<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilSetPropertyTableEx(
hkeyClusterKey As IntPtr, ' HKEY
pPropertyTable As IntPtr, ' RESUTIL_PROPERTY_ITEM*
Reserved As IntPtr, ' void* in/out
bAllowUnknownProperties As Boolean, ' BOOL
pInPropertyList As IntPtr, ' void*
cbInPropertyListSize As UInteger, ' DWORD
bForceWrite As Boolean, ' BOOL
pOutParams As IntPtr ' BYTE* in/out
) As UInteger
End Function' hkeyClusterKey : HKEY
' pPropertyTable : RESUTIL_PROPERTY_ITEM*
' Reserved : void* in/out
' bAllowUnknownProperties : BOOL
' pInPropertyList : void*
' cbInPropertyListSize : DWORD
' bForceWrite : BOOL
' pOutParams : BYTE* in/out
Declare PtrSafe Function ResUtilSetPropertyTableEx 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 bForceWrite 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
ResUtilSetPropertyTableEx = ctypes.windll.resutils.ResUtilSetPropertyTableEx
ResUtilSetPropertyTableEx.restype = wintypes.DWORD
ResUtilSetPropertyTableEx.argtypes = [
wintypes.HANDLE, # hkeyClusterKey : HKEY
ctypes.c_void_p, # pPropertyTable : RESUTIL_PROPERTY_ITEM*
ctypes.POINTER(None), # Reserved : void* in/out
wintypes.BOOL, # bAllowUnknownProperties : BOOL
ctypes.POINTER(None), # pInPropertyList : void*
wintypes.DWORD, # cbInPropertyListSize : DWORD
wintypes.BOOL, # bForceWrite : BOOL
ctypes.POINTER(ctypes.c_ubyte), # pOutParams : BYTE* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilSetPropertyTableEx = Fiddle::Function.new(
lib['ResUtilSetPropertyTableEx'],
[
Fiddle::TYPE_VOIDP, # hkeyClusterKey : HKEY
Fiddle::TYPE_VOIDP, # pPropertyTable : RESUTIL_PROPERTY_ITEM*
Fiddle::TYPE_VOIDP, # Reserved : void* in/out
Fiddle::TYPE_INT, # bAllowUnknownProperties : BOOL
Fiddle::TYPE_VOIDP, # pInPropertyList : void*
-Fiddle::TYPE_INT, # cbInPropertyListSize : DWORD
Fiddle::TYPE_INT, # bForceWrite : BOOL
Fiddle::TYPE_VOIDP, # pOutParams : BYTE* in/out
],
-Fiddle::TYPE_INT)#[link(name = "resutils")]
extern "system" {
fn ResUtilSetPropertyTableEx(
hkeyClusterKey: *mut core::ffi::c_void, // HKEY
pPropertyTable: *const RESUTIL_PROPERTY_ITEM, // RESUTIL_PROPERTY_ITEM*
Reserved: *mut (), // void* in/out
bAllowUnknownProperties: i32, // BOOL
pInPropertyList: *const (), // void*
cbInPropertyListSize: u32, // DWORD
bForceWrite: i32, // BOOL
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 ResUtilSetPropertyTableEx(IntPtr hkeyClusterKey, IntPtr pPropertyTable, IntPtr Reserved, bool bAllowUnknownProperties, IntPtr pInPropertyList, uint cbInPropertyListSize, bool bForceWrite, IntPtr pOutParams);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilSetPropertyTableEx' -Namespace Win32 -PassThru
# $api::ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)#uselib "RESUTILS.dll"
#func global ResUtilSetPropertyTableEx "ResUtilSetPropertyTableEx" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ResUtilSetPropertyTableEx hkeyClusterKey, varptr(pPropertyTable), Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, varptr(pOutParams) ; 戻り値は stat
; hkeyClusterKey : HKEY -> "sptr"
; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "sptr"
; Reserved : void* in/out -> "sptr"
; bAllowUnknownProperties : BOOL -> "sptr"
; pInPropertyList : void* -> "sptr"
; cbInPropertyListSize : DWORD -> "sptr"
; bForceWrite : BOOL -> "sptr"
; pOutParams : BYTE* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RESUTILS.dll" #cfunc global ResUtilSetPropertyTableEx "ResUtilSetPropertyTableEx" sptr, var, sptr, int, sptr, int, int, var ; res = ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams) ; hkeyClusterKey : HKEY -> "sptr" ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var" ; Reserved : void* in/out -> "sptr" ; bAllowUnknownProperties : BOOL -> "int" ; pInPropertyList : void* -> "sptr" ; cbInPropertyListSize : DWORD -> "int" ; bForceWrite : BOOL -> "int" ; pOutParams : BYTE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RESUTILS.dll" #cfunc global ResUtilSetPropertyTableEx "ResUtilSetPropertyTableEx" sptr, sptr, sptr, int, sptr, int, int, sptr ; res = ResUtilSetPropertyTableEx(hkeyClusterKey, varptr(pPropertyTable), Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, varptr(pOutParams)) ; hkeyClusterKey : HKEY -> "sptr" ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "sptr" ; Reserved : void* in/out -> "sptr" ; bAllowUnknownProperties : BOOL -> "int" ; pInPropertyList : void* -> "sptr" ; cbInPropertyListSize : DWORD -> "int" ; bForceWrite : BOOL -> "int" ; pOutParams : BYTE* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ResUtilSetPropertyTableEx(HKEY hkeyClusterKey, RESUTIL_PROPERTY_ITEM* pPropertyTable, void* Reserved, BOOL bAllowUnknownProperties, void* pInPropertyList, DWORD cbInPropertyListSize, BOOL bForceWrite, BYTE* pOutParams) #uselib "RESUTILS.dll" #cfunc global ResUtilSetPropertyTableEx "ResUtilSetPropertyTableEx" intptr, var, intptr, int, intptr, int, int, var ; res = ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams) ; hkeyClusterKey : HKEY -> "intptr" ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var" ; Reserved : void* in/out -> "intptr" ; bAllowUnknownProperties : BOOL -> "int" ; pInPropertyList : void* -> "intptr" ; cbInPropertyListSize : DWORD -> "int" ; bForceWrite : BOOL -> "int" ; pOutParams : BYTE* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ResUtilSetPropertyTableEx(HKEY hkeyClusterKey, RESUTIL_PROPERTY_ITEM* pPropertyTable, void* Reserved, BOOL bAllowUnknownProperties, void* pInPropertyList, DWORD cbInPropertyListSize, BOOL bForceWrite, BYTE* pOutParams) #uselib "RESUTILS.dll" #cfunc global ResUtilSetPropertyTableEx "ResUtilSetPropertyTableEx" intptr, intptr, intptr, int, intptr, int, int, intptr ; res = ResUtilSetPropertyTableEx(hkeyClusterKey, varptr(pPropertyTable), Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, varptr(pOutParams)) ; hkeyClusterKey : HKEY -> "intptr" ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "intptr" ; Reserved : void* in/out -> "intptr" ; bAllowUnknownProperties : BOOL -> "int" ; pInPropertyList : void* -> "intptr" ; cbInPropertyListSize : DWORD -> "int" ; bForceWrite : BOOL -> "int" ; pOutParams : BYTE* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
resutils = windows.NewLazySystemDLL("RESUTILS.dll")
procResUtilSetPropertyTableEx = resutils.NewProc("ResUtilSetPropertyTableEx")
)
// hkeyClusterKey (HKEY), pPropertyTable (RESUTIL_PROPERTY_ITEM*), Reserved (void* in/out), bAllowUnknownProperties (BOOL), pInPropertyList (void*), cbInPropertyListSize (DWORD), bForceWrite (BOOL), pOutParams (BYTE* in/out)
r1, _, err := procResUtilSetPropertyTableEx.Call(
uintptr(hkeyClusterKey),
uintptr(pPropertyTable),
uintptr(Reserved),
uintptr(bAllowUnknownProperties),
uintptr(pInPropertyList),
uintptr(cbInPropertyListSize),
uintptr(bForceWrite),
uintptr(pOutParams),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction ResUtilSetPropertyTableEx(
hkeyClusterKey: THandle; // HKEY
pPropertyTable: Pointer; // RESUTIL_PROPERTY_ITEM*
Reserved: Pointer; // void* in/out
bAllowUnknownProperties: BOOL; // BOOL
pInPropertyList: Pointer; // void*
cbInPropertyListSize: DWORD; // DWORD
bForceWrite: BOOL; // BOOL
pOutParams: Pointer // BYTE* in/out
): DWORD; stdcall;
external 'RESUTILS.dll' name 'ResUtilSetPropertyTableEx';result := DllCall("RESUTILS\ResUtilSetPropertyTableEx"
, "Ptr", hkeyClusterKey ; HKEY
, "Ptr", pPropertyTable ; RESUTIL_PROPERTY_ITEM*
, "Ptr", Reserved ; void* in/out
, "Int", bAllowUnknownProperties ; BOOL
, "Ptr", pInPropertyList ; void*
, "UInt", cbInPropertyListSize ; DWORD
, "Int", bForceWrite ; BOOL
, "Ptr", pOutParams ; BYTE* in/out
, "UInt") ; return: DWORD●ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams) = DLL("RESUTILS.dll", "dword ResUtilSetPropertyTableEx(void*, void*, void*, bool, void*, dword, bool, void*)")
# 呼び出し: ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
# hkeyClusterKey : HKEY -> "void*"
# pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "void*"
# Reserved : void* in/out -> "void*"
# bAllowUnknownProperties : BOOL -> "bool"
# pInPropertyList : void* -> "void*"
# cbInPropertyListSize : DWORD -> "dword"
# bForceWrite : BOOL -> "bool"
# pOutParams : BYTE* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。