ホーム › System.WindowsProgramming › RecordFeatureError
RecordFeatureError
関数フィーチャーで発生したエラーを記録する。
シグネチャ
// api-ms-win-core-featurestaging-l1-1-0.dll
#include <windows.h>
void RecordFeatureError(
DWORD featureId,
const FEATURE_ERROR* error
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| featureId | DWORD | in |
| error | FEATURE_ERROR* | in |
戻り値の型: void
各言語での呼び出し定義
// api-ms-win-core-featurestaging-l1-1-0.dll
#include <windows.h>
void RecordFeatureError(
DWORD featureId,
const FEATURE_ERROR* error
);[DllImport("api-ms-win-core-featurestaging-l1-1-0.dll", ExactSpelling = true)]
static extern void RecordFeatureError(
uint featureId, // DWORD
IntPtr error // FEATURE_ERROR*
);<DllImport("api-ms-win-core-featurestaging-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Sub RecordFeatureError(
featureId As UInteger, ' DWORD
[error] As IntPtr ' FEATURE_ERROR*
)
End Sub' featureId : DWORD
' error : FEATURE_ERROR*
Declare PtrSafe Sub RecordFeatureError Lib "api-ms-win-core-featurestaging-l1-1-0" ( _
ByVal featureId As Long, _
ByVal error As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
RecordFeatureError = ctypes.windll.LoadLibrary("api-ms-win-core-featurestaging-l1-1-0.dll").RecordFeatureError
RecordFeatureError.restype = None
RecordFeatureError.argtypes = [
wintypes.DWORD, # featureId : DWORD
ctypes.c_void_p, # error : FEATURE_ERROR*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('api-ms-win-core-featurestaging-l1-1-0.dll')
RecordFeatureError = Fiddle::Function.new(
lib['RecordFeatureError'],
[
-Fiddle::TYPE_INT, # featureId : DWORD
Fiddle::TYPE_VOIDP, # error : FEATURE_ERROR*
],
Fiddle::TYPE_VOID)#[link(name = "api-ms-win-core-featurestaging-l1-1-0")]
extern "system" {
fn RecordFeatureError(
featureId: u32, // DWORD
error: *const FEATURE_ERROR // FEATURE_ERROR*
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("api-ms-win-core-featurestaging-l1-1-0.dll")]
public static extern void RecordFeatureError(uint featureId, IntPtr error);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-featurestaging-l1-1-0_RecordFeatureError' -Namespace Win32 -PassThru
# $api::RecordFeatureError(featureId, error)#uselib "api-ms-win-core-featurestaging-l1-1-0.dll"
#func global RecordFeatureError "RecordFeatureError" sptr, sptr
; RecordFeatureError featureId, varptr(error)
; featureId : DWORD -> "sptr"
; error : FEATURE_ERROR* -> "sptr"出力引数:
#uselib "api-ms-win-core-featurestaging-l1-1-0.dll" #func global RecordFeatureError "RecordFeatureError" int, var ; RecordFeatureError featureId, error ; featureId : DWORD -> "int" ; error : FEATURE_ERROR* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "api-ms-win-core-featurestaging-l1-1-0.dll" #func global RecordFeatureError "RecordFeatureError" int, sptr ; RecordFeatureError featureId, varptr(error) ; featureId : DWORD -> "int" ; error : FEATURE_ERROR* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void RecordFeatureError(DWORD featureId, FEATURE_ERROR* error) #uselib "api-ms-win-core-featurestaging-l1-1-0.dll" #func global RecordFeatureError "RecordFeatureError" int, var ; RecordFeatureError featureId, error ; featureId : DWORD -> "int" ; error : FEATURE_ERROR* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void RecordFeatureError(DWORD featureId, FEATURE_ERROR* error) #uselib "api-ms-win-core-featurestaging-l1-1-0.dll" #func global RecordFeatureError "RecordFeatureError" int, intptr ; RecordFeatureError featureId, varptr(error) ; featureId : DWORD -> "int" ; error : FEATURE_ERROR* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
api_ms_win_core_featurestaging_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-core-featurestaging-l1-1-0.dll")
procRecordFeatureError = api_ms_win_core_featurestaging_l1_1_0.NewProc("RecordFeatureError")
)
// featureId (DWORD), error (FEATURE_ERROR*)
r1, _, err := procRecordFeatureError.Call(
uintptr(featureId),
uintptr(error),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure RecordFeatureError(
featureId: DWORD; // DWORD
error: Pointer // FEATURE_ERROR*
); stdcall;
external 'api-ms-win-core-featurestaging-l1-1-0.dll' name 'RecordFeatureError';result := DllCall("api-ms-win-core-featurestaging-l1-1-0\RecordFeatureError"
, "UInt", featureId ; DWORD
, "Ptr", error ; FEATURE_ERROR*
, "Int") ; return: void●RecordFeatureError(featureId, error) = DLL("api-ms-win-core-featurestaging-l1-1-0.dll", "int RecordFeatureError(dword, void*)")
# 呼び出し: RecordFeatureError(featureId, error)
# featureId : DWORD -> "dword"
# error : FEATURE_ERROR* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。