Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug › SymSrvStoreSupplement

SymSrvStoreSupplement

関数
シンボルサーバーに補足ファイルを格納する。
DLLdbghelp.dll文字セットANSI (-A)呼出規約winapiSetLastErrorあり

シグネチャ

// dbghelp.dll  (ANSI / -A)
#include <windows.h>

LPSTR SymSrvStoreSupplement(
    HANDLE hProcess,
    LPCSTR SrvPath,   // optional
    LPCSTR Node,
    LPCSTR File,
    DWORD Flags
);

パラメーター

名前方向
hProcessHANDLEin
SrvPathLPCSTRinoptional
NodeLPCSTRin
FileLPCSTRin
FlagsDWORDin

戻り値の型: LPSTR

各言語での呼び出し定義

// dbghelp.dll  (ANSI / -A)
#include <windows.h>

LPSTR SymSrvStoreSupplement(
    HANDLE hProcess,
    LPCSTR SrvPath,   // optional
    LPCSTR Node,
    LPCSTR File,
    DWORD Flags
);
[DllImport("dbghelp.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
static extern IntPtr SymSrvStoreSupplement(
    IntPtr hProcess,   // HANDLE
    [MarshalAs(UnmanagedType.LPStr)] string SrvPath,   // LPCSTR optional
    [MarshalAs(UnmanagedType.LPStr)] string Node,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string File,   // LPCSTR
    uint Flags   // DWORD
);
<DllImport("dbghelp.dll", CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)>
Public Shared Function SymSrvStoreSupplement(
    hProcess As IntPtr,   ' HANDLE
    <MarshalAs(UnmanagedType.LPStr)> SrvPath As String,   ' LPCSTR optional
    <MarshalAs(UnmanagedType.LPStr)> Node As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> File As String,   ' LPCSTR
    Flags As UInteger   ' DWORD
) As IntPtr
End Function
' hProcess : HANDLE
' SrvPath : LPCSTR optional
' Node : LPCSTR
' File : LPCSTR
' Flags : DWORD
Declare PtrSafe Function SymSrvStoreSupplement Lib "dbghelp" ( _
    ByVal hProcess As LongPtr, _
    ByVal SrvPath As String, _
    ByVal Node As String, _
    ByVal File As String, _
    ByVal Flags As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SymSrvStoreSupplement = ctypes.windll.dbghelp.SymSrvStoreSupplement
SymSrvStoreSupplement.restype = wintypes.LPSTR
SymSrvStoreSupplement.argtypes = [
    wintypes.HANDLE,  # hProcess : HANDLE
    wintypes.LPCSTR,  # SrvPath : LPCSTR optional
    wintypes.LPCSTR,  # Node : LPCSTR
    wintypes.LPCSTR,  # File : LPCSTR
    wintypes.DWORD,  # Flags : DWORD
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('dbghelp.dll')
SymSrvStoreSupplement = Fiddle::Function.new(
  lib['SymSrvStoreSupplement'],
  [
    Fiddle::TYPE_VOIDP,  # hProcess : HANDLE
    Fiddle::TYPE_VOIDP,  # SrvPath : LPCSTR optional
    Fiddle::TYPE_VOIDP,  # Node : LPCSTR
    Fiddle::TYPE_VOIDP,  # File : LPCSTR
    -Fiddle::TYPE_INT,  # Flags : DWORD
  ],
  Fiddle::TYPE_VOIDP)
#[link(name = "dbghelp")]
extern "system" {
    fn SymSrvStoreSupplement(
        hProcess: *mut core::ffi::c_void,  // HANDLE
        SrvPath: *const u8,  // LPCSTR optional
        Node: *const u8,  // LPCSTR
        File: *const u8,  // LPCSTR
        Flags: u32  // DWORD
    ) -> *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 SymSrvStoreSupplement(IntPtr hProcess, [MarshalAs(UnmanagedType.LPStr)] string SrvPath, [MarshalAs(UnmanagedType.LPStr)] string Node, [MarshalAs(UnmanagedType.LPStr)] string File, uint Flags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dbghelp_SymSrvStoreSupplement' -Namespace Win32 -PassThru
# $api::SymSrvStoreSupplement(hProcess, SrvPath, Node, File, Flags)
#uselib "dbghelp.dll"
#func global SymSrvStoreSupplement "SymSrvStoreSupplement" sptr, sptr, sptr, sptr, sptr
; SymSrvStoreSupplement hProcess, SrvPath, Node, File, Flags   ; 戻り値は stat
; hProcess : HANDLE -> "sptr"
; SrvPath : LPCSTR optional -> "sptr"
; Node : LPCSTR -> "sptr"
; File : LPCSTR -> "sptr"
; Flags : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "dbghelp.dll"
#cfunc global SymSrvStoreSupplement "SymSrvStoreSupplement" sptr, str, str, str, int
; res = SymSrvStoreSupplement(hProcess, SrvPath, Node, File, Flags)
; hProcess : HANDLE -> "sptr"
; SrvPath : LPCSTR optional -> "str"
; Node : LPCSTR -> "str"
; File : LPCSTR -> "str"
; Flags : DWORD -> "int"
; LPSTR SymSrvStoreSupplement(HANDLE hProcess, LPCSTR SrvPath, LPCSTR Node, LPCSTR File, DWORD Flags)
#uselib "dbghelp.dll"
#cfunc global SymSrvStoreSupplement "SymSrvStoreSupplement" intptr, str, str, str, int
; res = SymSrvStoreSupplement(hProcess, SrvPath, Node, File, Flags)
; hProcess : HANDLE -> "intptr"
; SrvPath : LPCSTR optional -> "str"
; Node : LPCSTR -> "str"
; File : LPCSTR -> "str"
; Flags : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dbghelp = windows.NewLazySystemDLL("dbghelp.dll")
	procSymSrvStoreSupplement = dbghelp.NewProc("SymSrvStoreSupplement")
)

// hProcess (HANDLE), SrvPath (LPCSTR optional), Node (LPCSTR), File (LPCSTR), Flags (DWORD)
r1, _, err := procSymSrvStoreSupplement.Call(
	uintptr(hProcess),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(SrvPath))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(Node))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(File))),
	uintptr(Flags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // LPSTR
function SymSrvStoreSupplement(
  hProcess: THandle;   // HANDLE
  SrvPath: PAnsiChar;   // LPCSTR optional
  Node: PAnsiChar;   // LPCSTR
  File: PAnsiChar;   // LPCSTR
  Flags: DWORD   // DWORD
): PAnsiChar; stdcall;
  external 'dbghelp.dll' name 'SymSrvStoreSupplement';
result := DllCall("dbghelp\SymSrvStoreSupplement"
    , "Ptr", hProcess   ; HANDLE
    , "AStr", SrvPath   ; LPCSTR optional
    , "AStr", Node   ; LPCSTR
    , "AStr", File   ; LPCSTR
    , "UInt", Flags   ; DWORD
    , "Ptr")   ; return: LPSTR
●SymSrvStoreSupplement(hProcess, SrvPath, Node, File, Flags) = DLL("dbghelp.dll", "char* SymSrvStoreSupplement(void*, char*, char*, char*, dword)")
# 呼び出し: SymSrvStoreSupplement(hProcess, SrvPath, Node, File, Flags)
# hProcess : HANDLE -> "void*"
# SrvPath : LPCSTR optional -> "char*"
# Node : LPCSTR -> "char*"
# File : LPCSTR -> "char*"
# Flags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。