Win32 API 日本語リファレンス
ホームDevices.Tapi › LINEINITIALIZEEXPARAMS

LINEINITIALIZEEXPARAMS

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

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

フィールド

フィールドサイズx64x86説明
dwTotalSizeDWORD4+0+0この構造体に割り当てられた総サイズをバイトで表す。
dwNeededSizeDWORD4+4+4全情報の格納に必要なサイズをバイトで表す。
dwUsedSizeDWORD4+8+8実際に使用されたサイズをバイトで表す。
dwOptionsDWORD4+12+12通知メカニズム(隠しウィンドウ/イベント/完了ポート)を示す値。
Handles_Handles_e__Union8/4+16+16通知に用いるイベント/完了ポートのハンドルを保持する共用体。
dwCompletionKeyDWORD4+24+20完了ポート使用時に通知へ付与する完了キーを表す。

共用体: _Handles_e__Union x64 8B / x86 4B

フィールドサイズx64x86
hEventHANDLE8/4+0+0
hCompletionPortHANDLE8/4+0+0

各言語での定義

#include <windows.h>

// LINEINITIALIZEEXPARAMS  (x64 28 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct LINEINITIALIZEEXPARAMS {
    DWORD dwTotalSize;
    DWORD dwNeededSize;
    DWORD dwUsedSize;
    DWORD dwOptions;
    _Handles_e__Union Handles;
    DWORD dwCompletionKey;
} LINEINITIALIZEEXPARAMS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINEINITIALIZEEXPARAMS
{
    public uint dwTotalSize;
    public uint dwNeededSize;
    public uint dwUsedSize;
    public uint dwOptions;
    public _Handles_e__Union Handles;
    public uint dwCompletionKey;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINEINITIALIZEEXPARAMS
    Public dwTotalSize As UInteger
    Public dwNeededSize As UInteger
    Public dwUsedSize As UInteger
    Public dwOptions As UInteger
    Public Handles As _Handles_e__Union
    Public dwCompletionKey As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LINEINITIALIZEEXPARAMS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwTotalSize", wintypes.DWORD),
        ("dwNeededSize", wintypes.DWORD),
        ("dwUsedSize", wintypes.DWORD),
        ("dwOptions", wintypes.DWORD),
        ("Handles", _Handles_e__Union),
        ("dwCompletionKey", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct LINEINITIALIZEEXPARAMS {
    pub dwTotalSize: u32,
    pub dwNeededSize: u32,
    pub dwUsedSize: u32,
    pub dwOptions: u32,
    pub Handles: _Handles_e__Union,
    pub dwCompletionKey: u32,
}
import "golang.org/x/sys/windows"

type LINEINITIALIZEEXPARAMS struct {
	dwTotalSize uint32
	dwNeededSize uint32
	dwUsedSize uint32
	dwOptions uint32
	Handles _Handles_e__Union
	dwCompletionKey uint32
}
type
  LINEINITIALIZEEXPARAMS = packed record
    dwTotalSize: DWORD;
    dwNeededSize: DWORD;
    dwUsedSize: DWORD;
    dwOptions: DWORD;
    Handles: _Handles_e__Union;
    dwCompletionKey: DWORD;
  end;
const LINEINITIALIZEEXPARAMS = extern struct {
    dwTotalSize: u32,
    dwNeededSize: u32,
    dwUsedSize: u32,
    dwOptions: u32,
    Handles: _Handles_e__Union,
    dwCompletionKey: u32,
};
type
  LINEINITIALIZEEXPARAMS {.packed.} = object
    dwTotalSize: uint32
    dwNeededSize: uint32
    dwUsedSize: uint32
    dwOptions: uint32
    Handles: _Handles_e__Union
    dwCompletionKey: uint32
align(1)
struct LINEINITIALIZEEXPARAMS
{
    uint dwTotalSize;
    uint dwNeededSize;
    uint dwUsedSize;
    uint dwOptions;
    _Handles_e__Union Handles;
    uint dwCompletionKey;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LINEINITIALIZEEXPARAMS サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwTotalSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwNeededSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwUsedSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwOptions : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Handles : _Handles_e__Union (+16, 4byte)  varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; dwCompletionKey : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINEINITIALIZEEXPARAMS サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwTotalSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwNeededSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwUsedSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwOptions : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Handles : _Handles_e__Union (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; dwCompletionKey : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINEINITIALIZEEXPARAMS, pack=1
    #field int dwTotalSize
    #field int dwNeededSize
    #field int dwUsedSize
    #field int dwOptions
    #field byte Handles 8
    #field int dwCompletionKey
#endstruct

stdim st, LINEINITIALIZEEXPARAMS        ; NSTRUCT 変数を確保
st->dwTotalSize = 100
mes "dwTotalSize=" + st->dwTotalSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。