ホーム › System.RemoteDesktop › WTSCONFIGINFOA
WTSCONFIGINFOA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| version | DWORD | 4 | +0 | +0 | この構成情報構造体のバージョン番号。 |
| fConnectClientDrivesAtLogon | DWORD | 4 | +4 | +4 | ログオン時にクライアントドライブを接続するか。 |
| fConnectPrinterAtLogon | DWORD | 4 | +8 | +8 | ログオン時にクライアントプリンタを接続するか。 |
| fDisablePrinterRedirection | DWORD | 4 | +12 | +12 | プリンタリダイレクトを無効にするかを示す。 |
| fDisableDefaultMainClientPrinter | DWORD | 4 | +16 | +16 | 既定メインクライアントプリンタを無効化するか。 |
| ShadowSettings | DWORD | 4 | +20 | +20 | セッションシャドウ(監視)の設定を示す値。 |
| LogonUserName | CHAR | 21 | +24 | +24 | ログオンユーザー名(ANSI)。 |
| LogonDomain | CHAR | 18 | +45 | +45 | ログオンドメイン名(ANSI)。 |
| WorkDirectory | CHAR | 261 | +63 | +63 | 作業ディレクトリのパス(ANSI)。 |
| InitialProgram | CHAR | 261 | +324 | +324 | 起動時に実行する初期プログラム(ANSI)。 |
| ApplicationName | CHAR | 261 | +585 | +585 | アプリケーション名(ANSI)。 |
各言語での定義
#include <windows.h>
// WTSCONFIGINFOA (x64 848 / x86 848 バイト)
typedef struct WTSCONFIGINFOA {
DWORD version;
DWORD fConnectClientDrivesAtLogon;
DWORD fConnectPrinterAtLogon;
DWORD fDisablePrinterRedirection;
DWORD fDisableDefaultMainClientPrinter;
DWORD ShadowSettings;
CHAR LogonUserName[21];
CHAR LogonDomain[18];
CHAR WorkDirectory[261];
CHAR InitialProgram[261];
CHAR ApplicationName[261];
} WTSCONFIGINFOA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTSCONFIGINFOA
{
public uint version;
public uint fConnectClientDrivesAtLogon;
public uint fConnectPrinterAtLogon;
public uint fDisablePrinterRedirection;
public uint fDisableDefaultMainClientPrinter;
public uint ShadowSettings;
[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;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 261)] public sbyte[] ApplicationName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTSCONFIGINFOA
Public version As UInteger
Public fConnectClientDrivesAtLogon As UInteger
Public fConnectPrinterAtLogon As UInteger
Public fDisablePrinterRedirection As UInteger
Public fDisableDefaultMainClientPrinter As UInteger
Public ShadowSettings As UInteger
<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
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=261)> Public ApplicationName() As SByte
End Structureimport ctypes
from ctypes import wintypes
class WTSCONFIGINFOA(ctypes.Structure):
_fields_ = [
("version", wintypes.DWORD),
("fConnectClientDrivesAtLogon", wintypes.DWORD),
("fConnectPrinterAtLogon", wintypes.DWORD),
("fDisablePrinterRedirection", wintypes.DWORD),
("fDisableDefaultMainClientPrinter", wintypes.DWORD),
("ShadowSettings", wintypes.DWORD),
("LogonUserName", ctypes.c_byte * 21),
("LogonDomain", ctypes.c_byte * 18),
("WorkDirectory", ctypes.c_byte * 261),
("InitialProgram", ctypes.c_byte * 261),
("ApplicationName", ctypes.c_byte * 261),
]#[repr(C)]
pub struct WTSCONFIGINFOA {
pub version: u32,
pub fConnectClientDrivesAtLogon: u32,
pub fConnectPrinterAtLogon: u32,
pub fDisablePrinterRedirection: u32,
pub fDisableDefaultMainClientPrinter: u32,
pub ShadowSettings: u32,
pub LogonUserName: [i8; 21],
pub LogonDomain: [i8; 18],
pub WorkDirectory: [i8; 261],
pub InitialProgram: [i8; 261],
pub ApplicationName: [i8; 261],
}import "golang.org/x/sys/windows"
type WTSCONFIGINFOA struct {
version uint32
fConnectClientDrivesAtLogon uint32
fConnectPrinterAtLogon uint32
fDisablePrinterRedirection uint32
fDisableDefaultMainClientPrinter uint32
ShadowSettings uint32
LogonUserName [21]int8
LogonDomain [18]int8
WorkDirectory [261]int8
InitialProgram [261]int8
ApplicationName [261]int8
}type
WTSCONFIGINFOA = record
version: DWORD;
fConnectClientDrivesAtLogon: DWORD;
fConnectPrinterAtLogon: DWORD;
fDisablePrinterRedirection: DWORD;
fDisableDefaultMainClientPrinter: DWORD;
ShadowSettings: DWORD;
LogonUserName: array[0..20] of Shortint;
LogonDomain: array[0..17] of Shortint;
WorkDirectory: array[0..260] of Shortint;
InitialProgram: array[0..260] of Shortint;
ApplicationName: array[0..260] of Shortint;
end;const WTSCONFIGINFOA = extern struct {
version: u32,
fConnectClientDrivesAtLogon: u32,
fConnectPrinterAtLogon: u32,
fDisablePrinterRedirection: u32,
fDisableDefaultMainClientPrinter: u32,
ShadowSettings: u32,
LogonUserName: [21]i8,
LogonDomain: [18]i8,
WorkDirectory: [261]i8,
InitialProgram: [261]i8,
ApplicationName: [261]i8,
};type
WTSCONFIGINFOA {.bycopy.} = object
version: uint32
fConnectClientDrivesAtLogon: uint32
fConnectPrinterAtLogon: uint32
fDisablePrinterRedirection: uint32
fDisableDefaultMainClientPrinter: uint32
ShadowSettings: uint32
LogonUserName: array[21, int8]
LogonDomain: array[18, int8]
WorkDirectory: array[261, int8]
InitialProgram: array[261, int8]
ApplicationName: array[261, int8]struct WTSCONFIGINFOA
{
uint version;
uint fConnectClientDrivesAtLogon;
uint fConnectPrinterAtLogon;
uint fDisablePrinterRedirection;
uint fDisableDefaultMainClientPrinter;
uint ShadowSettings;
byte[21] LogonUserName;
byte[18] LogonDomain;
byte[261] WorkDirectory;
byte[261] InitialProgram;
byte[261] ApplicationName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WTSCONFIGINFOA サイズ: 848 バイト(x64)
dim st, 212 ; 4byte整数×212(構造体サイズ 848 / 4 切り上げ)
; version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fConnectClientDrivesAtLogon : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fConnectPrinterAtLogon : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fDisablePrinterRedirection : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fDisableDefaultMainClientPrinter : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ShadowSettings : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; LogonUserName : CHAR (+24, 21byte) varptr(st)+24 を基点に操作(21byte:入れ子/配列)
; LogonDomain : CHAR (+45, 18byte) varptr(st)+45 を基点に操作(18byte:入れ子/配列)
; WorkDirectory : CHAR (+63, 261byte) varptr(st)+63 を基点に操作(261byte:入れ子/配列)
; InitialProgram : CHAR (+324, 261byte) varptr(st)+324 を基点に操作(261byte:入れ子/配列)
; ApplicationName : CHAR (+585, 261byte) varptr(st)+585 を基点に操作(261byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WTSCONFIGINFOA
#field int version
#field int fConnectClientDrivesAtLogon
#field int fConnectPrinterAtLogon
#field int fDisablePrinterRedirection
#field int fDisableDefaultMainClientPrinter
#field int ShadowSettings
#field byte LogonUserName 21
#field byte LogonDomain 18
#field byte WorkDirectory 261
#field byte InitialProgram 261
#field byte ApplicationName 261
#endstruct
stdim st, WTSCONFIGINFOA ; NSTRUCT 変数を確保
st->version = 100
mes "version=" + st->version