ホーム › 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 | 設定基準となるプロパティ定義を記述したRESUTIL_PROPERTY_ITEM配列。 |
| Reserved | void* | inout | 予約済み。NULLを指定する。 |
| bAllowUnknownProperties | BOOL | in | TRUEで未知のプロパティも設定を許容する。 |
| pInPropertyList | void* | in | 設定する入力プロパティリストへのポインタ。 |
| cbInPropertyListSize | DWORD | in | pInPropertyListのサイズ(バイト)。 |
| bForceWrite | BOOL | in | TRUEで値が変わらなくても強制的に書き込む。 |
| pOutParams | BYTE* | inout | 更新結果を反映するパラメーターブロックバッファ。NULL可。 |
戻り値の型: 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)。const std = @import("std");
extern "resutils" fn ResUtilSetPropertyTableEx(
hkeyClusterKey: ?*anyopaque, // HKEY
pPropertyTable: [*c]RESUTIL_PROPERTY_ITEM, // RESUTIL_PROPERTY_ITEM*
Reserved: ?*anyopaque, // void* in/out
bAllowUnknownProperties: i32, // BOOL
pInPropertyList: ?*anyopaque, // void*
cbInPropertyListSize: u32, // DWORD
bForceWrite: i32, // BOOL
pOutParams: [*c]u8 // BYTE* in/out
) callconv(std.os.windows.WINAPI) u32;proc ResUtilSetPropertyTableEx(
hkeyClusterKey: pointer, # HKEY
pPropertyTable: ptr RESUTIL_PROPERTY_ITEM, # RESUTIL_PROPERTY_ITEM*
Reserved: pointer, # void* in/out
bAllowUnknownProperties: int32, # BOOL
pInPropertyList: pointer, # void*
cbInPropertyListSize: uint32, # DWORD
bForceWrite: int32, # BOOL
pOutParams: ptr uint8 # BYTE* in/out
): uint32 {.importc: "ResUtilSetPropertyTableEx", stdcall, dynlib: "RESUTILS.dll".}pragma(lib, "resutils");
extern(Windows)
uint ResUtilSetPropertyTableEx(
void* hkeyClusterKey, // HKEY
RESUTIL_PROPERTY_ITEM* pPropertyTable, // RESUTIL_PROPERTY_ITEM*
void* Reserved, // void* in/out
int bAllowUnknownProperties, // BOOL
void* pInPropertyList, // void*
uint cbInPropertyListSize, // DWORD
int bForceWrite, // BOOL
ubyte* pOutParams // BYTE* in/out
);ccall((:ResUtilSetPropertyTableEx, "RESUTILS.dll"), stdcall, UInt32,
(Ptr{Cvoid}, Ptr{RESUTIL_PROPERTY_ITEM}, Ptr{Cvoid}, Int32, Ptr{Cvoid}, UInt32, Int32, Ptr{UInt8}),
hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
# hkeyClusterKey : HKEY -> Ptr{Cvoid}
# pPropertyTable : RESUTIL_PROPERTY_ITEM* -> Ptr{RESUTIL_PROPERTY_ITEM}
# Reserved : void* in/out -> Ptr{Cvoid}
# bAllowUnknownProperties : BOOL -> Int32
# 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 ResUtilSetPropertyTableEx(
void* hkeyClusterKey,
void* pPropertyTable,
void* Reserved,
int32_t bAllowUnknownProperties,
void* pInPropertyList,
uint32_t cbInPropertyListSize,
int32_t bForceWrite,
uint8_t* pOutParams);
]]
local resutils = ffi.load("resutils")
-- resutils.ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
-- hkeyClusterKey : HKEY
-- pPropertyTable : RESUTIL_PROPERTY_ITEM*
-- Reserved : void* in/out
-- bAllowUnknownProperties : BOOL
-- 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 ResUtilSetPropertyTableEx = lib.func('__stdcall', 'ResUtilSetPropertyTableEx', 'uint32_t', ['void *', 'void *', 'void *', 'int32_t', 'void *', 'uint32_t', 'int32_t', 'uint8_t *']);
// ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
// hkeyClusterKey : HKEY -> 'void *'
// pPropertyTable : RESUTIL_PROPERTY_ITEM* -> 'void *'
// Reserved : void* in/out -> 'void *'
// bAllowUnknownProperties : BOOL -> 'int32_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", {
ResUtilSetPropertyTableEx: { parameters: ["pointer", "pointer", "pointer", "i32", "pointer", "u32", "i32", "pointer"], result: "u32" },
});
// lib.symbols.ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams)
// hkeyClusterKey : HKEY -> "pointer"
// pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "pointer"
// Reserved : void* in/out -> "pointer"
// bAllowUnknownProperties : BOOL -> "i32"
// 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 ResUtilSetPropertyTableEx(
void* hkeyClusterKey,
void* pPropertyTable,
void* Reserved,
int32_t bAllowUnknownProperties,
void* pInPropertyList,
uint32_t cbInPropertyListSize,
int32_t bForceWrite,
uint8_t* pOutParams);
C, "RESUTILS.dll");
// $ffi->ResUtilSetPropertyTableEx(hkeyClusterKey, pPropertyTable, Reserved, bAllowUnknownProperties, pInPropertyList, cbInPropertyListSize, bForceWrite, pOutParams);
// hkeyClusterKey : HKEY
// pPropertyTable : RESUTIL_PROPERTY_ITEM*
// Reserved : void* in/out
// bAllowUnknownProperties : BOOL
// 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 ResUtilSetPropertyTableEx(
Pointer hkeyClusterKey, // HKEY
Pointer pPropertyTable, // RESUTIL_PROPERTY_ITEM*
Pointer Reserved, // void* in/out
boolean bAllowUnknownProperties, // BOOL
Pointer pInPropertyList, // void*
int cbInPropertyListSize, // DWORD
boolean bForceWrite, // BOOL
byte[] pOutParams // BYTE* in/out
);
}@[Link("resutils")]
lib LibRESUTILS
fun ResUtilSetPropertyTableEx = ResUtilSetPropertyTableEx(
hkeyClusterKey : Void*, # HKEY
pPropertyTable : RESUTIL_PROPERTY_ITEM*, # RESUTIL_PROPERTY_ITEM*
Reserved : Void*, # void* in/out
bAllowUnknownProperties : Int32, # BOOL
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 ResUtilSetPropertyTableExNative = Uint32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Int32, Pointer<Void>, Uint32, Int32, Pointer<Uint8>);
typedef ResUtilSetPropertyTableExDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, int, Pointer<Void>, int, int, Pointer<Uint8>);
final ResUtilSetPropertyTableEx = DynamicLibrary.open('RESUTILS.dll')
.lookupFunction<ResUtilSetPropertyTableExNative, ResUtilSetPropertyTableExDart>('ResUtilSetPropertyTableEx');
// hkeyClusterKey : HKEY -> Pointer<Void>
// pPropertyTable : RESUTIL_PROPERTY_ITEM* -> Pointer<Void>
// Reserved : void* in/out -> Pointer<Void>
// bAllowUnknownProperties : BOOL -> Int32
// pInPropertyList : void* -> Pointer<Void>
// cbInPropertyListSize : DWORD -> Uint32
// bForceWrite : BOOL -> Int32
// pOutParams : BYTE* in/out -> Pointer<Uint8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function 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';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "ResUtilSetPropertyTableEx"
c_ResUtilSetPropertyTableEx :: Ptr () -> Ptr () -> Ptr () -> CInt -> Ptr () -> Word32 -> CInt -> Ptr Word8 -> IO Word32
-- hkeyClusterKey : HKEY -> Ptr ()
-- pPropertyTable : RESUTIL_PROPERTY_ITEM* -> Ptr ()
-- Reserved : void* in/out -> Ptr ()
-- bAllowUnknownProperties : BOOL -> CInt
-- 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 resutilsetpropertytableex =
foreign "ResUtilSetPropertyTableEx"
((ptr void) @-> (ptr void) @-> (ptr void) @-> int32_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) *)
(* bAllowUnknownProperties : BOOL -> int32_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 ("ResUtilSetPropertyTableEx" res-util-set-property-table-ex :convention :stdcall) :uint32
(hkey-cluster-key :pointer) ; HKEY
(p-property-table :pointer) ; RESUTIL_PROPERTY_ITEM*
(reserved :pointer) ; void* in/out
(b-allow-unknown-properties :int32) ; BOOL
(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 $ResUtilSetPropertyTableEx = Win32::API::More->new('RESUTILS',
'DWORD ResUtilSetPropertyTableEx(HANDLE hkeyClusterKey, LPVOID pPropertyTable, LPVOID Reserved, BOOL bAllowUnknownProperties, LPVOID pInPropertyList, DWORD cbInPropertyListSize, BOOL bForceWrite, LPVOID pOutParams)');
# my $ret = $ResUtilSetPropertyTableEx->Call($hkeyClusterKey, $pPropertyTable, $Reserved, $bAllowUnknownProperties, $pInPropertyList, $cbInPropertyListSize, $bForceWrite, $pOutParams);
# hkeyClusterKey : HKEY -> HANDLE
# pPropertyTable : RESUTIL_PROPERTY_ITEM* -> LPVOID
# Reserved : void* in/out -> LPVOID
# bAllowUnknownProperties : BOOL -> BOOL
# pInPropertyList : void* -> LPVOID
# cbInPropertyListSize : DWORD -> DWORD
# bForceWrite : BOOL -> BOOL
# pOutParams : BYTE* in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
類似 API
- f ResUtilSetPropertyTable — プロパティテーブルに従い値をクラスタキーに設定する。