ホーム › System.RemoteDesktop › WTSCLIENTA
WTSCLIENTA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ClientName | CHAR | 21 | +0 | +0 | クライアントコンピュータ名(ANSI)。 |
| Domain | CHAR | 18 | +21 | +21 | クライアントのドメイン名(ANSI)。 |
| UserName | CHAR | 21 | +39 | +39 | クライアントのユーザー名(ANSI)。 |
| WorkDirectory | CHAR | 261 | +60 | +60 | 作業ディレクトリのパス(ANSI)。 |
| InitialProgram | CHAR | 261 | +321 | +321 | 起動時に実行する初期プログラム(ANSI)。 |
| EncryptionLevel | BYTE | 1 | +582 | +582 | 接続の暗号化レベルを示す値。 |
| ClientAddressFamily | DWORD | 4 | +584 | +584 | クライアントアドレスのアドレスファミリ(AF_INET等)。 |
| ClientAddress | WORD | 62 | +588 | +588 | クライアントのネットワークアドレス(WORD配列)。 |
| HRes | WORD | 2 | +650 | +650 | クライアント表示の水平解像度。ピクセル数で表す。 |
| VRes | WORD | 2 | +652 | +652 | クライアント表示の垂直解像度。ピクセル数で表す。 |
| ColorDepth | WORD | 2 | +654 | +654 | クライアント表示の色深度を示す値。 |
| ClientDirectory | CHAR | 261 | +656 | +656 | クライアントのインストールディレクトリ(ANSI)。 |
| ClientBuildNumber | DWORD | 4 | +920 | +920 | クライアントソフトウェアのビルド番号。 |
| ClientHardwareId | DWORD | 4 | +924 | +924 | クライアントのハードウェア識別子。 |
| ClientProductId | WORD | 2 | +928 | +928 | クライアントの製品識別子。 |
| OutBufCountHost | WORD | 2 | +930 | +930 | ホスト側の出力バッファ数。 |
| OutBufCountClient | WORD | 2 | +932 | +932 | クライアント側の出力バッファ数。 |
| OutBufLength | WORD | 2 | +934 | +934 | 出力バッファの長さ。バイト数で表す。 |
| DeviceId | CHAR | 261 | +936 | +936 | クライアントデバイスの識別子(ANSI)。 |
各言語での定義
#include <windows.h>
// WTSCLIENTA (x64 1200 / x86 1200 バイト)
typedef struct WTSCLIENTA {
CHAR ClientName[21];
CHAR Domain[18];
CHAR UserName[21];
CHAR WorkDirectory[261];
CHAR InitialProgram[261];
BYTE EncryptionLevel;
DWORD ClientAddressFamily;
WORD ClientAddress[31];
WORD HRes;
WORD VRes;
WORD ColorDepth;
CHAR ClientDirectory[261];
DWORD ClientBuildNumber;
DWORD ClientHardwareId;
WORD ClientProductId;
WORD OutBufCountHost;
WORD OutBufCountClient;
WORD OutBufLength;
CHAR DeviceId[261];
} WTSCLIENTA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTSCLIENTA
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 21)] public sbyte[] ClientName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)] public sbyte[] Domain;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 21)] public sbyte[] UserName;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 261)] public sbyte[] WorkDirectory;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 261)] public sbyte[] InitialProgram;
public byte EncryptionLevel;
public uint ClientAddressFamily;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)] public ushort[] ClientAddress;
public ushort HRes;
public ushort VRes;
public ushort ColorDepth;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 261)] public sbyte[] ClientDirectory;
public uint ClientBuildNumber;
public uint ClientHardwareId;
public ushort ClientProductId;
public ushort OutBufCountHost;
public ushort OutBufCountClient;
public ushort OutBufLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 261)] public sbyte[] DeviceId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTSCLIENTA
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=21)> Public ClientName() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=18)> Public Domain() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=21)> Public UserName() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=261)> Public WorkDirectory() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=261)> Public InitialProgram() As SByte
Public EncryptionLevel As Byte
Public ClientAddressFamily As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=31)> Public ClientAddress() As UShort
Public HRes As UShort
Public VRes As UShort
Public ColorDepth As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=261)> Public ClientDirectory() As SByte
Public ClientBuildNumber As UInteger
Public ClientHardwareId As UInteger
Public ClientProductId As UShort
Public OutBufCountHost As UShort
Public OutBufCountClient As UShort
Public OutBufLength As UShort
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=261)> Public DeviceId() As SByte
End Structureimport ctypes
from ctypes import wintypes
class WTSCLIENTA(ctypes.Structure):
_fields_ = [
("ClientName", ctypes.c_byte * 21),
("Domain", ctypes.c_byte * 18),
("UserName", ctypes.c_byte * 21),
("WorkDirectory", ctypes.c_byte * 261),
("InitialProgram", ctypes.c_byte * 261),
("EncryptionLevel", ctypes.c_ubyte),
("ClientAddressFamily", wintypes.DWORD),
("ClientAddress", ctypes.c_ushort * 31),
("HRes", ctypes.c_ushort),
("VRes", ctypes.c_ushort),
("ColorDepth", ctypes.c_ushort),
("ClientDirectory", ctypes.c_byte * 261),
("ClientBuildNumber", wintypes.DWORD),
("ClientHardwareId", wintypes.DWORD),
("ClientProductId", ctypes.c_ushort),
("OutBufCountHost", ctypes.c_ushort),
("OutBufCountClient", ctypes.c_ushort),
("OutBufLength", ctypes.c_ushort),
("DeviceId", ctypes.c_byte * 261),
]#[repr(C)]
pub struct WTSCLIENTA {
pub ClientName: [i8; 21],
pub Domain: [i8; 18],
pub UserName: [i8; 21],
pub WorkDirectory: [i8; 261],
pub InitialProgram: [i8; 261],
pub EncryptionLevel: u8,
pub ClientAddressFamily: u32,
pub ClientAddress: [u16; 31],
pub HRes: u16,
pub VRes: u16,
pub ColorDepth: u16,
pub ClientDirectory: [i8; 261],
pub ClientBuildNumber: u32,
pub ClientHardwareId: u32,
pub ClientProductId: u16,
pub OutBufCountHost: u16,
pub OutBufCountClient: u16,
pub OutBufLength: u16,
pub DeviceId: [i8; 261],
}import "golang.org/x/sys/windows"
type WTSCLIENTA struct {
ClientName [21]int8
Domain [18]int8
UserName [21]int8
WorkDirectory [261]int8
InitialProgram [261]int8
EncryptionLevel byte
ClientAddressFamily uint32
ClientAddress [31]uint16
HRes uint16
VRes uint16
ColorDepth uint16
ClientDirectory [261]int8
ClientBuildNumber uint32
ClientHardwareId uint32
ClientProductId uint16
OutBufCountHost uint16
OutBufCountClient uint16
OutBufLength uint16
DeviceId [261]int8
}type
WTSCLIENTA = record
ClientName: array[0..20] of Shortint;
Domain: array[0..17] of Shortint;
UserName: array[0..20] of Shortint;
WorkDirectory: array[0..260] of Shortint;
InitialProgram: array[0..260] of Shortint;
EncryptionLevel: Byte;
ClientAddressFamily: DWORD;
ClientAddress: array[0..30] of Word;
HRes: Word;
VRes: Word;
ColorDepth: Word;
ClientDirectory: array[0..260] of Shortint;
ClientBuildNumber: DWORD;
ClientHardwareId: DWORD;
ClientProductId: Word;
OutBufCountHost: Word;
OutBufCountClient: Word;
OutBufLength: Word;
DeviceId: array[0..260] of Shortint;
end;const WTSCLIENTA = extern struct {
ClientName: [21]i8,
Domain: [18]i8,
UserName: [21]i8,
WorkDirectory: [261]i8,
InitialProgram: [261]i8,
EncryptionLevel: u8,
ClientAddressFamily: u32,
ClientAddress: [31]u16,
HRes: u16,
VRes: u16,
ColorDepth: u16,
ClientDirectory: [261]i8,
ClientBuildNumber: u32,
ClientHardwareId: u32,
ClientProductId: u16,
OutBufCountHost: u16,
OutBufCountClient: u16,
OutBufLength: u16,
DeviceId: [261]i8,
};type
WTSCLIENTA {.bycopy.} = object
ClientName: array[21, int8]
Domain: array[18, int8]
UserName: array[21, int8]
WorkDirectory: array[261, int8]
InitialProgram: array[261, int8]
EncryptionLevel: uint8
ClientAddressFamily: uint32
ClientAddress: array[31, uint16]
HRes: uint16
VRes: uint16
ColorDepth: uint16
ClientDirectory: array[261, int8]
ClientBuildNumber: uint32
ClientHardwareId: uint32
ClientProductId: uint16
OutBufCountHost: uint16
OutBufCountClient: uint16
OutBufLength: uint16
DeviceId: array[261, int8]struct WTSCLIENTA
{
byte[21] ClientName;
byte[18] Domain;
byte[21] UserName;
byte[261] WorkDirectory;
byte[261] InitialProgram;
ubyte EncryptionLevel;
uint ClientAddressFamily;
ushort[31] ClientAddress;
ushort HRes;
ushort VRes;
ushort ColorDepth;
byte[261] ClientDirectory;
uint ClientBuildNumber;
uint ClientHardwareId;
ushort ClientProductId;
ushort OutBufCountHost;
ushort OutBufCountClient;
ushort OutBufLength;
byte[261] DeviceId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WTSCLIENTA サイズ: 1200 バイト(x64)
dim st, 300 ; 4byte整数×300(構造体サイズ 1200 / 4 切り上げ)
; ClientName : CHAR (+0, 21byte) varptr(st)+0 を基点に操作(21byte:入れ子/配列)
; Domain : CHAR (+21, 18byte) varptr(st)+21 を基点に操作(18byte:入れ子/配列)
; UserName : CHAR (+39, 21byte) varptr(st)+39 を基点に操作(21byte:入れ子/配列)
; WorkDirectory : CHAR (+60, 261byte) varptr(st)+60 を基点に操作(261byte:入れ子/配列)
; InitialProgram : CHAR (+321, 261byte) varptr(st)+321 を基点に操作(261byte:入れ子/配列)
; EncryptionLevel : BYTE (+582, 1byte) poke st,582,値 / 値 = peek(st,582)
; ClientAddressFamily : DWORD (+584, 4byte) st.146 = 値 / 値 = st.146 (lpoke/lpeek も可)
; ClientAddress : WORD (+588, 62byte) varptr(st)+588 を基点に操作(62byte:入れ子/配列)
; HRes : WORD (+650, 2byte) wpoke st,650,値 / 値 = wpeek(st,650)
; VRes : WORD (+652, 2byte) wpoke st,652,値 / 値 = wpeek(st,652)
; ColorDepth : WORD (+654, 2byte) wpoke st,654,値 / 値 = wpeek(st,654)
; ClientDirectory : CHAR (+656, 261byte) varptr(st)+656 を基点に操作(261byte:入れ子/配列)
; ClientBuildNumber : DWORD (+920, 4byte) st.230 = 値 / 値 = st.230 (lpoke/lpeek も可)
; ClientHardwareId : DWORD (+924, 4byte) st.231 = 値 / 値 = st.231 (lpoke/lpeek も可)
; ClientProductId : WORD (+928, 2byte) wpoke st,928,値 / 値 = wpeek(st,928)
; OutBufCountHost : WORD (+930, 2byte) wpoke st,930,値 / 値 = wpeek(st,930)
; OutBufCountClient : WORD (+932, 2byte) wpoke st,932,値 / 値 = wpeek(st,932)
; OutBufLength : WORD (+934, 2byte) wpoke st,934,値 / 値 = wpeek(st,934)
; DeviceId : CHAR (+936, 261byte) varptr(st)+936 を基点に操作(261byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WTSCLIENTA
#field byte ClientName 21
#field byte Domain 18
#field byte UserName 21
#field byte WorkDirectory 261
#field byte InitialProgram 261
#field byte EncryptionLevel
#field int ClientAddressFamily
#field short ClientAddress 31
#field short HRes
#field short VRes
#field short ColorDepth
#field byte ClientDirectory 261
#field int ClientBuildNumber
#field int ClientHardwareId
#field short ClientProductId
#field short OutBufCountHost
#field short OutBufCountClient
#field short OutBufLength
#field byte DeviceId 261
#endstruct
stdim st, WTSCLIENTA ; NSTRUCT 変数を確保
st->EncryptionLevel = 100
mes "EncryptionLevel=" + st->EncryptionLevel