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

ResUtilSetPropertyParameterBlockEx

関数
強制書き込み指定でパラメータブロックの値を設定する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2008

シグネチャ

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

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

パラメーター

名前方向説明
hkeyClusterKeyHKEYinプロパティを設定する対象のクラスターレジストリキー。
pPropertyTableRESUTIL_PROPERTY_ITEM*in設定基準となるプロパティ定義を記述したRESUTIL_PROPERTY_ITEM配列。
Reservedvoid*inout予約済み。NULLを指定する。
pInParamsBYTE*in書き込む値を保持する入力パラメーターブロックバッファ。
pInPropertyListvoid*in追加で設定する入力プロパティリストへのポインタ。NULL可。
cbInPropertyListSizeDWORDinpInPropertyListのサイズ(バイト)。
bForceWriteBOOLinTRUEで値が変わらなくても強制的に書き込む。
pOutParamsBYTE*inout更新結果を反映するパラメーターブロックバッファ。NULL可。

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD ResUtilSetPropertyParameterBlockEx(
    HKEY hkeyClusterKey,
    const RESUTIL_PROPERTY_ITEM* pPropertyTable,
    void* Reserved,
    const BYTE* pInParams,
    const void* pInPropertyList,
    DWORD cbInPropertyListSize,
    BOOL bForceWrite,
    BYTE* pOutParams
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilSetPropertyParameterBlockEx(
    IntPtr hkeyClusterKey,   // HKEY
    IntPtr pPropertyTable,   // RESUTIL_PROPERTY_ITEM*
    IntPtr Reserved,   // void* in/out
    IntPtr pInParams,   // BYTE*
    IntPtr pInPropertyList,   // void*
    uint cbInPropertyListSize,   // DWORD
    bool bForceWrite,   // BOOL
    IntPtr pOutParams   // BYTE* in/out
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilSetPropertyParameterBlockEx(
    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
    bForceWrite As Boolean,   ' BOOL
    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
' bForceWrite : BOOL
' pOutParams : BYTE* in/out
Declare PtrSafe Function ResUtilSetPropertyParameterBlockEx 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 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

ResUtilSetPropertyParameterBlockEx = ctypes.windll.resutils.ResUtilSetPropertyParameterBlockEx
ResUtilSetPropertyParameterBlockEx.restype = wintypes.DWORD
ResUtilSetPropertyParameterBlockEx.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
    wintypes.BOOL,  # bForceWrite : BOOL
    ctypes.POINTER(ctypes.c_ubyte),  # pOutParams : BYTE* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilSetPropertyParameterBlockEx = Fiddle::Function.new(
  lib['ResUtilSetPropertyParameterBlockEx'],
  [
    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_INT,  # bForceWrite : BOOL
    Fiddle::TYPE_VOIDP,  # pOutParams : BYTE* in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "resutils")]
extern "system" {
    fn ResUtilSetPropertyParameterBlockEx(
        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
        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 ResUtilSetPropertyParameterBlockEx(IntPtr hkeyClusterKey, IntPtr pPropertyTable, IntPtr Reserved, IntPtr pInParams, IntPtr pInPropertyList, uint cbInPropertyListSize, bool bForceWrite, IntPtr pOutParams);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilSetPropertyParameterBlockEx' -Namespace Win32 -PassThru
# $api::ResUtilSetPropertyParameterBlockEx(hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
#uselib "RESUTILS.dll"
#func global ResUtilSetPropertyParameterBlockEx "ResUtilSetPropertyParameterBlockEx" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ResUtilSetPropertyParameterBlockEx hkeyClusterKey, varptr(pPropertyTable), Reserved, varptr(pInParams), pInPropertyList, cbInPropertyListSize, bForceWrite, 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"
; bForceWrite : BOOL -> "sptr"
; pOutParams : BYTE* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RESUTILS.dll"
#cfunc global ResUtilSetPropertyParameterBlockEx "ResUtilSetPropertyParameterBlockEx" sptr, var, sptr, var, sptr, int, int, var
; res = ResUtilSetPropertyParameterBlockEx(hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
; hkeyClusterKey : HKEY -> "sptr"
; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var"
; Reserved : void* in/out -> "sptr"
; pInParams : BYTE* -> "var"
; pInPropertyList : void* -> "sptr"
; cbInPropertyListSize : DWORD -> "int"
; bForceWrite : BOOL -> "int"
; pOutParams : BYTE* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD ResUtilSetPropertyParameterBlockEx(HKEY hkeyClusterKey, RESUTIL_PROPERTY_ITEM* pPropertyTable, void* Reserved, BYTE* pInParams, void* pInPropertyList, DWORD cbInPropertyListSize, BOOL bForceWrite, BYTE* pOutParams)
#uselib "RESUTILS.dll"
#cfunc global ResUtilSetPropertyParameterBlockEx "ResUtilSetPropertyParameterBlockEx" intptr, var, intptr, var, intptr, int, int, var
; res = ResUtilSetPropertyParameterBlockEx(hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
; hkeyClusterKey : HKEY -> "intptr"
; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var"
; Reserved : void* in/out -> "intptr"
; pInParams : BYTE* -> "var"
; pInPropertyList : void* -> "intptr"
; cbInPropertyListSize : DWORD -> "int"
; bForceWrite : BOOL -> "int"
; pOutParams : BYTE* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilSetPropertyParameterBlockEx = resutils.NewProc("ResUtilSetPropertyParameterBlockEx")
)

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

extern "resutils" fn ResUtilSetPropertyParameterBlockEx(
    hkeyClusterKey: ?*anyopaque, // HKEY
    pPropertyTable: [*c]RESUTIL_PROPERTY_ITEM, // RESUTIL_PROPERTY_ITEM*
    Reserved: ?*anyopaque, // void* in/out
    pInParams: [*c]u8, // BYTE*
    pInPropertyList: ?*anyopaque, // void*
    cbInPropertyListSize: u32, // DWORD
    bForceWrite: i32, // BOOL
    pOutParams: [*c]u8 // BYTE* in/out
) callconv(std.os.windows.WINAPI) u32;
proc ResUtilSetPropertyParameterBlockEx(
    hkeyClusterKey: pointer,  # HKEY
    pPropertyTable: ptr RESUTIL_PROPERTY_ITEM,  # RESUTIL_PROPERTY_ITEM*
    Reserved: pointer,  # void* in/out
    pInParams: ptr uint8,  # BYTE*
    pInPropertyList: pointer,  # void*
    cbInPropertyListSize: uint32,  # DWORD
    bForceWrite: int32,  # BOOL
    pOutParams: ptr uint8  # BYTE* in/out
): uint32 {.importc: "ResUtilSetPropertyParameterBlockEx", stdcall, dynlib: "RESUTILS.dll".}
pragma(lib, "resutils");
extern(Windows)
uint ResUtilSetPropertyParameterBlockEx(
    void* hkeyClusterKey,   // HKEY
    RESUTIL_PROPERTY_ITEM* pPropertyTable,   // RESUTIL_PROPERTY_ITEM*
    void* Reserved,   // void* in/out
    ubyte* pInParams,   // BYTE*
    void* pInPropertyList,   // void*
    uint cbInPropertyListSize,   // DWORD
    int bForceWrite,   // BOOL
    ubyte* pOutParams   // BYTE* in/out
);
ccall((:ResUtilSetPropertyParameterBlockEx, "RESUTILS.dll"), stdcall, UInt32,
      (Ptr{Cvoid}, Ptr{RESUTIL_PROPERTY_ITEM}, Ptr{Cvoid}, Ptr{UInt8}, Ptr{Cvoid}, UInt32, Int32, Ptr{UInt8}),
      hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
# hkeyClusterKey : HKEY -> Ptr{Cvoid}
# pPropertyTable : RESUTIL_PROPERTY_ITEM* -> Ptr{RESUTIL_PROPERTY_ITEM}
# Reserved : void* in/out -> Ptr{Cvoid}
# pInParams : BYTE* -> Ptr{UInt8}
# pInPropertyList : void* -> Ptr{Cvoid}
# cbInPropertyListSize : DWORD -> UInt32
# bForceWrite : BOOL -> Int32
# pOutParams : BYTE* in/out -> Ptr{UInt8}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t ResUtilSetPropertyParameterBlockEx(
    void* hkeyClusterKey,
    void* pPropertyTable,
    void* Reserved,
    uint8_t* pInParams,
    void* pInPropertyList,
    uint32_t cbInPropertyListSize,
    int32_t bForceWrite,
    uint8_t* pOutParams);
]]
local resutils = ffi.load("resutils")
-- resutils.ResUtilSetPropertyParameterBlockEx(hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
-- hkeyClusterKey : HKEY
-- pPropertyTable : RESUTIL_PROPERTY_ITEM*
-- Reserved : void* in/out
-- pInParams : BYTE*
-- pInPropertyList : void*
-- cbInPropertyListSize : DWORD
-- bForceWrite : BOOL
-- pOutParams : BYTE* in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('RESUTILS.dll');
const ResUtilSetPropertyParameterBlockEx = lib.func('__stdcall', 'ResUtilSetPropertyParameterBlockEx', 'uint32_t', ['void *', 'void *', 'void *', 'uint8_t *', 'void *', 'uint32_t', 'int32_t', 'uint8_t *']);
// ResUtilSetPropertyParameterBlockEx(hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
// hkeyClusterKey : HKEY -> 'void *'
// pPropertyTable : RESUTIL_PROPERTY_ITEM* -> 'void *'
// Reserved : void* in/out -> 'void *'
// pInParams : BYTE* -> 'uint8_t *'
// pInPropertyList : void* -> 'void *'
// cbInPropertyListSize : DWORD -> 'uint32_t'
// bForceWrite : BOOL -> 'int32_t'
// pOutParams : BYTE* in/out -> 'uint8_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("RESUTILS.dll", {
  ResUtilSetPropertyParameterBlockEx: { parameters: ["pointer", "pointer", "pointer", "pointer", "pointer", "u32", "i32", "pointer"], result: "u32" },
});
// lib.symbols.ResUtilSetPropertyParameterBlockEx(hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
// hkeyClusterKey : HKEY -> "pointer"
// pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "pointer"
// Reserved : void* in/out -> "pointer"
// pInParams : BYTE* -> "pointer"
// pInPropertyList : void* -> "pointer"
// cbInPropertyListSize : DWORD -> "u32"
// bForceWrite : BOOL -> "i32"
// pOutParams : BYTE* in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t ResUtilSetPropertyParameterBlockEx(
    void* hkeyClusterKey,
    void* pPropertyTable,
    void* Reserved,
    uint8_t* pInParams,
    void* pInPropertyList,
    uint32_t cbInPropertyListSize,
    int32_t bForceWrite,
    uint8_t* pOutParams);
C, "RESUTILS.dll");
// $ffi->ResUtilSetPropertyParameterBlockEx(hkeyClusterKey, pPropertyTable, Reserved, pInParams, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams);
// hkeyClusterKey : HKEY
// pPropertyTable : RESUTIL_PROPERTY_ITEM*
// Reserved : void* in/out
// pInParams : BYTE*
// pInPropertyList : void*
// cbInPropertyListSize : DWORD
// bForceWrite : BOOL
// pOutParams : BYTE* in/out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Resutils extends StdCallLibrary {
    Resutils INSTANCE = Native.load("resutils", Resutils.class);
    int ResUtilSetPropertyParameterBlockEx(
        Pointer hkeyClusterKey,   // HKEY
        Pointer pPropertyTable,   // RESUTIL_PROPERTY_ITEM*
        Pointer Reserved,   // void* in/out
        byte[] pInParams,   // BYTE*
        Pointer pInPropertyList,   // void*
        int cbInPropertyListSize,   // DWORD
        boolean bForceWrite,   // BOOL
        byte[] pOutParams   // BYTE* in/out
    );
}
@[Link("resutils")]
lib LibRESUTILS
  fun ResUtilSetPropertyParameterBlockEx = ResUtilSetPropertyParameterBlockEx(
    hkeyClusterKey : Void*,   # HKEY
    pPropertyTable : RESUTIL_PROPERTY_ITEM*,   # RESUTIL_PROPERTY_ITEM*
    Reserved : Void*,   # void* in/out
    pInParams : UInt8*,   # BYTE*
    pInPropertyList : Void*,   # void*
    cbInPropertyListSize : UInt32,   # DWORD
    bForceWrite : Int32,   # BOOL
    pOutParams : UInt8*   # BYTE* in/out
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef ResUtilSetPropertyParameterBlockExNative = Uint32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Uint8>, Pointer<Void>, Uint32, Int32, Pointer<Uint8>);
typedef ResUtilSetPropertyParameterBlockExDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Pointer<Uint8>, Pointer<Void>, int, int, Pointer<Uint8>);
final ResUtilSetPropertyParameterBlockEx = DynamicLibrary.open('RESUTILS.dll')
    .lookupFunction<ResUtilSetPropertyParameterBlockExNative, ResUtilSetPropertyParameterBlockExDart>('ResUtilSetPropertyParameterBlockEx');
