ホーム › System.Diagnostics.Debug › DecodeRemotePointer
DecodeRemotePointer
関数指定プロセスで符号化されたポインタ値を復号する。
シグネチャ
// api-ms-win-core-util-l1-1-1.dll
#include <windows.h>
HRESULT DecodeRemotePointer(
HANDLE ProcessHandle,
void* Ptr, // optional
void** DecodedPtr
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ProcessHandle | HANDLE | in |
| Ptr | void* | inoptional |
| DecodedPtr | void** | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// api-ms-win-core-util-l1-1-1.dll
#include <windows.h>
HRESULT DecodeRemotePointer(
HANDLE ProcessHandle,
void* Ptr, // optional
void** DecodedPtr
);[DllImport("api-ms-win-core-util-l1-1-1.dll", ExactSpelling = true)]
static extern int DecodeRemotePointer(
IntPtr ProcessHandle, // HANDLE
IntPtr Ptr, // void* optional
IntPtr DecodedPtr // void** out
);<DllImport("api-ms-win-core-util-l1-1-1.dll", ExactSpelling:=True)>
Public Shared Function DecodeRemotePointer(
ProcessHandle As IntPtr, ' HANDLE
Ptr As IntPtr, ' void* optional
DecodedPtr As IntPtr ' void** out
) As Integer
End Function' ProcessHandle : HANDLE
' Ptr : void* optional
' DecodedPtr : void** out
Declare PtrSafe Function DecodeRemotePointer Lib "api-ms-win-core-util-l1-1-1" ( _
ByVal ProcessHandle As LongPtr, _
ByVal Ptr As LongPtr, _
ByVal DecodedPtr As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DecodeRemotePointer = ctypes.windll.LoadLibrary("api-ms-win-core-util-l1-1-1.dll").DecodeRemotePointer
DecodeRemotePointer.restype = ctypes.c_int
DecodeRemotePointer.argtypes = [
wintypes.HANDLE, # ProcessHandle : HANDLE
ctypes.POINTER(None), # Ptr : void* optional
ctypes.c_void_p, # DecodedPtr : void** out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('api-ms-win-core-util-l1-1-1.dll')
DecodeRemotePointer = Fiddle::Function.new(
lib['DecodeRemotePointer'],
[
Fiddle::TYPE_VOIDP, # ProcessHandle : HANDLE
Fiddle::TYPE_VOIDP, # Ptr : void* optional
Fiddle::TYPE_VOIDP, # DecodedPtr : void** out
],
Fiddle::TYPE_INT)#[link(name = "api-ms-win-core-util-l1-1-1")]
extern "system" {
fn DecodeRemotePointer(
ProcessHandle: *mut core::ffi::c_void, // HANDLE
Ptr: *mut (), // void* optional
DecodedPtr: *mut *mut () // void** out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("api-ms-win-core-util-l1-1-1.dll")]
public static extern int DecodeRemotePointer(IntPtr ProcessHandle, IntPtr Ptr, IntPtr DecodedPtr);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-util-l1-1-1_DecodeRemotePointer' -Namespace Win32 -PassThru
# $api::DecodeRemotePointer(ProcessHandle, Ptr, DecodedPtr)#uselib "api-ms-win-core-util-l1-1-1.dll"
#func global DecodeRemotePointer "DecodeRemotePointer" sptr, sptr, sptr
; DecodeRemotePointer ProcessHandle, Ptr, DecodedPtr ; 戻り値は stat
; ProcessHandle : HANDLE -> "sptr"
; Ptr : void* optional -> "sptr"
; DecodedPtr : void** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "api-ms-win-core-util-l1-1-1.dll"
#cfunc global DecodeRemotePointer "DecodeRemotePointer" sptr, sptr, sptr
; res = DecodeRemotePointer(ProcessHandle, Ptr, DecodedPtr)
; ProcessHandle : HANDLE -> "sptr"
; Ptr : void* optional -> "sptr"
; DecodedPtr : void** out -> "sptr"; HRESULT DecodeRemotePointer(HANDLE ProcessHandle, void* Ptr, void** DecodedPtr)
#uselib "api-ms-win-core-util-l1-1-1.dll"
#cfunc global DecodeRemotePointer "DecodeRemotePointer" intptr, intptr, intptr
; res = DecodeRemotePointer(ProcessHandle, Ptr, DecodedPtr)
; ProcessHandle : HANDLE -> "intptr"
; Ptr : void* optional -> "intptr"
; DecodedPtr : void** out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
api_ms_win_core_util_l1_1_1 = windows.NewLazySystemDLL("api-ms-win-core-util-l1-1-1.dll")
procDecodeRemotePointer = api_ms_win_core_util_l1_1_1.NewProc("DecodeRemotePointer")
)
// ProcessHandle (HANDLE), Ptr (void* optional), DecodedPtr (void** out)
r1, _, err := procDecodeRemotePointer.Call(
uintptr(ProcessHandle),
uintptr(Ptr),
uintptr(DecodedPtr),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction DecodeRemotePointer(
ProcessHandle: THandle; // HANDLE
Ptr: Pointer; // void* optional
DecodedPtr: Pointer // void** out
): Integer; stdcall;
external 'api-ms-win-core-util-l1-1-1.dll' name 'DecodeRemotePointer';result := DllCall("api-ms-win-core-util-l1-1-1\DecodeRemotePointer"
, "Ptr", ProcessHandle ; HANDLE
, "Ptr", Ptr ; void* optional
, "Ptr", DecodedPtr ; void** out
, "Int") ; return: HRESULT●DecodeRemotePointer(ProcessHandle, Ptr, DecodedPtr) = DLL("api-ms-win-core-util-l1-1-1.dll", "int DecodeRemotePointer(void*, void*, void*)")
# 呼び出し: DecodeRemotePointer(ProcessHandle, Ptr, DecodedPtr)
# ProcessHandle : HANDLE -> "void*"
# Ptr : void* optional -> "void*"
# DecodedPtr : void** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。