ホーム › Storage.IndexServer › DBID
DBID
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| uGuid | _uGuid_e__Union | 16 | +0 | +0 | 列を識別するGUID(直接値またはポインタ)を保持する共用体。 |
| eKind | DWORD | 4 | +16 | +16 | 名前部分の種類(GUID名/プロパティID/列番号等)。 |
| uName | _uName_e__Union | 8/4 | +20 | +20 | 列名(文字列ポインタまたは数値ID)を保持する共用体。 |
共用体: _uGuid_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| guid | GUID | 16 | +0 | +0 |
| pguid | GUID* | 8/4 | +0 | +0 |
共用体: _uName_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| pwszName | LPWSTR | 8/4 | +0 | +0 |
| ulPropid | DWORD | 4 | +0 | +0 |
各言語での定義
#include <windows.h>
// DBID (x64 28 / x86 24 バイト)
#pragma pack(push, 2)
typedef struct DBID {
_uGuid_e__Union uGuid;
DWORD eKind;
_uName_e__Union uName;
} DBID;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct DBID
{
public _uGuid_e__Union uGuid;
public uint eKind;
public _uName_e__Union uName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure DBID
Public uGuid As _uGuid_e__Union
Public eKind As UInteger
Public uName As _uName_e__Union
End Structureimport ctypes
from ctypes import wintypes
class DBID(ctypes.Structure):
_pack_ = 2
_fields_ = [
("uGuid", _uGuid_e__Union),
("eKind", wintypes.DWORD),
("uName", _uName_e__Union),
]#[repr(C, packed(2))]
pub struct DBID {
pub uGuid: _uGuid_e__Union,
pub eKind: u32,
pub uName: _uName_e__Union,
}import "golang.org/x/sys/windows"
type DBID struct {
uGuid _uGuid_e__Union
eKind uint32
uName _uName_e__Union
}type
DBID = packed record
uGuid: _uGuid_e__Union;
eKind: DWORD;
uName: _uName_e__Union;
end;const DBID = extern struct {
uGuid: _uGuid_e__Union,
eKind: u32,
uName: _uName_e__Union,
};type
DBID {.packed.} = object
uGuid: _uGuid_e__Union
eKind: uint32
uName: _uName_e__Unionalign(2)
struct DBID
{
_uGuid_e__Union uGuid;
uint eKind;
_uName_e__Union uName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DBID サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; uGuid : _uGuid_e__Union (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; eKind : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; uName : _uName_e__Union (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DBID サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; uGuid : _uGuid_e__Union (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; eKind : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; uName : _uName_e__Union (+20, 8byte) varptr(st)+20 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DBID, pack=2
#field byte uGuid 16
#field int eKind
#field byte uName 8
#endstruct
stdim st, DBID ; NSTRUCT 変数を確保
st->eKind = 100
mes "eKind=" + st->eKind
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。