// hkeyClusterKey : HKEY -> Pointer<Void>
// pPropertyTable : RESUTIL_PROPERTY_ITEM* -> Pointer<Void>
// Reserved : void* in/out -> Pointer<Void>
// pInParams : BYTE* -> Pointer<Uint8>
// pInPropertyList : void* -> Pointer<Void>
// cbInPropertyListSize : DWORD -> Uint32
// bForceWrite : BOOL -> Int32
// pOutParams : BYTE* in/out -> Pointer<Uint8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function ResUtilSetPropertyParameterBlockEx(
  hkeyClusterKey: THandle;   // HKEY
  pPropertyTable: Pointer;   // RESUTIL_PROPERTY_ITEM*
  Reserved: Pointer;   // void* in/out
  pInParams: Pointer;   // BYTE*
  pInPropertyList: Pointer;   // void*
  cbInPropertyListSize: DWORD;   // DWORD
  bForceWrite: BOOL;   // BOOL
  pOutParams: Pointer   // BYTE* in/out
): DWORD; stdcall;
  external 'RESUTILS.dll' name 'ResUtilSetPropertyParameterBlockEx';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "ResUtilSetPropertyParameterBlockEx"
  c_ResUtilSetPropertyParameterBlockEx :: Ptr () -> Ptr () -> Ptr () -> Ptr Word8 -> Ptr () -> Word32 -> CInt -> Ptr Word8 -> IO Word32
