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

ResUtilSetUnknownProperties

関数
未知のプロパティをクラスタキーに設定する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

DWORD ResUtilSetUnknownProperties(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    const void* pInPropertyList,
    DWORD cbInPropertyListSize
);

パラメーター

名前方向
hkeyClusterKeyHKEYin
pPropertyTableRESUTIL_PROPERTY_ITEM*in
pInPropertyListvoid*in
cbInPropertyListSizeDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

ResUtilSetUnknownProperties = ctypes.windll.resutils.ResUtilSetUnknownProperties
ResUtilSetUnknownProperties.restype = wintypes.DWORD
ResUtilSetUnknownProperties.argtypes = [
    wintypes.HANDLE,  # hkeyClusterKey : HKEY
    ctypes.c_void_p,  # pPropertyTable : RESUTIL_PROPERTY_ITEM*
    ctypes.POINTER(None),  # pInPropertyList : void*
    wintypes.DWORD,  # cbInPropertyListSize : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilSetUnknownProperties = resutils.NewProc("ResUtilSetUnknownProperties")
)

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