ホーム › Storage.Jet › JetGetErrorInfoW
JetGetErrorInfoW
関数ESEのエラーに関する詳細情報を取得する(Unicode版)。
シグネチャ
// ESENT.dll
#include <windows.h>
INT JetGetErrorInfoW(
void* pvContext, // optional
void* pvResult,
DWORD cbMax,
DWORD InfoLevel,
DWORD grbit
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pvContext | void* | inoptional |
| pvResult | void* | out |
| cbMax | DWORD | in |
| InfoLevel | DWORD | in |
| grbit | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// ESENT.dll
#include <windows.h>
INT JetGetErrorInfoW(
void* pvContext, // optional
void* pvResult,
DWORD cbMax,
DWORD InfoLevel,
DWORD grbit
);[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetGetErrorInfoW(
IntPtr pvContext, // void* optional
IntPtr pvResult, // void* out
uint cbMax, // DWORD
uint InfoLevel, // DWORD
uint grbit // DWORD
);<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetGetErrorInfoW(
pvContext As IntPtr, ' void* optional
pvResult As IntPtr, ' void* out
cbMax As UInteger, ' DWORD
InfoLevel As UInteger, ' DWORD
grbit As UInteger ' DWORD
) As Integer
End Function' pvContext : void* optional
' pvResult : void* out
' cbMax : DWORD
' InfoLevel : DWORD
' grbit : DWORD
Declare PtrSafe Function JetGetErrorInfoW Lib "esent" ( _
ByVal pvContext As LongPtr, _
ByVal pvResult As LongPtr, _
ByVal cbMax As Long, _
ByVal InfoLevel As Long, _
ByVal grbit As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
JetGetErrorInfoW = ctypes.windll.esent.JetGetErrorInfoW
JetGetErrorInfoW.restype = ctypes.c_int
JetGetErrorInfoW.argtypes = [
ctypes.POINTER(None), # pvContext : void* optional
ctypes.POINTER(None), # pvResult : void* out
wintypes.DWORD, # cbMax : DWORD
wintypes.DWORD, # InfoLevel : DWORD
wintypes.DWORD, # grbit : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('ESENT.dll')
JetGetErrorInfoW = Fiddle::Function.new(
lib['JetGetErrorInfoW'],
[
Fiddle::TYPE_VOIDP, # pvContext : void* optional
Fiddle::TYPE_VOIDP, # pvResult : void* out
-Fiddle::TYPE_INT, # cbMax : DWORD
-Fiddle::TYPE_INT, # InfoLevel : DWORD
-Fiddle::TYPE_INT, # grbit : DWORD
],
Fiddle::TYPE_INT)#[link(name = "esent")]
extern "system" {
fn JetGetErrorInfoW(
pvContext: *mut (), // void* optional
pvResult: *mut (), // void* out
cbMax: u32, // DWORD
InfoLevel: u32, // DWORD
grbit: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetGetErrorInfoW(IntPtr pvContext, IntPtr pvResult, uint cbMax, uint InfoLevel, uint grbit);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetGetErrorInfoW' -Namespace Win32 -PassThru
# $api::JetGetErrorInfoW(pvContext, pvResult, cbMax, InfoLevel, grbit)#uselib "ESENT.dll"
#func global JetGetErrorInfoW "JetGetErrorInfoW" sptr, sptr, sptr, sptr, sptr
; JetGetErrorInfoW pvContext, pvResult, cbMax, InfoLevel, grbit ; 戻り値は stat
; pvContext : void* optional -> "sptr"
; pvResult : void* out -> "sptr"
; cbMax : DWORD -> "sptr"
; InfoLevel : DWORD -> "sptr"
; grbit : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "ESENT.dll"
#cfunc global JetGetErrorInfoW "JetGetErrorInfoW" sptr, sptr, int, int, int
; res = JetGetErrorInfoW(pvContext, pvResult, cbMax, InfoLevel, grbit)
; pvContext : void* optional -> "sptr"
; pvResult : void* out -> "sptr"
; cbMax : DWORD -> "int"
; InfoLevel : DWORD -> "int"
; grbit : DWORD -> "int"; INT JetGetErrorInfoW(void* pvContext, void* pvResult, DWORD cbMax, DWORD InfoLevel, DWORD grbit)
#uselib "ESENT.dll"
#cfunc global JetGetErrorInfoW "JetGetErrorInfoW" intptr, intptr, int, int, int
; res = JetGetErrorInfoW(pvContext, pvResult, cbMax, InfoLevel, grbit)
; pvContext : void* optional -> "intptr"
; pvResult : void* out -> "intptr"
; cbMax : DWORD -> "int"
; InfoLevel : DWORD -> "int"
; grbit : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
esent = windows.NewLazySystemDLL("ESENT.dll")
procJetGetErrorInfoW = esent.NewProc("JetGetErrorInfoW")
)
// pvContext (void* optional), pvResult (void* out), cbMax (DWORD), InfoLevel (DWORD), grbit (DWORD)
r1, _, err := procJetGetErrorInfoW.Call(
uintptr(pvContext),
uintptr(pvResult),
uintptr(cbMax),
uintptr(InfoLevel),
uintptr(grbit),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction JetGetErrorInfoW(
pvContext: Pointer; // void* optional
pvResult: Pointer; // void* out
cbMax: DWORD; // DWORD
InfoLevel: DWORD; // DWORD
grbit: DWORD // DWORD
): Integer; stdcall;
external 'ESENT.dll' name 'JetGetErrorInfoW';result := DllCall("ESENT\JetGetErrorInfoW"
, "Ptr", pvContext ; void* optional
, "Ptr", pvResult ; void* out
, "UInt", cbMax ; DWORD
, "UInt", InfoLevel ; DWORD
, "UInt", grbit ; DWORD
, "Int") ; return: INT●JetGetErrorInfoW(pvContext, pvResult, cbMax, InfoLevel, grbit) = DLL("ESENT.dll", "int JetGetErrorInfoW(void*, void*, dword, dword, dword)")
# 呼び出し: JetGetErrorInfoW(pvContext, pvResult, cbMax, InfoLevel, grbit)
# pvContext : void* optional -> "void*"
# pvResult : void* out -> "void*"
# cbMax : DWORD -> "dword"
# InfoLevel : DWORD -> "dword"
# grbit : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。