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