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

RPC_CALL_ATTRIBUTES_V1_W

構造体
サイズx64: 56 バイト / x86: 36 バイト

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0この構造体のバージョン。1を指定する。
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型。

各言語での定義

#include <windows.h>

// RPC_CALL_ATTRIBUTES_V1_W  (x64 56 / x86 36 バイト)
typedef struct RPC_CALL_ATTRIBUTES_V1_W {
    DWORD Version;
    DWORD Flags;
    DWORD ServerPrincipalNameBufferLength;
    WORD* ServerPrincipalName;
    DWORD ClientPrincipalNameBufferLength;
    WORD* ClientPrincipalName;
    DWORD AuthenticationLevel;
    DWORD AuthenticationService;
    BOOL NullSession;
} RPC_CALL_ATTRIBUTES_V1_W;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RPC_CALL_ATTRIBUTES_V1_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;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RPC_CALL_ATTRIBUTES_V1_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
End Structure
import ctypes
from ctypes import wintypes

class RPC_CALL_ATTRIBUTES_V1_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),
    ]
#[repr(C)]
pub struct RPC_CALL_ATTRIBUTES_V1_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,
}
import "golang.org/x/sys/windows"

type RPC_CALL_ATTRIBUTES_V1_W struct {
	Version uint32
	Flags uint32
	ServerPrincipalNameBufferLength uint32
	ServerPrincipalName uintptr
	ClientPrincipalNameBufferLength uint32
	ClientPrincipalName uintptr
	AuthenticationLevel uint32
	AuthenticationService uint32
	NullSession int32
}
type
  RPC_CALL_ATTRIBUTES_V1_W = record
    Version: DWORD;
    Flags: DWORD;
    ServerPrincipalNameBufferLength: DWORD;
    ServerPrincipalName: Pointer;
    ClientPrincipalNameBufferLength: DWORD;
    ClientPrincipalName: Pointer;
    AuthenticationLevel: DWORD;
    AuthenticationService: DWORD;
    NullSession: BOOL;
  end;
const RPC_CALL_ATTRIBUTES_V1_W = extern struct {
    Version: u32,
    Flags: u32,
    ServerPrincipalNameBufferLength: u32,
    ServerPrincipalName: ?*anyopaque,
    ClientPrincipalNameBufferLength: u32,
    ClientPrincipalName: ?*anyopaque,
    AuthenticationLevel: u32,
    AuthenticationService: u32,
    NullSession: i32,
};
type
  RPC_CALL_ATTRIBUTES_V1_W {.bycopy.} = object
    Version: uint32
    Flags: uint32
    ServerPrincipalNameBufferLength: uint32
    ServerPrincipalName: pointer
    ClientPrincipalNameBufferLength: uint32
    ClientPrincipalName: pointer
    AuthenticationLevel: uint32
    AuthenticationService: uint32
    NullSession: int32
struct RPC_CALL_ATTRIBUTES_V1_W
{
    uint Version;
    uint Flags;
    uint ServerPrincipalNameBufferLength;
    void* ServerPrincipalName;
    uint ClientPrincipalNameBufferLength;
    void* ClientPrincipalName;
    uint AuthenticationLevel;
    uint AuthenticationService;
    int NullSession;
}

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_V1_W サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 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 も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RPC_CALL_ATTRIBUTES_V1_W サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 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 も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RPC_CALL_ATTRIBUTES_V1_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
#endstruct

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