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

RPC_EE_INFO_PARAM

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

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

フィールド

フィールドサイズx64x86説明
ParameterTypeExtendedErrorParamTypes4+0+0拡張エラーパラメーターの型。ExtendedErrorParamTypesで表す。
u_u_e__Union16/8+8+8型に応じたパラメーター値を保持する共用体。

共用体: _u_e__Union x64 16B / x86 8B

フィールドサイズx64x86
AnsiStringLPSTR8/4+0+0
UnicodeStringLPWSTR8/4+0+0
LValINT4+0+0
SValSHORT2+0+0
PValULONGLONG8+0+0
BValBinaryParam16/8+0+0

各言語での定義

#include <windows.h>

// RPC_EE_INFO_PARAM  (x64 24 / x86 16 バイト)
typedef struct RPC_EE_INFO_PARAM {
    ExtendedErrorParamTypes ParameterType;
    _u_e__Union u;
} RPC_EE_INFO_PARAM;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RPC_EE_INFO_PARAM
{
    public int ParameterType;
    public _u_e__Union u;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RPC_EE_INFO_PARAM
    Public ParameterType As Integer
    Public u As _u_e__Union
End Structure
import ctypes
from ctypes import wintypes

class RPC_EE_INFO_PARAM(ctypes.Structure):
    _fields_ = [
        ("ParameterType", ctypes.c_int),
        ("u", _u_e__Union),
    ]
#[repr(C)]
pub struct RPC_EE_INFO_PARAM {
    pub ParameterType: i32,
    pub u: _u_e__Union,
}
import "golang.org/x/sys/windows"

type RPC_EE_INFO_PARAM struct {
	ParameterType int32
	u _u_e__Union
}
type
  RPC_EE_INFO_PARAM = record
    ParameterType: Integer;
    u: _u_e__Union;
  end;
const RPC_EE_INFO_PARAM = extern struct {
    ParameterType: i32,
    u: _u_e__Union,
};
type
  RPC_EE_INFO_PARAM {.bycopy.} = object
    ParameterType: int32
    u: _u_e__Union
struct RPC_EE_INFO_PARAM
{
    int ParameterType;
    _u_e__Union u;
}

HSP用 定義

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

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

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