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

RPC_ENDPOINT_TEMPLATEW

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

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0この構造体のバージョン。
ProtSeqLPWSTR8/4+8+4プロトコルシーケンス名。LPWSTR型。
EndpointLPWSTR8/4+16+8エンドポイント名。LPWSTR型。
SecurityDescriptorvoid*8/4+24+12エンドポイントに適用するセキュリティ記述子へのポインター。NULL可。
BacklogDWORD4+32+16接続バックログ(待ち行列)の最大数。

各言語での定義

#include <windows.h>

// RPC_ENDPOINT_TEMPLATEW  (x64 40 / x86 20 バイト)
typedef struct RPC_ENDPOINT_TEMPLATEW {
    DWORD Version;
    LPWSTR ProtSeq;
    LPWSTR Endpoint;
    void* SecurityDescriptor;
    DWORD Backlog;
} RPC_ENDPOINT_TEMPLATEW;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RPC_ENDPOINT_TEMPLATEW
{
    public uint Version;
    public IntPtr ProtSeq;
    public IntPtr Endpoint;
    public IntPtr SecurityDescriptor;
    public uint Backlog;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RPC_ENDPOINT_TEMPLATEW
    Public Version As UInteger
    Public ProtSeq As IntPtr
    Public Endpoint As IntPtr
    Public SecurityDescriptor As IntPtr
    Public Backlog As UInteger
End Structure
import ctypes
from ctypes import wintypes

class RPC_ENDPOINT_TEMPLATEW(ctypes.Structure):
    _fields_ = [
        ("Version", wintypes.DWORD),
        ("ProtSeq", ctypes.c_void_p),
        ("Endpoint", ctypes.c_void_p),
        ("SecurityDescriptor", ctypes.c_void_p),
        ("Backlog", wintypes.DWORD),
    ]
#[repr(C)]
pub struct RPC_ENDPOINT_TEMPLATEW {
    pub Version: u32,
    pub ProtSeq: *mut core::ffi::c_void,
    pub Endpoint: *mut core::ffi::c_void,
    pub SecurityDescriptor: *mut core::ffi::c_void,
    pub Backlog: u32,
}
import "golang.org/x/sys/windows"

type RPC_ENDPOINT_TEMPLATEW struct {
	Version uint32
	ProtSeq uintptr
	Endpoint uintptr
	SecurityDescriptor uintptr
	Backlog uint32
}
type
  RPC_ENDPOINT_TEMPLATEW = record
    Version: DWORD;
    ProtSeq: Pointer;
    Endpoint: Pointer;
    SecurityDescriptor: Pointer;
    Backlog: DWORD;
  end;
const RPC_ENDPOINT_TEMPLATEW = extern struct {
    Version: u32,
    ProtSeq: ?*anyopaque,
    Endpoint: ?*anyopaque,
    SecurityDescriptor: ?*anyopaque,
    Backlog: u32,
};
type
  RPC_ENDPOINT_TEMPLATEW {.bycopy.} = object
    Version: uint32
    ProtSeq: pointer
    Endpoint: pointer
    SecurityDescriptor: pointer
    Backlog: uint32
struct RPC_ENDPOINT_TEMPLATEW
{
    uint Version;
    void* ProtSeq;
    void* Endpoint;
    void* SecurityDescriptor;
    uint Backlog;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RPC_ENDPOINT_TEMPLATEW サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ProtSeq : LPWSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Endpoint : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; SecurityDescriptor : void* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Backlog : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RPC_ENDPOINT_TEMPLATEW サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ProtSeq : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Endpoint : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; SecurityDescriptor : void* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Backlog : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RPC_ENDPOINT_TEMPLATEW
    #field int Version
    #field intptr ProtSeq
    #field intptr Endpoint
    #field intptr SecurityDescriptor
    #field int Backlog
#endstruct

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