ホーム › System.Diagnostics.Debug › SymSetScopeFromInlineContext
SymSetScopeFromInlineContext
関数インラインコンテキストからシンボルスコープを設定する。
シグネチャ
// dbghelp.dll
#include <windows.h>
BOOL SymSetScopeFromInlineContext(
HANDLE hProcess,
ULONGLONG Address,
DWORD InlineContext
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hProcess | HANDLE | in |
| Address | ULONGLONG | in |
| InlineContext | DWORD | in |
戻り値の型: BOOL
各言語での呼び出し定義
// dbghelp.dll
#include <windows.h>
BOOL SymSetScopeFromInlineContext(
HANDLE hProcess,
ULONGLONG Address,
DWORD InlineContext
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dbghelp.dll", SetLastError = true, ExactSpelling = true)]
static extern bool SymSetScopeFromInlineContext(
IntPtr hProcess, // HANDLE
ulong Address, // ULONGLONG
uint InlineContext // DWORD
);<DllImport("dbghelp.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SymSetScopeFromInlineContext(
hProcess As IntPtr, ' HANDLE
Address As ULong, ' ULONGLONG
InlineContext As UInteger ' DWORD
) As Boolean
End Function' hProcess : HANDLE
' Address : ULONGLONG
' InlineContext : DWORD
Declare PtrSafe Function SymSetScopeFromInlineContext Lib "dbghelp" ( _
ByVal hProcess As LongPtr, _
ByVal Address As LongLong, _
ByVal InlineContext As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SymSetScopeFromInlineContext = ctypes.windll.dbghelp.SymSetScopeFromInlineContext
SymSetScopeFromInlineContext.restype = wintypes.BOOL
SymSetScopeFromInlineContext.argtypes = [
wintypes.HANDLE, # hProcess : HANDLE
ctypes.c_ulonglong, # Address : ULONGLONG
wintypes.DWORD, # InlineContext : DWORD
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('dbghelp.dll')
SymSetScopeFromInlineContext = Fiddle::Function.new(
lib['SymSetScopeFromInlineContext'],
[
Fiddle::TYPE_VOIDP, # hProcess : HANDLE
-Fiddle::TYPE_LONG_LONG, # Address : ULONGLONG
-Fiddle::TYPE_INT, # InlineContext : DWORD
],
Fiddle::TYPE_INT)#[link(name = "dbghelp")]
extern "system" {
fn SymSetScopeFromInlineContext(
hProcess: *mut core::ffi::c_void, // HANDLE
Address: u64, // ULONGLONG
InlineContext: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dbghelp.dll", SetLastError = true)]
public static extern bool SymSetScopeFromInlineContext(IntPtr hProcess, ulong Address, uint InlineContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dbghelp_SymSetScopeFromInlineContext' -Namespace Win32 -PassThru
# $api::SymSetScopeFromInlineContext(hProcess, Address, InlineContext)#uselib "dbghelp.dll"
#func global SymSetScopeFromInlineContext "SymSetScopeFromInlineContext" sptr, sptr, sptr
; SymSetScopeFromInlineContext hProcess, Address, InlineContext ; 戻り値は stat
; hProcess : HANDLE -> "sptr"
; Address : ULONGLONG -> "sptr"
; InlineContext : DWORD -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "dbghelp.dll"
#cfunc global SymSetScopeFromInlineContext "SymSetScopeFromInlineContext" sptr, int64, int
; res = SymSetScopeFromInlineContext(hProcess, Address, InlineContext)
; hProcess : HANDLE -> "sptr"
; Address : ULONGLONG -> "int64"
; InlineContext : DWORD -> "int"
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。; BOOL SymSetScopeFromInlineContext(HANDLE hProcess, ULONGLONG Address, DWORD InlineContext)
#uselib "dbghelp.dll"
#cfunc global SymSetScopeFromInlineContext "SymSetScopeFromInlineContext" intptr, int64, int
; res = SymSetScopeFromInlineContext(hProcess, Address, InlineContext)
; hProcess : HANDLE -> "intptr"
; Address : ULONGLONG -> "int64"
; InlineContext : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
dbghelp = windows.NewLazySystemDLL("dbghelp.dll")
procSymSetScopeFromInlineContext = dbghelp.NewProc("SymSetScopeFromInlineContext")
)
// hProcess (HANDLE), Address (ULONGLONG), InlineContext (DWORD)
r1, _, err := procSymSetScopeFromInlineContext.Call(
uintptr(hProcess),
uintptr(Address),
uintptr(InlineContext),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction SymSetScopeFromInlineContext(
hProcess: THandle; // HANDLE
Address: UInt64; // ULONGLONG
InlineContext: DWORD // DWORD
): BOOL; stdcall;
external 'dbghelp.dll' name 'SymSetScopeFromInlineContext';result := DllCall("dbghelp\SymSetScopeFromInlineContext"
, "Ptr", hProcess ; HANDLE
, "Int64", Address ; ULONGLONG
, "UInt", InlineContext ; DWORD
, "Int") ; return: BOOL●SymSetScopeFromInlineContext(hProcess, Address, InlineContext) = DLL("dbghelp.dll", "bool SymSetScopeFromInlineContext(void*, qword, dword)")
# 呼び出し: SymSetScopeFromInlineContext(hProcess, Address, InlineContext)
# hProcess : HANDLE -> "void*"
# Address : ULONGLONG -> "qword"
# InlineContext : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。