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