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