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

FatalExit

関数
デバッガに制御を渡しプロセスを致命終了させる。
DLLKERNEL32.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

void FatalExit(
    INT ExitCode
);

パラメーター

名前方向
ExitCodeINTin

戻り値の型: void

各言語での呼び出し定義

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

void FatalExit(
    INT ExitCode
);
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern void FatalExit(
    int ExitCode   // INT
);
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Sub FatalExit(
    ExitCode As Integer   ' INT
)
End Sub
' ExitCode : INT
Declare PtrSafe Sub FatalExit Lib "kernel32" ( _
    ByVal ExitCode As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

FatalExit = ctypes.windll.kernel32.FatalExit
FatalExit.restype = None
FatalExit.argtypes = [
    ctypes.c_int,  # ExitCode : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KERNEL32.dll')
FatalExit = Fiddle::Function.new(
  lib['FatalExit'],
  [
    Fiddle::TYPE_INT,  # ExitCode : INT
  ],
  Fiddle::TYPE_VOID)
#[link(name = "kernel32")]
extern "system" {
    fn FatalExit(
        ExitCode: i32  // INT
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("KERNEL32.dll")]
public static extern void FatalExit(int ExitCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_FatalExit' -Namespace Win32 -PassThru
# $api::FatalExit(ExitCode)
#uselib "KERNEL32.dll"
#func global FatalExit "FatalExit" sptr
; FatalExit ExitCode
; ExitCode : INT -> "sptr"
#uselib "KERNEL32.dll"
#func global FatalExit "FatalExit" int
; FatalExit ExitCode
; ExitCode : INT -> "int"
; void FatalExit(INT ExitCode)
#uselib "KERNEL32.dll"
#func global FatalExit "FatalExit" int
; FatalExit ExitCode
; ExitCode : INT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procFatalExit = kernel32.NewProc("FatalExit")
)

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