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