ホーム › Graphics.Printing › BIDI_RESPONSE_CONTAINER
BIDI_RESPONSE_CONTAINER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | コンテナのバージョン番号。 |
| Flags | DWORD | 4 | +4 | +4 | 応答動作を制御するビットフラグ。 |
| Count | DWORD | 4 | +8 | +8 | aData配列に含まれる応答数。 |
| aData | BIDI_RESPONSE_DATA | 40/24 | +16 | +12 | 個々の応答を表すBIDI_RESPONSE_DATAの可変長配列の先頭要素。 |
各言語での定義
#include <windows.h>
// BIDI_DATA (x64 24 / x86 12 バイト)
typedef struct BIDI_DATA {
DWORD dwBidiType;
_u_e__Union u;
} BIDI_DATA;
// BIDI_RESPONSE_DATA (x64 40 / x86 24 バイト)
typedef struct BIDI_RESPONSE_DATA {
DWORD dwResult;
DWORD dwReqNumber;
LPWSTR pSchema;
BIDI_DATA data;
} BIDI_RESPONSE_DATA;
// BIDI_RESPONSE_CONTAINER (x64 56 / x86 36 バイト)
typedef struct BIDI_RESPONSE_CONTAINER {
DWORD Version;
DWORD Flags;
DWORD Count;
BIDI_RESPONSE_DATA aData[1];
} BIDI_RESPONSE_CONTAINER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BIDI_DATA
{
public uint dwBidiType;
public _u_e__Union u;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BIDI_RESPONSE_DATA
{
public uint dwResult;
public uint dwReqNumber;
public IntPtr pSchema;
public BIDI_DATA data;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BIDI_RESPONSE_CONTAINER
{
public uint Version;
public uint Flags;
public uint Count;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public BIDI_RESPONSE_DATA[] aData;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BIDI_DATA
Public dwBidiType As UInteger
Public u As _u_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BIDI_RESPONSE_DATA
Public dwResult As UInteger
Public dwReqNumber As UInteger
Public pSchema As IntPtr
Public data As BIDI_DATA
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BIDI_RESPONSE_CONTAINER
Public Version As UInteger
Public Flags As UInteger
Public Count As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public aData() As BIDI_RESPONSE_DATA
End Structureimport ctypes
from ctypes import wintypes
class BIDI_DATA(ctypes.Structure):
_fields_ = [
("dwBidiType", wintypes.DWORD),
("u", _u_e__Union),
]
class BIDI_RESPONSE_DATA(ctypes.Structure):
_fields_ = [
("dwResult", wintypes.DWORD),
("dwReqNumber", wintypes.DWORD),
("pSchema", ctypes.c_void_p),
("data", BIDI_DATA),
]
class BIDI_RESPONSE_CONTAINER(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("Flags", wintypes.DWORD),
("Count", wintypes.DWORD),
("aData", BIDI_RESPONSE_DATA * 1),
]#[repr(C)]
pub struct BIDI_DATA {
pub dwBidiType: u32,
pub u: _u_e__Union,
}
#[repr(C)]
pub struct BIDI_RESPONSE_DATA {
pub dwResult: u32,
pub dwReqNumber: u32,
pub pSchema: *mut core::ffi::c_void,
pub data: BIDI_DATA,
}
#[repr(C)]
pub struct BIDI_RESPONSE_CONTAINER {
pub Version: u32,
pub Flags: u32,
pub Count: u32,
pub aData: [BIDI_RESPONSE_DATA; 1],
}import "golang.org/x/sys/windows"
type BIDI_DATA struct {
dwBidiType uint32
u _u_e__Union
}
type BIDI_RESPONSE_DATA struct {
dwResult uint32
dwReqNumber uint32
pSchema uintptr
data BIDI_DATA
}
type BIDI_RESPONSE_CONTAINER struct {
Version uint32
Flags uint32
Count uint32
aData [1]BIDI_RESPONSE_DATA
}type
BIDI_DATA = record
dwBidiType: DWORD;
u: _u_e__Union;
end;
BIDI_RESPONSE_DATA = record
dwResult: DWORD;
dwReqNumber: DWORD;
pSchema: Pointer;
data: BIDI_DATA;
end;
BIDI_RESPONSE_CONTAINER = record
Version: DWORD;
Flags: DWORD;
Count: DWORD;
aData: array[0..0] of BIDI_RESPONSE_DATA;
end;const BIDI_DATA = extern struct {
dwBidiType: u32,
u: _u_e__Union,
};
const BIDI_RESPONSE_DATA = extern struct {
dwResult: u32,
dwReqNumber: u32,
pSchema: ?*anyopaque,
data: BIDI_DATA,
};
const BIDI_RESPONSE_CONTAINER = extern struct {
Version: u32,
Flags: u32,
Count: u32,
aData: [1]BIDI_RESPONSE_DATA,
};type
BIDI_DATA {.bycopy.} = object
dwBidiType: uint32
u: _u_e__Union
BIDI_RESPONSE_DATA {.bycopy.} = object
dwResult: uint32
dwReqNumber: uint32
pSchema: pointer
data: BIDI_DATA
BIDI_RESPONSE_CONTAINER {.bycopy.} = object
Version: uint32
Flags: uint32
Count: uint32
aData: array[1, BIDI_RESPONSE_DATA]struct BIDI_DATA
{
uint dwBidiType;
_u_e__Union u;
}
struct BIDI_RESPONSE_DATA
{
uint dwResult;
uint dwReqNumber;
void* pSchema;
BIDI_DATA data;
}
struct BIDI_RESPONSE_CONTAINER
{
uint Version;
uint Flags;
uint Count;
BIDI_RESPONSE_DATA[1] aData;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; BIDI_RESPONSE_CONTAINER サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Count : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; aData : BIDI_RESPONSE_DATA (+12, 24byte) varptr(st)+12 を基点に操作(24byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; BIDI_RESPONSE_CONTAINER サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Count : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; aData : BIDI_RESPONSE_DATA (+16, 40byte) varptr(st)+16 を基点に操作(40byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global BIDI_DATA
#field int dwBidiType
#field byte u 16
#endstruct
#defstruct global BIDI_RESPONSE_DATA
#field int dwResult
#field int dwReqNumber
#field intptr pSchema
#field BIDI_DATA data
#endstruct
#defstruct global BIDI_RESPONSE_CONTAINER
#field int Version
#field int Flags
#field int Count
#field BIDI_RESPONSE_DATA aData 1
#endstruct
stdim st, BIDI_RESPONSE_CONTAINER ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version