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

ResUtilSetPrivatePropertyList

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

シグネチャ

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

DWORD ResUtilSetPrivatePropertyList(
    HKEY hkeyClusterKey,
    const void* pInPropertyList,
    DWORD cbInPropertyListSize
);

パラメーター

名前方向
hkeyClusterKeyHKEYin
pInPropertyListvoid*in
cbInPropertyListSizeDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ResUtilSetPrivatePropertyList(
    HKEY hkeyClusterKey,
    const void* pInPropertyList,
    DWORD cbInPropertyListSize
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilSetPrivatePropertyList(
    IntPtr hkeyClusterKey,   // HKEY
    IntPtr pInPropertyList,   // void*
    uint cbInPropertyListSize   // DWORD
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilSetPrivatePropertyList(
    hkeyClusterKey As IntPtr,   ' HKEY
    pInPropertyList As IntPtr,   ' void*
    cbInPropertyListSize As UInteger   ' DWORD
) As UInteger
End Function
' hkeyClusterKey : HKEY
' pInPropertyList : void*
' cbInPropertyListSize : DWORD
Declare PtrSafe Function ResUtilSetPrivatePropertyList Lib "resutils" ( _
    ByVal hkeyClusterKey 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

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

lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilSetPrivatePropertyList = Fiddle::Function.new(
  lib['ResUtilSetPrivatePropertyList'],
  [
    Fiddle::TYPE_VOIDP,  # hkeyClusterKey : HKEY
    Fiddle::TYPE_VOIDP,  # pInPropertyList : void*
    -Fiddle::TYPE_INT,  # cbInPropertyListSize : DWORD
  ],
  -Fiddle::TYPE_INT)
#[link(name = "resutils")]
extern "system" {
    fn ResUtilSetPrivatePropertyList(
        hkeyClusterKey: *mut core::ffi::c_void,  // HKEY
        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 ResUtilSetPrivatePropertyList(IntPtr hkeyClusterKey, IntPtr pInPropertyList, uint cbInPropertyListSize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilSetPrivatePropertyList' -Namespace Win32 -PassThru
# $api::ResUtilSetPrivatePropertyList(hkeyClusterKey, pInPropertyList, cbInPropertyListSize)
#uselib "RESUTILS.dll"
#func global ResUtilSetPrivatePropertyList "ResUtilSetPrivatePropertyList" sptr, sptr, sptr
; ResUtilSetPrivatePropertyList hkeyClusterKey, pInPropertyList, cbInPropertyListSize   ; 戻り値は stat
; hkeyClusterKey : HKEY -> "sptr"
; pInPropertyList : void* -> "sptr"
; cbInPropertyListSize : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "RESUTILS.dll"
#cfunc global ResUtilSetPrivatePropertyList "ResUtilSetPrivatePropertyList" sptr, sptr, int
; res = ResUtilSetPrivatePropertyList(hkeyClusterKey, pInPropertyList, cbInPropertyListSize)
; hkeyClusterKey : HKEY -> "sptr"
; pInPropertyList : void* -> "sptr"
; cbInPropertyListSize : DWORD -> "int"
; DWORD ResUtilSetPrivatePropertyList(HKEY hkeyClusterKey, void* pInPropertyList, DWORD cbInPropertyListSize)
#uselib "RESUTILS.dll"
#cfunc global ResUtilSetPrivatePropertyList "ResUtilSetPrivatePropertyList" intptr, intptr, int
; res = ResUtilSetPrivatePropertyList(hkeyClusterKey, pInPropertyList, cbInPropertyListSize)
; hkeyClusterKey : HKEY -> "intptr"
; pInPropertyList : void* -> "intptr"
; cbInPropertyListSize : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilSetPrivatePropertyList = resutils.NewProc("ResUtilSetPrivatePropertyList")
)

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