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

RPC_CALL_ATTRIBUTES_V3_W

構造体
サイズx64: 120 バイト / x86: 92 バイト

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0この構造体のバージョン。3を指定する。
FlagsDWORD4+4+4取得する属性を指定するフラグ。
ServerPrincipalNameBufferLengthDWORD4+8+8サーバープリンシパル名バッファの長さをバイト単位で表す。
ServerPrincipalNameWORD*8/4+16+12サーバーのプリンシパル名。Unicode(WORD)文字列へのポインター。
ClientPrincipalNameBufferLengthDWORD4+24+16クライアントプリンシパル名バッファの長さをバイト単位で表す。
ClientPrincipalNameWORD*8/4+32+20クライアントのプリンシパル名。Unicode(WORD)文字列へのポインター。
AuthenticationLevelDWORD4+40+24呼び出しの認証レベルを示す値。
AuthenticationServiceDWORD4+44+28使用された認証サービスの識別子。
NullSessionBOOL4+48+32NULLセッションでの呼び出しかを示すフラグ。BOOL型。
KernelModeCallerBOOL4+52+36カーネルモードからの呼び出しかを示すフラグ。BOOL型。
ProtocolSequenceDWORD4+56+40使用されたプロトコルシーケンスの識別子。
IsClientLocalRpcCallClientLocality4+60+44クライアントがローカルかを示す値。RpcCallClientLocalityで表す。
ClientPIDHANDLE8/4+64+48クライアントプロセスのID(ハンドルとして格納)。
CallStatusDWORD4+72+52呼び出しの現在のステータス。
CallTypeRpcCallType4+76+56呼び出しの種別。RpcCallTypeで表す。
CallLocalAddressRPC_CALL_LOCAL_ADDRESS_V1*8/4+80+60呼び出しを受けたローカルアドレスへのポインター。
OpNumWORD2+88+64呼び出されたプロシージャのオペレーション番号。
InterfaceUuidGUID16+92+68呼び出されたインターフェイスのUUID。
ClientIdentifierBufferLengthDWORD4+108+84クライアント識別子バッファの長さをバイト単位で表す。
ClientIdentifierBYTE*8/4+112+88クライアントを識別するデータへのポインター。BYTE配列。

各言語での定義

#include <windows.h>

