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

WRDS_LISTENER_SETTING

共用体
サイズx64: 16 バイト / x86: 12 バイト

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

フィールド

フィールドサイズx64x86説明
WRdsListenerSettings1WRDS_LISTENER_SETTINGS_116/12+0+0レベル1のリスナー設定。WRDS_LISTENER_SETTINGS_1で表す共用体メンバー。

各言語での定義

#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;
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;
}
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
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),
    ]
#[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,
}
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_1 = record
    MaxProtocolListenerConnectionCount: DWORD;
    SecurityDescriptorSize: DWORD;
    pSecurityDescriptor: Pointer;
  end;

  WRDS_LISTENER_SETTING = record
    WRdsListenerSettings1: WRDS_LISTENER_SETTINGS_1;
  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,
};
type
  WRDS_LISTENER_SETTINGS_1 {.bycopy.} = object
    MaxProtocolListenerConnectionCount: uint32
    SecurityDescriptorSize: uint32
    pSecurityDescriptor: pointer

  WRDS_LISTENER_SETTING {.bycopy.} = object
    WRdsListenerSettings1: WRDS_LISTENER_SETTINGS_1
struct WRDS_LISTENER_SETTINGS_1
{
    uint MaxProtocolListenerConnectionCount;
    uint SecurityDescriptorSize;
    void* pSecurityDescriptor;
}

struct WRDS_LISTENER_SETTING
{
    WRDS_LISTENER_SETTINGS_1 WRdsListenerSettings1;
}

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_SETTING サイズ: 12 バイト(x86)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; WRdsListenerSettings1 : WRDS_LISTENER_SETTINGS_1 (+0, 12byte)  varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WRDS_LISTENER_SETTING サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; WRdsListenerSettings1 : WRDS_LISTENER_SETTINGS_1 (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WRDS_LISTENER_SETTINGS_1
    #field int MaxProtocolListenerConnectionCount
    #field int SecurityDescriptorSize
    #field intptr pSecurityDescriptor
#endstruct

#defstruct global WRDS_LISTENER_SETTING
    #field WRDS_LISTENER_SETTINGS_1 WRdsListenerSettings1
#endstruct

stdim st, WRDS_LISTENER_SETTING        ; NSTRUCT 変数を確保