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

WTSLISTENERCONFIGA

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

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

フィールド

フィールドサイズx64x86説明
versionDWORD4+0+0このメンバーは予約済みです。
fEnableListenerDWORD4+4+4

リスナーが有効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

リスナーは無効です。

1

リスナーは有効です。

MaxConnectionCountDWORD4+8+8リスナーが受け入れるアクティブな接続の最大数です。
fPromptForPasswordDWORD4+12+12

リスナーが常にユーザーにパスワードの入力を求めるかどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

サーバーによって指定された場合にのみ、ユーザーにパスワードの入力を求めます。

1

常にユーザーにパスワードの入力を求めます。

fInheritColorDepthDWORD4+16+16

リスナーがユーザーによって指定された色深度を使用するかどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

サーバーによって指定された色深度を使用します。

1

ユーザーによって指定された色深度を使用します。

ColorDepthDWORD4+20+20

リスナーの色深度の設定です。この設定は fInheritColorDepth メンバーが 0 の場合にのみ適用されます。次のいずれかの値を指定できます。

1

8 ビット

2

15 ビット

3

16 ビット

4

24 ビット

5

32 ビット

fInheritBrokenTimeoutSettingsDWORD4+24+24

リスナーがユーザーによって指定された BrokenTimeoutSettings の値を使用するかどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

サーバーによって指定された BrokenTimeoutSettings の値を使用します。

1

ユーザーによって指定された BrokenTimeoutSettings の値を使用します。

BrokenTimeoutSettingsDWORD4+28+28

接続タイマーまたはアイドル タイマーが満了したとき、あるいは接続エラーによって接続が失われたときにリスナーが行う動作です。この設定は fInheritBrokenTimeoutSettings メンバーが 0 の場合にのみ適用されます。このメンバーには次のいずれかの値を指定できます。

0

接続タイマーまたはアイドル タイマーが満了したとき、あるいは接続エラーによって接続が失われたときに、ユーザーは切断されますが、セッションはサーバー上に残ります。

1

接続タイマーまたはアイドル タイマーが満了したとき、あるいは接続エラーによって接続が失われたときに、セッションは終了されます。

fDisablePrinterRedirectionDWORD4+32+32

プリンター リダイレクトが無効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ユーザーはプリンター リダイレクトを有効にできます。

1

プリンター リダイレクトは無効です。

fDisableDriveRedirectionDWORD4+36+36

ドライブ リダイレクトが無効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ユーザーはドライブ リダイレクトを有効にできます。

1

ドライブ リダイレクトは無効です。

fDisableComPortRedirectionDWORD4+40+40

COM ポート リダイレクトが無効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ユーザーは COM ポート リダイレクトを有効にできます。

1

COM ポート リダイレクトは無効です。

fDisableLPTPortRedirectionDWORD4+44+44

LPT ポート リダイレクトが無効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ユーザーは LPT ポート リダイレクトを有効にできます。

1

LPT ポート リダイレクトは無効です。

fDisableClipboardRedirectionDWORD4+48+48

クリップボード リダイレクトが無効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ユーザーはクリップボード リダイレクトを有効にできます。

1

クリップボード リダイレクトは無効です。

fDisableAudioRedirectionDWORD4+52+52

オーディオ リダイレクトが無効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ユーザーはオーディオ リダイレクトを有効にできます。

1

オーディオ リダイレクトは無効です。

fDisablePNPRedirectionDWORD4+56+56

プラグ アンド プレイ リダイレクトが無効かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ユーザーはプラグ アンド プレイ リダイレクトを有効にできます。

1

プラグ アンド プレイ リダイレクトは無効です。

fDisableDefaultMainClientPrinterDWORD4+60+60

クライアントのプリンターを既定のプリンターにするかどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

クライアントのプリンターは既定のプリンターではありません。

1

クライアントのプリンターは既定のプリンターです。

LanAdapterDWORD4+64+64リスナーが使用するネットワーク アダプターです。
PortNumberDWORD4+68+68リスナーのポート番号です。
fInheritShadowSettingsDWORD4+72+72

リスナーがユーザーによって指定された ShadowSettings の値を使用するかどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

サーバーによって指定された設定を使用します。

1

ユーザーによって指定された設定を使用します。

ShadowSettingsDWORD4+76+76

