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

WRDS_LISTENER_SETTINGS

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

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

フィールド

フィールドサイズx64x86説明
WRdsListenerSettingLevelWRDS_LISTENER_SETTING_LEVEL4+0+0リスナー設定のレベルを示す列挙値。共用体の解釈を決める。
WRdsListenerSettingWRDS_LISTENER_SETTING16/12+8+4レベルに応じたリスナー設定本体。WRDS_LISTENER_SETTING共用体。

各言語での定義

#include <windows.h>

// 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;
using System;
using System.Runtime.InteropServices;

[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;
}
Imports System.Runtime.InteropServices

<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
import ctypes
from ctypes import wintypes

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),
    ]
#[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,
}
import "golang.org/x/sys/windows"

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_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;
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,
};
type
  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
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;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WRDS_LISTENER_SETTINGS サイズ: 16 バイト(x86)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; WRdsListenerSettingLevel : WRDS_LISTENER_SETTING_LEVEL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; WRdsListenerSetting : WRDS_LISTENER_SETTING (+4, 12byte)  varptr(st)+4 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WRDS_LISTENER_SETTINGS サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; WRdsListenerSettingLevel : WRDS_LISTENER_SETTING_LEVEL (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; WRdsListenerSetting : WRDS_LISTENER_SETTING (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WRDS_LISTENER_SETTINGS
    #field int WRdsListenerSettingLevel
    #field byte WRdsListenerSetting 16
#endstruct

stdim st, WRDS_LISTENER_SETTINGS        ; NSTRUCT 変数を確保
st->WRdsListenerSettingLevel = 100
mes "WRdsListenerSettingLevel=" + st->WRdsListenerSettingLevel
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。