ホーム › System.Search › DBPARAMINFO
DBPARAMINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | パラメータの特性を示すフラグ(DBPARAMFLAGS_*)。方向や可NULL等を表す。 |
| iOrdinal | UINT_PTR | 8/4 | +4 | +4 | パラメータの序数(1始まり)。 |
| pwszName | LPWSTR | 8/4 | +12 | +8 | パラメータ名を表すワイド文字列へのポインタ。NULL可。 |
| pTypeInfo | ITypeInfo* | 8/4 | +20 | +12 | パラメータの型情報(ITypeInfo)へのポインタ。NULL可。 |
| ulParamSize | UINT_PTR | 8/4 | +28 | +16 | パラメータの最大サイズ。文字列は文字数、その他はバイト数。 |
| wType | WORD | 2 | +36 | +20 | パラメータのデータ型を示すDBTYPE値(WORD)。 |
| bPrecision | BYTE | 1 | +38 | +22 | 数値型の精度(全体桁数)。 |
| bScale | BYTE | 1 | +39 | +23 | 数値型のスケール(小数部桁数)。 |
各言語での定義
#include <windows.h>
// DBPARAMINFO (x64 40 / x86 24 バイト)
#pragma pack(push, 2)
typedef struct DBPARAMINFO {
DWORD dwFlags;
UINT_PTR iOrdinal;
LPWSTR pwszName;
ITypeInfo* pTypeInfo;
UINT_PTR ulParamSize;
WORD wType;
BYTE bPrecision;
BYTE bScale;
} DBPARAMINFO;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct DBPARAMINFO
{
public uint dwFlags;
public UIntPtr iOrdinal;
public IntPtr pwszName;
public IntPtr pTypeInfo;
public UIntPtr ulParamSize;
public ushort wType;
public byte bPrecision;
public byte bScale;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure DBPARAMINFO
Public dwFlags As UInteger
Public iOrdinal As UIntPtr
Public pwszName As IntPtr
Public pTypeInfo As IntPtr
Public ulParamSize As UIntPtr
Public wType As UShort
Public bPrecision As Byte
Public bScale As Byte
End Structureimport ctypes
from ctypes import wintypes
class DBPARAMINFO(ctypes.Structure):
_pack_ = 2
_fields_ = [
("dwFlags", wintypes.DWORD),
("iOrdinal", ctypes.c_size_t),
("pwszName", ctypes.c_void_p),
("pTypeInfo", ctypes.c_void_p),
("ulParamSize", ctypes.c_size_t),
("wType", ctypes.c_ushort),
("bPrecision", ctypes.c_ubyte),
("bScale", ctypes.c_ubyte),
]#[repr(C, packed(2))]
pub struct DBPARAMINFO {
pub dwFlags: u32,
pub iOrdinal: usize,
pub pwszName: *mut core::ffi::c_void,
pub pTypeInfo: *mut core::ffi::c_void,
pub ulParamSize: usize,
pub wType: u16,
pub bPrecision: u8,
pub bScale: u8,
}import "golang.org/x/sys/windows"
type DBPARAMINFO struct {
dwFlags uint32
iOrdinal uintptr
pwszName uintptr
pTypeInfo uintptr
ulParamSize uintptr
wType uint16
bPrecision byte
bScale byte
}type
DBPARAMINFO = packed record
dwFlags: DWORD;
iOrdinal: NativeUInt;
pwszName: Pointer;
pTypeInfo: Pointer;
ulParamSize: NativeUInt;
wType: Word;
bPrecision: Byte;
bScale: Byte;
end;const DBPARAMINFO = extern struct {
dwFlags: u32,
iOrdinal: usize,
pwszName: ?*anyopaque,
pTypeInfo: ?*anyopaque,
ulParamSize: usize,
wType: u16,
bPrecision: u8,
bScale: u8,
};type
DBPARAMINFO {.packed.} = object
dwFlags: uint32
iOrdinal: uint
pwszName: pointer
pTypeInfo: pointer
ulParamSize: uint
wType: uint16
bPrecision: uint8
bScale: uint8align(2)
struct DBPARAMINFO
{
uint dwFlags;
size_t iOrdinal;
void* pwszName;
void* pTypeInfo;
size_t ulParamSize;
ushort wType;
ubyte bPrecision;
ubyte bScale;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DBPARAMINFO サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; iOrdinal : UINT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pwszName : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pTypeInfo : ITypeInfo* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ulParamSize : UINT_PTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; wType : WORD (+20, 2byte) wpoke st,20,値 / 値 = wpeek(st,20)
; bPrecision : BYTE (+22, 1byte) poke st,22,値 / 値 = peek(st,22)
; bScale : BYTE (+23, 1byte) poke st,23,値 / 値 = peek(st,23)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DBPARAMINFO サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; iOrdinal : UINT_PTR (+4, 8byte) qpoke st,4,値 / qpeek(st,4) ※IronHSPのみ。3.7/3.8は lpoke st,4,下位 : lpoke st,8,上位
; pwszName : LPWSTR (+12, 8byte) qpoke st,12,値 / qpeek(st,12) ※IronHSPのみ。3.7/3.8は lpoke st,12,下位 : lpoke st,16,上位
; pTypeInfo : ITypeInfo* (+20, 8byte) qpoke st,20,値 / qpeek(st,20) ※IronHSPのみ。3.7/3.8は lpoke st,20,下位 : lpoke st,24,上位
; ulParamSize : UINT_PTR (+28, 8byte) qpoke st,28,値 / qpeek(st,28) ※IronHSPのみ。3.7/3.8は lpoke st,28,下位 : lpoke st,32,上位
; wType : WORD (+36, 2byte) wpoke st,36,値 / 値 = wpeek(st,36)
; bPrecision : BYTE (+38, 1byte) poke st,38,値 / 値 = peek(st,38)
; bScale : BYTE (+39, 1byte) poke st,39,値 / 値 = peek(st,39)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DBPARAMINFO, pack=2
#field int dwFlags
#field intptr iOrdinal
#field intptr pwszName
#field intptr pTypeInfo
#field intptr ulParamSize
#field short wType
#field byte bPrecision
#field byte bScale
#endstruct
stdim st, DBPARAMINFO ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags