Win32 API 日本語リファレンス
ホームSystem.ErrorReporting › WerReportCloseHandle

WerReportCloseHandle

関数
WERレポートのハンドルを閉じて解放する。
DLLwer.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT WerReportCloseHandle(
    HREPORT hReportHandle
);

パラメーター

名前方向
hReportHandleHREPORTin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT WerReportCloseHandle(
    HREPORT hReportHandle
);
[DllImport("wer.dll", ExactSpelling = true)]
static extern int WerReportCloseHandle(
    IntPtr hReportHandle   // HREPORT
);
<DllImport("wer.dll", ExactSpelling:=True)>
Public Shared Function WerReportCloseHandle(
    hReportHandle As IntPtr   ' HREPORT
) As Integer
End Function
' hReportHandle : HREPORT
Declare PtrSafe Function WerReportCloseHandle Lib "wer" ( _
    ByVal hReportHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WerReportCloseHandle = ctypes.windll.wer.WerReportCloseHandle
WerReportCloseHandle.restype = ctypes.c_int
WerReportCloseHandle.argtypes = [
    wintypes.HANDLE,  # hReportHandle : HREPORT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('wer.dll')
WerReportCloseHandle = Fiddle::Function.new(
  lib['WerReportCloseHandle'],
  [
    Fiddle::TYPE_VOIDP,  # hReportHandle : HREPORT
  ],
  Fiddle::TYPE_INT)
#[link(name = "wer")]
extern "system" {
    fn WerReportCloseHandle(
        hReportHandle: *mut core::ffi::c_void  // HREPORT
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("wer.dll")]
public static extern int WerReportCloseHandle(IntPtr hReportHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wer_WerReportCloseHandle' -Namespace Win32 -PassThru
# $api::WerReportCloseHandle(hReportHandle)
#uselib "wer.dll"
#func global WerReportCloseHandle "WerReportCloseHandle" sptr
; WerReportCloseHandle hReportHandle   ; 戻り値は stat
; hReportHandle : HREPORT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "wer.dll"
#cfunc global WerReportCloseHandle "WerReportCloseHandle" sptr
; res = WerReportCloseHandle(hReportHandle)
; hReportHandle : HREPORT -> "sptr"
; HRESULT WerReportCloseHandle(HREPORT hReportHandle)
#uselib "wer.dll"
#cfunc global WerReportCloseHandle "WerReportCloseHandle" intptr
; res = WerReportCloseHandle(hReportHandle)
; hReportHandle : HREPORT -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wer = windows.NewLazySystemDLL("wer.dll")
	procWerReportCloseHandle = wer.NewProc("WerReportCloseHandle")
)

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