ホーム › System.Diagnostics.Debug › SymSrvGetSupplement
SymSrvGetSupplement
関数シンボルサーバーから補足ファイルを取得する。
シグネチャ
// dbghelp.dll (ANSI / -A)
#include <windows.h>
LPSTR SymSrvGetSupplement(
HANDLE hProcess,
LPCSTR SymPath, // optional
LPCSTR Node,
LPCSTR File
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hProcess | HANDLE | in |
| SymPath | LPCSTR | inoptional |
| Node | LPCSTR | in |
| File | LPCSTR | in |
戻り値の型: LPSTR
各言語での呼び出し定義
// dbghelp.dll (ANSI / -A)
#include <windows.h>
LPSTR SymSrvGetSupplement(
HANDLE hProcess,
LPCSTR SymPath, // optional
LPCSTR Node,
LPCSTR File
);[DllImport("dbghelp.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
static extern IntPtr SymSrvGetSupplement(
IntPtr hProcess, // HANDLE
[MarshalAs(UnmanagedType.LPStr)] string SymPath, // LPCSTR optional
[MarshalAs(UnmanagedType.LPStr)] string Node, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string File // LPCSTR
);<DllImport("dbghelp.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SymSrvGetSupplement(
hProcess As IntPtr, ' HANDLE
<MarshalAs(UnmanagedType.LPStr)> SymPath As String, ' LPCSTR optional
<MarshalAs(UnmanagedType.LPStr)> Node As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> File As String ' LPCSTR
) As IntPtr
End Function' hProcess : HANDLE
' SymPath : LPCSTR optional
' Node : LPCSTR
' File : LPCSTR
Declare PtrSafe Function SymSrvGetSupplement Lib "dbghelp" ( _
ByVal hProcess As LongPtr, _
ByVal SymPath As String, _
ByVal Node As String, _
ByVal File As String) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SymSrvGetSupplement = ctypes.windll.dbghelp.SymSrvGetSupplement
SymSrvGetSupplement.restype = wintypes.LPSTR
SymSrvGetSupplement.argtypes = [
wintypes.HANDLE, # hProcess : HANDLE
wintypes.LPCSTR, # SymPath : LPCSTR optional
wintypes.LPCSTR, # Node : LPCSTR
wintypes.LPCSTR, # File : LPCSTR
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('dbghelp.dll')
SymSrvGetSupplement = Fiddle::Function.new(
lib['SymSrvGetSupplement'],
[
Fiddle::TYPE_VOIDP, # hProcess : HANDLE
Fiddle::TYPE_VOIDP, # SymPath : LPCSTR optional
Fiddle::TYPE_VOIDP, # Node : LPCSTR
Fiddle::TYPE_VOIDP, # File : LPCSTR
],
Fiddle::TYPE_VOIDP)#[link(name = "dbghelp")]
extern "system" {
fn SymSrvGetSupplement(
hProcess: *mut core::ffi::c_void, // HANDLE
SymPath: *const u8, // LPCSTR optional
Node: *const u8, // LPCSTR
File: *const u8 // LPCSTR
) -> *mut u8;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("dbghelp.dll", CharSet = CharSet.Ansi, SetLastError = true)]
public static extern IntPtr SymSrvGetSupplement(IntPtr hProcess, [MarshalAs(UnmanagedType.LPStr)] string SymPath, [MarshalAs(UnmanagedType.LPStr)] string Node, [MarshalAs(UnmanagedType.LPStr)] string File);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dbghelp_SymSrvGetSupplement' -Namespace Win32 -PassThru
# $api::SymSrvGetSupplement(hProcess, SymPath, Node, File)#uselib "dbghelp.dll"
#func global SymSrvGetSupplement "SymSrvGetSupplement" sptr, sptr, sptr, sptr
; SymSrvGetSupplement hProcess, SymPath, Node, File ; 戻り値は stat
; hProcess : HANDLE -> "sptr"
; SymPath : LPCSTR optional -> "sptr"
; Node : LPCSTR -> "sptr"
; File : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "dbghelp.dll"
#cfunc global SymSrvGetSupplement "SymSrvGetSupplement" sptr, str, str, str
; res = SymSrvGetSupplement(hProcess, SymPath, Node, File)
; hProcess : HANDLE -> "sptr"
; SymPath : LPCSTR optional -> "str"
; Node : LPCSTR -> "str"
; File : LPCSTR -> "str"; LPSTR SymSrvGetSupplement(HANDLE hProcess, LPCSTR SymPath, LPCSTR Node, LPCSTR File)
#uselib "dbghelp.dll"
#cfunc global SymSrvGetSupplement "SymSrvGetSupplement" intptr, str, str, str
; res = SymSrvGetSupplement(hProcess, SymPath, Node, File)
; hProcess : HANDLE -> "intptr"
; SymPath : LPCSTR optional -> "str"
; Node : LPCSTR -> "str"
; File : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
dbghelp = windows.NewLazySystemDLL("dbghelp.dll")
procSymSrvGetSupplement = dbghelp.NewProc("SymSrvGetSupplement")
)
// hProcess (HANDLE), SymPath (LPCSTR optional), Node (LPCSTR), File (LPCSTR)
r1, _, err := procSymSrvGetSupplement.Call(
uintptr(hProcess),
uintptr(unsafe.Pointer(windows.BytePtrFromString(SymPath))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(Node))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(File))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // LPSTRfunction SymSrvGetSupplement(
hProcess: THandle; // HANDLE
SymPath: PAnsiChar; // LPCSTR optional
Node: PAnsiChar; // LPCSTR
File: PAnsiChar // LPCSTR
): PAnsiChar; stdcall;
external 'dbghelp.dll' name 'SymSrvGetSupplement';result := DllCall("dbghelp\SymSrvGetSupplement"
, "Ptr", hProcess ; HANDLE
, "AStr", SymPath ; LPCSTR optional
, "AStr", Node ; LPCSTR
, "AStr", File ; LPCSTR
, "Ptr") ; return: LPSTR●SymSrvGetSupplement(hProcess, SymPath, Node, File) = DLL("dbghelp.dll", "char* SymSrvGetSupplement(void*, char*, char*, char*)")
# 呼び出し: SymSrvGetSupplement(hProcess, SymPath, Node, File)
# hProcess : HANDLE -> "void*"
# SymPath : LPCSTR optional -> "char*"
# Node : LPCSTR -> "char*"
# File : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。