ホーム › Devices.Tapi › PHONEINITIALIZEEXPARAMS
PHONEINITIALIZEEXPARAMS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwTotalSize | DWORD | 4 | +0 | +0 | アプリが確保した構造体全体のサイズをバイト単位で示す。 |
| dwNeededSize | DWORD | 4 | +4 | +4 | 必要なサイズをバイト単位で示す。 |
| dwUsedSize | DWORD | 4 | +8 | +8 | 実際に使用されたサイズをバイト単位で示す。 |
| dwOptions | DWORD | 4 | +12 | +12 | イベント通知方式を示すPHONEINITIALIZEEXOPTION定数。 |
| Handles | _Handles_e__Union | 8/4 | +16 | +16 | 通知に使うイベントハンドルや完了ポートハンドルを格納する無名共用体。 |
| dwCompletionKey | DWORD | 4 | +24 | +20 | 完了ポート方式使用時に通知を識別する完了キーを示す。 |
共用体: _Handles_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| hEvent | HANDLE | 8/4 | +0 | +0 |
| hCompletionPort | HANDLE | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// PHONEINITIALIZEEXPARAMS (x64 28 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct PHONEINITIALIZEEXPARAMS {
DWORD dwTotalSize;
DWORD dwNeededSize;
DWORD dwUsedSize;
DWORD dwOptions;
_Handles_e__Union Handles;
DWORD dwCompletionKey;
} PHONEINITIALIZEEXPARAMS;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct PHONEINITIALIZEEXPARAMS
{
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 PHONEINITIALIZEEXPARAMS
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 Structureimport ctypes
from ctypes import wintypes
class PHONEINITIALIZEEXPARAMS(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 PHONEINITIALIZEEXPARAMS {
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 PHONEINITIALIZEEXPARAMS struct {
dwTotalSize uint32
dwNeededSize uint32
dwUsedSize uint32
dwOptions uint32
Handles _Handles_e__Union
dwCompletionKey uint32
}type
PHONEINITIALIZEEXPARAMS = packed record
dwTotalSize: DWORD;
dwNeededSize: DWORD;
dwUsedSize: DWORD;
dwOptions: DWORD;
Handles: _Handles_e__Union;
dwCompletionKey: DWORD;
end;const PHONEINITIALIZEEXPARAMS = extern struct {
dwTotalSize: u32,
dwNeededSize: u32,
dwUsedSize: u32,
dwOptions: u32,
Handles: _Handles_e__Union,
dwCompletionKey: u32,
};type
PHONEINITIALIZEEXPARAMS {.packed.} = object
dwTotalSize: uint32
dwNeededSize: uint32
dwUsedSize: uint32
dwOptions: uint32
Handles: _Handles_e__Union
dwCompletionKey: uint32align(1)
struct PHONEINITIALIZEEXPARAMS
{
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 レイアウト)
; PHONEINITIALIZEEXPARAMS サイズ: 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 レイアウト)
; PHONEINITIALIZEEXPARAMS サイズ: 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 PHONEINITIALIZEEXPARAMS, pack=1
#field int dwTotalSize
#field int dwNeededSize
#field int dwUsedSize
#field int dwOptions
#field byte Handles 8
#field int dwCompletionKey
#endstruct
stdim st, PHONEINITIALIZEEXPARAMS ; NSTRUCT 変数を確保
st->dwTotalSize = 100
mes "dwTotalSize=" + st->dwTotalSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。