ホーム › Storage.Jet › JET_INDEXCREATE2_A
JET_INDEXCREATE2_A
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| szIndexName | CHAR* | 8/4 | +8 | +4 | 作成するインデックスの名前(ANSI文字列)へのポインタ。 |
| szKey | CHAR* | 8/4 | +16 | +8 | インデックスキーを定義する列指定文字列(ANSI、ヌル区切り)へのポインタ。 |
| cbKey | DWORD | 4 | +24 | +12 | szKeyのバイト長(末尾のダブルヌルを含む)。 |
| grbit | DWORD | 4 | +28 | +16 | インデックスの属性を示すフラグ群(主キー、一意等)。 |
| ulDensity | DWORD | 4 | +32 | +20 | インデックスページの初期充填率(パーセント)。 |
| Anonymous1 | _Anonymous1_e__Union | 8/4 | +40 | +24 | Unicode照合情報または言語IDを保持する無名共用体。 |
| Anonymous2 | _Anonymous2_e__Union | 8/4 | +48 | +28 | 可変セグメント長などの追加設定を保持する無名共用体。 |
| rgconditionalcolumn | JET_CONDITIONALCOLUMN_A* | 8/4 | +56 | +32 | 条件付き列の配列JET_CONDITIONALCOLUMN_Aへのポインタ。NULL可。 |
| cConditionalColumn | DWORD | 4 | +64 | +36 | rgconditionalcolumn配列の要素数。 |
| err | INT | 4 | +68 | +40 | このインデックスの作成結果を示すJETエラーコード(出力)。 |
| cbKeyMost | DWORD | 4 | +72 | +44 | インデックスキーの最大バイト長。0で既定値。 |
| pSpacehints | JET_SPACEHINTS* | 8/4 | +80 | +48 | インデックスの領域確保ヒントJET_SPACEHINTSへのポインタ。NULL可。 |
共用体: _Anonymous1_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| lcid | DWORD | 4 | +0 | +0 |
| pidxunicode | JET_UNICODEINDEX* | 8/4 | +0 | +0 |
共用体: _Anonymous2_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| cbVarSegMac | DWORD | 4 | +0 | +0 |
| ptuplelimits | JET_TUPLELIMITS* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// JET_INDEXCREATE2_A (x64 88 / x86 52 バイト)
typedef struct JET_INDEXCREATE2_A {
DWORD cbStruct;
CHAR* szIndexName;
CHAR* szKey;
DWORD cbKey;
DWORD grbit;
DWORD ulDensity;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
JET_CONDITIONALCOLUMN_A* rgconditionalcolumn;
DWORD cConditionalColumn;
INT err;
DWORD cbKeyMost;
JET_SPACEHINTS* pSpacehints;
} JET_INDEXCREATE2_A;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JET_INDEXCREATE2_A
{
public uint cbStruct;
public IntPtr szIndexName;
public IntPtr szKey;
public uint cbKey;
public uint grbit;
public uint ulDensity;
public _Anonymous1_e__Union Anonymous1;
public _Anonymous2_e__Union Anonymous2;
public IntPtr rgconditionalcolumn;
public uint cConditionalColumn;
public int err;
public uint cbKeyMost;
public IntPtr pSpacehints;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JET_INDEXCREATE2_A
Public cbStruct As UInteger
Public szIndexName As IntPtr
Public szKey As IntPtr
Public cbKey As UInteger
Public grbit As UInteger
Public ulDensity As UInteger
Public Anonymous1 As _Anonymous1_e__Union
Public Anonymous2 As _Anonymous2_e__Union
Public rgconditionalcolumn As IntPtr
Public cConditionalColumn As UInteger
Public err As Integer
Public cbKeyMost As UInteger
Public pSpacehints As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class JET_INDEXCREATE2_A(ctypes.Structure):
_fields_ = [
("cbStruct", wintypes.DWORD),
("szIndexName", ctypes.c_void_p),
("szKey", ctypes.c_void_p),
("cbKey", wintypes.DWORD),
("grbit", wintypes.DWORD),
("ulDensity", wintypes.DWORD),
("Anonymous1", _Anonymous1_e__Union),
("Anonymous2", _Anonymous2_e__Union),
("rgconditionalcolumn", ctypes.c_void_p),
("cConditionalColumn", wintypes.DWORD),
("err", ctypes.c_int),
("cbKeyMost", wintypes.DWORD),
("pSpacehints", ctypes.c_void_p),
]#[repr(C)]
pub struct JET_INDEXCREATE2_A {
pub cbStruct: u32,
pub szIndexName: *mut core::ffi::c_void,
pub szKey: *mut core::ffi::c_void,
pub cbKey: u32,
pub grbit: u32,
pub ulDensity: u32,
pub Anonymous1: _Anonymous1_e__Union,
pub Anonymous2: _Anonymous2_e__Union,
pub rgconditionalcolumn: *mut core::ffi::c_void,
pub cConditionalColumn: u32,
pub err: i32,
pub cbKeyMost: u32,
pub pSpacehints: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type JET_INDEXCREATE2_A struct {
cbStruct uint32
szIndexName uintptr
szKey uintptr
cbKey uint32
grbit uint32
ulDensity uint32
Anonymous1 _Anonymous1_e__Union
Anonymous2 _Anonymous2_e__Union
rgconditionalcolumn uintptr
cConditionalColumn uint32
err int32
cbKeyMost uint32
pSpacehints uintptr
}type
JET_INDEXCREATE2_A = record
cbStruct: DWORD;
szIndexName: Pointer;
szKey: Pointer;
cbKey: DWORD;
grbit: DWORD;
ulDensity: DWORD;
Anonymous1: _Anonymous1_e__Union;
Anonymous2: _Anonymous2_e__Union;
rgconditionalcolumn: Pointer;
cConditionalColumn: DWORD;
err: Integer;
cbKeyMost: DWORD;
pSpacehints: Pointer;
end;const JET_INDEXCREATE2_A = extern struct {
cbStruct: u32,
szIndexName: ?*anyopaque,
szKey: ?*anyopaque,
cbKey: u32,
grbit: u32,
ulDensity: u32,
Anonymous1: _Anonymous1_e__Union,
Anonymous2: _Anonymous2_e__Union,
rgconditionalcolumn: ?*anyopaque,
cConditionalColumn: u32,
err: i32,
cbKeyMost: u32,
pSpacehints: ?*anyopaque,
};type
JET_INDEXCREATE2_A {.bycopy.} = object
cbStruct: uint32
szIndexName: pointer
szKey: pointer
cbKey: uint32
grbit: uint32
ulDensity: uint32
Anonymous1: _Anonymous1_e__Union
Anonymous2: _Anonymous2_e__Union
rgconditionalcolumn: pointer
cConditionalColumn: uint32
err: int32
cbKeyMost: uint32
pSpacehints: pointerstruct JET_INDEXCREATE2_A
{
uint cbStruct;
void* szIndexName;
void* szKey;
uint cbKey;
uint grbit;
uint ulDensity;
_Anonymous1_e__Union Anonymous1;
_Anonymous2_e__Union Anonymous2;
void* rgconditionalcolumn;
uint cConditionalColumn;
int err;
uint cbKeyMost;
void* pSpacehints;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JET_INDEXCREATE2_A サイズ: 52 バイト(x86)
dim st, 13 ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; szIndexName : CHAR* (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; szKey : CHAR* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cbKey : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; grbit : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ulDensity : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+24, 4byte) varptr(st)+24 を基点に操作(4byte:入れ子/配列)
; Anonymous2 : _Anonymous2_e__Union (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; rgconditionalcolumn : JET_CONDITIONALCOLUMN_A* (+32, 4byte) varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; cConditionalColumn : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; err : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; cbKeyMost : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; pSpacehints : JET_SPACEHINTS* (+48, 4byte) varptr(st)+48 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JET_INDEXCREATE2_A サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; szIndexName : CHAR* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; szKey : CHAR* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; cbKey : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; grbit : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ulDensity : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; Anonymous1 : _Anonymous1_e__Union (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; Anonymous2 : _Anonymous2_e__Union (+48, 8byte) varptr(st)+48 を基点に操作(8byte:入れ子/配列)
; rgconditionalcolumn : JET_CONDITIONALCOLUMN_A* (+56, 8byte) varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; cConditionalColumn : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; err : INT (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; cbKeyMost : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; pSpacehints : JET_SPACEHINTS* (+80, 8byte) varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JET_INDEXCREATE2_A
#field int cbStruct
#field intptr szIndexName
#field intptr szKey
#field int cbKey
#field int grbit
#field int ulDensity
#field byte Anonymous1 8
#field byte Anonymous2 8
#field intptr rgconditionalcolumn
#field int cConditionalColumn
#field int err
#field int cbKeyMost
#field intptr pSpacehints
#endstruct
stdim st, JET_INDEXCREATE2_A ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。