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

SymSetExtendedOption

関数
シンボルハンドラの拡張オプションの値を設定する。
DLLdbghelp.dll呼出規約winapi

シグネチャ

// dbghelp.dll
#include <windows.h>

BOOL SymSetExtendedOption(
    IMAGEHLP_EXTENDED_OPTIONS option,
    BOOL value
);

パラメーター

名前方向
optionIMAGEHLP_EXTENDED_OPTIONSin
valueBOOLin

戻り値の型: BOOL

各言語での呼び出し定義

// dbghelp.dll
#include <windows.h>

BOOL SymSetExtendedOption(
    IMAGEHLP_EXTENDED_OPTIONS option,
    BOOL value
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dbghelp.dll", ExactSpelling = true)]
static extern bool SymSetExtendedOption(
    int option,   // IMAGEHLP_EXTENDED_OPTIONS
    bool value   // BOOL
);
<DllImport("dbghelp.dll", ExactSpelling:=True)>
Public Shared Function SymSetExtendedOption(
    [option] As Integer,   ' IMAGEHLP_EXTENDED_OPTIONS
    value As Boolean   ' BOOL
) As Boolean
End Function
' option : IMAGEHLP_EXTENDED_OPTIONS
' value : BOOL
Declare PtrSafe Function SymSetExtendedOption Lib "dbghelp" ( _
    ByVal option As Long, _
    ByVal value As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SymSetExtendedOption = ctypes.windll.dbghelp.SymSetExtendedOption
SymSetExtendedOption.restype = wintypes.BOOL
SymSetExtendedOption.argtypes = [
    ctypes.c_int,  # option : IMAGEHLP_EXTENDED_OPTIONS
    wintypes.BOOL,  # value : BOOL
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('dbghelp.dll')
SymSetExtendedOption = Fiddle::Function.new(
  lib['SymSetExtendedOption'],
  [
    Fiddle::TYPE_INT,  # option : IMAGEHLP_EXTENDED_OPTIONS
    Fiddle::TYPE_INT,  # value : BOOL
  ],
  Fiddle::TYPE_INT)
#[link(name = "dbghelp")]
extern "system" {
    fn SymSetExtendedOption(
        option: i32,  // IMAGEHLP_EXTENDED_OPTIONS
        value: i32  // BOOL
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dbghelp.dll")]
public static extern bool SymSetExtendedOption(int option, bool value);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dbghelp_SymSetExtendedOption' -Namespace Win32 -PassThru
# $api::SymSetExtendedOption(option, value)
#uselib "dbghelp.dll"
#func global SymSetExtendedOption "SymSetExtendedOption" sptr, sptr
; SymSetExtendedOption option, value   ; 戻り値は stat
; option : IMAGEHLP_EXTENDED_OPTIONS -> "sptr"
; value : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "dbghelp.dll"
#cfunc global SymSetExtendedOption "SymSetExtendedOption" int, int
; res = SymSetExtendedOption(option, value)
; option : IMAGEHLP_EXTENDED_OPTIONS -> "int"
; value : BOOL -> "int"
; BOOL SymSetExtendedOption(IMAGEHLP_EXTENDED_OPTIONS option, BOOL value)
#uselib "dbghelp.dll"
#cfunc global SymSetExtendedOption "SymSetExtendedOption" int, int
; res = SymSetExtendedOption(option, value)
; option : IMAGEHLP_EXTENDED_OPTIONS -> "int"
; value : BOOL -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dbghelp = windows.NewLazySystemDLL("dbghelp.dll")
	procSymSetExtendedOption = dbghelp.NewProc("SymSetExtendedOption")
)

// option (IMAGEHLP_EXTENDED_OPTIONS), value (BOOL)
r1, _, err := procSymSetExtendedOption.Call(
	uintptr(option),
	uintptr(value),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function SymSetExtendedOption(
  option: Integer;   // IMAGEHLP_EXTENDED_OPTIONS
  value: BOOL   // BOOL
): BOOL; stdcall;
  external 'dbghelp.dll' name 'SymSetExtendedOption';
result := DllCall("dbghelp\SymSetExtendedOption"
    , "Int", option   ; IMAGEHLP_EXTENDED_OPTIONS
    , "Int", value   ; BOOL
    , "Int")   ; return: BOOL
●SymSetExtendedOption(option, value) = DLL("dbghelp.dll", "bool SymSetExtendedOption(int, bool)")
# 呼び出し: SymSetExtendedOption(option, value)
# option : IMAGEHLP_EXTENDED_OPTIONS -> "int"
# value : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。