ホーム › Networking.Clustering › ResUtilFindExpandSzProperty
ResUtilFindExpandSzProperty
関数プロパティリストから展開可能文字列プロパティを検索する。
シグネチャ
// RESUTILS.dll
#include <windows.h>
DWORD ResUtilFindExpandSzProperty(
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 ResUtilFindExpandSzProperty(
const void* pPropertyList,
DWORD cbPropertyListSize,
LPCWSTR pszPropertyName,
LPWSTR* pszPropertyValue // optional
);[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilFindExpandSzProperty(
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 ResUtilFindExpandSzProperty(
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 ResUtilFindExpandSzProperty 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
ResUtilFindExpandSzProperty = ctypes.windll.resutils.ResUtilFindExpandSzProperty
ResUtilFindExpandSzProperty.restype = wintypes.DWORD
ResUtilFindExpandSzProperty.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')
ResUtilFindExpandSzProperty = Fiddle::Function.new(
lib['ResUtilFindExpandSzProperty'],
[
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 ResUtilFindExpandSzProperty(
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 ResUtilFindExpandSzProperty(IntPtr pPropertyList, uint cbPropertyListSize, [MarshalAs(UnmanagedType.LPWStr)] string pszPropertyName, IntPtr pszPropertyValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilFindExpandSzProperty' -Namespace Win32 -PassThru
# $api::ResUtilFindExpandSzProperty(pPropertyList, cbPropertyListSize, pszPropertyName, pszPropertyValue)#uselib "RESUTILS.dll"
#func global ResUtilFindExpandSzProperty "ResUtilFindExpandSzProperty" sptr, sptr, sptr, sptr
; ResUtilFindExpandSzProperty 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 ResUtilFindExpandSzProperty "ResUtilFindExpandSzProperty" sptr, int, wstr, var ; res = ResUtilFindExpandSzProperty(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 ResUtilFindExpandSzProperty "ResUtilFindExpandSzProperty" sptr, int, wstr, sptr ; res = ResUtilFindExpandSzProperty(pPropertyList, cbPropertyListSize, pszPropertyName, varptr(pszPropertyValue)) ; pPropertyList : void* -> "sptr" ; cbPropertyListSize : DWORD -> "int" ; pszPropertyName : LPCWSTR -> "wstr" ; pszPropertyValue : LPWSTR* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD ResUtilFindExpandSzProperty(void* pPropertyList, DWORD cbPropertyListSize, LPCWSTR pszPropertyName, LPWSTR* pszPropertyValue) #uselib "RESUTILS.dll" #cfunc global ResUtilFindExpandSzProperty "ResUtilFindExpandSzProperty" intptr, int, wstr, var ; res = ResUtilFindExpandSzProperty(pPropertyList, cbPropertyListSize, pszPropertyName, pszPropertyValue) ; pPropertyList : void* -> "intptr" ; cbPropertyListSize : DWORD -> "int" ; pszPropertyName : LPCWSTR -> "wstr" ; pszPropertyValue : LPWSTR* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD ResUtilFindExpandSzProperty(void* pPropertyList, DWORD cbPropertyListSize, LPCWSTR pszPropertyName, LPWSTR* pszPropertyValue) #uselib "RESUTILS.dll" #cfunc global ResUtilFindExpandSzProperty "ResUtilFindExpandSzProperty" intptr, int, wstr, intptr ; res = ResUtilFindExpandSzProperty(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")
procResUtilFindExpandSzProperty = resutils.NewProc("ResUtilFindExpandSzProperty")
)
// pPropertyList (void*), cbPropertyListSize (DWORD), pszPropertyName (LPCWSTR), pszPropertyValue (LPWSTR* optional, out)
r1, _, err := procResUtilFindExpandSzProperty.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 ResUtilFindExpandSzProperty(
pPropertyList: Pointer; // void*
cbPropertyListSize: DWORD; // DWORD
pszPropertyName: PWideChar; // LPCWSTR
pszPropertyValue: PPWideChar // LPWSTR* optional, out
): DWORD; stdcall;
external 'RESUTILS.dll' name 'ResUtilFindExpandSzProperty';result := DllCall("RESUTILS\ResUtilFindExpandSzProperty"
, "Ptr", pPropertyList ; void*
, "UInt", cbPropertyListSize ; DWORD
, "WStr", pszPropertyName ; LPCWSTR
, "Ptr", pszPropertyValue ; LPWSTR* optional, out
, "UInt") ; return: DWORD●ResUtilFindExpandSzProperty(pPropertyList, cbPropertyListSize, pszPropertyName, pszPropertyValue) = DLL("RESUTILS.dll", "dword ResUtilFindExpandSzProperty(void*, dword, char*, void*)")
# 呼び出し: ResUtilFindExpandSzProperty(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)。