ホーム › Storage.Jet › JET_TABLECREATE_A
JET_TABLECREATE_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配列の要素数。 |
| grbit | DWORD | 4 | +60 | +36 | テーブル作成オプションを示すフラグ群。 |
| tableid | JET_TABLEID | 8/4 | +64 | +40 | 作成後に返されるテーブルID。 |
| cCreated | DWORD | 4 | +72 | +44 | 実際に作成されたオブジェクト数(出力)。 |
各言語での定義
#include <windows.h>
// JET_TABLECREATE_A (x64 80 / x86 48 バイト)
typedef struct JET_TABLECREATE_A {
DWORD cbStruct;
CHAR* szTableName;
CHAR* szTemplateTableName;
DWORD ulPages;
DWORD ulDensity;
JET_COLUMNCREATE_A* rgcolumncreate;
DWORD cColumns;
JET_INDEXCREATE_A* rgindexcreate;
DWORD cIndexes;
DWORD grbit;
JET_TABLEID tableid;
DWORD cCreated;
} JET_TABLECREATE_A;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_TABLECREATE_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 uint grbit;
public UIntPtr tableid;
public uint cCreated;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_TABLECREATE_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 grbit As UInteger
Public tableid As UIntPtr
Public cCreated As UInteger
End Structureimport ctypes
from ctypes import wintypes
class JET_TABLECREATE_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),
("grbit", wintypes.DWORD),
("tableid", ctypes.c_size_t),
("cCreated", wintypes.DWORD),
]#[repr(C)]
pub struct JET_TABLECREATE_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 grbit: u32,
pub tableid: usize,
pub cCreated: u32,
}import "golang.org/x/sys/windows"
type JET_TABLECREATE_A struct {
cbStruct uint32
szTableName uintptr
szTemplateTableName uintptr
ulPages uint32
ulDensity uint32
rgcolumncreate uintptr
cColumns uint32
rgindexcreate uintptr
cIndexes uint32
grbit uint32
tableid uintptr
cCreated uint32
}type
JET_TABLECREATE_A = record
cbStruct: DWORD;
szTableName: Pointer;
szTemplateTableName: Pointer;
ulPages: DWORD;
ulDensity: DWORD;
rgcolumncreate: Pointer;
cColumns: DWORD;
rgindexcreate: Pointer;
cIndexes: DWORD;
grbit: DWORD;
tableid: NativeUInt;
cCreated: DWORD;
end;const JET_TABLECREATE_A = extern struct {
cbStruct: u32,
szTableName: ?*anyopaque,
szTemplateTableName: ?*anyopaque,
ulPages: u32,
ulDensity: u32,
rgcolumncreate: ?*anyopaque,
cColumns: u32,
rgindexcreate: ?*anyopaque,
cIndexes: u32,
grbit: u32,
tableid: usize,
cCreated: u32,
};type
JET_TABLECREATE_A {.bycopy.} = object
cbStruct: uint32
szTableName: pointer
szTemplateTableName: pointer
ulPages: uint32
ulDensity: uint32
rgcolumncreate: pointer
cColumns: uint32
rgindexcreate: pointer
cIndexes: uint32
grbit: uint32
tableid: uint
cCreated: uint32struct JET_TABLECREATE_A
{
uint cbStruct;
void* szTableName;
void* szTemplateTableName;
uint ulPages;
uint ulDensity;
void* rgcolumncreate;
uint cColumns;
void* rgindexcreate;
uint cIndexes;
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_TABLECREATE_A サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 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 も可)
; grbit : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; tableid : JET_TABLEID (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; cCreated : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_TABLECREATE_A サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 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 も可)
; grbit : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; tableid : JET_TABLEID (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; cCreated : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JET_TABLECREATE_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 int grbit
#field intptr tableid
#field int cCreated
#endstruct
stdim st, JET_TABLECREATE_A ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct