Win32 API 日本語リファレンス
ホームNetworking.Clustering › ResUtilFindULargeIntegerProperty

ResUtilFindULargeIntegerProperty

関数
プロパティリストから符号なし64ビット整数プロパティを検索する。
DLLRESUTILS.dll呼出規約winapi対応OSwindowsserver2016

シグネチャ

// RESUTILS.dll
#include <windows.h>

DWORD ResUtilFindULargeIntegerProperty(
    const void* pPropertyList,
    DWORD cbPropertyListSize,
    LPCWSTR pszPropertyName,
    ULONGLONG* plPropertyValue
);

パラメーター

名前方向
pPropertyListvoid*in
cbPropertyListSizeDWORDin
pszPropertyNameLPCWSTRin
plPropertyValueULONGLONG*out

戻り値の型: DWORD

各言語での呼び出し定義

// RESUTILS.dll
#include <windows.h>

DWORD ResUtilFindULargeIntegerProperty(
    const void* pPropertyList,
    DWORD cbPropertyListSize,
    LPCWSTR pszPropertyName,
    ULONGLONG* plPropertyValue
);
[DllImport("RESUTILS.dll", ExactSpelling = true)]
static extern uint ResUtilFindULargeIntegerProperty(
    IntPtr pPropertyList,   // void*
    uint cbPropertyListSize,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string pszPropertyName,   // LPCWSTR
    out ulong plPropertyValue   // ULONGLONG* out
);
<DllImport("RESUTILS.dll", ExactSpelling:=True)>
Public Shared Function ResUtilFindULargeIntegerProperty(
    pPropertyList As IntPtr,   ' void*
    cbPropertyListSize As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> pszPropertyName As String,   ' LPCWSTR
    <Out> ByRef plPropertyValue As ULong   ' ULONGLONG* out
) As UInteger
End Function
' pPropertyList : void*
' cbPropertyListSize : DWORD
' pszPropertyName : LPCWSTR
' plPropertyValue : ULONGLONG* out
Declare PtrSafe Function ResUtilFindULargeIntegerProperty Lib "resutils" ( _
    ByVal pPropertyList As LongPtr, _
    ByVal cbPropertyListSize As Long, _
    ByVal pszPropertyName As LongPtr, _
    ByRef plPropertyValue As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ResUtilFindULargeIntegerProperty = ctypes.windll.resutils.ResUtilFindULargeIntegerProperty
ResUtilFindULargeIntegerProperty.restype = wintypes.DWORD
ResUtilFindULargeIntegerProperty.argtypes = [
    ctypes.POINTER(None),  # pPropertyList : void*
    wintypes.DWORD,  # cbPropertyListSize : DWORD
    wintypes.LPCWSTR,  # pszPropertyName : LPCWSTR
    ctypes.POINTER(ctypes.c_ulonglong),  # plPropertyValue : ULONGLONG* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('RESUTILS.dll')
ResUtilFindULargeIntegerProperty = Fiddle::Function.new(
  lib['ResUtilFindULargeIntegerProperty'],
  [
    Fiddle::TYPE_VOIDP,  # pPropertyList : void*
    -Fiddle::TYPE_INT,  # cbPropertyListSize : DWORD
    Fiddle::TYPE_VOIDP,  # pszPropertyName : LPCWSTR
    Fiddle::TYPE_VOIDP,  # plPropertyValue : ULONGLONG* out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "resutils")]
extern "system" {
    fn ResUtilFindULargeIntegerProperty(
        pPropertyList: *const (),  // void*
        cbPropertyListSize: u32,  // DWORD
        pszPropertyName: *const u16,  // LPCWSTR
        plPropertyValue: *mut u64  // ULONGLONG* out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("RESUTILS.dll")]
public static extern uint ResUtilFindULargeIntegerProperty(IntPtr pPropertyList, uint cbPropertyListSize, [MarshalAs(UnmanagedType.LPWStr)] string pszPropertyName, out ulong plPropertyValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'RESUTILS_ResUtilFindULargeIntegerProperty' -Namespace Win32 -PassThru
# $api::ResUtilFindULargeIntegerProperty(pPropertyList, cbPropertyListSize, pszPropertyName, plPropertyValue)
#uselib "RESUTILS.dll"
#func global ResUtilFindULargeIntegerProperty "ResUtilFindULargeIntegerProperty" sptr, sptr, sptr, sptr
; ResUtilFindULargeIntegerProperty pPropertyList, cbPropertyListSize, pszPropertyName, varptr(plPropertyValue)   ; 戻り値は stat
; pPropertyList : void* -> "sptr"
; cbPropertyListSize : DWORD -> "sptr"
; pszPropertyName : LPCWSTR -> "sptr"
; plPropertyValue : ULONGLONG* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "RESUTILS.dll"
#cfunc global ResUtilFindULargeIntegerProperty "ResUtilFindULargeIntegerProperty" sptr, int, wstr, var
; res = ResUtilFindULargeIntegerProperty(pPropertyList, cbPropertyListSize, pszPropertyName, plPropertyValue)
; pPropertyList : void* -> "sptr"
; cbPropertyListSize : DWORD -> "int"
; pszPropertyName : LPCWSTR -> "wstr"
; plPropertyValue : ULONGLONG* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD ResUtilFindULargeIntegerProperty(void* pPropertyList, DWORD cbPropertyListSize, LPCWSTR pszPropertyName, ULONGLONG* plPropertyValue)
#uselib "RESUTILS.dll"
#cfunc global ResUtilFindULargeIntegerProperty "ResUtilFindULargeIntegerProperty" intptr, int, wstr, var
; res = ResUtilFindULargeIntegerProperty(pPropertyList, cbPropertyListSize, pszPropertyName, plPropertyValue)
; pPropertyList : void* -> "intptr"
; cbPropertyListSize : DWORD -> "int"
; pszPropertyName : LPCWSTR -> "wstr"
; plPropertyValue : ULONGLONG* out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	resutils = windows.NewLazySystemDLL("RESUTILS.dll")
	procResUtilFindULargeIntegerProperty = resutils.NewProc("ResUtilFindULargeIntegerProperty")
)

// pPropertyList (void*), cbPropertyListSize (DWORD), pszPropertyName (LPCWSTR), plPropertyValue (ULONGLONG* out)
r1, _, err := procResUtilFindULargeIntegerProperty.Call(
	uintptr(pPropertyList),
	uintptr(cbPropertyListSize),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszPropertyName))),
	uintptr(plPropertyValue),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function ResUtilFindULargeIntegerProperty(
  pPropertyList: Pointer;   // void*
  cbPropertyListSize: DWORD;   // DWORD
  pszPropertyName: PWideChar;   // LPCWSTR
  plPropertyValue: Pointer   // ULONGLONG* out
): DWORD; stdcall;
  external 'RESUTILS.dll' name 'ResUtilFindULargeIntegerProperty';
result := DllCall("RESUTILS\ResUtilFindULargeIntegerProperty"
    , "Ptr", pPropertyList   ; void*
    , "UInt", cbPropertyListSize   ; DWORD
    , "WStr", pszPropertyName   ; LPCWSTR
    , "Ptr", plPropertyValue   ; ULONGLONG* out
    , "UInt")   ; return: DWORD
●ResUtilFindULargeIntegerProperty(pPropertyList, cbPropertyListSize, pszPropertyName, plPropertyValue) = DLL("RESUTILS.dll", "dword ResUtilFindULargeIntegerProperty(void*, dword, char*, void*)")
# 呼び出し: ResUtilFindULargeIntegerProperty(pPropertyList, cbPropertyListSize, pszPropertyName, plPropertyValue)
# pPropertyList : void* -> "void*"
# cbPropertyListSize : DWORD -> "dword"
# pszPropertyName : LPCWSTR -> "char*"
# plPropertyValue : ULONGLONG* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。