Win32 API 日本語リファレンス
ホームSystem.Search › DBPROPSET

DBPROPSET

構造体
サイズx64: 28 バイト / x86: 24 バイトパッキング2

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

フィールド

フィールドサイズx64x86説明
rgPropertiesDBPROP*8/4+0+0DBPROP配列へのポインタ。設定/取得するプロパティ群を指す。
cPropertiesDWORD4+8+4rgProperties配列の要素数。
guidPropertySetGUID16+12+8プロパティ群が属するプロパティセットのGUID。

各言語での定義

#include <windows.h>

// DBPROPSET  (x64 28 / x86 24 バイト)
#pragma pack(push, 2)
typedef struct DBPROPSET {
    DBPROP* rgProperties;
    DWORD cProperties;
    GUID guidPropertySet;
} DBPROPSET;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 2, CharSet = CharSet.Unicode)]
public struct DBPROPSET
{
    public IntPtr rgProperties;
    public uint cProperties;
    public Guid guidPropertySet;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=2, CharSet:=CharSet.Unicode)>
Public Structure DBPROPSET
    Public rgProperties As IntPtr
    Public cProperties As UInteger
    Public guidPropertySet As Guid
End Structure
import ctypes
from ctypes import wintypes

class DBPROPSET(ctypes.Structure):
    _pack_ = 2
    _fields_ = [
        ("rgProperties", ctypes.c_void_p),
        ("cProperties", wintypes.DWORD),
        ("guidPropertySet", GUID),
    ]
#[repr(C, packed(2))]
pub struct DBPROPSET {
    pub rgProperties: *mut core::ffi::c_void,
    pub cProperties: u32,
    pub guidPropertySet: GUID,
}
import "golang.org/x/sys/windows"

type DBPROPSET struct {
	rgProperties uintptr
	cProperties uint32
	guidPropertySet windows.GUID
}
type
  DBPROPSET = packed record
    rgProperties: Pointer;
    cProperties: DWORD;
    guidPropertySet: TGUID;
  end;
const DBPROPSET = extern struct {
    rgProperties: ?*anyopaque,
    cProperties: u32,
    guidPropertySet: GUID,
};
type
  DBPROPSET {.packed.} = object
    rgProperties: pointer
    cProperties: uint32
    guidPropertySet: GUID
align(2)
struct DBPROPSET
{
    void* rgProperties;
    uint cProperties;
    GUID guidPropertySet;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DBPROPSET サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; rgProperties : DBPROP* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; cProperties : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; guidPropertySet : GUID (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DBPROPSET サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; rgProperties : DBPROP* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; cProperties : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; guidPropertySet : GUID (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global DBPROPSET, pack=2
    #field intptr rgProperties
    #field int cProperties
    #field GUID guidPropertySet
#endstruct

stdim st, DBPROPSET        ; NSTRUCT 変数を確保
st->cProperties = 100
mes "cProperties=" + st->cProperties