ホーム › System.RemoteDesktop › WRDS_CONNECTION_SETTINGS_1
WRDS_CONNECTION_SETTINGS_1
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| fInheritInitialProgram | BOOLEAN | 1 | +0 | +0 | 初期プログラム設定を継承するかのフラグ。 |
| fInheritColorDepth | BOOLEAN | 1 | +1 | +1 | 色深度設定を継承するかのフラグ。 |
| fHideTitleBar | BOOLEAN | 1 | +2 | +2 | タイトルバーを非表示にするかのフラグ。 |
| fInheritAutoLogon | BOOLEAN | 1 | +3 | +3 | 自動ログオン設定を継承するかのフラグ。 |
| fMaximizeShell | BOOLEAN | 1 | +4 | +4 | シェルを最大化表示するかのフラグ。 |
| fDisablePNP | BOOLEAN | 1 | +5 | +5 | プラグアンドプレイリダイレクトを無効にするかのフラグ。 |
| fPasswordIsScPin | BOOLEAN | 1 | +6 | +6 | パスワードがスマートカードPINであるかのフラグ。 |
| fPromptForPassword | BOOLEAN | 1 | +7 | +7 | 接続時にパスワード入力を要求するかのフラグ。 |
| fDisableCpm | BOOLEAN | 1 | +8 | +8 | プリンターリダイレクトを無効にするかのフラグ。 |
| fDisableCdm | BOOLEAN | 1 | +9 | +9 | ドライブリダイレクトを無効にするかのフラグ。 |
| fDisableCcm | BOOLEAN | 1 | +10 | +10 | COMポートリダイレクトを無効にするかのフラグ。 |
| fDisableLPT | BOOLEAN | 1 | +11 | +11 | LPTポートリダイレクトを無効にするかのフラグ。 |
| fDisableClip | BOOLEAN | 1 | +12 | +12 | クリップボードリダイレクトを無効にするかのフラグ。 |
| fResetBroken | BOOLEAN | 1 | +13 | +13 | 切断された接続をリセットするかのフラグ。 |
| fDisableEncryption | BOOLEAN | 1 | +14 | +14 | 暗号化を無効にするかのフラグ。 |
| fDisableAutoReconnect | BOOLEAN | 1 | +15 | +15 | 自動再接続を無効にするかのフラグ。 |
| fDisableCtrlAltDel | BOOLEAN | 1 | +16 | +16 | Ctrl+Alt+Delを無効にするかのフラグ。 |
| fDoubleClickDetect | BOOLEAN | 1 | +17 | +17 | ダブルクリック検出を有効にするかのフラグ。 |
| fEnableWindowsKey | BOOLEAN | 1 | +18 | +18 | Windowsキーを有効にするかのフラグ。 |
| fUsingSavedCreds | BOOLEAN | 1 | +19 | +19 | 保存済み資格情報を使用するかのフラグ。 |
| fMouse | BOOLEAN | 1 | +20 | +20 | マウスを有効にするかのフラグ。 |
| fNoAudioPlayback | BOOLEAN | 1 | +21 | +21 | 音声再生を無効にするかのフラグ。 |
| fRemoteConsoleAudio | BOOLEAN | 1 | +22 | +22 | リモートコンソールでの音声再生フラグ。 |
| EncryptionLevel | BYTE | 1 | +23 | +23 | 接続の暗号化レベル。BYTE値で指定する。 |
| ColorDepth | WORD | 2 | +24 | +24 | 画面の色深度を示す数値。 |
| ProtocolType | WORD | 2 | +26 | +26 | プロトコル種別を示す数値。 |
| HRes | WORD | 2 | +28 | +28 | 画面の水平解像度をピクセル単位で表す。 |
| VRes | WORD | 2 | +30 | +30 | 画面の垂直解像度をピクセル単位で表す。 |
| ClientProductId | WORD | 2 | +32 | +32 | クライアントの製品ID。 |
| OutBufCountHost | WORD | 2 | +34 | +34 | ホスト側出力バッファ数。 |
| OutBufCountClient | WORD | 2 | +36 | +36 | クライアント側出力バッファ数。 |
| OutBufLength | WORD | 2 | +38 | +38 | 出力バッファ長をバイト単位で表す。 |
| KeyboardLayout | DWORD | 4 | +40 | +40 | キーボードレイアウト識別子。 |
| MaxConnectionTime | DWORD | 4 | +44 | +44 | 最大接続時間をミリ秒単位で表す。0で無制限。 |
| MaxDisconnectionTime | DWORD | 4 | +48 | +48 | 切断状態を維持する最大時間をミリ秒単位で表す。 |
| MaxIdleTime | DWORD | 4 | +52 | +52 | アイドル状態を許容する最大時間をミリ秒単位で表す。 |
| PerformanceFlags | DWORD | 4 | +56 | +56 | 表示効果抑制などパフォーマンス最適化フラグの集合。 |
| KeyboardType | DWORD | 4 | +60 | +60 | キーボードの種類を示す数値。 |
| KeyboardSubType | DWORD | 4 | +64 | +64 | キーボードのサブタイプを示す数値。 |
| KeyboardFunctionKey | DWORD | 4 | +68 | +68 | ファンクションキーの個数。 |
| ActiveInputLocale | DWORD | 4 | +72 | +72 | アクティブな入力ロケール識別子。 |
| SerialNumber | DWORD | 4 | +76 | +76 | クライアントのシリアル番号。 |
| ClientAddressFamily | DWORD | 4 | +80 | +80 | クライアントアドレスのアドレスファミリ。 |
| ClientBuildNumber | DWORD | 4 | +84 | +84 | クライアントソフトウェアのビルド番号。 |
| ClientSessionId | DWORD | 4 | +88 | +88 | クライアント側のセッションID。 |
| WorkDirectory | WCHAR | 514 | +92 | +92 | 作業ディレクトリ。WCHARの固定長バッファ。 |
| InitialProgram | WCHAR | 514 | +606 | +606 | 初期実行プログラムのパス。WCHARバッファ。 |
| UserName | WCHAR | 512 | +1120 | +1120 | ログオンに用いるユーザー名。WCHARバッファ。 |
| Domain | WCHAR | 512 | +1632 | +1632 | ログオンに用いるドメイン名。WCHARバッファ。 |
| Password | WCHAR | 512 | +2144 | +2144 | ログオンに用いるパスワード。WCHARバッファに格納される機微情報。 |
| ProtocolName | WCHAR | 18 | +2656 | +2656 | 使用するプロトコル名。WCHARバッファ。 |
| DisplayDriverName | WCHAR | 18 | +2674 | +2674 | 表示ドライバー名。WCHARバッファ。 |
| DisplayDeviceName | WCHAR | 40 | +2692 | +2692 | 表示デバイス名。WCHARバッファ。 |
| imeFileName | WCHAR | 66 | +2732 | +2732 | IMEのファイル名。WCHARバッファ。 |
| AudioDriverName | WCHAR | 18 | +2798 | +2798 | オーディオドライバー名。WCHARバッファ。 |
| ClientName | WCHAR | 42 | +2816 | +2816 | クライアントコンピューター名。WCHARバッファ。 |
| ClientAddress | WCHAR | 62 | +2858 | +2858 | クライアントのネットワークアドレス。WCHARバッファ。 |
| ClientDirectory | WCHAR | 514 | +2920 | +2920 | クライアントのインストールディレクトリ。WCHARバッファ。 |
| ClientDigProductId | WCHAR | 66 | +3434 | +3434 | クライアントのデジタル製品ID。WCHARバッファ。 |
| ClientSockAddress | WTS_SOCKADDR | 16/8 | +3504 | +3500 | クライアントのソケットアドレス。WTS_SOCKADDRで表す。 |
| ClientTimeZone | WTS_TIME_ZONE_INFORMATION | 172 | +3520 | +3508 | クライアントのタイムゾーン情報。WTS_TIME_ZONE_INFORMATIONで表す。 |
| WRdsListenerSettings | WRDS_LISTENER_SETTINGS | 24/16 | +3696 | +3680 | 関連するリスナー設定。WRDS_LISTENER_SETTINGSで表す。 |
| EventLogActivityId | GUID | 16 | +3720 | +3696 | イベントログ相関用のアクティビティID。GUIDで表す。 |
| ContextSize | DWORD | 4 | +3736 | +3712 | コンテキストデータのサイズをバイト単位で表す。 |
| ContextData | BYTE* | 8/4 | +3744 | +3716 | 追加コンテキストデータへのポインター。 |
各言語での定義
#include <windows.h>
// WTS_SOCKADDR (x64 16 / x86 8 バイト)
typedef struct WTS_SOCKADDR {
WORD sin_family;
_u_e__Union u;
} WTS_SOCKADDR;
// WTS_SYSTEMTIME (x64 16 / x86 16 バイト)
typedef struct WTS_SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} WTS_SYSTEMTIME;
// WTS_TIME_ZONE_INFORMATION (x64 172 / x86 172 バイト)
typedef struct WTS_TIME_ZONE_INFORMATION {
INT Bias;
WCHAR StandardName[32];
WTS_SYSTEMTIME StandardDate;
INT StandardBias;
WCHAR DaylightName[32];
WTS_SYSTEMTIME DaylightDate;
INT DaylightBias;
} WTS_TIME_ZONE_INFORMATION;
// WRDS_LISTENER_SETTINGS_1 (x64 16 / x86 12 バイト)
typedef struct WRDS_LISTENER_SETTINGS_1 {
DWORD MaxProtocolListenerConnectionCount;
DWORD SecurityDescriptorSize;
BYTE* pSecurityDescriptor;
} WRDS_LISTENER_SETTINGS_1;
// WRDS_LISTENER_SETTING (x64 16 / x86 12 バイト)
typedef struct WRDS_LISTENER_SETTING {
WRDS_LISTENER_SETTINGS_1 WRdsListenerSettings1;
} WRDS_LISTENER_SETTING;
// WRDS_LISTENER_SETTINGS (x64 24 / x86 16 バイト)
typedef struct WRDS_LISTENER_SETTINGS {
WRDS_LISTENER_SETTING_LEVEL WRdsListenerSettingLevel;
WRDS_LISTENER_SETTING WRdsListenerSetting;
} WRDS_LISTENER_SETTINGS;
// WRDS_CONNECTION_SETTINGS_1 (x64 3752 / x86 3720 バイト)
typedef struct WRDS_CONNECTION_SETTINGS_1 {
BOOLEAN fInheritInitialProgram;
BOOLEAN fInheritColorDepth;
BOOLEAN fHideTitleBar;
BOOLEAN fInheritAutoLogon;
BOOLEAN fMaximizeShell;
BOOLEAN fDisablePNP;
BOOLEAN fPasswordIsScPin;
BOOLEAN fPromptForPassword;
BOOLEAN fDisableCpm;
BOOLEAN fDisableCdm;
BOOLEAN fDisableCcm;
BOOLEAN fDisableLPT;
BOOLEAN fDisableClip;
BOOLEAN fResetBroken;
BOOLEAN fDisableEncryption;
BOOLEAN fDisableAutoReconnect;
BOOLEAN fDisableCtrlAltDel;
BOOLEAN fDoubleClickDetect;
BOOLEAN fEnableWindowsKey;
BOOLEAN fUsingSavedCreds;
BOOLEAN fMouse;
BOOLEAN fNoAudioPlayback;
BOOLEAN fRemoteConsoleAudio;
BYTE EncryptionLevel;
WORD ColorDepth;
WORD ProtocolType;
WORD HRes;
WORD VRes;
WORD ClientProductId;
WORD OutBufCountHost;
WORD OutBufCountClient;
WORD OutBufLength;
DWORD KeyboardLayout;
DWORD MaxConnectionTime;
DWORD MaxDisconnectionTime;
DWORD MaxIdleTime;
DWORD PerformanceFlags;
DWORD KeyboardType;
DWORD KeyboardSubType;
DWORD KeyboardFunctionKey;
DWORD ActiveInputLocale;
DWORD SerialNumber;
DWORD ClientAddressFamily;
DWORD ClientBuildNumber;
DWORD ClientSessionId;
WCHAR WorkDirectory[257];
WCHAR InitialProgram[257];
WCHAR UserName[256];
WCHAR Domain[256];
WCHAR Password[256];
WCHAR ProtocolName[9];
WCHAR DisplayDriverName[9];
WCHAR DisplayDeviceName[20];
WCHAR imeFileName[33];
WCHAR AudioDriverName[9];
WCHAR ClientName[21];
WCHAR ClientAddress[31];
WCHAR ClientDirectory[257];
WCHAR ClientDigProductId[33];
WTS_SOCKADDR ClientSockAddress;
WTS_TIME_ZONE_INFORMATION ClientTimeZone;
WRDS_LISTENER_SETTINGS WRdsListenerSettings;
GUID EventLogActivityId;
DWORD ContextSize;
BYTE* ContextData;
} WRDS_CONNECTION_SETTINGS_1;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTS_SOCKADDR
{
public ushort sin_family;
public _u_e__Union u;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTS_SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTS_TIME_ZONE_INFORMATION
{
public int Bias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string StandardName;
public WTS_SYSTEMTIME StandardDate;
public int StandardBias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string DaylightName;
public WTS_SYSTEMTIME DaylightDate;
public int DaylightBias;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WRDS_LISTENER_SETTINGS_1
{
public uint MaxProtocolListenerConnectionCount;
public uint SecurityDescriptorSize;
public IntPtr pSecurityDescriptor;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WRDS_LISTENER_SETTING
{
public WRDS_LISTENER_SETTINGS_1 WRdsListenerSettings1;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WRDS_LISTENER_SETTINGS
{
public int WRdsListenerSettingLevel;
public WRDS_LISTENER_SETTING WRdsListenerSetting;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WRDS_CONNECTION_SETTINGS_1
{
[MarshalAs(UnmanagedType.U1)] public bool fInheritInitialProgram;
[MarshalAs(UnmanagedType.U1)] public bool fInheritColorDepth;
[MarshalAs(UnmanagedType.U1)] public bool fHideTitleBar;
[MarshalAs(UnmanagedType.U1)] public bool fInheritAutoLogon;
[MarshalAs(UnmanagedType.U1)] public bool fMaximizeShell;
[MarshalAs(UnmanagedType.U1)] public bool fDisablePNP;
[MarshalAs(UnmanagedType.U1)] public bool fPasswordIsScPin;
[MarshalAs(UnmanagedType.U1)] public bool fPromptForPassword;
[MarshalAs(UnmanagedType.U1)] public bool fDisableCpm;
[MarshalAs(UnmanagedType.U1)] public bool fDisableCdm;
[MarshalAs(UnmanagedType.U1)] public bool fDisableCcm;
[MarshalAs(UnmanagedType.U1)] public bool fDisableLPT;
[MarshalAs(UnmanagedType.U1)] public bool fDisableClip;
[MarshalAs(UnmanagedType.U1)] public bool fResetBroken;
[MarshalAs(UnmanagedType.U1)] public bool fDisableEncryption;
[MarshalAs(UnmanagedType.U1)] public bool fDisableAutoReconnect;
[MarshalAs(UnmanagedType.U1)] public bool fDisableCtrlAltDel;
[MarshalAs(UnmanagedType.U1)] public bool fDoubleClickDetect;
[MarshalAs(UnmanagedType.U1)] public bool fEnableWindowsKey;
[MarshalAs(UnmanagedType.U1)] public bool fUsingSavedCreds;
[MarshalAs(UnmanagedType.U1)] public bool fMouse;
[MarshalAs(UnmanagedType.U1)] public bool fNoAudioPlayback;
[MarshalAs(UnmanagedType.U1)] public bool fRemoteConsoleAudio;
public byte EncryptionLevel;
public ushort ColorDepth;
public ushort ProtocolType;
public ushort HRes;
public ushort VRes;
public ushort ClientProductId;
public ushort OutBufCountHost;
public ushort OutBufCountClient;
public ushort OutBufLength;
public uint KeyboardLayout;
public uint MaxConnectionTime;
public uint MaxDisconnectionTime;
public uint MaxIdleTime;
public uint PerformanceFlags;
public uint KeyboardType;
public uint KeyboardSubType;
public uint KeyboardFunctionKey;
public uint ActiveInputLocale;
public uint SerialNumber;
public uint ClientAddressFamily;
public uint ClientBuildNumber;
public uint ClientSessionId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 257)] public string WorkDirectory;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 257)] public string InitialProgram;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string UserName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string Domain;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string Password;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] public string ProtocolName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] public string DisplayDriverName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] public string DisplayDeviceName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 33)] public string imeFileName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 9)] public string AudioDriverName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 21)] public string ClientName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] public string ClientAddress;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 257)] public string ClientDirectory;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 33)] public string ClientDigProductId;
public WTS_SOCKADDR ClientSockAddress;
public WTS_TIME_ZONE_INFORMATION ClientTimeZone;
public WRDS_LISTENER_SETTINGS WRdsListenerSettings;
public Guid EventLogActivityId;
public uint ContextSize;
public IntPtr ContextData;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTS_SOCKADDR
Public sin_family As UShort
Public u As _u_e__Union
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTS_SYSTEMTIME
Public wYear As UShort
Public wMonth As UShort
Public wDayOfWeek As UShort
Public wDay As UShort
Public wHour As UShort
Public wMinute As UShort
Public wSecond As UShort
Public wMilliseconds As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTS_TIME_ZONE_INFORMATION
Public Bias As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public StandardName As String
Public StandardDate As WTS_SYSTEMTIME
Public StandardBias As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public DaylightName As String
Public DaylightDate As WTS_SYSTEMTIME
Public DaylightBias As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WRDS_LISTENER_SETTINGS_1
Public MaxProtocolListenerConnectionCount As UInteger
Public SecurityDescriptorSize As UInteger
Public pSecurityDescriptor As IntPtr
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WRDS_LISTENER_SETTING
Public WRdsListenerSettings1 As WRDS_LISTENER_SETTINGS_1
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WRDS_LISTENER_SETTINGS
Public WRdsListenerSettingLevel As Integer
Public WRdsListenerSetting As WRDS_LISTENER_SETTING
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WRDS_CONNECTION_SETTINGS_1
<MarshalAs(UnmanagedType.U1)> Public fInheritInitialProgram As Boolean
<MarshalAs(UnmanagedType.U1)> Public fInheritColorDepth As Boolean
<MarshalAs(UnmanagedType.U1)> Public fHideTitleBar As Boolean
<MarshalAs(UnmanagedType.U1)> Public fInheritAutoLogon As Boolean
<MarshalAs(UnmanagedType.U1)> Public fMaximizeShell As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisablePNP As Boolean
<MarshalAs(UnmanagedType.U1)> Public fPasswordIsScPin As Boolean
<MarshalAs(UnmanagedType.U1)> Public fPromptForPassword As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableCpm As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableCdm As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableCcm As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableLPT As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableClip As Boolean
<MarshalAs(UnmanagedType.U1)> Public fResetBroken As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableEncryption As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableAutoReconnect As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDisableCtrlAltDel As Boolean
<MarshalAs(UnmanagedType.U1)> Public fDoubleClickDetect As Boolean
<MarshalAs(UnmanagedType.U1)> Public fEnableWindowsKey As Boolean
<MarshalAs(UnmanagedType.U1)> Public fUsingSavedCreds As Boolean
<MarshalAs(UnmanagedType.U1)> Public fMouse As Boolean
<MarshalAs(UnmanagedType.U1)> Public fNoAudioPlayback As Boolean
<MarshalAs(UnmanagedType.U1)> Public fRemoteConsoleAudio As Boolean
Public EncryptionLevel As Byte
Public ColorDepth As UShort
Public ProtocolType As UShort
Public HRes As UShort
Public VRes As UShort
Public ClientProductId As UShort
Public OutBufCountHost As UShort
Public OutBufCountClient As UShort
Public OutBufLength As UShort
Public KeyboardLayout As UInteger
Public MaxConnectionTime As UInteger
Public MaxDisconnectionTime As UInteger
Public MaxIdleTime As UInteger
Public PerformanceFlags As UInteger
Public KeyboardType As UInteger
Public KeyboardSubType As UInteger
Public KeyboardFunctionKey As UInteger
Public ActiveInputLocale As UInteger
Public SerialNumber As UInteger
Public ClientAddressFamily As UInteger
Public ClientBuildNumber As UInteger
Public ClientSessionId As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public WorkDirectory As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public InitialProgram As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public UserName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public Domain As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public Password As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=9)> Public ProtocolName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=9)> Public DisplayDriverName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=20)> Public DisplayDeviceName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=33)> Public imeFileName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=9)> Public AudioDriverName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=21)> Public ClientName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public ClientAddress As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public ClientDirectory As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=33)> Public ClientDigProductId As String
Public ClientSockAddress As WTS_SOCKADDR
Public ClientTimeZone As WTS_TIME_ZONE_INFORMATION
Public WRdsListenerSettings As WRDS_LISTENER_SETTINGS
Public EventLogActivityId As Guid
Public ContextSize As UInteger
Public ContextData As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class WTS_SOCKADDR(ctypes.Structure):
_fields_ = [
("sin_family", ctypes.c_ushort),
("u", _u_e__Union),
]
class WTS_SYSTEMTIME(ctypes.Structure):
_fields_ = [
("wYear", ctypes.c_ushort),
("wMonth", ctypes.c_ushort),
("wDayOfWeek", ctypes.c_ushort),
("wDay", ctypes.c_ushort),
("wHour", ctypes.c_ushort),
("wMinute", ctypes.c_ushort),
("wSecond", ctypes.c_ushort),
("wMilliseconds", ctypes.c_ushort),
]
class WTS_TIME_ZONE_INFORMATION(ctypes.Structure):
_fields_ = [
("Bias", ctypes.c_int),
("StandardName", ctypes.c_wchar * 32),
("StandardDate", WTS_SYSTEMTIME),
("StandardBias", ctypes.c_int),
("DaylightName", ctypes.c_wchar * 32),
("DaylightDate", WTS_SYSTEMTIME),
("DaylightBias", ctypes.c_int),
]
class WRDS_LISTENER_SETTINGS_1(ctypes.Structure):
_fields_ = [
("MaxProtocolListenerConnectionCount", wintypes.DWORD),
("SecurityDescriptorSize", wintypes.DWORD),
("pSecurityDescriptor", ctypes.c_void_p),
]
class WRDS_LISTENER_SETTING(ctypes.Structure):
_fields_ = [
("WRdsListenerSettings1", WRDS_LISTENER_SETTINGS_1),
]
class WRDS_LISTENER_SETTINGS(ctypes.Structure):
_fields_ = [
("WRdsListenerSettingLevel", ctypes.c_int),
("WRdsListenerSetting", WRDS_LISTENER_SETTING),
]
class WRDS_CONNECTION_SETTINGS_1(ctypes.Structure):
_fields_ = [
("fInheritInitialProgram", ctypes.c_byte),
("fInheritColorDepth", ctypes.c_byte),
("fHideTitleBar", ctypes.c_byte),
("fInheritAutoLogon", ctypes.c_byte),
("fMaximizeShell", ctypes.c_byte),
("fDisablePNP", ctypes.c_byte),
("fPasswordIsScPin", ctypes.c_byte),
("fPromptForPassword", ctypes.c_byte),
("fDisableCpm", ctypes.c_byte),
("fDisableCdm", ctypes.c_byte),
("fDisableCcm", ctypes.c_byte),
("fDisableLPT", ctypes.c_byte),
("fDisableClip", ctypes.c_byte),
("fResetBroken", ctypes.c_byte),
("fDisableEncryption", ctypes.c_byte),
("fDisableAutoReconnect", ctypes.c_byte),
("fDisableCtrlAltDel", ctypes.c_byte),
("fDoubleClickDetect", ctypes.c_byte),
("fEnableWindowsKey", ctypes.c_byte),
("fUsingSavedCreds", ctypes.c_byte),
("fMouse", ctypes.c_byte),
("fNoAudioPlayback", ctypes.c_byte),
("fRemoteConsoleAudio", ctypes.c_byte),
("EncryptionLevel", ctypes.c_ubyte),
("ColorDepth", ctypes.c_ushort),
("ProtocolType", ctypes.c_ushort),
("HRes", ctypes.c_ushort),
("VRes", ctypes.c_ushort),
("ClientProductId", ctypes.c_ushort),
("OutBufCountHost", ctypes.c_ushort),
("OutBufCountClient", ctypes.c_ushort),
("OutBufLength", ctypes.c_ushort),
("KeyboardLayout", wintypes.DWORD),
("MaxConnectionTime", wintypes.DWORD),
("MaxDisconnectionTime", wintypes.DWORD),
("MaxIdleTime", wintypes.DWORD),
("PerformanceFlags", wintypes.DWORD),
("KeyboardType", wintypes.DWORD),
("KeyboardSubType", wintypes.DWORD),
("KeyboardFunctionKey", wintypes.DWORD),
("ActiveInputLocale", wintypes.DWORD),
("SerialNumber", wintypes.DWORD),
("ClientAddressFamily", wintypes.DWORD),
("ClientBuildNumber", wintypes.DWORD),
("ClientSessionId", wintypes.DWORD),
("WorkDirectory", ctypes.c_wchar * 257),
("InitialProgram", ctypes.c_wchar * 257),
("UserName", ctypes.c_wchar * 256),
("Domain", ctypes.c_wchar * 256),
("Password", ctypes.c_wchar * 256),
("ProtocolName", ctypes.c_wchar * 9),
("DisplayDriverName", ctypes.c_wchar * 9),
("DisplayDeviceName", ctypes.c_wchar * 20),
("imeFileName", ctypes.c_wchar * 33),
("AudioDriverName", ctypes.c_wchar * 9),
("ClientName", ctypes.c_wchar * 21),
("ClientAddress", ctypes.c_wchar * 31),
("ClientDirectory", ctypes.c_wchar * 257),
("ClientDigProductId", ctypes.c_wchar * 33),
("ClientSockAddress", WTS_SOCKADDR),
("ClientTimeZone", WTS_TIME_ZONE_INFORMATION),
("WRdsListenerSettings", WRDS_LISTENER_SETTINGS),
("EventLogActivityId", GUID),
("ContextSize", wintypes.DWORD),
("ContextData", ctypes.c_void_p),
]#[repr(C)]
pub struct WTS_SOCKADDR {
pub sin_family: u16,
pub u: _u_e__Union,
}
#[repr(C)]
pub struct WTS_SYSTEMTIME {
pub wYear: u16,
pub wMonth: u16,
pub wDayOfWeek: u16,
pub wDay: u16,
pub wHour: u16,
pub wMinute: u16,
pub wSecond: u16,
pub wMilliseconds: u16,
}
#[repr(C)]
pub struct WTS_TIME_ZONE_INFORMATION {
pub Bias: i32,
pub StandardName: [u16; 32],
pub StandardDate: WTS_SYSTEMTIME,
pub StandardBias: i32,
pub DaylightName: [u16; 32],
pub DaylightDate: WTS_SYSTEMTIME,
pub DaylightBias: i32,
}
#[repr(C)]
pub struct WRDS_LISTENER_SETTINGS_1 {
pub MaxProtocolListenerConnectionCount: u32,
pub SecurityDescriptorSize: u32,
pub pSecurityDescriptor: *mut core::ffi::c_void,
}
#[repr(C)]
pub struct WRDS_LISTENER_SETTING {
pub WRdsListenerSettings1: WRDS_LISTENER_SETTINGS_1,
}
#[repr(C)]
pub struct WRDS_LISTENER_SETTINGS {
pub WRdsListenerSettingLevel: i32,
pub WRdsListenerSetting: WRDS_LISTENER_SETTING,
}
#[repr(C)]
pub struct WRDS_CONNECTION_SETTINGS_1 {
pub fInheritInitialProgram: u8,
pub fInheritColorDepth: u8,
pub fHideTitleBar: u8,
pub fInheritAutoLogon: u8,
pub fMaximizeShell: u8,
pub fDisablePNP: u8,
pub fPasswordIsScPin: u8,
pub fPromptForPassword: u8,
pub fDisableCpm: u8,
pub fDisableCdm: u8,
pub fDisableCcm: u8,
pub fDisableLPT: u8,
pub fDisableClip: u8,
pub fResetBroken: u8,
pub fDisableEncryption: u8,
pub fDisableAutoReconnect: u8,
pub fDisableCtrlAltDel: u8,
pub fDoubleClickDetect: u8,
pub fEnableWindowsKey: u8,
pub fUsingSavedCreds: u8,
pub fMouse: u8,
pub fNoAudioPlayback: u8,
pub fRemoteConsoleAudio: u8,
pub EncryptionLevel: u8,
pub ColorDepth: u16,
pub ProtocolType: u16,
pub HRes: u16,
pub VRes: u16,
pub ClientProductId: u16,
pub OutBufCountHost: u16,
pub OutBufCountClient: u16,
pub OutBufLength: u16,
pub KeyboardLayout: u32,
pub MaxConnectionTime: u32,
pub MaxDisconnectionTime: u32,
pub MaxIdleTime: u32,
pub PerformanceFlags: u32,
pub KeyboardType: u32,
pub KeyboardSubType: u32,
pub KeyboardFunctionKey: u32,
pub ActiveInputLocale: u32,
pub SerialNumber: u32,
pub ClientAddressFamily: u32,
pub ClientBuildNumber: u32,
pub ClientSessionId: u32,
pub WorkDirectory: [u16; 257],
pub InitialProgram: [u16; 257],
pub UserName: [u16; 256],
pub Domain: [u16; 256],
pub Password: [u16; 256],
pub ProtocolName: [u16; 9],
pub DisplayDriverName: [u16; 9],
pub DisplayDeviceName: [u16; 20],
pub imeFileName: [u16; 33],
pub AudioDriverName: [u16; 9],
pub ClientName: [u16; 21],
pub ClientAddress: [u16; 31],
pub ClientDirectory: [u16; 257],
pub ClientDigProductId: [u16; 33],
pub ClientSockAddress: WTS_SOCKADDR,
pub ClientTimeZone: WTS_TIME_ZONE_INFORMATION,
pub WRdsListenerSettings: WRDS_LISTENER_SETTINGS,
pub EventLogActivityId: GUID,
pub ContextSize: u32,
pub ContextData: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type WTS_SOCKADDR struct {
sin_family uint16
u _u_e__Union
}
type WTS_SYSTEMTIME struct {
wYear uint16
wMonth uint16
wDayOfWeek uint16
wDay uint16
wHour uint16
wMinute uint16
wSecond uint16
wMilliseconds uint16
}
type WTS_TIME_ZONE_INFORMATION struct {
Bias int32
StandardName [32]uint16
StandardDate WTS_SYSTEMTIME
StandardBias int32
DaylightName [32]uint16
DaylightDate WTS_SYSTEMTIME
DaylightBias int32
}
type WRDS_LISTENER_SETTINGS_1 struct {
MaxProtocolListenerConnectionCount uint32
SecurityDescriptorSize uint32
pSecurityDescriptor uintptr
}
type WRDS_LISTENER_SETTING struct {
WRdsListenerSettings1 WRDS_LISTENER_SETTINGS_1
}
type WRDS_LISTENER_SETTINGS struct {
WRdsListenerSettingLevel int32
WRdsListenerSetting WRDS_LISTENER_SETTING
}
type WRDS_CONNECTION_SETTINGS_1 struct {
fInheritInitialProgram byte
fInheritColorDepth byte
fHideTitleBar byte
fInheritAutoLogon byte
fMaximizeShell byte
fDisablePNP byte
fPasswordIsScPin byte
fPromptForPassword byte
fDisableCpm byte
fDisableCdm byte
fDisableCcm byte
fDisableLPT byte
fDisableClip byte
fResetBroken byte
fDisableEncryption byte
fDisableAutoReconnect byte
fDisableCtrlAltDel byte
fDoubleClickDetect byte
fEnableWindowsKey byte
fUsingSavedCreds byte
fMouse byte
fNoAudioPlayback byte
fRemoteConsoleAudio byte
EncryptionLevel byte
ColorDepth uint16
ProtocolType uint16
HRes uint16
VRes uint16
ClientProductId uint16
OutBufCountHost uint16
OutBufCountClient uint16
OutBufLength uint16
KeyboardLayout uint32
MaxConnectionTime uint32
MaxDisconnectionTime uint32
MaxIdleTime uint32
PerformanceFlags uint32
KeyboardType uint32
KeyboardSubType uint32
KeyboardFunctionKey uint32
ActiveInputLocale uint32
SerialNumber uint32
ClientAddressFamily uint32
ClientBuildNumber uint32
ClientSessionId uint32
WorkDirectory [257]uint16
InitialProgram [257]uint16
UserName [256]uint16
Domain [256]uint16
Password [256]uint16
ProtocolName [9]uint16
DisplayDriverName [9]uint16
DisplayDeviceName [20]uint16
imeFileName [33]uint16
AudioDriverName [9]uint16
ClientName [21]uint16
ClientAddress [31]uint16
ClientDirectory [257]uint16
ClientDigProductId [33]uint16
ClientSockAddress WTS_SOCKADDR
ClientTimeZone WTS_TIME_ZONE_INFORMATION
WRdsListenerSettings WRDS_LISTENER_SETTINGS
EventLogActivityId windows.GUID
ContextSize uint32
ContextData uintptr
}type
WTS_SOCKADDR = record
sin_family: Word;
u: _u_e__Union;
end;
WTS_SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;
WTS_TIME_ZONE_INFORMATION = record
Bias: Integer;
StandardName: array[0..31] of WideChar;
StandardDate: WTS_SYSTEMTIME;
StandardBias: Integer;
DaylightName: array[0..31] of WideChar;
DaylightDate: WTS_SYSTEMTIME;
DaylightBias: Integer;
end;
WRDS_LISTENER_SETTINGS_1 = record
MaxProtocolListenerConnectionCount: DWORD;
SecurityDescriptorSize: DWORD;
pSecurityDescriptor: Pointer;
end;
WRDS_LISTENER_SETTING = record
WRdsListenerSettings1: WRDS_LISTENER_SETTINGS_1;
end;
WRDS_LISTENER_SETTINGS = record
WRdsListenerSettingLevel: Integer;
WRdsListenerSetting: WRDS_LISTENER_SETTING;
end;
WRDS_CONNECTION_SETTINGS_1 = record
fInheritInitialProgram: ByteBool;
fInheritColorDepth: ByteBool;
fHideTitleBar: ByteBool;
fInheritAutoLogon: ByteBool;
fMaximizeShell: ByteBool;
fDisablePNP: ByteBool;
fPasswordIsScPin: ByteBool;
fPromptForPassword: ByteBool;
fDisableCpm: ByteBool;
fDisableCdm: ByteBool;
fDisableCcm: ByteBool;
fDisableLPT: ByteBool;
fDisableClip: ByteBool;
fResetBroken: ByteBool;
fDisableEncryption: ByteBool;
fDisableAutoReconnect: ByteBool;
fDisableCtrlAltDel: ByteBool;
fDoubleClickDetect: ByteBool;
fEnableWindowsKey: ByteBool;
fUsingSavedCreds: ByteBool;
fMouse: ByteBool;
fNoAudioPlayback: ByteBool;
fRemoteConsoleAudio: ByteBool;
EncryptionLevel: Byte;
ColorDepth: Word;
ProtocolType: Word;
HRes: Word;
VRes: Word;
ClientProductId: Word;
OutBufCountHost: Word;
OutBufCountClient: Word;
OutBufLength: Word;
KeyboardLayout: DWORD;
MaxConnectionTime: DWORD;
MaxDisconnectionTime: DWORD;
MaxIdleTime: DWORD;
PerformanceFlags: DWORD;
KeyboardType: DWORD;
KeyboardSubType: DWORD;
KeyboardFunctionKey: DWORD;
ActiveInputLocale: DWORD;
SerialNumber: DWORD;
ClientAddressFamily: DWORD;
ClientBuildNumber: DWORD;
ClientSessionId: DWORD;
WorkDirectory: array[0..256] of WideChar;
InitialProgram: array[0..256] of WideChar;
UserName: array[0..255] of WideChar;
Domain: array[0..255] of WideChar;
Password: array[0..255] of WideChar;
ProtocolName: array[0..8] of WideChar;
DisplayDriverName: array[0..8] of WideChar;
DisplayDeviceName: array[0..19] of WideChar;
imeFileName: array[0..32] of WideChar;
AudioDriverName: array[0..8] of WideChar;
ClientName: array[0..20] of WideChar;
ClientAddress: array[0..30] of WideChar;
ClientDirectory: array[0..256] of WideChar;
ClientDigProductId: array[0..32] of WideChar;
ClientSockAddress: WTS_SOCKADDR;
ClientTimeZone: WTS_TIME_ZONE_INFORMATION;
WRdsListenerSettings: WRDS_LISTENER_SETTINGS;
EventLogActivityId: TGUID;
ContextSize: DWORD;
ContextData: Pointer;
end;const WTS_SOCKADDR = extern struct {
sin_family: u16,
u: _u_e__Union,
};
const WTS_SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};
const WTS_TIME_ZONE_INFORMATION = extern struct {
Bias: i32,
StandardName: [32]u16,
StandardDate: WTS_SYSTEMTIME,
StandardBias: i32,
DaylightName: [32]u16,
DaylightDate: WTS_SYSTEMTIME,
DaylightBias: i32,
};
const WRDS_LISTENER_SETTINGS_1 = extern struct {
MaxProtocolListenerConnectionCount: u32,
SecurityDescriptorSize: u32,
pSecurityDescriptor: ?*anyopaque,
};
const WRDS_LISTENER_SETTING = extern struct {
WRdsListenerSettings1: WRDS_LISTENER_SETTINGS_1,
};
const WRDS_LISTENER_SETTINGS = extern struct {
WRdsListenerSettingLevel: i32,
WRdsListenerSetting: WRDS_LISTENER_SETTING,
};
const WRDS_CONNECTION_SETTINGS_1 = extern struct {
fInheritInitialProgram: u8,
fInheritColorDepth: u8,
fHideTitleBar: u8,
fInheritAutoLogon: u8,
fMaximizeShell: u8,
fDisablePNP: u8,
fPasswordIsScPin: u8,
fPromptForPassword: u8,
fDisableCpm: u8,
fDisableCdm: u8,
fDisableCcm: u8,
fDisableLPT: u8,
fDisableClip: u8,
fResetBroken: u8,
fDisableEncryption: u8,
fDisableAutoReconnect: u8,
fDisableCtrlAltDel: u8,
fDoubleClickDetect: u8,
fEnableWindowsKey: u8,
fUsingSavedCreds: u8,
fMouse: u8,
fNoAudioPlayback: u8,
fRemoteConsoleAudio: u8,
EncryptionLevel: u8,
ColorDepth: u16,
ProtocolType: u16,
HRes: u16,
VRes: u16,
ClientProductId: u16,
OutBufCountHost: u16,
OutBufCountClient: u16,
OutBufLength: u16,
KeyboardLayout: u32,
MaxConnectionTime: u32,
MaxDisconnectionTime: u32,
MaxIdleTime: u32,
PerformanceFlags: u32,
KeyboardType: u32,
KeyboardSubType: u32,
KeyboardFunctionKey: u32,
ActiveInputLocale: u32,
SerialNumber: u32,
ClientAddressFamily: u32,
ClientBuildNumber: u32,
ClientSessionId: u32,
WorkDirectory: [257]u16,
InitialProgram: [257]u16,
UserName: [256]u16,
Domain: [256]u16,
Password: [256]u16,
ProtocolName: [9]u16,
DisplayDriverName: [9]u16,
DisplayDeviceName: [20]u16,
imeFileName: [33]u16,
AudioDriverName: [9]u16,
ClientName: [21]u16,
ClientAddress: [31]u16,
ClientDirectory: [257]u16,
ClientDigProductId: [33]u16,
ClientSockAddress: WTS_SOCKADDR,
ClientTimeZone: WTS_TIME_ZONE_INFORMATION,
WRdsListenerSettings: WRDS_LISTENER_SETTINGS,
EventLogActivityId: GUID,
ContextSize: u32,
ContextData: ?*anyopaque,
};type
WTS_SOCKADDR {.bycopy.} = object
sin_family: uint16
u: _u_e__Union
WTS_SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16
WTS_TIME_ZONE_INFORMATION {.bycopy.} = object
Bias: int32
StandardName: array[32, uint16]
StandardDate: WTS_SYSTEMTIME
StandardBias: int32
DaylightName: array[32, uint16]
DaylightDate: WTS_SYSTEMTIME
DaylightBias: int32
WRDS_LISTENER_SETTINGS_1 {.bycopy.} = object
MaxProtocolListenerConnectionCount: uint32
SecurityDescriptorSize: uint32
pSecurityDescriptor: pointer
WRDS_LISTENER_SETTING {.bycopy.} = object
WRdsListenerSettings1: WRDS_LISTENER_SETTINGS_1
WRDS_LISTENER_SETTINGS {.bycopy.} = object
WRdsListenerSettingLevel: int32
WRdsListenerSetting: WRDS_LISTENER_SETTING
WRDS_CONNECTION_SETTINGS_1 {.bycopy.} = object
fInheritInitialProgram: uint8
fInheritColorDepth: uint8
fHideTitleBar: uint8
fInheritAutoLogon: uint8
fMaximizeShell: uint8
fDisablePNP: uint8
fPasswordIsScPin: uint8
fPromptForPassword: uint8
fDisableCpm: uint8
fDisableCdm: uint8
fDisableCcm: uint8
fDisableLPT: uint8
fDisableClip: uint8
fResetBroken: uint8
fDisableEncryption: uint8
fDisableAutoReconnect: uint8
fDisableCtrlAltDel: uint8
fDoubleClickDetect: uint8
fEnableWindowsKey: uint8
fUsingSavedCreds: uint8
fMouse: uint8
fNoAudioPlayback: uint8
fRemoteConsoleAudio: uint8
EncryptionLevel: uint8
ColorDepth: uint16
ProtocolType: uint16
HRes: uint16
VRes: uint16
ClientProductId: uint16
OutBufCountHost: uint16
OutBufCountClient: uint16
OutBufLength: uint16
KeyboardLayout: uint32
MaxConnectionTime: uint32
MaxDisconnectionTime: uint32
MaxIdleTime: uint32
PerformanceFlags: uint32
KeyboardType: uint32
KeyboardSubType: uint32
KeyboardFunctionKey: uint32
ActiveInputLocale: uint32
SerialNumber: uint32
ClientAddressFamily: uint32
ClientBuildNumber: uint32
ClientSessionId: uint32
WorkDirectory: array[257, uint16]
InitialProgram: array[257, uint16]
UserName: array[256, uint16]
Domain: array[256, uint16]
Password: array[256, uint16]
ProtocolName: array[9, uint16]
DisplayDriverName: array[9, uint16]
DisplayDeviceName: array[20, uint16]
imeFileName: array[33, uint16]
AudioDriverName: array[9, uint16]
ClientName: array[21, uint16]
ClientAddress: array[31, uint16]
ClientDirectory: array[257, uint16]
ClientDigProductId: array[33, uint16]
ClientSockAddress: WTS_SOCKADDR
ClientTimeZone: WTS_TIME_ZONE_INFORMATION
WRdsListenerSettings: WRDS_LISTENER_SETTINGS
EventLogActivityId: GUID
ContextSize: uint32
ContextData: pointerstruct WTS_SOCKADDR
{
ushort sin_family;
_u_e__Union u;
}
struct WTS_SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}
struct WTS_TIME_ZONE_INFORMATION
{
int Bias;
wchar[32] StandardName;
WTS_SYSTEMTIME StandardDate;
int StandardBias;
wchar[32] DaylightName;
WTS_SYSTEMTIME DaylightDate;
int DaylightBias;
}
struct WRDS_LISTENER_SETTINGS_1
{
uint MaxProtocolListenerConnectionCount;
uint SecurityDescriptorSize;
void* pSecurityDescriptor;
}
struct WRDS_LISTENER_SETTING
{
WRDS_LISTENER_SETTINGS_1 WRdsListenerSettings1;
}
struct WRDS_LISTENER_SETTINGS
{
int WRdsListenerSettingLevel;
WRDS_LISTENER_SETTING WRdsListenerSetting;
}
struct WRDS_CONNECTION_SETTINGS_1
{
ubyte fInheritInitialProgram;
ubyte fInheritColorDepth;
ubyte fHideTitleBar;
ubyte fInheritAutoLogon;
ubyte fMaximizeShell;
ubyte fDisablePNP;
ubyte fPasswordIsScPin;
ubyte fPromptForPassword;
ubyte fDisableCpm;
ubyte fDisableCdm;
ubyte fDisableCcm;
ubyte fDisableLPT;
ubyte fDisableClip;
ubyte fResetBroken;
ubyte fDisableEncryption;
ubyte fDisableAutoReconnect;
ubyte fDisableCtrlAltDel;
ubyte fDoubleClickDetect;
ubyte fEnableWindowsKey;
ubyte fUsingSavedCreds;
ubyte fMouse;
ubyte fNoAudioPlayback;
ubyte fRemoteConsoleAudio;
ubyte EncryptionLevel;
ushort ColorDepth;
ushort ProtocolType;
ushort HRes;
ushort VRes;
ushort ClientProductId;
ushort OutBufCountHost;
ushort OutBufCountClient;
ushort OutBufLength;
uint KeyboardLayout;
uint MaxConnectionTime;
uint MaxDisconnectionTime;
uint MaxIdleTime;
uint PerformanceFlags;
uint KeyboardType;
uint KeyboardSubType;
uint KeyboardFunctionKey;
uint ActiveInputLocale;
uint SerialNumber;
uint ClientAddressFamily;
uint ClientBuildNumber;
uint ClientSessionId;
wchar[257] WorkDirectory;
wchar[257] InitialProgram;
wchar[256] UserName;
wchar[256] Domain;
wchar[256] Password;
wchar[9] ProtocolName;
wchar[9] DisplayDriverName;
wchar[20] DisplayDeviceName;
wchar[33] imeFileName;
wchar[9] AudioDriverName;
wchar[21] ClientName;
wchar[31] ClientAddress;
wchar[257] ClientDirectory;
wchar[33] ClientDigProductId;
WTS_SOCKADDR ClientSockAddress;
WTS_TIME_ZONE_INFORMATION ClientTimeZone;
WRDS_LISTENER_SETTINGS WRdsListenerSettings;
GUID EventLogActivityId;
uint ContextSize;
void* ContextData;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WRDS_CONNECTION_SETTINGS_1 サイズ: 3720 バイト(x86)
dim st, 930 ; 4byte整数×930(構造体サイズ 3720 / 4 切り上げ)
; fInheritInitialProgram : BOOLEAN (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; fInheritColorDepth : BOOLEAN (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; fHideTitleBar : BOOLEAN (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; fInheritAutoLogon : BOOLEAN (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; fMaximizeShell : BOOLEAN (+4, 1byte) poke st,4,値 / 値 = peek(st,4)
; fDisablePNP : BOOLEAN (+5, 1byte) poke st,5,値 / 値 = peek(st,5)
; fPasswordIsScPin : BOOLEAN (+6, 1byte) poke st,6,値 / 値 = peek(st,6)
; fPromptForPassword : BOOLEAN (+7, 1byte) poke st,7,値 / 値 = peek(st,7)
; fDisableCpm : BOOLEAN (+8, 1byte) poke st,8,値 / 値 = peek(st,8)
; fDisableCdm : BOOLEAN (+9, 1byte) poke st,9,値 / 値 = peek(st,9)
; fDisableCcm : BOOLEAN (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; fDisableLPT : BOOLEAN (+11, 1byte) poke st,11,値 / 値 = peek(st,11)
; fDisableClip : BOOLEAN (+12, 1byte) poke st,12,値 / 値 = peek(st,12)
; fResetBroken : BOOLEAN (+13, 1byte) poke st,13,値 / 値 = peek(st,13)
; fDisableEncryption : BOOLEAN (+14, 1byte) poke st,14,値 / 値 = peek(st,14)
; fDisableAutoReconnect : BOOLEAN (+15, 1byte) poke st,15,値 / 値 = peek(st,15)
; fDisableCtrlAltDel : BOOLEAN (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; fDoubleClickDetect : BOOLEAN (+17, 1byte) poke st,17,値 / 値 = peek(st,17)
; fEnableWindowsKey : BOOLEAN (+18, 1byte) poke st,18,値 / 値 = peek(st,18)
; fUsingSavedCreds : BOOLEAN (+19, 1byte) poke st,19,値 / 値 = peek(st,19)
; fMouse : BOOLEAN (+20, 1byte) poke st,20,値 / 値 = peek(st,20)
; fNoAudioPlayback : BOOLEAN (+21, 1byte) poke st,21,値 / 値 = peek(st,21)
; fRemoteConsoleAudio : BOOLEAN (+22, 1byte) poke st,22,値 / 値 = peek(st,22)
; EncryptionLevel : BYTE (+23, 1byte) poke st,23,値 / 値 = peek(st,23)
; ColorDepth : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; ProtocolType : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; HRes : WORD (+28, 2byte) wpoke st,28,値 / 値 = wpeek(st,28)
; VRes : WORD (+30, 2byte) wpoke st,30,値 / 値 = wpeek(st,30)
; ClientProductId : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; OutBufCountHost : WORD (+34, 2byte) wpoke st,34,値 / 値 = wpeek(st,34)
; OutBufCountClient : WORD (+36, 2byte) wpoke st,36,値 / 値 = wpeek(st,36)
; OutBufLength : WORD (+38, 2byte) wpoke st,38,値 / 値 = wpeek(st,38)
; KeyboardLayout : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; MaxConnectionTime : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; MaxDisconnectionTime : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; MaxIdleTime : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; PerformanceFlags : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; KeyboardType : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; KeyboardSubType : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; KeyboardFunctionKey : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; ActiveInputLocale : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; SerialNumber : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ClientAddressFamily : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; ClientBuildNumber : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; ClientSessionId : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; WorkDirectory : WCHAR (+92, 514byte) varptr(st)+92 を基点に操作(514byte:入れ子/配列)
; InitialProgram : WCHAR (+606, 514byte) varptr(st)+606 を基点に操作(514byte:入れ子/配列)
; UserName : WCHAR (+1120, 512byte) varptr(st)+1120 を基点に操作(512byte:入れ子/配列)
; Domain : WCHAR (+1632, 512byte) varptr(st)+1632 を基点に操作(512byte:入れ子/配列)
; Password : WCHAR (+2144, 512byte) varptr(st)+2144 を基点に操作(512byte:入れ子/配列)
; ProtocolName : WCHAR (+2656, 18byte) varptr(st)+2656 を基点に操作(18byte:入れ子/配列)
; DisplayDriverName : WCHAR (+2674, 18byte) varptr(st)+2674 を基点に操作(18byte:入れ子/配列)
; DisplayDeviceName : WCHAR (+2692, 40byte) varptr(st)+2692 を基点に操作(40byte:入れ子/配列)
; imeFileName : WCHAR (+2732, 66byte) varptr(st)+2732 を基点に操作(66byte:入れ子/配列)
; AudioDriverName : WCHAR (+2798, 18byte) varptr(st)+2798 を基点に操作(18byte:入れ子/配列)
; ClientName : WCHAR (+2816, 42byte) varptr(st)+2816 を基点に操作(42byte:入れ子/配列)
; ClientAddress : WCHAR (+2858, 62byte) varptr(st)+2858 を基点に操作(62byte:入れ子/配列)
; ClientDirectory : WCHAR (+2920, 514byte) varptr(st)+2920 を基点に操作(514byte:入れ子/配列)
; ClientDigProductId : WCHAR (+3434, 66byte) varptr(st)+3434 を基点に操作(66byte:入れ子/配列)
; ClientSockAddress : WTS_SOCKADDR (+3500, 8byte) varptr(st)+3500 を基点に操作(8byte:入れ子/配列)
; ClientTimeZone : WTS_TIME_ZONE_INFORMATION (+3508, 172byte) varptr(st)+3508 を基点に操作(172byte:入れ子/配列)
; WRdsListenerSettings : WRDS_LISTENER_SETTINGS (+3680, 16byte) varptr(st)+3680 を基点に操作(16byte:入れ子/配列)
; EventLogActivityId : GUID (+3696, 16byte) varptr(st)+3696 を基点に操作(16byte:入れ子/配列)
; ContextSize : DWORD (+3712, 4byte) st.928 = 値 / 値 = st.928 (lpoke/lpeek も可)
; ContextData : BYTE* (+3716, 4byte) st.929 = 値 / 値 = st.929 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WRDS_CONNECTION_SETTINGS_1 サイズ: 3752 バイト(x64)
dim st, 938 ; 4byte整数×938(構造体サイズ 3752 / 4 切り上げ)
; fInheritInitialProgram : BOOLEAN (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; fInheritColorDepth : BOOLEAN (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; fHideTitleBar : BOOLEAN (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; fInheritAutoLogon : BOOLEAN (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; fMaximizeShell : BOOLEAN (+4, 1byte) poke st,4,値 / 値 = peek(st,4)
; fDisablePNP : BOOLEAN (+5, 1byte) poke st,5,値 / 値 = peek(st,5)
; fPasswordIsScPin : BOOLEAN (+6, 1byte) poke st,6,値 / 値 = peek(st,6)
; fPromptForPassword : BOOLEAN (+7, 1byte) poke st,7,値 / 値 = peek(st,7)
; fDisableCpm : BOOLEAN (+8, 1byte) poke st,8,値 / 値 = peek(st,8)
; fDisableCdm : BOOLEAN (+9, 1byte) poke st,9,値 / 値 = peek(st,9)
; fDisableCcm : BOOLEAN (+10, 1byte) poke st,10,値 / 値 = peek(st,10)
; fDisableLPT : BOOLEAN (+11, 1byte) poke st,11,値 / 値 = peek(st,11)
; fDisableClip : BOOLEAN (+12, 1byte) poke st,12,値 / 値 = peek(st,12)
; fResetBroken : BOOLEAN (+13, 1byte) poke st,13,値 / 値 = peek(st,13)
; fDisableEncryption : BOOLEAN (+14, 1byte) poke st,14,値 / 値 = peek(st,14)
; fDisableAutoReconnect : BOOLEAN (+15, 1byte) poke st,15,値 / 値 = peek(st,15)
; fDisableCtrlAltDel : BOOLEAN (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; fDoubleClickDetect : BOOLEAN (+17, 1byte) poke st,17,値 / 値 = peek(st,17)
; fEnableWindowsKey : BOOLEAN (+18, 1byte) poke st,18,値 / 値 = peek(st,18)
; fUsingSavedCreds : BOOLEAN (+19, 1byte) poke st,19,値 / 値 = peek(st,19)
; fMouse : BOOLEAN (+20, 1byte) poke st,20,値 / 値 = peek(st,20)
; fNoAudioPlayback : BOOLEAN (+21, 1byte) poke st,21,値 / 値 = peek(st,21)
; fRemoteConsoleAudio : BOOLEAN (+22, 1byte) poke st,22,値 / 値 = peek(st,22)
; EncryptionLevel : BYTE (+23, 1byte) poke st,23,値 / 値 = peek(st,23)
; ColorDepth : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; ProtocolType : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; HRes : WORD (+28, 2byte) wpoke st,28,値 / 値 = wpeek(st,28)
; VRes : WORD (+30, 2byte) wpoke st,30,値 / 値 = wpeek(st,30)
; ClientProductId : WORD (+32, 2byte) wpoke st,32,値 / 値 = wpeek(st,32)
; OutBufCountHost : WORD (+34, 2byte) wpoke st,34,値 / 値 = wpeek(st,34)
; OutBufCountClient : WORD (+36, 2byte) wpoke st,36,値 / 値 = wpeek(st,36)
; OutBufLength : WORD (+38, 2byte) wpoke st,38,値 / 値 = wpeek(st,38)
; KeyboardLayout : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; MaxConnectionTime : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; MaxDisconnectionTime : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; MaxIdleTime : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; PerformanceFlags : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; KeyboardType : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; KeyboardSubType : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; KeyboardFunctionKey : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; ActiveInputLocale : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; SerialNumber : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ClientAddressFamily : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; ClientBuildNumber : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; ClientSessionId : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; WorkDirectory : WCHAR (+92, 514byte) varptr(st)+92 を基点に操作(514byte:入れ子/配列)
; InitialProgram : WCHAR (+606, 514byte) varptr(st)+606 を基点に操作(514byte:入れ子/配列)
; UserName : WCHAR (+1120, 512byte) varptr(st)+1120 を基点に操作(512byte:入れ子/配列)
; Domain : WCHAR (+1632, 512byte) varptr(st)+1632 を基点に操作(512byte:入れ子/配列)
; Password : WCHAR (+2144, 512byte) varptr(st)+2144 を基点に操作(512byte:入れ子/配列)
; ProtocolName : WCHAR (+2656, 18byte) varptr(st)+2656 を基点に操作(18byte:入れ子/配列)
; DisplayDriverName : WCHAR (+2674, 18byte) varptr(st)+2674 を基点に操作(18byte:入れ子/配列)
; DisplayDeviceName : WCHAR (+2692, 40byte) varptr(st)+2692 を基点に操作(40byte:入れ子/配列)
; imeFileName : WCHAR (+2732, 66byte) varptr(st)+2732 を基点に操作(66byte:入れ子/配列)
; AudioDriverName : WCHAR (+2798, 18byte) varptr(st)+2798 を基点に操作(18byte:入れ子/配列)
; ClientName : WCHAR (+2816, 42byte) varptr(st)+2816 を基点に操作(42byte:入れ子/配列)
; ClientAddress : WCHAR (+2858, 62byte) varptr(st)+2858 を基点に操作(62byte:入れ子/配列)
; ClientDirectory : WCHAR (+2920, 514byte) varptr(st)+2920 を基点に操作(514byte:入れ子/配列)
; ClientDigProductId : WCHAR (+3434, 66byte) varptr(st)+3434 を基点に操作(66byte:入れ子/配列)
; ClientSockAddress : WTS_SOCKADDR (+3504, 16byte) varptr(st)+3504 を基点に操作(16byte:入れ子/配列)
; ClientTimeZone : WTS_TIME_ZONE_INFORMATION (+3520, 172byte) varptr(st)+3520 を基点に操作(172byte:入れ子/配列)
; WRdsListenerSettings : WRDS_LISTENER_SETTINGS (+3696, 24byte) varptr(st)+3696 を基点に操作(24byte:入れ子/配列)
; EventLogActivityId : GUID (+3720, 16byte) varptr(st)+3720 を基点に操作(16byte:入れ子/配列)
; ContextSize : DWORD (+3736, 4byte) st.934 = 値 / 値 = st.934 (lpoke/lpeek も可)
; ContextData : BYTE* (+3744, 8byte) qpoke st,3744,値 / qpeek(st,3744) ※IronHSPのみ。3.7/3.8は lpoke st,3744,下位 : lpoke st,3748,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WTS_SOCKADDR
#field short sin_family
#field byte u 8
#endstruct
#defstruct global WTS_SYSTEMTIME
#field short wYear
#field short wMonth
#field short wDayOfWeek
#field short wDay
#field short wHour
#field short wMinute
#field short wSecond
#field short wMilliseconds
#endstruct
#defstruct global WTS_TIME_ZONE_INFORMATION
#field int Bias
#field wchar StandardName 32
#field WTS_SYSTEMTIME StandardDate
#field int StandardBias
#field wchar DaylightName 32
#field WTS_SYSTEMTIME DaylightDate
#field int DaylightBias
#endstruct
#defstruct global WRDS_LISTENER_SETTINGS
#field int WRdsListenerSettingLevel
#field byte WRdsListenerSetting 16
#endstruct
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global WRDS_CONNECTION_SETTINGS_1
#field bool1 fInheritInitialProgram
#field bool1 fInheritColorDepth
#field bool1 fHideTitleBar
#field bool1 fInheritAutoLogon
#field bool1 fMaximizeShell
#field bool1 fDisablePNP
#field bool1 fPasswordIsScPin
#field bool1 fPromptForPassword
#field bool1 fDisableCpm
#field bool1 fDisableCdm
#field bool1 fDisableCcm
#field bool1 fDisableLPT
#field bool1 fDisableClip
#field bool1 fResetBroken
#field bool1 fDisableEncryption
#field bool1 fDisableAutoReconnect
#field bool1 fDisableCtrlAltDel
#field bool1 fDoubleClickDetect
#field bool1 fEnableWindowsKey
#field bool1 fUsingSavedCreds
#field bool1 fMouse
#field bool1 fNoAudioPlayback
#field bool1 fRemoteConsoleAudio
#field byte EncryptionLevel
#field short ColorDepth
#field short ProtocolType
#field short HRes
#field short VRes
#field short ClientProductId
#field short OutBufCountHost
#field short OutBufCountClient
#field short OutBufLength
#field int KeyboardLayout
#field int MaxConnectionTime
#field int MaxDisconnectionTime
#field int MaxIdleTime
#field int PerformanceFlags
#field int KeyboardType
#field int KeyboardSubType
#field int KeyboardFunctionKey
#field int ActiveInputLocale
#field int SerialNumber
#field int ClientAddressFamily
#field int ClientBuildNumber
#field int ClientSessionId
#field wchar WorkDirectory 257
#field wchar InitialProgram 257
#field wchar UserName 256
#field wchar Domain 256
#field wchar Password 256
#field wchar ProtocolName 9
#field wchar DisplayDriverName 9
#field wchar DisplayDeviceName 20
#field wchar imeFileName 33
#field wchar AudioDriverName 9
#field wchar ClientName 21
#field wchar ClientAddress 31
#field wchar ClientDirectory 257
#field wchar ClientDigProductId 33
#field WTS_SOCKADDR ClientSockAddress
#field WTS_TIME_ZONE_INFORMATION ClientTimeZone
#field WRDS_LISTENER_SETTINGS WRdsListenerSettings
#field GUID EventLogActivityId
#field int ContextSize
#field intptr ContextData
#endstruct
stdim st, WRDS_CONNECTION_SETTINGS_1 ; NSTRUCT 変数を確保
st->fInheritInitialProgram = 100
mes "fInheritInitialProgram=" + st->fInheritInitialProgram