ホーム › System.RemoteDesktop › WTSLISTENERCONFIGW
WTSLISTENERCONFIGW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| version | DWORD | 4 | +0 | +0 | このリスナー構成構造体のバージョン番号。 |
| fEnableListener | DWORD | 4 | +4 | +4 | リスナーを有効にするかどうかを示す。 |
| MaxConnectionCount | DWORD | 4 | +8 | +8 | 許可する最大同時接続数。 |
| fPromptForPassword | DWORD | 4 | +12 | +12 | ログオン時にパスワード入力を求めるかを示す。 |
| fInheritColorDepth | DWORD | 4 | +16 | +16 | 色深度設定を継承するかを示す。 |
| ColorDepth | DWORD | 4 | +20 | +20 | セッションの色深度を示す値。 |
| fInheritBrokenTimeoutSettings | DWORD | 4 | +24 | +24 | 接続断タイムアウト設定を継承するかを示す。 |
| BrokenTimeoutSettings | DWORD | 4 | +28 | +28 | 接続断時のタイムアウト動作設定を示す値。 |
| fDisablePrinterRedirection | DWORD | 4 | +32 | +32 | プリンタリダイレクトを無効にするかを示す。 |
| fDisableDriveRedirection | DWORD | 4 | +36 | +36 | ドライブリダイレクトを無効にするかを示す。 |
| fDisableComPortRedirection | DWORD | 4 | +40 | +40 | COMポートリダイレクトを無効にするかを示す。 |
| fDisableLPTPortRedirection | DWORD | 4 | +44 | +44 | LPTポートリダイレクトを無効にするかを示す。 |
| fDisableClipboardRedirection | DWORD | 4 | +48 | +48 | クリップボードリダイレクトを無効にするかを示す。 |
| fDisableAudioRedirection | DWORD | 4 | +52 | +52 | オーディオリダイレクトを無効にするかを示す。 |
| fDisablePNPRedirection | DWORD | 4 | +56 | +56 | プラグアンドプレイデバイスのリダイレクトを無効化するか。 |
| fDisableDefaultMainClientPrinter | DWORD | 4 | +60 | +60 | 既定メインクライアントプリンタを無効化するか。 |
| LanAdapter | DWORD | 4 | +64 | +64 | 使用するLANアダプタの識別子。0で全アダプタ。 |
| PortNumber | DWORD | 4 | +68 | +68 | リスナーが待ち受けるポート番号。 |
| fInheritShadowSettings | DWORD | 4 | +72 | +72 | シャドウ設定を継承するかを示す。 |
| ShadowSettings | DWORD | 4 | +76 | +76 | セッションシャドウ(監視)の設定を示す値。 |
| TimeoutSettingsConnection | DWORD | 4 | +80 | +80 | 接続セッションのタイムアウト時間。分単位で表す。 |
| TimeoutSettingsDisconnection | DWORD | 4 | +84 | +84 | 切断セッションのタイムアウト時間。分単位で表す。 |
| TimeoutSettingsIdle | DWORD | 4 | +88 | +88 | アイドルセッションのタイムアウト時間。分単位で表す。 |
| SecurityLayer | DWORD | 4 | +92 | +92 | 使用するセキュリティレイヤーを示す値。 |
| MinEncryptionLevel | DWORD | 4 | +96 | +96 | 許可する最小暗号化レベルを示す値。 |
| UserAuthentication | DWORD | 4 | +100 | +100 | ネットワークレベル認証(NLA)の要否を示す値。 |
| Comment | WCHAR | 122 | +104 | +104 | リスナーに関するコメント(Unicode)。 |
| LogonUserName | WCHAR | 42 | +226 | +226 | ログオンユーザー名(Unicode)。 |
| LogonDomain | WCHAR | 36 | +268 | +268 | ログオンドメイン名(Unicode)。 |
| WorkDirectory | WCHAR | 522 | +304 | +304 | 作業ディレクトリのパス(Unicode)。 |
| InitialProgram | WCHAR | 522 | +826 | +826 | 起動時に実行する初期プログラム(Unicode)。 |
各言語での定義
#include <windows.h>
// WTSLISTENERCONFIGW (x64 1348 / x86 1348 バイト)
typedef struct WTSLISTENERCONFIGW {
DWORD version;
DWORD fEnableListener;
DWORD MaxConnectionCount;
DWORD fPromptForPassword;
DWORD fInheritColorDepth;
DWORD ColorDepth;
DWORD fInheritBrokenTimeoutSettings;
DWORD BrokenTimeoutSettings;
DWORD fDisablePrinterRedirection;
DWORD fDisableDriveRedirection;
DWORD fDisableComPortRedirection;
DWORD fDisableLPTPortRedirection;
DWORD fDisableClipboardRedirection;
DWORD fDisableAudioRedirection;
DWORD fDisablePNPRedirection;
DWORD fDisableDefaultMainClientPrinter;
DWORD LanAdapter;
DWORD PortNumber;
DWORD fInheritShadowSettings;
DWORD ShadowSettings;
DWORD TimeoutSettingsConnection;
DWORD TimeoutSettingsDisconnection;
DWORD TimeoutSettingsIdle;
DWORD SecurityLayer;
DWORD MinEncryptionLevel;
DWORD UserAuthentication;
WCHAR Comment[61];
WCHAR LogonUserName[21];
WCHAR LogonDomain[18];
WCHAR WorkDirectory[261];
WCHAR InitialProgram[261];
} WTSLISTENERCONFIGW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTSLISTENERCONFIGW
{
public uint version;
public uint fEnableListener;
public uint MaxConnectionCount;
public uint fPromptForPassword;
public uint fInheritColorDepth;
public uint ColorDepth;
public uint fInheritBrokenTimeoutSettings;
public uint BrokenTimeoutSettings;
public uint fDisablePrinterRedirection;
public uint fDisableDriveRedirection;
public uint fDisableComPortRedirection;
public uint fDisableLPTPortRedirection;
public uint fDisableClipboardRedirection;
public uint fDisableAudioRedirection;
public uint fDisablePNPRedirection;
public uint fDisableDefaultMainClientPrinter;
public uint LanAdapter;
public uint PortNumber;
public uint fInheritShadowSettings;
public uint ShadowSettings;
public uint TimeoutSettingsConnection;
public uint TimeoutSettingsDisconnection;
public uint TimeoutSettingsIdle;
public uint SecurityLayer;
public uint MinEncryptionLevel;
public uint UserAuthentication;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 61)] public string Comment;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 21)] public string LogonUserName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 18)] public string LogonDomain;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 261)] public string WorkDirectory;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 261)] public string InitialProgram;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTSLISTENERCONFIGW
Public version As UInteger
Public fEnableListener As UInteger
Public MaxConnectionCount As UInteger
Public fPromptForPassword As UInteger
Public fInheritColorDepth As UInteger
Public ColorDepth As UInteger
Public fInheritBrokenTimeoutSettings As UInteger
Public BrokenTimeoutSettings As UInteger
Public fDisablePrinterRedirection As UInteger
Public fDisableDriveRedirection As UInteger
Public fDisableComPortRedirection As UInteger
Public fDisableLPTPortRedirection As UInteger
Public fDisableClipboardRedirection As UInteger
Public fDisableAudioRedirection As UInteger
Public fDisablePNPRedirection As UInteger
Public fDisableDefaultMainClientPrinter As UInteger
Public LanAdapter As UInteger
Public PortNumber As UInteger
Public fInheritShadowSettings As UInteger
Public ShadowSettings As UInteger
Public TimeoutSettingsConnection As UInteger
Public TimeoutSettingsDisconnection As UInteger
Public TimeoutSettingsIdle As UInteger
Public SecurityLayer As UInteger
Public MinEncryptionLevel As UInteger
Public UserAuthentication As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=61)> Public Comment As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=21)> Public LogonUserName As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=18)> Public LogonDomain As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=261)> Public WorkDirectory As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=261)> Public InitialProgram As String
End Structureimport ctypes
from ctypes import wintypes
class WTSLISTENERCONFIGW(ctypes.Structure):
_fields_ = [
("version", wintypes.DWORD),
("fEnableListener", wintypes.DWORD),
("MaxConnectionCount", wintypes.DWORD),
("fPromptForPassword", wintypes.DWORD),
("fInheritColorDepth", wintypes.DWORD),
("ColorDepth", wintypes.DWORD),
("fInheritBrokenTimeoutSettings", wintypes.DWORD),
("BrokenTimeoutSettings", wintypes.DWORD),
("fDisablePrinterRedirection", wintypes.DWORD),
("fDisableDriveRedirection", wintypes.DWORD),
("fDisableComPortRedirection", wintypes.DWORD),
("fDisableLPTPortRedirection", wintypes.DWORD),
("fDisableClipboardRedirection", wintypes.DWORD),
("fDisableAudioRedirection", wintypes.DWORD),
("fDisablePNPRedirection", wintypes.DWORD),
("fDisableDefaultMainClientPrinter", wintypes.DWORD),
("LanAdapter", wintypes.DWORD),
("PortNumber", wintypes.DWORD),
("fInheritShadowSettings", wintypes.DWORD),
("ShadowSettings", wintypes.DWORD),
("TimeoutSettingsConnection", wintypes.DWORD),
("TimeoutSettingsDisconnection", wintypes.DWORD),
("TimeoutSettingsIdle", wintypes.DWORD),
("SecurityLayer", wintypes.DWORD),
("MinEncryptionLevel", wintypes.DWORD),
("UserAuthentication", wintypes.DWORD),
("Comment", ctypes.c_wchar * 61),
("LogonUserName", ctypes.c_wchar * 21),
("LogonDomain", ctypes.c_wchar * 18),
("WorkDirectory", ctypes.c_wchar * 261),
("InitialProgram", ctypes.c_wchar * 261),
]#[repr(C)]
pub struct WTSLISTENERCONFIGW {
pub version: u32,
pub fEnableListener: u32,
pub MaxConnectionCount: u32,
pub fPromptForPassword: u32,
pub fInheritColorDepth: u32,
pub ColorDepth: u32,
pub fInheritBrokenTimeoutSettings: u32,
pub BrokenTimeoutSettings: u32,
pub fDisablePrinterRedirection: u32,
pub fDisableDriveRedirection: u32,
pub fDisableComPortRedirection: u32,
pub fDisableLPTPortRedirection: u32,
pub fDisableClipboardRedirection: u32,
pub fDisableAudioRedirection: u32,
pub fDisablePNPRedirection: u32,
pub fDisableDefaultMainClientPrinter: u32,
pub LanAdapter: u32,
pub PortNumber: u32,
pub fInheritShadowSettings: u32,
pub ShadowSettings: u32,
pub TimeoutSettingsConnection: u32,
pub TimeoutSettingsDisconnection: u32,
pub TimeoutSettingsIdle: u32,
pub SecurityLayer: u32,
pub MinEncryptionLevel: u32,
pub UserAuthentication: u32,
pub Comment: [u16; 61],
pub LogonUserName: [u16; 21],
pub LogonDomain: [u16; 18],
pub WorkDirectory: [u16; 261],
pub InitialProgram: [u16; 261],
}import "golang.org/x/sys/windows"
type WTSLISTENERCONFIGW struct {
version uint32
fEnableListener uint32
MaxConnectionCount uint32
fPromptForPassword uint32
fInheritColorDepth uint32
ColorDepth uint32
fInheritBrokenTimeoutSettings uint32
BrokenTimeoutSettings uint32
fDisablePrinterRedirection uint32
fDisableDriveRedirection uint32
fDisableComPortRedirection uint32
fDisableLPTPortRedirection uint32
fDisableClipboardRedirection uint32
fDisableAudioRedirection uint32
fDisablePNPRedirection uint32
fDisableDefaultMainClientPrinter uint32
LanAdapter uint32
PortNumber uint32
fInheritShadowSettings uint32
ShadowSettings uint32
TimeoutSettingsConnection uint32
TimeoutSettingsDisconnection uint32
TimeoutSettingsIdle uint32
SecurityLayer uint32
MinEncryptionLevel uint32
UserAuthentication uint32
Comment [61]uint16
LogonUserName [21]uint16
LogonDomain [18]uint16
WorkDirectory [261]uint16
InitialProgram [261]uint16
}type
WTSLISTENERCONFIGW = record
version: DWORD;
fEnableListener: DWORD;
MaxConnectionCount: DWORD;
fPromptForPassword: DWORD;
fInheritColorDepth: DWORD;
ColorDepth: DWORD;
fInheritBrokenTimeoutSettings: DWORD;
BrokenTimeoutSettings: DWORD;
fDisablePrinterRedirection: DWORD;
fDisableDriveRedirection: DWORD;
fDisableComPortRedirection: DWORD;
fDisableLPTPortRedirection: DWORD;
fDisableClipboardRedirection: DWORD;
fDisableAudioRedirection: DWORD;
fDisablePNPRedirection: DWORD;
fDisableDefaultMainClientPrinter: DWORD;
LanAdapter: DWORD;
PortNumber: DWORD;
fInheritShadowSettings: DWORD;
ShadowSettings: DWORD;
TimeoutSettingsConnection: DWORD;
TimeoutSettingsDisconnection: DWORD;
TimeoutSettingsIdle: DWORD;
SecurityLayer: DWORD;
MinEncryptionLevel: DWORD;
UserAuthentication: DWORD;
Comment: array[0..60] of WideChar;
LogonUserName: array[0..20] of WideChar;
LogonDomain: array[0..17] of WideChar;
WorkDirectory: array[0..260] of WideChar;
InitialProgram: array[0..260] of WideChar;
end;const WTSLISTENERCONFIGW = extern struct {
version: u32,
fEnableListener: u32,
MaxConnectionCount: u32,
fPromptForPassword: u32,
fInheritColorDepth: u32,
ColorDepth: u32,
fInheritBrokenTimeoutSettings: u32,
BrokenTimeoutSettings: u32,
fDisablePrinterRedirection: u32,
fDisableDriveRedirection: u32,
fDisableComPortRedirection: u32,
fDisableLPTPortRedirection: u32,
fDisableClipboardRedirection: u32,
fDisableAudioRedirection: u32,
fDisablePNPRedirection: u32,
fDisableDefaultMainClientPrinter: u32,
LanAdapter: u32,
PortNumber: u32,
fInheritShadowSettings: u32,
ShadowSettings: u32,
TimeoutSettingsConnection: u32,
TimeoutSettingsDisconnection: u32,
TimeoutSettingsIdle: u32,
SecurityLayer: u32,
MinEncryptionLevel: u32,
UserAuthentication: u32,
Comment: [61]u16,
LogonUserName: [21]u16,
LogonDomain: [18]u16,
WorkDirectory: [261]u16,
InitialProgram: [261]u16,
};type
WTSLISTENERCONFIGW {.bycopy.} = object
version: uint32
fEnableListener: uint32
MaxConnectionCount: uint32
fPromptForPassword: uint32
fInheritColorDepth: uint32
ColorDepth: uint32
fInheritBrokenTimeoutSettings: uint32
BrokenTimeoutSettings: uint32
fDisablePrinterRedirection: uint32
fDisableDriveRedirection: uint32
fDisableComPortRedirection: uint32
fDisableLPTPortRedirection: uint32
fDisableClipboardRedirection: uint32
fDisableAudioRedirection: uint32
fDisablePNPRedirection: uint32
fDisableDefaultMainClientPrinter: uint32
LanAdapter: uint32
PortNumber: uint32
fInheritShadowSettings: uint32
ShadowSettings: uint32
TimeoutSettingsConnection: uint32
TimeoutSettingsDisconnection: uint32
TimeoutSettingsIdle: uint32
SecurityLayer: uint32
MinEncryptionLevel: uint32
UserAuthentication: uint32
Comment: array[61, uint16]
LogonUserName: array[21, uint16]
LogonDomain: array[18, uint16]
WorkDirectory: array[261, uint16]
InitialProgram: array[261, uint16]struct WTSLISTENERCONFIGW
{
uint version;
uint fEnableListener;
uint MaxConnectionCount;
uint fPromptForPassword;
uint fInheritColorDepth;
uint ColorDepth;
uint fInheritBrokenTimeoutSettings;
uint BrokenTimeoutSettings;
uint fDisablePrinterRedirection;
uint fDisableDriveRedirection;
uint fDisableComPortRedirection;
uint fDisableLPTPortRedirection;
uint fDisableClipboardRedirection;
uint fDisableAudioRedirection;
uint fDisablePNPRedirection;
uint fDisableDefaultMainClientPrinter;
uint LanAdapter;
uint PortNumber;
uint fInheritShadowSettings;
uint ShadowSettings;
uint TimeoutSettingsConnection;
uint TimeoutSettingsDisconnection;
uint TimeoutSettingsIdle;
uint SecurityLayer;
uint MinEncryptionLevel;
uint UserAuthentication;
wchar[61] Comment;
wchar[21] LogonUserName;
wchar[18] LogonDomain;
wchar[261] WorkDirectory;
wchar[261] InitialProgram;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WTSLISTENERCONFIGW サイズ: 1348 バイト(x64)
dim st, 337 ; 4byte整数×337(構造体サイズ 1348 / 4 切り上げ)
; version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fEnableListener : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; MaxConnectionCount : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fPromptForPassword : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fInheritColorDepth : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ColorDepth : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; fInheritBrokenTimeoutSettings : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; BrokenTimeoutSettings : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; fDisablePrinterRedirection : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; fDisableDriveRedirection : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; fDisableComPortRedirection : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; fDisableLPTPortRedirection : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; fDisableClipboardRedirection : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; fDisableAudioRedirection : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; fDisablePNPRedirection : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; fDisableDefaultMainClientPrinter : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; LanAdapter : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; PortNumber : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; fInheritShadowSettings : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; ShadowSettings : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; TimeoutSettingsConnection : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; TimeoutSettingsDisconnection : DWORD (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; TimeoutSettingsIdle : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; SecurityLayer : DWORD (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; MinEncryptionLevel : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; UserAuthentication : DWORD (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; Comment : WCHAR (+104, 122byte) varptr(st)+104 を基点に操作(122byte:入れ子/配列)
; LogonUserName : WCHAR (+226, 42byte) varptr(st)+226 を基点に操作(42byte:入れ子/配列)
; LogonDomain : WCHAR (+268, 36byte) varptr(st)+268 を基点に操作(36byte:入れ子/配列)
; WorkDirectory : WCHAR (+304, 522byte) varptr(st)+304 を基点に操作(522byte:入れ子/配列)
; InitialProgram : WCHAR (+826, 522byte) varptr(st)+826 を基点に操作(522byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WTSLISTENERCONFIGW
#field int version
#field int fEnableListener
#field int MaxConnectionCount
#field int fPromptForPassword
#field int fInheritColorDepth
#field int ColorDepth
#field int fInheritBrokenTimeoutSettings
#field int BrokenTimeoutSettings
#field int fDisablePrinterRedirection
#field int fDisableDriveRedirection
#field int fDisableComPortRedirection
#field int fDisableLPTPortRedirection
#field int fDisableClipboardRedirection
#field int fDisableAudioRedirection
#field int fDisablePNPRedirection
#field int fDisableDefaultMainClientPrinter
#field int LanAdapter
#field int PortNumber
#field int fInheritShadowSettings
#field int ShadowSettings
#field int TimeoutSettingsConnection
#field int TimeoutSettingsDisconnection
#field int TimeoutSettingsIdle
#field int SecurityLayer
#field int MinEncryptionLevel
#field int UserAuthentication
#field wchar Comment 61
#field wchar LogonUserName 21
#field wchar LogonDomain 18
#field wchar WorkDirectory 261
#field wchar InitialProgram 261
#endstruct
stdim st, WTSLISTENERCONFIGW ; NSTRUCT 変数を確保
st->version = 100
mes "version=" + st->version