Win32 API 日本語リファレンス
ホームNetworking.WindowsWebServices › WS_PARAMETER_DESCRIPTION

WS_PARAMETER_DESCRIPTION

構造体
サイズx64: 8 バイト / x86: 8 バイト

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

フィールド

フィールドサイズx64x86説明
parameterTypeWS_PARAMETER_TYPE4+0+0パラメータの種別(値/配列/サイズ等)を示す列挙値。
inputMessageIndexWORD2+4+4入力メッセージ本体内で対応するフィールドのインデックス。未使用時は0xFFFF。
outputMessageIndexWORD2+6+6出力メッセージ本体内で対応するフィールドのインデックス。未使用時は0xFFFF。

各言語での定義

#include <windows.h>

// WS_PARAMETER_DESCRIPTION  (x64 8 / x86 8 バイト)
typedef struct WS_PARAMETER_DESCRIPTION {
    WS_PARAMETER_TYPE parameterType;
    WORD inputMessageIndex;
    WORD outputMessageIndex;
} WS_PARAMETER_DESCRIPTION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WS_PARAMETER_DESCRIPTION
{
    public int parameterType;
    public ushort inputMessageIndex;
    public ushort outputMessageIndex;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WS_PARAMETER_DESCRIPTION
    Public parameterType As Integer
    Public inputMessageIndex As UShort
    Public outputMessageIndex As UShort
End Structure
import ctypes
from ctypes import wintypes

class WS_PARAMETER_DESCRIPTION(ctypes.Structure):
    _fields_ = [
        ("parameterType", ctypes.c_int),
        ("inputMessageIndex", ctypes.c_ushort),
        ("outputMessageIndex", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct WS_PARAMETER_DESCRIPTION {
    pub parameterType: i32,
    pub inputMessageIndex: u16,
    pub outputMessageIndex: u16,
}
import "golang.org/x/sys/windows"

type WS_PARAMETER_DESCRIPTION struct {
	parameterType int32
	inputMessageIndex uint16
	outputMessageIndex uint16
}
type
  WS_PARAMETER_DESCRIPTION = record
    parameterType: Integer;
    inputMessageIndex: Word;
    outputMessageIndex: Word;
  end;
const WS_PARAMETER_DESCRIPTION = extern struct {
    parameterType: i32,
    inputMessageIndex: u16,
    outputMessageIndex: u16,
};
type
  WS_PARAMETER_DESCRIPTION {.bycopy.} = object
    parameterType: int32
    inputMessageIndex: uint16
    outputMessageIndex: uint16
struct WS_PARAMETER_DESCRIPTION
{
    int parameterType;
    ushort inputMessageIndex;
    ushort outputMessageIndex;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WS_PARAMETER_DESCRIPTION サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; parameterType : WS_PARAMETER_TYPE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; inputMessageIndex : WORD (+4, 2byte)  wpoke st,4,値  /  値 = wpeek(st,4)
; outputMessageIndex : WORD (+6, 2byte)  wpoke st,6,値  /  値 = wpeek(st,6)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WS_PARAMETER_DESCRIPTION
    #field int parameterType
    #field short inputMessageIndex
    #field short outputMessageIndex
#endstruct

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