Win32 API 日本語リファレンス
ホームStorage.Jet › JetEscrowUpdate

JetEscrowUpdate

関数
列の値をエスクロー方式で原子的に増減更新する。
DLLESENT.dll呼出規約winapi

シグネチャ

// ESENT.dll
#include <windows.h>

INT JetEscrowUpdate(
    JET_SESID sesid,
    JET_TABLEID tableid,
    DWORD columnid,
    void* pv,
    DWORD cbMax,
    void* pvOld,   // optional
    DWORD cbOldMax,
    DWORD* pcbOldActual,   // optional
    DWORD grbit
);

パラメーター

名前方向
sesidJET_SESIDin
tableidJET_TABLEIDin
columnidDWORDin
pvvoid*in
cbMaxDWORDin
pvOldvoid*outoptional
cbOldMaxDWORDin
pcbOldActualDWORD*outoptional
grbitDWORDin

戻り値の型: INT

各言語での呼び出し定義

// ESENT.dll
#include <windows.h>

INT JetEscrowUpdate(
    JET_SESID sesid,
    JET_TABLEID tableid,
    DWORD columnid,
    void* pv,
    DWORD cbMax,
    void* pvOld,   // optional
    DWORD cbOldMax,
    DWORD* pcbOldActual,   // optional
    DWORD grbit
);
[DllImport("ESENT.dll", ExactSpelling = true)]
static extern int JetEscrowUpdate(
    UIntPtr sesid,   // JET_SESID
    UIntPtr tableid,   // JET_TABLEID
    uint columnid,   // DWORD
    IntPtr pv,   // void*
    uint cbMax,   // DWORD
    IntPtr pvOld,   // void* optional, out
    uint cbOldMax,   // DWORD
    IntPtr pcbOldActual,   // DWORD* optional, out
    uint grbit   // DWORD
);
<DllImport("ESENT.dll", ExactSpelling:=True)>
Public Shared Function JetEscrowUpdate(
    sesid As UIntPtr,   ' JET_SESID
    tableid As UIntPtr,   ' JET_TABLEID
    columnid As UInteger,   ' DWORD
    pv As IntPtr,   ' void*
    cbMax As UInteger,   ' DWORD
    pvOld As IntPtr,   ' void* optional, out
    cbOldMax As UInteger,   ' DWORD
    pcbOldActual As IntPtr,   ' DWORD* optional, out
    grbit As UInteger   ' DWORD
) As Integer
End Function
' sesid : JET_SESID
' tableid : JET_TABLEID
' columnid : DWORD
' pv : void*
' cbMax : DWORD
' pvOld : void* optional, out
' cbOldMax : DWORD
' pcbOldActual : DWORD* optional, out
' grbit : DWORD
Declare PtrSafe Function JetEscrowUpdate Lib "esent" ( _
    ByVal sesid As LongPtr, _
    ByVal tableid As LongPtr, _
    ByVal columnid As Long, _
    ByVal pv As LongPtr, _
    ByVal cbMax As Long, _
    ByVal pvOld As LongPtr, _
    ByVal cbOldMax As Long, _
    ByVal pcbOldActual As LongPtr, _
    ByVal grbit As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

JetEscrowUpdate = ctypes.windll.esent.JetEscrowUpdate
JetEscrowUpdate.restype = ctypes.c_int
JetEscrowUpdate.argtypes = [
    ctypes.c_size_t,  # sesid : JET_SESID
    ctypes.c_size_t,  # tableid : JET_TABLEID
    wintypes.DWORD,  # columnid : DWORD
    ctypes.POINTER(None),  # pv : void*
    wintypes.DWORD,  # cbMax : DWORD
    ctypes.POINTER(None),  # pvOld : void* optional, out
    wintypes.DWORD,  # cbOldMax : DWORD
    ctypes.POINTER(wintypes.DWORD),  # pcbOldActual : DWORD* optional, out
    wintypes.DWORD,  # grbit : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ESENT.dll')
JetEscrowUpdate = Fiddle::Function.new(
  lib['JetEscrowUpdate'],
  [
    Fiddle::TYPE_UINTPTR_T,  # sesid : JET_SESID
    Fiddle::TYPE_UINTPTR_T,  # tableid : JET_TABLEID
    -Fiddle::TYPE_INT,  # columnid : DWORD
    Fiddle::TYPE_VOIDP,  # pv : void*
    -Fiddle::TYPE_INT,  # cbMax : DWORD
    Fiddle::TYPE_VOIDP,  # pvOld : void* optional, out
    -Fiddle::TYPE_INT,  # cbOldMax : DWORD
    Fiddle::TYPE_VOIDP,  # pcbOldActual : DWORD* optional, out
    -Fiddle::TYPE_INT,  # grbit : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "esent")]
extern "system" {
    fn JetEscrowUpdate(
        sesid: usize,  // JET_SESID
        tableid: usize,  // JET_TABLEID
        columnid: u32,  // DWORD
        pv: *mut (),  // void*
        cbMax: u32,  // DWORD
        pvOld: *mut (),  // void* optional, out
        cbOldMax: u32,  // DWORD
        pcbOldActual: *mut u32,  // DWORD* optional, out
        grbit: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ESENT.dll")]
public static extern int JetEscrowUpdate(UIntPtr sesid, UIntPtr tableid, uint columnid, IntPtr pv, uint cbMax, IntPtr pvOld, uint cbOldMax, IntPtr pcbOldActual, uint grbit);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetEscrowUpdate' -Namespace Win32 -PassThru
# $api::JetEscrowUpdate(sesid, tableid, columnid, pv, cbMax, pvOld, cbOldMax, pcbOldActual, grbit)
#uselib "ESENT.dll"
#func global JetEscrowUpdate "JetEscrowUpdate" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; JetEscrowUpdate sesid, tableid, columnid, pv, cbMax, pvOld, cbOldMax, varptr(pcbOldActual), grbit   ; 戻り値は stat
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; columnid : DWORD -> "sptr"
; pv : void* -> "sptr"
; cbMax : DWORD -> "sptr"
; pvOld : void* optional, out -> "sptr"
; cbOldMax : DWORD -> "sptr"
; pcbOldActual : DWORD* optional, out -> "sptr"
; grbit : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "ESENT.dll"
#cfunc global JetEscrowUpdate "JetEscrowUpdate" sptr, sptr, int, sptr, int, sptr, int, var, int
; res = JetEscrowUpdate(sesid, tableid, columnid, pv, cbMax, pvOld, cbOldMax, pcbOldActual, grbit)
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; columnid : DWORD -> "int"
; pv : void* -> "sptr"
; cbMax : DWORD -> "int"
; pvOld : void* optional, out -> "sptr"
; cbOldMax : DWORD -> "int"
; pcbOldActual : DWORD* optional, out -> "var"
; grbit : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT JetEscrowUpdate(JET_SESID sesid, JET_TABLEID tableid, DWORD columnid, void* pv, DWORD cbMax, void* pvOld, DWORD cbOldMax, DWORD* pcbOldActual, DWORD grbit)
#uselib "ESENT.dll"
#cfunc global JetEscrowUpdate "JetEscrowUpdate" intptr, intptr, int, intptr, int, intptr, int, var, int
; res = JetEscrowUpdate(sesid, tableid, columnid, pv, cbMax, pvOld, cbOldMax, pcbOldActual, grbit)
; sesid : JET_SESID -> "intptr"
; tableid : JET_TABLEID -> "intptr"
; columnid : DWORD -> "int"
; pv : void* -> "intptr"
; cbMax : DWORD -> "int"
; pvOld : void* optional, out -> "intptr"
; cbOldMax : DWORD -> "int"
; pcbOldActual : DWORD* optional, out -> "var"
; grbit : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetEscrowUpdate = esent.NewProc("JetEscrowUpdate")
)

// sesid (JET_SESID), tableid (JET_TABLEID), columnid (DWORD), pv (void*), cbMax (DWORD), pvOld (void* optional, out), cbOldMax (DWORD), pcbOldActual (DWORD* optional, out), grbit (DWORD)
r1, _, err := procJetEscrowUpdate.Call(
	uintptr(sesid),
	uintptr(tableid),
	uintptr(columnid),
	uintptr(pv),
	uintptr(cbMax),
	uintptr(pvOld),
	uintptr(cbOldMax),
	uintptr(pcbOldActual),
	uintptr(grbit),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function JetEscrowUpdate(
  sesid: NativeUInt;   // JET_SESID
  tableid: NativeUInt;   // JET_TABLEID
  columnid: DWORD;   // DWORD
  pv: Pointer;   // void*
  cbMax: DWORD;   // DWORD
  pvOld: Pointer;   // void* optional, out
  cbOldMax: DWORD;   // DWORD
  pcbOldActual: Pointer;   // DWORD* optional, out
  grbit: DWORD   // DWORD
): Integer; stdcall;
  external 'ESENT.dll' name 'JetEscrowUpdate';
result := DllCall("ESENT\JetEscrowUpdate"
    , "UPtr", sesid   ; JET_SESID
    , "UPtr", tableid   ; JET_TABLEID
    , "UInt", columnid   ; DWORD
    , "Ptr", pv   ; void*
    , "UInt", cbMax   ; DWORD
    , "Ptr", pvOld   ; void* optional, out
    , "UInt", cbOldMax   ; DWORD
    , "Ptr", pcbOldActual   ; DWORD* optional, out
    , "UInt", grbit   ; DWORD
    , "Int")   ; return: INT
●JetEscrowUpdate(sesid, tableid, columnid, pv, cbMax, pvOld, cbOldMax, pcbOldActual, grbit) = DLL("ESENT.dll", "int JetEscrowUpdate(int, int, dword, void*, dword, void*, dword, void*, dword)")
# 呼び出し: JetEscrowUpdate(sesid, tableid, columnid, pv, cbMax, pvOld, cbOldMax, pcbOldActual, grbit)
# sesid : JET_SESID -> "int"
# tableid : JET_TABLEID -> "int"
# columnid : DWORD -> "dword"
# pv : void* -> "void*"
# cbMax : DWORD -> "dword"
# pvOld : void* optional, out -> "void*"
# cbOldMax : DWORD -> "dword"
# pcbOldActual : DWORD* optional, out -> "void*"
# grbit : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。