-- hkeyClusterKey : HKEY -> Ptr ()
-- pPropertyTable : RESUTIL_PROPERTY_ITEM* -> Ptr ()
-- Reserved : void* in/out -> Ptr ()
-- pInParams : BYTE* -> Ptr Word8
-- pInPropertyList : void* -> Ptr ()
-- cbInPropertyListSize : DWORD -> Word32
-- bForceWrite : BOOL -> CInt
-- pOutParams : BYTE* in/out -> Ptr Word8
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let resutilsetpropertyparameterblockex =
  foreign "ResUtilSetPropertyParameterBlockEx"
    ((ptr void) @-> (ptr void) @-> (ptr void) @-> (ptr uint8_t) @-> (ptr void) @-> uint32_t @-> int32_t @-> (ptr uint8_t) @-> returning uint32_t)
(* hkeyClusterKey : HKEY -> (ptr void) *)
(* pPropertyTable : RESUTIL_PROPERTY_ITEM* -> (ptr void) *)
(* Reserved : void* in/out -> (ptr void) *)
(* pInParams : BYTE* -> (ptr uint8_t) *)
(* pInPropertyList : void* -> (ptr void) *)
(* cbInPropertyListSize : DWORD -> uint32_t *)
(* bForceWrite : BOOL -> int32_t *)
(* pOutParams : BYTE* in/out -> (ptr uint8_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library resutils (t "RESUTILS.dll"))
(cffi:use-foreign-library resutils)

(cffi:defcfun ("ResUtilSetPropertyParameterBlockEx" res-util-set-property-parameter-block-ex :convention :stdcall) :uint32
  (hkey-cluster-key :pointer)   ; HKEY
  (p-property-table :pointer)   ; RESUTIL_PROPERTY_ITEM*
  (reserved :pointer)   ; void* in/out
  (p-in-params :pointer)   ; BYTE*
  (p-in-property-list :pointer)   ; void*
  (cb-in-property-list-size :uint32)   ; DWORD
  (b-force-write :int32)   ; BOOL
  (p-out-params :pointer))   ; BYTE* in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $ResUtilSetPropertyParameterBlockEx = Win32::API::More->new('RESUTILS',
    'DWORD ResUtilSetPropertyParameterBlockEx(HANDLE hkeyClusterKey, LPVOID pPropertyTable, LPVOID Reserved, LPVOID pInParams, LPVOID pInPropertyList, DWORD cbInPropertyListSize, BOOL bForceWrite, LPVOID pOutParams)');
# my $ret = $ResUtilSetPropertyParameterBlockEx->Call($hkeyClusterKey, $pPropertyTable, $Reserved, $pInParams, $pInPropertyList, $cbInPropertyListSize, $bForceWrite, $pOutParams);
# hkeyClusterKey : HKEY -> HANDLE
# pPropertyTable : RESUTIL_PROPERTY_ITEM* -> LPVOID
# Reserved : void* in/out -> LPVOID
# pInParams : BYTE* -> LPVOID
# pInPropertyList : void* -> LPVOID
# cbInPropertyListSize : DWORD -> DWORD
# bForceWrite : BOOL -> BOOL
# pOutParams : BYTE* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

類似 API
使用する型