リスナーのリモート コントロールの設定です。リモート コントロールを使用すると、あるユーザーが別のユーザーの画面上の操作をリモートで監視できます。この設定は fInheritShadowSettings メンバーが 0 の場合にのみ適用されます。このメンバーには次のいずれかの値を指定できます。

0

リモート コントロールは無効です。

1

リモート コントロールを行うユーザーは、対象ユーザーの許可を得たうえで、そのユーザーのセッションを完全に制御できます。

2

リモート コントロールを行うユーザーは、対象ユーザーのセッションを完全に制御できます。対象ユーザーの許可は必要ありません。

3

リモート コントロールを行うユーザーは、対象ユーザーの許可を得たうえで、セッションをリモートで表示できます。リモート ユーザーがセッションを能動的に制御することはできません。

4

リモート コントロールを行うユーザーは、セッションをリモートで表示できますが、能動的に制御することはできません。対象ユーザーの許可は必要ありません。

TimeoutSettingsConnectionDWORD4+80+80接続の最大継続時間 (ミリ秒単位) です。ユーザーがログオンするたびにタイマーはリセットされます。値が 0 の場合、接続タイマーは無効であることを示します。
TimeoutSettingsDisconnectionDWORD4+84+84ログオンが終了されるまで、サーバーが切断されたセッションを保持する最大時間 (ミリ秒単位) です。値が 0 の場合、切断タイマーは無効であることを示します。
TimeoutSettingsIdleDWORD4+88+88最大アイドル時間 (ミリ秒単位) です。値が 0 の場合、アイドル タイマーは無効であることを示します。
SecurityLayerDWORD4+92+92

リスナーのセキュリティ レイヤーです。このメンバーには次のいずれかの値を指定できます。

0

接続が確立される前の認証に、サーバーとクライアントがリモート デスクトップ プロトコル (RDP) を使用します。

1

接続が確立される前に、サーバーとクライアントが認証方法をネゴシエートします。

2

接続が確立される前の認証に、サーバーとクライアントが Transport Layer Security (TLS) プロトコルを使用します。

MinEncryptionLevelDWORD4+96+96

リスナーの暗号化レベルです。 このメンバーには次のいずれかの値を指定できます。

1

クライアントからサーバーへ送信されるデータは 56 ビット暗号化を使用して暗号化されます。サーバーからクライアントへ送信されるデータは暗号化されません。

2

クライアントからサーバーへ、およびサーバーからクライアントへ送信されるすべてのデータが、クライアントがサポートする最大の鍵長を使用して暗号化されます。

3

クライアントからサーバーへ、およびサーバーからクライアントへ送信されるすべてのデータが 128 ビット暗号化を使用して暗号化されます。このレベルの暗号化をサポートしないクライアントは接続できません。

4

クライアントからサーバーへ、およびサーバーからクライアントへ送信されるすべてのデータが、連邦情報処理標準 (FIPS) の暗号化アルゴリズムと Microsoft の暗号化モジュールを使用して暗号化および復号化されます。

UserAuthenticationDWORD4+100+100

接続が確立される前にネットワーク レベルのユーザー認証が必要かどうかを指定します。このメンバーには次のいずれかの値を指定できます。

0

ネットワーク レベルのユーザー認証は必要ありません。

1

ネットワーク レベルのユーザー認証が必要です。

CommentCHAR61+104+104リスナーの説明を格納する、null 終端の文字列です。
LogonUserNameCHAR21+165+165自動ログオンのシナリオで使用されるユーザー名を格納する、null 終端の文字列です。
LogonDomainCHAR18+186+186自動ログオンのシナリオで使用されるドメイン名を格納する、null 終端の文字列です。
WorkDirectoryCHAR261+204+204初期プログラムの作業ディレクトリのパスを格納する、null 終端の文字列です。
InitialProgramCHAR261+465+465ユーザーがサーバーにログオンした直後に開始するプログラムの名前を格納する、null 終端の文字列です。

公式ドキュメント

リモート デスクトップ サービスのリスナーに関する情報を格納します。この構造体は WTSCreateListener 関数で使用されます。

解説(Remarks)

メモ

