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

WTSLISTENERCONFIGW

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

サイズ=各フィールドのバイト数(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

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

UserAuthenticationDWORD4+100+100

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

0

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

1

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

CommentWCHAR122+104+104リスナーの説明を格納する、NULL で終わる文字列です。
LogonUserNameWCHAR42+226+226自動ログオンのシナリオで使用されるユーザー名を格納する、NULL で終わる文字列です。
LogonDomainWCHAR36+268+268自動ログオンのシナリオで使用されるドメイン名を格納する、NULL で終わる文字列です。
WorkDirectoryWCHAR522+304+304初期プログラムの作業ディレクトリのパスを格納する、NULL で終わる文字列です。
InitialProgramWCHAR522+826+826

ユーザーがサーバーにログオンした直後に起動するプログラムの名前を格納する、NULL で終わる文字列です。

- BrokenTimeoutSettings.0

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

- BrokenTimeoutSettings.1

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

- ColorDepth.1

8 ビット

- ColorDepth.2

15 ビット

- ColorDepth.3

16 ビット

- ColorDepth.4

24 ビット

- ColorDepth.5

32 ビット

- MinEncryptionLevel.1

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

- MinEncryptionLevel.2

クライアントからサーバーへ、およびサーバーからクライアントへ送信されるすべてのデータが、クライアントがサポートする最大のキー強度で暗号化されます。

- MinEncryptionLevel.3

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

- MinEncryptionLevel.4

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

- SecurityLayer.0

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

- SecurityLayer.1

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

- SecurityLayer.2

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

- ShadowSettings.0

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

- ShadowSettings.1

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

- ShadowSettings.2

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

- ShadowSettings.3

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

- ShadowSettings.4

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

- UserAuthentication.0

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

- UserAuthentication.1

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

- fDisableAudioRedirection.0

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

- fDisableAudioRedirection.1

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

- fDisableClipboardRedirection.0

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

- fDisableClipboardRedirection.1

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

- fDisableComPortRedirection.0

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

- fDisableComPortRedirection.1

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

- fDisableDefaultMainClientPrinter.0

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

- fDisableDefaultMainClientPrinter.1

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

- fDisableDriveRedirection.0

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

- fDisableDriveRedirection.1

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

- fDisableLPTPortRedirection.0

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

- fDisableLPTPortRedirection.1

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

- fDisablePNPRedirection.0

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

- fDisablePNPRedirection.1

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

- fDisablePrinterRedirection.0

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

- fDisablePrinterRedirection.1

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

- fEnableListener.0

リスナーは無効です。

- fEnableListener.1

リスナーは有効です。

- fInheritBrokenTimeoutSettings.0

サーバーで指定された BrokenTimeoutSettings の値を使用します。

- fInheritBrokenTimeoutSettings.1

ユーザーが指定した BrokenTimeoutSettings の値を使用します。

- fInheritColorDepth.0

サーバーで指定された色深度を使用します。

- fInheritColorDepth.1

ユーザーが指定した色深度を使用します。

- fInheritShadowSettings.0

サーバーで指定された設定を使用します。

- fInheritShadowSettings.1

ユーザーが指定した設定を使用します。

- fPromptForPassword.0

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

- fPromptForPassword.1

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

公式ドキュメント

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

解説(Remarks)

メモ

wtsapi32.h ヘッダーは、UNICODE プリプロセッサ定数の定義に基づいて、この関数の ANSI 版または Unicode 版を自動的に選択するエイリアスとして WTSLISTENERCONFIG を定義しています。エンコードに依存しないこのエイリアスの使用と、エンコードに依存するコードを混在させると、不一致が生じ、コンパイル エラーや実行時エラーの原因となる可能性があります。詳細については、「Conventions for Function Prototypes」を参照してください。

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

各言語での定義

#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 Structure
import 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