// RPC_CALL_ATTRIBUTES_V3_W  (x64 120 / x86 92 バイト)
typedef struct RPC_CALL_ATTRIBUTES_V3_W {
    DWORD Version;
    DWORD Flags;
    DWORD ServerPrincipalNameBufferLength;
    WORD* ServerPrincipalName;
    DWORD ClientPrincipalNameBufferLength;
    WORD* ClientPrincipalName;
    DWORD AuthenticationLevel;
    DWORD AuthenticationService;
    BOOL NullSession;
    BOOL KernelModeCaller;
    DWORD ProtocolSequence;
    RpcCallClientLocality IsClientLocal;
    HANDLE ClientPID;
    DWORD CallStatus;
    RpcCallType CallType;
    RPC_CALL_LOCAL_ADDRESS_V1* CallLocalAddress;
    WORD OpNum;
    GUID InterfaceUuid;
    DWORD ClientIdentifierBufferLength;
    BYTE* ClientIdentifier;
} RPC_CALL_ATTRIBUTES_V3_W;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RPC_CALL_ATTRIBUTES_V3_W
{
    public uint Version;
    public uint Flags;
    public uint ServerPrincipalNameBufferLength;
    public IntPtr ServerPrincipalName;
    public uint ClientPrincipalNameBufferLength;
    public IntPtr ClientPrincipalName;
    public uint AuthenticationLevel;
    public uint AuthenticationService;
    [MarshalAs(UnmanagedType.Bool)] public bool NullSession;
    [MarshalAs(UnmanagedType.Bool)] public bool KernelModeCaller;
    public uint ProtocolSequence;
    public int IsClientLocal;
    public IntPtr ClientPID;
    public uint CallStatus;
    public int CallType;
    public IntPtr CallLocalAddress;
    public ushort OpNum;
    public Guid InterfaceUuid;
    public uint ClientIdentifierBufferLength;
    public IntPtr ClientIdentifier;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RPC_CALL_ATTRIBUTES_V3_W
    Public Version As UInteger
    Public Flags As UInteger
    Public ServerPrincipalNameBufferLength As UInteger
    Public ServerPrincipalName As IntPtr
    Public ClientPrincipalNameBufferLength As UInteger
    Public ClientPrincipalName As IntPtr
    Public AuthenticationLevel As UInteger
    Public AuthenticationService As UInteger
    <MarshalAs(UnmanagedType.Bool)> Public NullSession As Boolean
    <MarshalAs(UnmanagedType.Bool)> Public KernelModeCaller As Boolean
    Public ProtocolSequence As UInteger
    Public IsClientLocal As Integer
    Public ClientPID As IntPtr
    Public CallStatus As UInteger
    Public CallType As Integer
    Public CallLocalAddress As IntPtr
    Public OpNum As UShort
    Public InterfaceUuid As Guid
    Public ClientIdentifierBufferLength As UInteger
    Public ClientIdentifier As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class RPC_CALL_ATTRIBUTES_V3_W(ctypes.Structure):
    _fields_ = [
        ("Version", wintypes.DWORD),
        ("Flags", wintypes.DWORD),
        ("ServerPrincipalNameBufferLength", wintypes.DWORD),
        ("ServerPrincipalName", ctypes.c_void_p),
        ("ClientPrincipalNameBufferLength", wintypes.DWORD),
        ("ClientPrincipalName", ctypes.c_void_p),
        ("AuthenticationLevel", wintypes.DWORD),
        ("AuthenticationService", wintypes.DWORD),
        ("NullSession", wintypes.BOOL),
        ("KernelModeCaller", wintypes.BOOL),
        ("ProtocolSequence", wintypes.DWORD),
        ("IsClientLocal", ctypes.c_int),
        ("ClientPID", ctypes.c_void_p),
        ("CallStatus", wintypes.DWORD),
        ("CallType", ctypes.c_int),
        ("CallLocalAddress", ctypes.c_void_p),
        ("OpNum", ctypes.c_ushort),
        ("InterfaceUuid", GUID),
        ("ClientIdentifierBufferLength", wintypes.DWORD),
        ("ClientIdentifier", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct RPC_CALL_ATTRIBUTES_V3_W {
    pub Version: u32,
    pub Flags: u32,
    pub ServerPrincipalNameBufferLength: u32,
    pub ServerPrincipalName: *mut core::ffi::c_void,
    pub ClientPrincipalNameBufferLength: u32,
    pub ClientPrincipalName: *mut core::ffi::c_void,
    pub AuthenticationLevel: u32,
    pub AuthenticationService: u32,
    pub NullSession: i32,
    pub KernelModeCaller: i32,
    pub ProtocolSequence: u32,
    pub IsClientLocal: i32,
    pub ClientPID: *mut core::ffi::c_void,
    pub CallStatus: u32,
    pub CallType: i32,
    pub CallLocalAddress: *mut core::ffi::c_void,
    pub OpNum: u16,
    pub InterfaceUuid: GUID,
    pub ClientIdentifierBufferLength: u32,
    pub ClientIdentifier: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type RPC_CALL_ATTRIBUTES_V3_W struct {
	Version uint32
	Flags uint32
	ServerPrincipalNameBufferLength uint32
	ServerPrincipalName uintptr
	ClientPrincipalNameBufferLength uint32
	ClientPrincipalName uintptr
	AuthenticationLevel uint32
	AuthenticationService uint32
	NullSession int32
	KernelModeCaller int32
	ProtocolSequence uint32
	IsClientLocal int32
	ClientPID uintptr
	CallStatus uint32
	CallType int32
	CallLocalAddress uintptr
	OpNum uint16
	InterfaceUuid windows.GUID
	ClientIdentifierBufferLength uint32
	ClientIdentifier uintptr
}
type
  RPC_CALL_ATTRIBUTES_V3_W = record
    Version: DWORD;
    Flags: DWORD;
    ServerPrincipalNameBufferLength: DWORD;
    ServerPrincipalName: Pointer;
    ClientPrincipalNameBufferLength: DWORD;
    ClientPrincipalName: Pointer;
    AuthenticationLevel: DWORD;
    AuthenticationService: DWORD;
    NullSession: BOOL;
    KernelModeCaller: BOOL;
    ProtocolSequence: DWORD;
    IsClientLocal: Integer;
    ClientPID: Pointer;
    CallStatus: DWORD;
    CallType: Integer;
    CallLocalAddress: Pointer;
    OpNum: Word;
    InterfaceUuid: TGUID;
    ClientIdentifierBufferLength: DWORD;
    ClientIdentifier: Pointer;
  end;
const RPC_CALL_ATTRIBUTES_V3_W = extern struct {
    Version: u32,
    Flags: u32,
    ServerPrincipalNameBufferLength: u32,
    ServerPrincipalName: ?*anyopaque,
    ClientPrincipalNameBufferLength: u32,
    ClientPrincipalName: ?*anyopaque,
    AuthenticationLevel: u32,
    AuthenticationService: u32,
    NullSession: i32,
    KernelModeCaller: i32,
    ProtocolSequence: u32,
    IsClientLocal: i32,
    ClientPID: ?*anyopaque,
    CallStatus: u32,
    CallType: i32,
    CallLocalAddress: ?*anyopaque,
    OpNum: u16,
    InterfaceUuid: GUID,
    ClientIdentifierBufferLength: u32,
    ClientIdentifier: ?*anyopaque,
};
type
  RPC_CALL_ATTRIBUTES_V3_W {.bycopy.} = object
    Version: uint32
    Flags: uint32
    ServerPrincipalNameBufferLength: uint32
    ServerPrincipalName: pointer
    ClientPrincipalNameBufferLength: uint32
    ClientPrincipalName: pointer
    AuthenticationLevel: uint32
    AuthenticationService: uint32
    NullSession: int32
    KernelModeCaller: int32
    ProtocolSequence: uint32
    IsClientLocal: int32
    ClientPID: pointer
    CallStatus: uint32
    CallType: int32
    CallLocalAddress: pointer
    OpNum: uint16
    InterfaceUuid: GUID
    ClientIdentifierBufferLength: uint32
    ClientIdentifier: pointer
struct RPC_CALL_ATTRIBUTES_V3_W
{
    uint Version;
    uint Flags;
    uint ServerPrincipalNameBufferLength;
    void* ServerPrincipalName;
    uint ClientPrincipalNameBufferLength;
    void* ClientPrincipalName;
    uint AuthenticationLevel;
    uint AuthenticationService;
    int NullSession;
    int KernelModeCaller;
    uint ProtocolSequence;
    int IsClientLocal;
    void* ClientPID;
    uint CallStatus;
    int CallType;
    void* CallLocalAddress;
    ushort OpNum;
    GUID InterfaceUuid;
    uint ClientIdentifierBufferLength;
    void* ClientIdentifier;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; RPC_CALL_ATTRIBUTES_V3_W サイズ: 92 バイト(x86)
dim st, 23    ; 4byte整数×23(構造体サイズ 92 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ServerPrincipalNameBufferLength : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ServerPrincipalName : WORD* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ClientPrincipalNameBufferLength : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ClientPrincipalName : WORD* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; AuthenticationLevel : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; AuthenticationService : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; NullSession : BOOL (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; KernelModeCaller : BOOL (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ProtocolSequence : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; IsClientLocal : RpcCallClientLocality (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ClientPID : HANDLE (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; CallStatus : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; CallType : RpcCallType (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; CallLocalAddress : RPC_CALL_LOCAL_ADDRESS_V1* (+60, 4byte)  varptr(st)+60 を基点に操作(4byte:入れ子/配列)
; OpNum : WORD (+64, 2byte)  wpoke st,64,値  /  値 = wpeek(st,64)
; InterfaceUuid : GUID (+68, 16byte)  varptr(st)+68 を基点に操作(16byte:入れ子/配列)
; ClientIdentifierBufferLength : DWORD (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; ClientIdentifier : BYTE* (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RPC_CALL_ATTRIBUTES_V3_W サイズ: 120 バイト(x64)
dim st, 30    ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ServerPrincipalNameBufferLength : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ServerPrincipalName : WORD* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ClientPrincipalNameBufferLength : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ClientPrincipalName : WORD* (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; AuthenticationLevel : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; AuthenticationService : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; NullSession : BOOL (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; KernelModeCaller : BOOL (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ProtocolSequence : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; IsClientLocal : RpcCallClientLocality (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; ClientPID : HANDLE (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; CallStatus : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; CallType : RpcCallType (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; CallLocalAddress : RPC_CALL_LOCAL_ADDRESS_V1* (+80, 8byte)  varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; OpNum : WORD (+88, 2byte)  wpoke st,88,値  /  値 = wpeek(st,88)
; InterfaceUuid : GUID (+92, 16byte)  varptr(st)+92 を基点に操作(16byte:入れ子/配列)
; ClientIdentifierBufferLength : DWORD (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; ClientIdentifier : BYTE* (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global RPC_CALL_ATTRIBUTES_V3_W
    #field int Version
    #field int Flags
    #field int ServerPrincipalNameBufferLength
    #field intptr ServerPrincipalName
    #field int ClientPrincipalNameBufferLength
    #field intptr ClientPrincipalName
    #field int AuthenticationLevel
    #field int AuthenticationService
    #field bool NullSession
    #field bool KernelModeCaller
    #field int ProtocolSequence
    #field int IsClientLocal
    #field intptr ClientPID
    #field int CallStatus
    #field int CallType
    #field intptr CallLocalAddress
    #field short OpNum
    #field GUID InterfaceUuid
    #field int ClientIdentifierBufferLength
    #field intptr ClientIdentifier
#endstruct

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