ホーム › System.ErrorReporting › WerUnregisterMemoryBlock
WerUnregisterMemoryBlock
関数WERに登録したメモリブロックを登録解除する。
シグネチャ
// KERNEL32.dll
#include <windows.h>
HRESULT WerUnregisterMemoryBlock(
void* pvAddress
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pvAddress | void* | in | 登録解除する対象メモリブロックの先頭アドレス。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
HRESULT WerUnregisterMemoryBlock(
void* pvAddress
);[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern int WerUnregisterMemoryBlock(
IntPtr pvAddress // void*
);<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function WerUnregisterMemoryBlock(
pvAddress As IntPtr ' void*
) As Integer
End Function' pvAddress : void*
Declare PtrSafe Function WerUnregisterMemoryBlock Lib "kernel32" ( _
ByVal pvAddress As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WerUnregisterMemoryBlock = ctypes.windll.kernel32.WerUnregisterMemoryBlock
WerUnregisterMemoryBlock.restype = ctypes.c_int
WerUnregisterMemoryBlock.argtypes = [
ctypes.POINTER(None), # pvAddress : void*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
WerUnregisterMemoryBlock = Fiddle::Function.new(
lib['WerUnregisterMemoryBlock'],
[
Fiddle::TYPE_VOIDP, # pvAddress : void*
],
Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn WerUnregisterMemoryBlock(
pvAddress: *mut () // void*
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll")]
public static extern int WerUnregisterMemoryBlock(IntPtr pvAddress);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_WerUnregisterMemoryBlock' -Namespace Win32 -PassThru
# $api::WerUnregisterMemoryBlock(pvAddress)#uselib "KERNEL32.dll"
#func global WerUnregisterMemoryBlock "WerUnregisterMemoryBlock" sptr
; WerUnregisterMemoryBlock pvAddress ; 戻り値は stat
; pvAddress : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global WerUnregisterMemoryBlock "WerUnregisterMemoryBlock" sptr
; res = WerUnregisterMemoryBlock(pvAddress)
; pvAddress : void* -> "sptr"; HRESULT WerUnregisterMemoryBlock(void* pvAddress)
#uselib "KERNEL32.dll"
#cfunc global WerUnregisterMemoryBlock "WerUnregisterMemoryBlock" intptr
; res = WerUnregisterMemoryBlock(pvAddress)
; pvAddress : void* -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procWerUnregisterMemoryBlock = kernel32.NewProc("WerUnregisterMemoryBlock")
)
// pvAddress (void*)
r1, _, err := procWerUnregisterMemoryBlock.Call(
uintptr(pvAddress),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WerUnregisterMemoryBlock(
pvAddress: Pointer // void*
): Integer; stdcall;
external 'KERNEL32.dll' name 'WerUnregisterMemoryBlock';result := DllCall("KERNEL32\WerUnregisterMemoryBlock"
, "Ptr", pvAddress ; void*
, "Int") ; return: HRESULT●WerUnregisterMemoryBlock(pvAddress) = DLL("KERNEL32.dll", "int WerUnregisterMemoryBlock(void*)")
# 呼び出し: WerUnregisterMemoryBlock(pvAddress)
# pvAddress : void* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。