ホーム › Networking.Clustering › ResUtilGetPropertyFormats
ResUtilGetPropertyFormats
関数プロパティテーブルの書式情報リストを取得する。
シグネチャ
// RESUTILS.dll
#include <windows.h>
DWORD ResUtilGetPropertyFormats(
const RESUTIL_PROPERTY_ITEM* pPropertyTable,
void* pOutPropertyFormatList,
DWORD cbPropertyFormatListSize,
DWORD* pcbBytesReturned,
DWORD* pcbRequired
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pPropertyTable | RESUTIL_PROPERTY_ITEM* | in |
| pOutPropertyFormatList | void* | out |
| cbPropertyFormatListSize | DWORD | in |
| pcbBytesReturned | DWORD* | out |
| pcbRequired | DWORD* | out |
戻り値の型: DWORD
各言語での呼び出し定義
// RESUTILS.dll
#include <windows.h>
DWORD ResUtilGetPropertyFormats(
const RESUTIL_PROPERTY_ITEM* pPropertyTable,
void* pOutPropertyFormatList,
DWORD cbPropertyFormatListSize,
DWORD* pcbBytesReturned,
DWORD* pcbRequired
);[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilGetPropertyFormats(
IntPtr pPropertyTable, // RESUTIL_PROPERTY_ITEM*
IntPtr pOutPropertyFormatList, // void* out
uint cbPropertyFormatListSize, // DWORD
out uint pcbBytesReturned, // DWORD* out
out uint pcbRequired // DWORD* out
);<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilGetPropertyFormats(
pPropertyTable As IntPtr, ' RESUTIL_PROPERTY_ITEM*
pOutPropertyFormatList As IntPtr, ' void* out
cbPropertyFormatListSize As UInteger, ' DWORD
<Out> ByRef pcbBytesReturned As UInteger, ' DWORD* out
<Out> ByRef pcbRequired As UInteger ' DWORD* out
) As UInteger
End Function' pPropertyTable : RESUTIL_PROPERTY_ITEM*
' pOutPropertyFormatList : void* out
' cbPropertyFormatListSize : DWORD
' pcbBytesReturned : DWORD* out
' pcbRequired : DWORD* out
Declare PtrSafe Function ResUtilGetPropertyFormats Lib "resutils" ( _
ByVal pPropertyTable As LongPtr, _
ByVal pOutPropertyFormatList As LongPtr, _
ByVal cbPropertyFormatListSize As Long, _
ByRef pcbBytesReturned As Long, _
ByRef pcbRequired As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ResUtilGetPropertyFormats = ctypes.windll.resutils.ResUtilGetPropertyFormats
ResUtilGetPropertyFormats.restype = wintypes.DWORD
ResUtilGetPropertyFormats.argtypes = [
ctypes.c_void_p, # pPropertyTable : RESUTIL_PROPERTY_ITEM*
ctypes.POINTER(None), # pOutPropertyFormatList : void* out
wintypes.DWORD, # cbPropertyFormatListSize : DWORD
ctypes.POINTER(wintypes.DWORD), # pcbBytesReturned : DWORD* out
ctypes.POINTER(wintypes.DWORD), # pcbRequired : DWORD* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilGetPropertyFormats = Fiddle::Function.new(
lib['ResUtilGetPropertyFormats'],
[
Fiddle::TYPE_VOIDP, # pPropertyTable : RESUTIL_PROPERTY_ITEM*
Fiddle::TYPE_VOIDP, # pOutPropertyFormatList : void* out
-Fiddle::TYPE_INT, # cbPropertyFormatListSize : DWORD
Fiddle::TYPE_VOIDP, # pcbBytesReturned : DWORD* out
Fiddle::TYPE_VOIDP, # pcbRequired : DWORD* out
],
-Fiddle::TYPE_INT)#[link(name = "resutils")]
extern "system" {
fn ResUtilGetPropertyFormats(
pPropertyTable: *const RESUTIL_PROPERTY_ITEM, // RESUTIL_PROPERTY_ITEM*
pOutPropertyFormatList: *mut (), // void* out
cbPropertyFormatListSize: u32, // DWORD
pcbBytesReturned: *mut u32, // DWORD* out
pcbRequired: *mut u32 // DWORD* out
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("RESUTILS.dll")]
public static extern uint ResUtilGetPropertyFormats(IntPtr pPropertyTable, IntPtr pOutPropertyFormatList, uint cbPropertyFormatListSize, out uint pcbBytesReturned, out uint pcbRequired);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilGetPropertyFormats' -Namespace Win32 -PassThru
# $api::ResUtilGetPropertyFormats(pPropertyTable, pOutPropertyFormatList, cbPropertyFormatListSize, pcbBytesReturned, pcbRequired)#uselib "RESUTILS.dll"
#func global ResUtilGetPropertyFormats "ResUtilGetPropertyFormats" sptr, sptr, sptr, sptr, sptr
; ResUtilGetPropertyFormats varptr(pPropertyTable), pOutPropertyFormatList, cbPropertyFormatListSize, varptr(pcbBytesReturned), varptr(pcbRequired) ; 戻り値は stat
; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "sptr"
; pOutPropertyFormatList : void* out -> "sptr"
; cbPropertyFormatListSize : DWORD -> "sptr"
; pcbBytesReturned : DWORD* out -> "sptr"
; pcbRequired : DWORD* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "RESUTILS.dll" #cfunc global ResUtilGetPropertyFormats "ResUtilGetPropertyFormats" var, sptr, int, var, var ; res = ResUtilGetPropertyFormats(pPropertyTable, pOutPropertyFormatList, cbPropertyFormatListSize, pcbBytesReturned, pcbRequired) ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var" ; pOutPropertyFormatList : void* out -> "sptr" ; cbPropertyFormatListSize : DWORD -> "int" ; pcbBytesReturned : DWORD* out -> "var" ; pcbRequired : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "RESUTILS.dll" #cfunc global ResUtilGetPropertyFormats "ResUtilGetPropertyFormats" sptr, sptr, int, sptr, sptr ; res = ResUtilGetPropertyFormats(varptr(pPropertyTable), pOutPropertyFormatList, cbPropertyFormatListSize, varptr(pcbBytesReturned), varptr(pcbRequired)) ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "sptr" ; pOutPropertyFormatList : void* out -> "sptr" ; cbPropertyFormatListSize : DWORD -> "int" ; pcbBytesReturned : DWORD* out -> "sptr" ; pcbRequired : DWORD* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ResUtilGetPropertyFormats(RESUTIL_PROPERTY_ITEM* pPropertyTable, void* pOutPropertyFormatList, DWORD cbPropertyFormatListSize, DWORD* pcbBytesReturned, DWORD* pcbRequired) #uselib "RESUTILS.dll" #cfunc global ResUtilGetPropertyFormats "ResUtilGetPropertyFormats" var, intptr, int, var, var ; res = ResUtilGetPropertyFormats(pPropertyTable, pOutPropertyFormatList, cbPropertyFormatListSize, pcbBytesReturned, pcbRequired) ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "var" ; pOutPropertyFormatList : void* out -> "intptr" ; cbPropertyFormatListSize : DWORD -> "int" ; pcbBytesReturned : DWORD* out -> "var" ; pcbRequired : DWORD* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ResUtilGetPropertyFormats(RESUTIL_PROPERTY_ITEM* pPropertyTable, void* pOutPropertyFormatList, DWORD cbPropertyFormatListSize, DWORD* pcbBytesReturned, DWORD* pcbRequired) #uselib "RESUTILS.dll" #cfunc global ResUtilGetPropertyFormats "ResUtilGetPropertyFormats" intptr, intptr, int, intptr, intptr ; res = ResUtilGetPropertyFormats(varptr(pPropertyTable), pOutPropertyFormatList, cbPropertyFormatListSize, varptr(pcbBytesReturned), varptr(pcbRequired)) ; pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "intptr" ; pOutPropertyFormatList : void* out -> "intptr" ; cbPropertyFormatListSize : DWORD -> "int" ; pcbBytesReturned : DWORD* out -> "intptr" ; pcbRequired : DWORD* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
resutils = windows.NewLazySystemDLL("RESUTILS.dll")
procResUtilGetPropertyFormats = resutils.NewProc("ResUtilGetPropertyFormats")
)
// pPropertyTable (RESUTIL_PROPERTY_ITEM*), pOutPropertyFormatList (void* out), cbPropertyFormatListSize (DWORD), pcbBytesReturned (DWORD* out), pcbRequired (DWORD* out)
r1, _, err := procResUtilGetPropertyFormats.Call(
uintptr(pPropertyTable),
uintptr(pOutPropertyFormatList),
uintptr(cbPropertyFormatListSize),
uintptr(pcbBytesReturned),
uintptr(pcbRequired),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction ResUtilGetPropertyFormats(
pPropertyTable: Pointer; // RESUTIL_PROPERTY_ITEM*
pOutPropertyFormatList: Pointer; // void* out
cbPropertyFormatListSize: DWORD; // DWORD
pcbBytesReturned: Pointer; // DWORD* out
pcbRequired: Pointer // DWORD* out
): DWORD; stdcall;
external 'RESUTILS.dll' name 'ResUtilGetPropertyFormats';result := DllCall("RESUTILS\ResUtilGetPropertyFormats"
, "Ptr", pPropertyTable ; RESUTIL_PROPERTY_ITEM*
, "Ptr", pOutPropertyFormatList ; void* out
, "UInt", cbPropertyFormatListSize ; DWORD
, "Ptr", pcbBytesReturned ; DWORD* out
, "Ptr", pcbRequired ; DWORD* out
, "UInt") ; return: DWORD●ResUtilGetPropertyFormats(pPropertyTable, pOutPropertyFormatList, cbPropertyFormatListSize, pcbBytesReturned, pcbRequired) = DLL("RESUTILS.dll", "dword ResUtilGetPropertyFormats(void*, void*, dword, void*, void*)")
# 呼び出し: ResUtilGetPropertyFormats(pPropertyTable, pOutPropertyFormatList, cbPropertyFormatListSize, pcbBytesReturned, pcbRequired)
# pPropertyTable : RESUTIL_PROPERTY_ITEM* -> "void*"
# pOutPropertyFormatList : void* out -> "void*"
# cbPropertyFormatListSize : DWORD -> "dword"
# pcbBytesReturned : DWORD* out -> "void*"
# pcbRequired : DWORD* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。