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