ホーム › System.Diagnostics.Debug › DebugSetProcessKillOnExit
DebugSetProcessKillOnExit
関数デバッガ終了時に被デバッグプロセスを終了させるか設定する。
シグネチャ
// KERNEL32.dll
#include <windows.h>
BOOL DebugSetProcessKillOnExit(
BOOL KillOnExit
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| KillOnExit | BOOL | in |
戻り値の型: BOOL
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
BOOL DebugSetProcessKillOnExit(
BOOL KillOnExit
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool DebugSetProcessKillOnExit(
bool KillOnExit // BOOL
);<DllImport("KERNEL32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function DebugSetProcessKillOnExit(
KillOnExit As Boolean ' BOOL
) As Boolean
End Function' KillOnExit : BOOL
Declare PtrSafe Function DebugSetProcessKillOnExit Lib "kernel32" ( _
ByVal KillOnExit As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
DebugSetProcessKillOnExit = ctypes.windll.kernel32.DebugSetProcessKillOnExit
DebugSetProcessKillOnExit.restype = wintypes.BOOL
DebugSetProcessKillOnExit.argtypes = [
wintypes.BOOL, # KillOnExit : BOOL
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
DebugSetProcessKillOnExit = Fiddle::Function.new(
lib['DebugSetProcessKillOnExit'],
[
Fiddle::TYPE_INT, # KillOnExit : BOOL
],
Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn DebugSetProcessKillOnExit(
KillOnExit: i32 // BOOL
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", SetLastError = true)]
public static extern bool DebugSetProcessKillOnExit(bool KillOnExit);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_DebugSetProcessKillOnExit' -Namespace Win32 -PassThru
# $api::DebugSetProcessKillOnExit(KillOnExit)#uselib "KERNEL32.dll"
#func global DebugSetProcessKillOnExit "DebugSetProcessKillOnExit" sptr
; DebugSetProcessKillOnExit KillOnExit ; 戻り値は stat
; KillOnExit : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global DebugSetProcessKillOnExit "DebugSetProcessKillOnExit" int
; res = DebugSetProcessKillOnExit(KillOnExit)
; KillOnExit : BOOL -> "int"; BOOL DebugSetProcessKillOnExit(BOOL KillOnExit)
#uselib "KERNEL32.dll"
#cfunc global DebugSetProcessKillOnExit "DebugSetProcessKillOnExit" int
; res = DebugSetProcessKillOnExit(KillOnExit)
; KillOnExit : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procDebugSetProcessKillOnExit = kernel32.NewProc("DebugSetProcessKillOnExit")
)
// KillOnExit (BOOL)
r1, _, err := procDebugSetProcessKillOnExit.Call(
uintptr(KillOnExit),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction DebugSetProcessKillOnExit(
KillOnExit: BOOL // BOOL
): BOOL; stdcall;
external 'KERNEL32.dll' name 'DebugSetProcessKillOnExit';result := DllCall("KERNEL32\DebugSetProcessKillOnExit"
, "Int", KillOnExit ; BOOL
, "Int") ; return: BOOL●DebugSetProcessKillOnExit(KillOnExit) = DLL("KERNEL32.dll", "bool DebugSetProcessKillOnExit(bool)")
# 呼び出し: DebugSetProcessKillOnExit(KillOnExit)
# KillOnExit : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。