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

NDR_USER_MARSHAL_INFO

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

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

フィールド

フィールドサイズx64x86説明
InformationLevelDWORD4+0+0情報レベルを示す値。どのレベルの共用体メンバが有効かを示す。
Anonymous_Anonymous_e__Union80/40+8+4レベルに応じた情報を保持する無名共用体(Level1等)。

共用体: _Anonymous_e__Union x64 80B / x86 40B

フィールドサイズx64x86
Level1NDR_USER_MARSHAL_INFO_LEVEL180/40+0+0

各言語での定義

#include <windows.h>

// NDR_USER_MARSHAL_INFO  (x64 88 / x86 44 バイト)
typedef struct NDR_USER_MARSHAL_INFO {
    DWORD InformationLevel;
    _Anonymous_e__Union Anonymous;
} NDR_USER_MARSHAL_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NDR_USER_MARSHAL_INFO
{
    public uint InformationLevel;
    public _Anonymous_e__Union Anonymous;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NDR_USER_MARSHAL_INFO
    Public InformationLevel As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure
import ctypes
from ctypes import wintypes

class NDR_USER_MARSHAL_INFO(ctypes.Structure):
    _fields_ = [
        ("InformationLevel", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
    ]
#[repr(C)]
pub struct NDR_USER_MARSHAL_INFO {
    pub InformationLevel: u32,
    pub Anonymous: _Anonymous_e__Union,
}
import "golang.org/x/sys/windows"

type NDR_USER_MARSHAL_INFO struct {
	InformationLevel uint32
	Anonymous _Anonymous_e__Union
}
type
  NDR_USER_MARSHAL_INFO = record
    InformationLevel: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;
const NDR_USER_MARSHAL_INFO = extern struct {
    InformationLevel: u32,
    Anonymous: _Anonymous_e__Union,
};
type
  NDR_USER_MARSHAL_INFO {.bycopy.} = object
    InformationLevel: uint32
    Anonymous: _Anonymous_e__Union
struct NDR_USER_MARSHAL_INFO
{
    uint InformationLevel;
    _Anonymous_e__Union Anonymous;
}

HSP用 定義

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

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

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