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

JET_TABLECREATE_W

構造体
サイズx64: 80 バイト / x86: 48 バイト

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

フィールド

フィールドサイズx64x86説明
cbStructDWORD4+0+0この構造体のバイトサイズ。
szTableNameWORD*8/4+8+4作成するテーブルの名前(Unicode文字列)へのポインタ。
szTemplateTableNameWORD*8/4+16+8継承元となるテンプレートテーブル名(Unicode文字列)へのポインタ。NULL可。
ulPagesDWORD4+24+12テーブルに初期確保するページ数。
ulDensityDWORD4+28+16テーブルページの初期充填率(パーセント)。
rgcolumncreateJET_COLUMNCREATE_W*8/4+32+20作成する列定義の配列JET_COLUMNCREATE_Wへのポインタ。
cColumnsDWORD4+40+24rgcolumncreate配列の要素数。
rgindexcreateJET_INDEXCREATE_W*8/4+48+28作成するインデックス定義の配列JET_INDEXCREATE_Wへのポインタ。
cIndexesDWORD4+56+32rgindexcreate配列の要素数。
grbitDWORD4+60+36テーブル作成オプションを示すフラグ群。
tableidJET_TABLEID8/4+64+40作成後に返されるテーブルID。
cCreatedDWORD4+72+44実際に作成されたオブジェクト数(出力)。

各言語での定義

#include <windows.h>

// JET_TABLECREATE_W  (x64 80 / x86 48 バイト)
typedef struct JET_TABLECREATE_W {
    DWORD cbStruct;
    WORD* szTableName;
    WORD* szTemplateTableName;
    DWORD ulPages;
    DWORD ulDensity;
    JET_COLUMNCREATE_W* rgcolumncreate;
    DWORD cColumns;
    JET_INDEXCREATE_W* rgindexcreate;
    DWORD cIndexes;
    DWORD grbit;
    JET_TABLEID tableid;
    DWORD cCreated;
} JET_TABLECREATE_W;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_TABLECREATE_W
{
    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_W
    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 Structure
import ctypes
from ctypes import wintypes

class JET_TABLECREATE_W(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_W {
    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_W 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_W = 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_W = 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_W {.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: uint32
struct JET_TABLECREATE_W
{
    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_W サイズ: 48 バイト(x86)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; szTableName : WORD* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; szTemplateTableName : WORD* (+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_W* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; cColumns : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; rgindexcreate : JET_INDEXCREATE_W* (+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_W サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; szTableName : WORD* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; szTemplateTableName : WORD* (+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_W* (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; cColumns : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; rgindexcreate : JET_INDEXCREATE_W* (+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_W
    #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_W        ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct