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

RPC_INTERFACE_TEMPLATEW

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

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0この構造体のバージョン。
IfSpecvoid*8/4+8+4インターフェイス仕様へのハンドル。
MgrTypeUuidGUID*8/4+16+8マネージャー型のUUIDへのポインター。GUID。NULL可。
MgrEpvvoid*8/4+24+12マネージャーのエントリーポイントベクターへのポインター。NULL可。
FlagsDWORD4+32+16インターフェイス登録の動作を制御するフラグ。
MaxCallsDWORD4+36+20同時に処理する最大呼び出し数。
MaxRpcSizeDWORD4+40+24受信RPCデータの最大サイズをバイト単位で表す。
IfCallbackRPC_IF_CALLBACK_FN8/4+48+28セキュリティ検証用のインターフェイスコールバック関数。
UuidVectorUUID_VECTOR*8/4+56+32オブジェクトUUIDのベクターへのポインター。NULL可。
AnnotationLPWSTR8/4+64+36エンドポイントマッパー登録用の注釈文字列。LPWSTR型。
SecurityDescriptorvoid*8/4+72+40インターフェイスに適用するセキュリティ記述子へのポインター。NULL可。

各言語での定義

#include <windows.h>

// RPC_INTERFACE_TEMPLATEW  (x64 80 / x86 44 バイト)
typedef struct RPC_INTERFACE_TEMPLATEW {
    DWORD Version;
    void* IfSpec;
    GUID* MgrTypeUuid;
    void* MgrEpv;
    DWORD Flags;
    DWORD MaxCalls;
    DWORD MaxRpcSize;
    RPC_IF_CALLBACK_FN IfCallback;
    UUID_VECTOR* UuidVector;
    LPWSTR Annotation;
    void* SecurityDescriptor;
} RPC_INTERFACE_TEMPLATEW;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RPC_INTERFACE_TEMPLATEW
{
    public uint Version;
    public IntPtr IfSpec;
    public IntPtr MgrTypeUuid;
    public IntPtr MgrEpv;
    public uint Flags;
    public uint MaxCalls;
    public uint MaxRpcSize;
    public IntPtr IfCallback;
    public IntPtr UuidVector;
    public IntPtr Annotation;
    public IntPtr SecurityDescriptor;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RPC_INTERFACE_TEMPLATEW
    Public Version As UInteger
    Public IfSpec As IntPtr
    Public MgrTypeUuid As IntPtr
    Public MgrEpv As IntPtr
    Public Flags As UInteger
    Public MaxCalls As UInteger
    Public MaxRpcSize As UInteger
    Public IfCallback As IntPtr
    Public UuidVector As IntPtr
    Public Annotation As IntPtr
    Public SecurityDescriptor As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class RPC_INTERFACE_TEMPLATEW(ctypes.Structure):
    _fields_ = [
        ("Version", wintypes.DWORD),
        ("IfSpec", ctypes.c_void_p),
        ("MgrTypeUuid", ctypes.c_void_p),
        ("MgrEpv", ctypes.c_void_p),
        ("Flags", wintypes.DWORD),
        ("MaxCalls", wintypes.DWORD),
        ("MaxRpcSize", wintypes.DWORD),
        ("IfCallback", ctypes.c_void_p),
        ("UuidVector", ctypes.c_void_p),
        ("Annotation", ctypes.c_void_p),
        ("SecurityDescriptor", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct RPC_INTERFACE_TEMPLATEW {
    pub Version: u32,
    pub IfSpec: *mut core::ffi::c_void,
    pub MgrTypeUuid: *mut core::ffi::c_void,
    pub MgrEpv: *mut core::ffi::c_void,
    pub Flags: u32,
    pub MaxCalls: u32,
    pub MaxRpcSize: u32,
    pub IfCallback: *mut core::ffi::c_void,
    pub UuidVector: *mut core::ffi::c_void,
    pub Annotation: *mut core::ffi::c_void,
    pub SecurityDescriptor: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type RPC_INTERFACE_TEMPLATEW struct {
	Version uint32
	IfSpec uintptr
	MgrTypeUuid uintptr
	MgrEpv uintptr
	Flags uint32
	MaxCalls uint32
	MaxRpcSize uint32
	IfCallback uintptr
	UuidVector uintptr
	Annotation uintptr
	SecurityDescriptor uintptr
}
type
  RPC_INTERFACE_TEMPLATEW = record
    Version: DWORD;
    IfSpec: Pointer;
    MgrTypeUuid: Pointer;
    MgrEpv: Pointer;
    Flags: DWORD;
    MaxCalls: DWORD;
    MaxRpcSize: DWORD;
    IfCallback: Pointer;
    UuidVector: Pointer;
    Annotation: Pointer;
    SecurityDescriptor: Pointer;
  end;
const RPC_INTERFACE_TEMPLATEW = extern struct {
    Version: u32,
    IfSpec: ?*anyopaque,
    MgrTypeUuid: ?*anyopaque,
    MgrEpv: ?*anyopaque,
    Flags: u32,
    MaxCalls: u32,
    MaxRpcSize: u32,
    IfCallback: ?*anyopaque,
    UuidVector: ?*anyopaque,
    Annotation: ?*anyopaque,
    SecurityDescriptor: ?*anyopaque,
};
type
  RPC_INTERFACE_TEMPLATEW {.bycopy.} = object
    Version: uint32
    IfSpec: pointer
    MgrTypeUuid: pointer
    MgrEpv: pointer
    Flags: uint32
    MaxCalls: uint32
    MaxRpcSize: uint32
    IfCallback: pointer
    UuidVector: pointer
    Annotation: pointer
    SecurityDescriptor: pointer
struct RPC_INTERFACE_TEMPLATEW
{
    uint Version;
    void* IfSpec;
    void* MgrTypeUuid;
    void* MgrEpv;
    uint Flags;
    uint MaxCalls;
    uint MaxRpcSize;
    void* IfCallback;
    void* UuidVector;
    void* Annotation;
    void* SecurityDescriptor;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RPC_INTERFACE_TEMPLATEW サイズ: 44 バイト(x86)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; IfSpec : void* (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; MgrTypeUuid : GUID* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; MgrEpv : void* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Flags : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; MaxCalls : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; MaxRpcSize : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; IfCallback : RPC_IF_CALLBACK_FN (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; UuidVector : UUID_VECTOR* (+32, 4byte)  varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; Annotation : LPWSTR (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; SecurityDescriptor : void* (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RPC_INTERFACE_TEMPLATEW サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; IfSpec : void* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; MgrTypeUuid : GUID* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; MgrEpv : void* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Flags : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; MaxCalls : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; MaxRpcSize : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; IfCallback : RPC_IF_CALLBACK_FN (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; UuidVector : UUID_VECTOR* (+56, 8byte)  varptr(st)+56 を基点に操作(8byte:入れ子/配列)
; Annotation : LPWSTR (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; SecurityDescriptor : void* (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RPC_INTERFACE_TEMPLATEW
    #field int Version
    #field intptr IfSpec
    #field intptr MgrTypeUuid
    #field intptr MgrEpv
    #field int Flags
    #field int MaxCalls
    #field int MaxRpcSize
    #field intptr IfCallback
    #field intptr UuidVector
    #field intptr Annotation
    #field intptr SecurityDescriptor
#endstruct

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