wtsapi32.h ヘッダーは WTSLISTENERCONFIG をエイリアスとして定義しており、UNICODE プリプロセッサ定数の定義に応じて、この関数の ANSI 版と Unicode 版が自動的に選択されます。エンコーディング中立のエイリアスの使用と、エンコーディング中立でないコードを混在させると、不一致が生じ、コンパイル エラーや実行時エラーの原因となることがあります。詳細については、関数プロトタイプの表記規則を参照してください。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// WTSLISTENERCONFIGA  (x64 728 / x86 728 バイト)
typedef struct WTSLISTENERCONFIGA {
    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;
    CHAR Comment[61];
    CHAR LogonUserName[21];
    CHAR LogonDomain[18];
    CHAR WorkDirectory[261];
    CHAR InitialProgram[261];
} WTSLISTENERCONFIGA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTSLISTENERCONFIGA
{
    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.ByValArray, SizeConst = 61)] public sbyte[] Comment;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 21)] public sbyte[] LogonUserName;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)] public sbyte[] LogonDomain;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 261)] public sbyte[] WorkDirectory;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 261)] public sbyte[] InitialProgram;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTSLISTENERCONFIGA
    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.ByValArray, SizeConst:=61)> Public Comment() As SByte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=21)> Public LogonUserName() As SByte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=18)> Public LogonDomain() As SByte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=261)> Public WorkDirectory() As SByte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=261)> Public InitialProgram() As SByte
End Structure
import ctypes
from ctypes import wintypes

class WTSLISTENERCONFIGA(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_byte * 61),
        ("LogonUserName", ctypes.c_byte * 21),
        ("LogonDomain", ctypes.c_byte * 18),
        ("WorkDirectory", ctypes.c_byte * 261),
        ("InitialProgram", ctypes.c_byte * 261),
    ]
#[repr(C)]
pub struct WTSLISTENERCONFIGA {
    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: [i8; 61],
    pub LogonUserName: [i8; 21],
    pub LogonDomain: [i8; 18],
    pub WorkDirectory: [i8; 261],
    pub InitialProgram: [i8; 261],
}
import "golang.org/x/sys/windows"

type WTSLISTENERCONFIGA 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]int8
	LogonUserName [21]int8
	LogonDomain [18]int8
	WorkDirectory [261]int8
	InitialProgram [261]int8
}
type
  WTSLISTENERCONFIGA = 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 Shortint;
    LogonUserName: array[0..20] of Shortint;
    LogonDomain: array[0..17] of Shortint;
    WorkDirectory: array[0..260] of Shortint;
    InitialProgram: array[0..260] of Shortint;
  end;
const WTSLISTENERCONFIGA = 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]i8,
    LogonUserName: [21]i8,
    LogonDomain: [18]i8,
    WorkDirectory: [261]i8,
    InitialProgram: [261]i8,
};
type
  WTSLISTENERCONFIGA {.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, int8]
    LogonUserName: array[21, int8]
    LogonDomain: array[18, int8]
    WorkDirectory: array[261, int8]
    InitialProgram: array[261, int8]
struct WTSLISTENERCONFIGA
{
    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;
    byte[61] Comment;
    byte[21] LogonUserName;
    byte[18] LogonDomain;
    byte[261] WorkDirectory;
    byte[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 レイアウト)
; WTSLISTENERCONFIGA サイズ: 728 バイト(x64)
dim st, 182    ; 4byte整数×182(構造体サイズ 728 / 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 : CHAR (+104, 61byte)  varptr(st)+104 を基点に操作(61byte:入れ子/配列)
; LogonUserName : CHAR (+165, 21byte)  varptr(st)+165 を基点に操作(21byte:入れ子/配列)
; LogonDomain : CHAR (+186, 18byte)  varptr(st)+186 を基点に操作(18byte:入れ子/配列)
; WorkDirectory : CHAR (+204, 261byte)  varptr(st)+204 を基点に操作(261byte:入れ子/配列)
; InitialProgram : CHAR (+465, 261byte)  varptr(st)+465 を基点に操作(261byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WTSLISTENERCONFIGA
    #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 byte Comment 61
    #field byte LogonUserName 21
    #field byte LogonDomain 18
    #field byte WorkDirectory 261
    #field byte InitialProgram 261
#endstruct

stdim st, WTSLISTENERCONFIGA        ; NSTRUCT 変数を確保
st->version = 100
mes "version=" + st->version