ホーム › System.RemoteDesktop › RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE
RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| channelHdr | RFX_GFX_MSG_HEADER | 4 | +0 | +0 | メッセージ共通のチャネルヘッダ。 |
| reserved | DWORD | 4 | +4 | +4 | 将来の拡張用に予約された領域。 |
| monitorCount | DWORD | 4 | +8 | +8 | MonitorData配列に含まれるモニタの数。 |
| MonitorData | RFX_GFX_MONITOR_INFO | 512 | +12 | +12 | 各モニタの情報を格納する可変長配列。 |
| clientUniqueId | WCHAR | 64 | +524 | +524 | クライアントを一意に識別する文字列。 |
各言語での定義
#include <windows.h>
// RFX_GFX_MSG_HEADER (x64 4 / x86 4 バイト)
#pragma pack(push, 1)
typedef struct RFX_GFX_MSG_HEADER {
WORD uMSGType;
WORD cbSize;
} RFX_GFX_MSG_HEADER;
#pragma pack(pop)
// RFX_GFX_MONITOR_INFO (x64 32 / x86 32 バイト)
#pragma pack(push, 1)
typedef struct RFX_GFX_MONITOR_INFO {
INT left;
INT top;
INT right;
INT bottom;
DWORD physicalWidth;
DWORD physicalHeight;
DWORD orientation;
BOOL primary;
} RFX_GFX_MONITOR_INFO;
#pragma pack(pop)
// RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE (x64 588 / x86 588 バイト)
#pragma pack(push, 1)
typedef struct RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE {
RFX_GFX_MSG_HEADER channelHdr;
DWORD reserved;
DWORD monitorCount;
RFX_GFX_MONITOR_INFO MonitorData[16];
WCHAR clientUniqueId[32];
} RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct RFX_GFX_MSG_HEADER
{
public ushort uMSGType;
public ushort cbSize;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct RFX_GFX_MONITOR_INFO
{
public int left;
public int top;
public int right;
public int bottom;
public uint physicalWidth;
public uint physicalHeight;
public uint orientation;
[MarshalAs(UnmanagedType.Bool)] public bool primary;
}
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE
{
public RFX_GFX_MSG_HEADER channelHdr;
public uint reserved;
public uint monitorCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public RFX_GFX_MONITOR_INFO[] MonitorData;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string clientUniqueId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure RFX_GFX_MSG_HEADER
Public uMSGType As UShort
Public cbSize As UShort
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure RFX_GFX_MONITOR_INFO
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
Public physicalWidth As UInteger
Public physicalHeight As UInteger
Public orientation As UInteger
<MarshalAs(UnmanagedType.Bool)> Public primary As Boolean
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE
Public channelHdr As RFX_GFX_MSG_HEADER
Public reserved As UInteger
Public monitorCount As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public MonitorData() As RFX_GFX_MONITOR_INFO
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public clientUniqueId As String
End Structureimport ctypes
from ctypes import wintypes
class RFX_GFX_MSG_HEADER(ctypes.Structure):
_pack_ = 1
_fields_ = [
("uMSGType", ctypes.c_ushort),
("cbSize", ctypes.c_ushort),
]
class RFX_GFX_MONITOR_INFO(ctypes.Structure):
_pack_ = 1
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
("physicalWidth", wintypes.DWORD),
("physicalHeight", wintypes.DWORD),
("orientation", wintypes.DWORD),
("primary", wintypes.BOOL),
]
class RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE(ctypes.Structure):
_pack_ = 1
_fields_ = [
("channelHdr", RFX_GFX_MSG_HEADER),
("reserved", wintypes.DWORD),
("monitorCount", wintypes.DWORD),
("MonitorData", RFX_GFX_MONITOR_INFO * 16),
("clientUniqueId", ctypes.c_wchar * 32),
]#[repr(C, packed(1))]
pub struct RFX_GFX_MSG_HEADER {
pub uMSGType: u16,
pub cbSize: u16,
}
#[repr(C, packed(1))]
pub struct RFX_GFX_MONITOR_INFO {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
pub physicalWidth: u32,
pub physicalHeight: u32,
pub orientation: u32,
pub primary: i32,
}
#[repr(C, packed(1))]
pub struct RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE {
pub channelHdr: RFX_GFX_MSG_HEADER,
pub reserved: u32,
pub monitorCount: u32,
pub MonitorData: [RFX_GFX_MONITOR_INFO; 16],
pub clientUniqueId: [u16; 32],
}import "golang.org/x/sys/windows"
type RFX_GFX_MSG_HEADER struct {
uMSGType uint16
cbSize uint16
}
type RFX_GFX_MONITOR_INFO struct {
left int32
top int32
right int32
bottom int32
physicalWidth uint32
physicalHeight uint32
orientation uint32
primary int32
}
type RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE struct {
channelHdr RFX_GFX_MSG_HEADER
reserved uint32
monitorCount uint32
MonitorData [16]RFX_GFX_MONITOR_INFO
clientUniqueId [32]uint16
}type
RFX_GFX_MSG_HEADER = packed record
uMSGType: Word;
cbSize: Word;
end;
RFX_GFX_MONITOR_INFO = packed record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
physicalWidth: DWORD;
physicalHeight: DWORD;
orientation: DWORD;
primary: BOOL;
end;
RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE = packed record
channelHdr: RFX_GFX_MSG_HEADER;
reserved: DWORD;
monitorCount: DWORD;
MonitorData: array[0..15] of RFX_GFX_MONITOR_INFO;
clientUniqueId: array[0..31] of WideChar;
end;const RFX_GFX_MSG_HEADER = extern struct {
uMSGType: u16,
cbSize: u16,
};
const RFX_GFX_MONITOR_INFO = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
physicalWidth: u32,
physicalHeight: u32,
orientation: u32,
primary: i32,
};
const RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE = extern struct {
channelHdr: RFX_GFX_MSG_HEADER,
reserved: u32,
monitorCount: u32,
MonitorData: [16]RFX_GFX_MONITOR_INFO,
clientUniqueId: [32]u16,
};type
RFX_GFX_MSG_HEADER {.packed.} = object
uMSGType: uint16
cbSize: uint16
RFX_GFX_MONITOR_INFO {.packed.} = object
left: int32
top: int32
right: int32
bottom: int32
physicalWidth: uint32
physicalHeight: uint32
orientation: uint32
primary: int32
RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE {.packed.} = object
channelHdr: RFX_GFX_MSG_HEADER
reserved: uint32
monitorCount: uint32
MonitorData: array[16, RFX_GFX_MONITOR_INFO]
clientUniqueId: array[32, uint16]align(1)
struct RFX_GFX_MSG_HEADER
{
ushort uMSGType;
ushort cbSize;
}
align(1)
struct RFX_GFX_MONITOR_INFO
{
int left;
int top;
int right;
int bottom;
uint physicalWidth;
uint physicalHeight;
uint orientation;
int primary;
}
align(1)
struct RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE
{
RFX_GFX_MSG_HEADER channelHdr;
uint reserved;
uint monitorCount;
RFX_GFX_MONITOR_INFO[16] MonitorData;
wchar[32] clientUniqueId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE サイズ: 588 バイト(x64)
dim st, 147 ; 4byte整数×147(構造体サイズ 588 / 4 切り上げ)
; channelHdr : RFX_GFX_MSG_HEADER (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; reserved : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; monitorCount : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; MonitorData : RFX_GFX_MONITOR_INFO (+12, 512byte) varptr(st)+12 を基点に操作(512byte:入れ子/配列)
; clientUniqueId : WCHAR (+524, 64byte) varptr(st)+524 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RFX_GFX_MSG_HEADER, pack=1
#field short uMSGType
#field short cbSize
#endstruct
#defstruct global RFX_GFX_MONITOR_INFO, pack=1
#field int left
#field int top
#field int right
#field int bottom
#field int physicalWidth
#field int physicalHeight
#field int orientation
#field bool primary
#endstruct
#defstruct global RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE, pack=1
#field RFX_GFX_MSG_HEADER channelHdr
#field int reserved
#field int monitorCount
#field RFX_GFX_MONITOR_INFO MonitorData 16
#field wchar clientUniqueId 32
#endstruct
stdim st, RFX_GFX_MSG_CLIENT_DESKTOP_INFO_RESPONSE ; NSTRUCT 変数を確保
st->reserved = 100
mes "reserved=" + st->reserved