ホーム › System.WindowsProgramming › QueryInterruptTime
QueryInterruptTime
関数現在の割り込み時間カウンタ値を取得する。
シグネチャ
// api-ms-win-core-realtime-l1-1-1.dll
#include <windows.h>
void QueryInterruptTime(
ULONGLONG* lpInterruptTime
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpInterruptTime | ULONGLONG* | out |
戻り値の型: void
各言語での呼び出し定義
// api-ms-win-core-realtime-l1-1-1.dll
#include <windows.h>
void QueryInterruptTime(
ULONGLONG* lpInterruptTime
);[DllImport("api-ms-win-core-realtime-l1-1-1.dll", ExactSpelling = true)]
static extern void QueryInterruptTime(
out ulong lpInterruptTime // ULONGLONG* out
);<DllImport("api-ms-win-core-realtime-l1-1-1.dll", ExactSpelling:=True)>
Public Shared Sub QueryInterruptTime(
<Out> ByRef lpInterruptTime As ULong ' ULONGLONG* out
)
End Sub' lpInterruptTime : ULONGLONG* out
Declare PtrSafe Sub QueryInterruptTime Lib "api-ms-win-core-realtime-l1-1-1" ( _
ByRef lpInterruptTime As LongLong)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
QueryInterruptTime = ctypes.windll.LoadLibrary("api-ms-win-core-realtime-l1-1-1.dll").QueryInterruptTime
QueryInterruptTime.restype = None
QueryInterruptTime.argtypes = [
ctypes.POINTER(ctypes.c_ulonglong), # lpInterruptTime : ULONGLONG* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('api-ms-win-core-realtime-l1-1-1.dll')
QueryInterruptTime = Fiddle::Function.new(
lib['QueryInterruptTime'],
[
Fiddle::TYPE_VOIDP, # lpInterruptTime : ULONGLONG* out
],
Fiddle::TYPE_VOID)#[link(name = "api-ms-win-core-realtime-l1-1-1")]
extern "system" {
fn QueryInterruptTime(
lpInterruptTime: *mut u64 // ULONGLONG* out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("api-ms-win-core-realtime-l1-1-1.dll")]
public static extern void QueryInterruptTime(out ulong lpInterruptTime);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-realtime-l1-1-1_QueryInterruptTime' -Namespace Win32 -PassThru
# $api::QueryInterruptTime(lpInterruptTime)#uselib "api-ms-win-core-realtime-l1-1-1.dll"
#func global QueryInterruptTime "QueryInterruptTime" sptr
; QueryInterruptTime varptr(lpInterruptTime)
; lpInterruptTime : ULONGLONG* out -> "sptr"出力引数:
#uselib "api-ms-win-core-realtime-l1-1-1.dll" #func global QueryInterruptTime "QueryInterruptTime" var ; QueryInterruptTime lpInterruptTime ; lpInterruptTime : ULONGLONG* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "api-ms-win-core-realtime-l1-1-1.dll" #func global QueryInterruptTime "QueryInterruptTime" sptr ; QueryInterruptTime varptr(lpInterruptTime) ; lpInterruptTime : ULONGLONG* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void QueryInterruptTime(ULONGLONG* lpInterruptTime) #uselib "api-ms-win-core-realtime-l1-1-1.dll" #func global QueryInterruptTime "QueryInterruptTime" var ; QueryInterruptTime lpInterruptTime ; lpInterruptTime : ULONGLONG* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void QueryInterruptTime(ULONGLONG* lpInterruptTime) #uselib "api-ms-win-core-realtime-l1-1-1.dll" #func global QueryInterruptTime "QueryInterruptTime" intptr ; QueryInterruptTime varptr(lpInterruptTime) ; lpInterruptTime : ULONGLONG* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
api_ms_win_core_realtime_l1_1_1 = windows.NewLazySystemDLL("api-ms-win-core-realtime-l1-1-1.dll")
procQueryInterruptTime = api_ms_win_core_realtime_l1_1_1.NewProc("QueryInterruptTime")
)
// lpInterruptTime (ULONGLONG* out)
r1, _, err := procQueryInterruptTime.Call(
uintptr(lpInterruptTime),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure QueryInterruptTime(
lpInterruptTime: Pointer // ULONGLONG* out
); stdcall;
external 'api-ms-win-core-realtime-l1-1-1.dll' name 'QueryInterruptTime';result := DllCall("api-ms-win-core-realtime-l1-1-1\QueryInterruptTime"
, "Ptr", lpInterruptTime ; ULONGLONG* out
, "Int") ; return: void●QueryInterruptTime(lpInterruptTime) = DLL("api-ms-win-core-realtime-l1-1-1.dll", "int QueryInterruptTime(void*)")
# 呼び出し: QueryInterruptTime(lpInterruptTime)
# lpInterruptTime : ULONGLONG* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。