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

ContinueDebugEvent

関数
デバッグイベントを報告したスレッドの実行を再開させる。
DLLKERNEL32.dll呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

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

BOOL ContinueDebugEvent(
    DWORD dwProcessId,
    DWORD dwThreadId,
    NTSTATUS dwContinueStatus
);

パラメーター

名前方向
dwProcessIdDWORDin
dwThreadIdDWORDin
dwContinueStatusNTSTATUSin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL ContinueDebugEvent(
    DWORD dwProcessId,
    DWORD dwThreadId,
    NTSTATUS dwContinueStatus
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool ContinueDebugEvent(
    uint dwProcessId,   // DWORD
    uint dwThreadId,   // DWORD
    int dwContinueStatus   // NTSTATUS
);
<DllImport("KERNEL32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function ContinueDebugEvent(
    dwProcessId As UInteger,   ' DWORD
    dwThreadId As UInteger,   ' DWORD
    dwContinueStatus As Integer   ' NTSTATUS
) As Boolean
End Function
' dwProcessId : DWORD
' dwThreadId : DWORD
' dwContinueStatus : NTSTATUS
Declare PtrSafe Function ContinueDebugEvent Lib "kernel32" ( _
    ByVal dwProcessId As Long, _
    ByVal dwThreadId As Long, _
    ByVal dwContinueStatus As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ContinueDebugEvent = ctypes.windll.kernel32.ContinueDebugEvent
ContinueDebugEvent.restype = wintypes.BOOL
ContinueDebugEvent.argtypes = [
    wintypes.DWORD,  # dwProcessId : DWORD
    wintypes.DWORD,  # dwThreadId : DWORD
    ctypes.c_int,  # dwContinueStatus : NTSTATUS
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KERNEL32.dll')
ContinueDebugEvent = Fiddle::Function.new(
  lib['ContinueDebugEvent'],
  [
    -Fiddle::TYPE_INT,  # dwProcessId : DWORD
    -Fiddle::TYPE_INT,  # dwThreadId : DWORD
    Fiddle::TYPE_INT,  # dwContinueStatus : NTSTATUS
  ],
  Fiddle::TYPE_INT)
#[link(name = "kernel32")]
extern "system" {
    fn ContinueDebugEvent(
        dwProcessId: u32,  // DWORD
        dwThreadId: u32,  // DWORD
        dwContinueStatus: i32  // NTSTATUS
    ) -> 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 ContinueDebugEvent(uint dwProcessId, uint dwThreadId, int dwContinueStatus);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_ContinueDebugEvent' -Namespace Win32 -PassThru
# $api::ContinueDebugEvent(dwProcessId, dwThreadId, dwContinueStatus)
#uselib "KERNEL32.dll"
#func global ContinueDebugEvent "ContinueDebugEvent" sptr, sptr, sptr
; ContinueDebugEvent dwProcessId, dwThreadId, dwContinueStatus   ; 戻り値は stat
; dwProcessId : DWORD -> "sptr"
; dwThreadId : DWORD -> "sptr"
; dwContinueStatus : NTSTATUS -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "KERNEL32.dll"
#cfunc global ContinueDebugEvent "ContinueDebugEvent" int, int, int
; res = ContinueDebugEvent(dwProcessId, dwThreadId, dwContinueStatus)
; dwProcessId : DWORD -> "int"
; dwThreadId : DWORD -> "int"
; dwContinueStatus : NTSTATUS -> "int"
; BOOL ContinueDebugEvent(DWORD dwProcessId, DWORD dwThreadId, NTSTATUS dwContinueStatus)
#uselib "KERNEL32.dll"
#cfunc global ContinueDebugEvent "ContinueDebugEvent" int, int, int
; res = ContinueDebugEvent(dwProcessId, dwThreadId, dwContinueStatus)
; dwProcessId : DWORD -> "int"
; dwThreadId : DWORD -> "int"
; dwContinueStatus : NTSTATUS -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procContinueDebugEvent = kernel32.NewProc("ContinueDebugEvent")
)

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