ホーム › Storage.Jet › JET_TABLECREATE2_A
JET_TABLECREATE2_A
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| szTableName | CHAR* | 8/4 | +8 | +4 | 作成するテーブルの名前(ANSI文字列)へのポインタ。 |
| szTemplateTableName | CHAR* | 8/4 | +16 | +8 | 継承元となるテンプレートテーブル名(ANSI文字列)へのポインタ。NULL可。 |
| ulPages | DWORD | 4 | +24 | +12 | テーブルに初期確保するページ数。 |
| ulDensity | DWORD | 4 | +28 | +16 | テーブルページの初期充填率(パーセント)。 |
| rgcolumncreate | JET_COLUMNCREATE_A* | 8/4 | +32 | +20 | 作成する列定義の配列JET_COLUMNCREATE_Aへのポインタ。 |
| cColumns | DWORD | 4 | +40 | +24 | rgcolumncreate配列の要素数。 |
| rgindexcreate | JET_INDEXCREATE_A* | 8/4 | +48 | +28 | 作成するインデックス定義の配列JET_INDEXCREATE_Aへのポインタ。 |
| cIndexes | DWORD | 4 | +56 | +32 | rgindexcreate配列の要素数。 |
| szCallback | CHAR* | 8/4 | +64 | +36 | テーブルに関連付けるコールバック関数名(ANSI文字列)へのポインタ。NULL可。 |
| cbtyp | DWORD | 4 | +72 | +40 | コールバックを呼び出すイベント種別を示す値。 |
| grbit | DWORD | 4 | +76 | +44 | テーブル作成オプションを示すフラグ群。 |
| tableid | JET_TABLEID | 8/4 | +80 | +48 | 作成後に返されるテーブルID。 |
| cCreated | DWORD | 4 | +88 | +52 | 実際に作成されたオブジェクト数(出力)。 |
各言語での定義
#include <windows.h>
// JET_TABLECREATE2_A (x64 96 / x86 56 バイト)
typedef struct JET_TABLECREATE2_A {
DWORD cbStruct;
CHAR* szTableName;
CHAR* szTemplateTableName;
DWORD ulPages;
DWORD ulDensity;
JET_COLUMNCREATE_A* rgcolumncreate;
DWORD cColumns;
JET_INDEXCREATE_A* rgindexcreate;
DWORD cIndexes;
CHAR* szCallback;
DWORD cbtyp;
DWORD grbit;
JET_TABLEID tableid;
DWORD cCreated;
} JET_TABLECREATE2_A;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_TABLECREATE2_A
{
public uint cbStruct;
public IntPtr szTableName;
public IntPtr szTemplateTableName;
public uint ulPages;
public uint ulDensity;
public IntPtr rgcolumncreate;
public uint cColumns;
public IntPtr rgindexcreate;
public uint cIndexes;
public IntPtr szCallback;
public uint cbtyp;
public uint grbit;
public UIntPtr tableid;
public uint cCreated;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_TABLECREATE2_A
Public cbStruct As UInteger
Public szTableName As IntPtr
Public szTemplateTableName As IntPtr
Public ulPages As UInteger
Public ulDensity As UInteger
Public rgcolumncreate As IntPtr
Public cColumns As UInteger
Public rgindexcreate As IntPtr
Public cIndexes As UInteger
Public szCallback As IntPtr
Public cbtyp As UInteger
Public grbit As UInteger
Public tableid As UIntPtr
Public cCreated As UInteger
End Structureimport ctypes
from ctypes import wintypes
class JET_TABLECREATE2_A(ctypes.Structure):
_fields_ = [
("cbStruct", wintypes.DWORD),
("szTableName", ctypes.c_void_p),
("szTemplateTableName", ctypes.c_void_p),
("ulPages", wintypes.DWORD),
("ulDensity", wintypes.DWORD),
("rgcolumncreate", ctypes.c_void_p),
("cColumns", wintypes.DWORD),
("rgindexcreate", ctypes.c_void_p),
("cIndexes", wintypes.DWORD),
("szCallback", ctypes.c_void_p),
("cbtyp", wintypes.DWORD),
("grbit", wintypes.DWORD),
("tableid", ctypes.c_size_t),
("cCreated", wintypes.DWORD),
]#[repr(C)]
pub struct JET_TABLECREATE2_A {
pub cbStruct: u32,
pub szTableName: *mut core::ffi::c_void,
pub szTemplateTableName: *mut core::ffi::c_void,
pub ulPages: u32,
pub ulDensity: u32,
pub rgcolumncreate: *mut core::ffi::c_void,
pub cColumns: u32,
pub rgindexcreate: *mut core::ffi::c_void,
pub cIndexes: u32,
pub szCallback: *mut core::ffi::c_void,
pub cbtyp: u32,
pub grbit: u32,
pub tableid: usize,
pub cCreated: u32,
}import "golang.org/x/sys/windows"
type JET_TABLECREATE2_A struct {
cbStruct uint32
szTableName uintptr
szTemplateTableName uintptr
ulPages uint32
ulDensity uint32
rgcolumncreate uintptr
cColumns uint32
rgindexcreate uintptr
cIndexes uint32
szCallback uintptr
cbtyp uint32
grbit uint32
tableid uintptr
cCreated uint32
}type
JET_TABLECREATE2_A = record
cbStruct: DWORD;
szTableName: Pointer;
szTemplateTableName: Pointer;
ulPages: DWORD;
ulDensity: DWORD;
rgcolumncreate: Pointer;
cColumns: DWORD;
rgindexcreate: Pointer;
cIndexes: DWORD;
szCallback: Pointer;
cbtyp: DWORD;
grbit: DWORD;
tableid: NativeUInt;
cCreated: DWORD;
end;const JET_TABLECREATE2_A = extern struct {
cbStruct: u32,
szTableName: ?*anyopaque,
szTemplateTableName: ?*anyopaque,
ulPages: u32,
ulDensity: u32,
rgcolumncreate: ?*anyopaque,
cColumns: u32,
rgindexcreate: ?*anyopaque,
cIndexes: u32,
szCallback: ?*anyopaque,
cbtyp: u32,
grbit: u32,
tableid: usize,
cCreated: u32,
};type
JET_TABLECREATE2_A {.bycopy.} = object
cbStruct: uint32
szTableName: pointer
szTemplateTableName: pointer
ulPages: uint32
ulDensity: uint32
rgcolumncreate: pointer
cColumns: uint32
rgindexcreate: pointer
cIndexes: uint32
szCallback: pointer
cbtyp: uint32
grbit: uint32
tableid: uint
cCreated: uint32struct JET_TABLECREATE2_A
{
uint cbStruct;
void* szTableName;
void* szTemplateTableName;
uint ulPages;
uint ulDensity;
void* rgcolumncreate;
uint cColumns;
void* rgindexcreate;
uint cIndexes;
void* szCallback;
uint cbtyp;
uint grbit;
size_t tableid;
uint cCreated;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JET_TABLECREATE2_A サイズ: 56 バイト(x86)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; szTableName : CHAR* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szTemplateTableName : CHAR* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ulPages : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ulDensity : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; rgcolumncreate : JET_COLUMNCREATE_A* (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; cColumns : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; rgindexcreate : JET_INDEXCREATE_A* (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; cIndexes : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; szCallback : CHAR* (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; cbtyp : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; grbit : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; tableid : JET_TABLEID (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; cCreated : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_TABLECREATE2_A サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; szTableName : CHAR* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; szTemplateTableName : CHAR* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ulPages : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ulDensity : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; rgcolumncreate : JET_COLUMNCREATE_A* (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; cColumns : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; rgindexcreate : JET_INDEXCREATE_A* (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; cIndexes : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; szCallback : CHAR* (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; cbtyp : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; grbit : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; tableid : JET_TABLEID (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; cCreated : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JET_TABLECREATE2_A
#field int cbStruct
#field intptr szTableName
#field intptr szTemplateTableName
#field int ulPages
#field int ulDensity
#field intptr rgcolumncreate
#field int cColumns
#field intptr rgindexcreate
#field int cIndexes
#field intptr szCallback
#field int cbtyp
#field int grbit
#field intptr tableid
#field int cCreated
#endstruct
stdim st, JET_TABLECREATE2_A ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct