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

JetDeleteIndexW

関数
テーブルから指定したインデックスを削除する(Unicode版)。
DLLESENT.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

// ESENT.dll  (Unicode / -W)
#include <windows.h>

INT JetDeleteIndexW(
    JET_SESID sesid,
    JET_TABLEID tableid,
    WORD* szIndexName
);

パラメーター

名前方向
sesidJET_SESIDin
tableidJET_TABLEIDin
szIndexNameWORD*in

戻り値の型: INT

各言語での呼び出し定義

// ESENT.dll  (Unicode / -W)
#include <windows.h>

INT JetDeleteIndexW(
    JET_SESID sesid,
    JET_TABLEID tableid,
    WORD* szIndexName
);
[DllImport("ESENT.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int JetDeleteIndexW(
    UIntPtr sesid,   // JET_SESID
    UIntPtr tableid,   // JET_TABLEID
    ref ushort szIndexName   // WORD*
);
<DllImport("ESENT.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function JetDeleteIndexW(
    sesid As UIntPtr,   ' JET_SESID
    tableid As UIntPtr,   ' JET_TABLEID
    ByRef szIndexName As UShort   ' WORD*
) As Integer
End Function
' sesid : JET_SESID
' tableid : JET_TABLEID
' szIndexName : WORD*
Declare PtrSafe Function JetDeleteIndexW Lib "esent" ( _
    ByVal sesid As LongPtr, _
    ByVal tableid As LongPtr, _
    ByRef szIndexName As Integer) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

JetDeleteIndexW = ctypes.windll.esent.JetDeleteIndexW
JetDeleteIndexW.restype = ctypes.c_int
JetDeleteIndexW.argtypes = [
    ctypes.c_size_t,  # sesid : JET_SESID
    ctypes.c_size_t,  # tableid : JET_TABLEID
    ctypes.POINTER(ctypes.c_ushort),  # szIndexName : WORD*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('ESENT.dll')
JetDeleteIndexW = Fiddle::Function.new(
  lib['JetDeleteIndexW'],
  [
    Fiddle::TYPE_UINTPTR_T,  # sesid : JET_SESID
    Fiddle::TYPE_UINTPTR_T,  # tableid : JET_TABLEID
    Fiddle::TYPE_VOIDP,  # szIndexName : WORD*
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "esent")]
extern "system" {
    fn JetDeleteIndexW(
        sesid: usize,  // JET_SESID
        tableid: usize,  // JET_TABLEID
        szIndexName: *mut u16  // WORD*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("ESENT.dll", CharSet = CharSet.Unicode)]
public static extern int JetDeleteIndexW(UIntPtr sesid, UIntPtr tableid, ref ushort szIndexName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'ESENT_JetDeleteIndexW' -Namespace Win32 -PassThru
# $api::JetDeleteIndexW(sesid, tableid, szIndexName)
#uselib "ESENT.dll"
#func global JetDeleteIndexW "JetDeleteIndexW" wptr, wptr, wptr
; JetDeleteIndexW sesid, tableid, varptr(szIndexName)   ; 戻り値は stat
; sesid : JET_SESID -> "wptr"
; tableid : JET_TABLEID -> "wptr"
; szIndexName : WORD* -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "ESENT.dll"
#cfunc global JetDeleteIndexW "JetDeleteIndexW" sptr, sptr, var
; res = JetDeleteIndexW(sesid, tableid, szIndexName)
; sesid : JET_SESID -> "sptr"
; tableid : JET_TABLEID -> "sptr"
; szIndexName : WORD* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT JetDeleteIndexW(JET_SESID sesid, JET_TABLEID tableid, WORD* szIndexName)
#uselib "ESENT.dll"
#cfunc global JetDeleteIndexW "JetDeleteIndexW" intptr, intptr, var
; res = JetDeleteIndexW(sesid, tableid, szIndexName)
; sesid : JET_SESID -> "intptr"
; tableid : JET_TABLEID -> "intptr"
; szIndexName : WORD* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	esent = windows.NewLazySystemDLL("ESENT.dll")
	procJetDeleteIndexW = esent.NewProc("JetDeleteIndexW")
)

// sesid (JET_SESID), tableid (JET_TABLEID), szIndexName (WORD*)
r1, _, err := procJetDeleteIndexW.Call(
	uintptr(sesid),
	uintptr(tableid),
	uintptr(szIndexName),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function JetDeleteIndexW(
  sesid: NativeUInt;   // JET_SESID
  tableid: NativeUInt;   // JET_TABLEID
  szIndexName: Pointer   // WORD*
): Integer; stdcall;
  external 'ESENT.dll' name 'JetDeleteIndexW';
result := DllCall("ESENT\JetDeleteIndexW"
    , "UPtr", sesid   ; JET_SESID
    , "UPtr", tableid   ; JET_TABLEID
    , "Ptr", szIndexName   ; WORD*
    , "Int")   ; return: INT
●JetDeleteIndexW(sesid, tableid, szIndexName) = DLL("ESENT.dll", "int JetDeleteIndexW(int, int, void*)")
# 呼び出し: JetDeleteIndexW(sesid, tableid, szIndexName)
# sesid : JET_SESID -> "int"
# tableid : JET_TABLEID -> "int"
# szIndexName : WORD* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。