ホーム › System.ErrorReporting › WerStoreClose
WerStoreClose
関数WERレポートストアのハンドルを閉じる。
シグネチャ
// wer.dll
#include <windows.h>
void WerStoreClose(
HREPORTSTORE hReportStore // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hReportStore | HREPORTSTORE | inoptional | 閉じる対象レポートストアのHREPORTSTOREハンドル。 |
戻り値の型: void
各言語での呼び出し定義
// wer.dll
#include <windows.h>
void WerStoreClose(
HREPORTSTORE hReportStore // optional
);[DllImport("wer.dll", ExactSpelling = true)]
static extern void WerStoreClose(
IntPtr hReportStore // HREPORTSTORE optional
);<DllImport("wer.dll", ExactSpelling:=True)>
Public Shared Sub WerStoreClose(
hReportStore As IntPtr ' HREPORTSTORE optional
)
End Sub' hReportStore : HREPORTSTORE optional
Declare PtrSafe Sub WerStoreClose Lib "wer" ( _
ByVal hReportStore As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WerStoreClose = ctypes.windll.wer.WerStoreClose
WerStoreClose.restype = None
WerStoreClose.argtypes = [
wintypes.HANDLE, # hReportStore : HREPORTSTORE optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('wer.dll')
WerStoreClose = Fiddle::Function.new(
lib['WerStoreClose'],
[
Fiddle::TYPE_VOIDP, # hReportStore : HREPORTSTORE optional
],
Fiddle::TYPE_VOID)#[link(name = "wer")]
extern "system" {
fn WerStoreClose(
hReportStore: *mut core::ffi::c_void // HREPORTSTORE optional
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("wer.dll")]
public static extern void WerStoreClose(IntPtr hReportStore);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wer_WerStoreClose' -Namespace Win32 -PassThru
# $api::WerStoreClose(hReportStore)#uselib "wer.dll"
#func global WerStoreClose "WerStoreClose" sptr
; WerStoreClose hReportStore
; hReportStore : HREPORTSTORE optional -> "sptr"#uselib "wer.dll"
#func global WerStoreClose "WerStoreClose" sptr
; WerStoreClose hReportStore
; hReportStore : HREPORTSTORE optional -> "sptr"; void WerStoreClose(HREPORTSTORE hReportStore)
#uselib "wer.dll"
#func global WerStoreClose "WerStoreClose" intptr
; WerStoreClose hReportStore
; hReportStore : HREPORTSTORE optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wer = windows.NewLazySystemDLL("wer.dll")
procWerStoreClose = wer.NewProc("WerStoreClose")
)
// hReportStore (HREPORTSTORE optional)
r1, _, err := procWerStoreClose.Call(
uintptr(hReportStore),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure WerStoreClose(
hReportStore: THandle // HREPORTSTORE optional
); stdcall;
external 'wer.dll' name 'WerStoreClose';result := DllCall("wer\WerStoreClose"
, "Ptr", hReportStore ; HREPORTSTORE optional
, "Int") ; return: void●WerStoreClose(hReportStore) = DLL("wer.dll", "int WerStoreClose(void*)")
# 呼び出し: WerStoreClose(hReportStore)
# hReportStore : HREPORTSTORE optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wer" fn WerStoreClose(
hReportStore: ?*anyopaque // HREPORTSTORE optional
) callconv(std.os.windows.WINAPI) void;proc WerStoreClose(
hReportStore: pointer # HREPORTSTORE optional
) {.importc: "WerStoreClose", stdcall, dynlib: "wer.dll".}pragma(lib, "wer");
extern(Windows)
void WerStoreClose(
void* hReportStore // HREPORTSTORE optional
);ccall((:WerStoreClose, "wer.dll"), stdcall, Cvoid,
(Ptr{Cvoid},),
hReportStore)
# hReportStore : HREPORTSTORE optional -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
void WerStoreClose(
void* hReportStore);
]]
local wer = ffi.load("wer")
-- wer.WerStoreClose(hReportStore)
-- hReportStore : HREPORTSTORE optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('wer.dll');
const WerStoreClose = lib.func('__stdcall', 'WerStoreClose', 'void', ['void *']);
// WerStoreClose(hReportStore)
// hReportStore : HREPORTSTORE optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("wer.dll", {
WerStoreClose: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.WerStoreClose(hReportStore)
// hReportStore : HREPORTSTORE optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void WerStoreClose(
void* hReportStore);
C, "wer.dll");
// $ffi->WerStoreClose(hReportStore);
// hReportStore : HREPORTSTORE optional
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Wer extends StdCallLibrary {
Wer INSTANCE = Native.load("wer", Wer.class);
void WerStoreClose(
Pointer hReportStore // HREPORTSTORE optional
);
}@[Link("wer")]
lib Libwer
fun WerStoreClose = WerStoreClose(
hReportStore : Void* # HREPORTSTORE optional
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WerStoreCloseNative = Void Function(Pointer<Void>);
typedef WerStoreCloseDart = void Function(Pointer<Void>);
final WerStoreClose = DynamicLibrary.open('wer.dll')
.lookupFunction<WerStoreCloseNative, WerStoreCloseDart>('WerStoreClose');
// hReportStore : HREPORTSTORE optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure WerStoreClose(
hReportStore: THandle // HREPORTSTORE optional
); stdcall;
external 'wer.dll' name 'WerStoreClose';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WerStoreClose"
c_WerStoreClose :: Ptr () -> IO ()
-- hReportStore : HREPORTSTORE optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let werstoreclose =
foreign "WerStoreClose"
((ptr void) @-> returning void)
(* hReportStore : HREPORTSTORE optional -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wer (t "wer.dll"))
(cffi:use-foreign-library wer)
(cffi:defcfun ("WerStoreClose" wer-store-close :convention :stdcall) :void
(h-report-store :pointer)) ; HREPORTSTORE optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WerStoreClose = Win32::API::More->new('wer',
'void WerStoreClose(HANDLE hReportStore)');
# my $ret = $WerStoreClose->Call($hReportStore);
# hReportStore : HREPORTSTORE optional -> HANDLE
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。