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

JET_OPENTEMPORARYTABLE2

構造体
サイズx64: 64 バイト / x86: 36 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0この構造体のバイトサイズ。
prgcolumndefJET_COLUMNDEF*8/4+8+4一時テーブルの列定義配列JET_COLUMNDEFへのポインタ。
ccolumnDWORD4+16+8prgcolumndef配列の列数。
pidxunicodeJET_UNICODEINDEX2*8/4+24+12ソートに用いるロケール名ベースのUnicode照合設定JET_UNICODEINDEX2へのポインタ。NULL可。
grbitDWORD4+32+16一時テーブルの動作を制御するフラグ群(重複排除、順序固定等)。
prgcolumnidDWORD*8/4+40+20作成後に各列の列IDを受け取る配列へのポインタ(出力)。
cbKeyMostDWORD4+48+24ソートキーの最大バイト長。0で既定値。
cbVarSegMacDWORD4+52+28可変長セグメントの最大バイト数。
tableidJET_TABLEID8/4+56+32作成後に返される一時テーブルのテーブルID。

各言語での定義

#include <windows.h>

// JET_OPENTEMPORARYTABLE2  (x64 64 / x86 36 バイト)
typedef struct JET_OPENTEMPORARYTABLE2 {
    DWORD cbStruct;
    JET_COLUMNDEF* prgcolumndef;
    DWORD ccolumn;
    JET_UNICODEINDEX2* pidxunicode;
    DWORD grbit;
    DWORD* prgcolumnid;
    DWORD cbKeyMost;
    DWORD cbVarSegMac;
    JET_TABLEID tableid;
} JET_OPENTEMPORARYTABLE2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_OPENTEMPORARYTABLE2
{
    public uint cbStruct;
    public IntPtr prgcolumndef;
    public uint ccolumn;
    public IntPtr pidxunicode;
    public uint grbit;
    public IntPtr prgcolumnid;
    public uint cbKeyMost;
    public uint cbVarSegMac;
    public UIntPtr tableid;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_OPENTEMPORARYTABLE2
    Public cbStruct As UInteger
    Public prgcolumndef As IntPtr
    Public ccolumn As UInteger
    Public pidxunicode As IntPtr
    Public grbit As UInteger
    Public prgcolumnid As IntPtr
    Public cbKeyMost As UInteger
    Public cbVarSegMac As UInteger
    Public tableid As UIntPtr
End Structure
import ctypes
from ctypes import wintypes

class JET_OPENTEMPORARYTABLE2(ctypes.Structure):
    _fields_ = [
        ("cbStruct", wintypes.DWORD),
        ("prgcolumndef", ctypes.c_void_p),
        ("ccolumn", wintypes.DWORD),
        ("pidxunicode", ctypes.c_void_p),
        ("grbit", wintypes.DWORD),
        ("prgcolumnid", ctypes.c_void_p),
        ("cbKeyMost", wintypes.DWORD),
        ("cbVarSegMac", wintypes.DWORD),
        ("tableid", ctypes.c_size_t),
    ]
#[repr(C)]
pub struct JET_OPENTEMPORARYTABLE2 {
    pub cbStruct: u32,
    pub prgcolumndef: *mut core::ffi::c_void,
    pub ccolumn: u32,
    pub pidxunicode: *mut core::ffi::c_void,
    pub grbit: u32,
    pub prgcolumnid: *mut core::ffi::c_void,
    pub cbKeyMost: u32,
    pub cbVarSegMac: u32,
    pub tableid: usize,
}
import "golang.org/x/sys/windows"

type JET_OPENTEMPORARYTABLE2 struct {
	cbStruct uint32
	prgcolumndef uintptr
	ccolumn uint32
	pidxunicode uintptr
	grbit uint32
	prgcolumnid uintptr
	cbKeyMost uint32
	cbVarSegMac uint32
	tableid uintptr
}
type
  JET_OPENTEMPORARYTABLE2 = record
    cbStruct: DWORD;
    prgcolumndef: Pointer;
    ccolumn: DWORD;
    pidxunicode: Pointer;
    grbit: DWORD;
    prgcolumnid: Pointer;
    cbKeyMost: DWORD;
    cbVarSegMac: DWORD;
    tableid: NativeUInt;
  end;
const JET_OPENTEMPORARYTABLE2 = extern struct {
    cbStruct: u32,
    prgcolumndef: ?*anyopaque,
    ccolumn: u32,
    pidxunicode: ?*anyopaque,
    grbit: u32,
    prgcolumnid: ?*anyopaque,
    cbKeyMost: u32,
    cbVarSegMac: u32,
    tableid: usize,
};
type
  JET_OPENTEMPORARYTABLE2 {.bycopy.} = object
    cbStruct: uint32
    prgcolumndef: pointer
    ccolumn: uint32
    pidxunicode: pointer
    grbit: uint32
    prgcolumnid: pointer
    cbKeyMost: uint32
    cbVarSegMac: uint32
    tableid: uint
struct JET_OPENTEMPORARYTABLE2
{
    uint cbStruct;
    void* prgcolumndef;
    uint ccolumn;
    void* pidxunicode;
    uint grbit;
    void* prgcolumnid;
    uint cbKeyMost;
    uint cbVarSegMac;
    size_t tableid;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JET_OPENTEMPORARYTABLE2 サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; prgcolumndef : JET_COLUMNDEF* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; ccolumn : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pidxunicode : JET_UNICODEINDEX2* (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; grbit : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; prgcolumnid : DWORD* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; cbKeyMost : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cbVarSegMac : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; tableid : JET_TABLEID (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_OPENTEMPORARYTABLE2 サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; prgcolumndef : JET_COLUMNDEF* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ccolumn : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; pidxunicode : JET_UNICODEINDEX2* (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; grbit : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; prgcolumnid : DWORD* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cbKeyMost : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; cbVarSegMac : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; tableid : JET_TABLEID (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JET_OPENTEMPORARYTABLE2
    #field int cbStruct
    #field intptr prgcolumndef
    #field int ccolumn
    #field intptr pidxunicode
    #field int grbit
    #field intptr prgcolumnid
    #field int cbKeyMost
    #field int cbVarSegMac
    #field intptr tableid
#endstruct

stdim st, JET_OPENTEMPORARYTABLE2        ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct