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