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

AAAccountingData

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

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

フィールド

フィールドサイズx64x86説明
userNameLPWSTR8/4+0+0接続したユーザーの名前。Unicode文字列。
clientNameLPWSTR8/4+8+4接続元クライアントの名前。Unicode文字列。
authTypeAAAuthSchemes4+16+8使用された認証スキームを示す列挙値。
resourceNameLPWSTR8/4+24+12アクセスされたリソースの名前。Unicode文字列。
portNumberINT4+32+16接続に使用されたポート番号。
protocolNameLPWSTR8/4+40+20使用された通信プロトコルの名前。Unicode文字列。
numberOfBytesReceivedINT4+48+24受信したバイト数。
numberOfBytesTransferedINT4+52+28送信したバイト数。
reasonForDisconnectLPWSTR8/4+56+32切断理由を示す文字列。Unicode文字列。
mainSessionIdGUID16+64+36メインセッションを識別するGUID。
subSessionIdINT4+80+52サブセッションの識別子。

各言語での定義

#include <windows.h>

// AAAccountingData  (x64 88 / x86 56 バイト)
typedef struct AAAccountingData {
    LPWSTR userName;
    LPWSTR clientName;
    AAAuthSchemes authType;
    LPWSTR resourceName;
    INT portNumber;
    LPWSTR protocolName;
    INT numberOfBytesReceived;
    INT numberOfBytesTransfered;
    LPWSTR reasonForDisconnect;
    GUID mainSessionId;
    INT subSessionId;
} AAAccountingData;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AAAccountingData
{
    public IntPtr userName;
    public IntPtr clientName;
    public int authType;
    public IntPtr resourceName;
    public int portNumber;
    public IntPtr protocolName;
    public int numberOfBytesReceived;
    public int numberOfBytesTransfered;
    public IntPtr reasonForDisconnect;
    public Guid mainSessionId;
    public int subSessionId;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AAAccountingData
    Public userName As IntPtr
    Public clientName As IntPtr
    Public authType As Integer
    Public resourceName As IntPtr
    Public portNumber As Integer
    Public protocolName As IntPtr
    Public numberOfBytesReceived As Integer
    Public numberOfBytesTransfered As Integer
    Public reasonForDisconnect As IntPtr
    Public mainSessionId As Guid
    Public subSessionId As Integer
End Structure
import ctypes
from ctypes import wintypes

class AAAccountingData(ctypes.Structure):
    _fields_ = [
        ("userName", ctypes.c_void_p),
        ("clientName", ctypes.c_void_p),
        ("authType", ctypes.c_int),
        ("resourceName", ctypes.c_void_p),
        ("portNumber", ctypes.c_int),
        ("protocolName", ctypes.c_void_p),
        ("numberOfBytesReceived", ctypes.c_int),
        ("numberOfBytesTransfered", ctypes.c_int),
        ("reasonForDisconnect", ctypes.c_void_p),
        ("mainSessionId", GUID),
        ("subSessionId", ctypes.c_int),
    ]
#[repr(C)]
pub struct AAAccountingData {
    pub userName: *mut core::ffi::c_void,
    pub clientName: *mut core::ffi::c_void,
    pub authType: i32,
    pub resourceName: *mut core::ffi::c_void,
    pub portNumber: i32,
    pub protocolName: *mut core::ffi::c_void,
    pub numberOfBytesReceived: i32,
    pub numberOfBytesTransfered: i32,
    pub reasonForDisconnect: *mut core::ffi::c_void,
    pub mainSessionId: GUID,
    pub subSessionId: i32,
}
import "golang.org/x/sys/windows"

type AAAccountingData struct {
	userName uintptr
	clientName uintptr
	authType int32
	resourceName uintptr
	portNumber int32
	protocolName uintptr
	numberOfBytesReceived int32
	numberOfBytesTransfered int32
	reasonForDisconnect uintptr
	mainSessionId windows.GUID
	subSessionId int32
}
type
  AAAccountingData = record
    userName: Pointer;
    clientName: Pointer;
    authType: Integer;
    resourceName: Pointer;
    portNumber: Integer;
    protocolName: Pointer;
    numberOfBytesReceived: Integer;
    numberOfBytesTransfered: Integer;
    reasonForDisconnect: Pointer;
    mainSessionId: TGUID;
    subSessionId: Integer;
  end;
const AAAccountingData = extern struct {
    userName: ?*anyopaque,
    clientName: ?*anyopaque,
    authType: i32,
    resourceName: ?*anyopaque,
    portNumber: i32,
    protocolName: ?*anyopaque,
    numberOfBytesReceived: i32,
    numberOfBytesTransfered: i32,
    reasonForDisconnect: ?*anyopaque,
    mainSessionId: GUID,
    subSessionId: i32,
};
type
  AAAccountingData {.bycopy.} = object
    userName: pointer
    clientName: pointer
    authType: int32
    resourceName: pointer
    portNumber: int32
    protocolName: pointer
    numberOfBytesReceived: int32
    numberOfBytesTransfered: int32
    reasonForDisconnect: pointer
    mainSessionId: GUID
    subSessionId: int32
struct AAAccountingData
{
    void* userName;
    void* clientName;
    int authType;
    void* resourceName;
    int portNumber;
    void* protocolName;
    int numberOfBytesReceived;
    int numberOfBytesTransfered;
    void* reasonForDisconnect;
    GUID mainSessionId;
    int subSessionId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; AAAccountingData サイズ: 56 バイト(x86)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; userName : LPWSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; clientName : LPWSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; authType : AAAuthSchemes (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; resourceName : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; portNumber : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; protocolName : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; numberOfBytesReceived : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; numberOfBytesTransfered : INT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; reasonForDisconnect : LPWSTR (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; mainSessionId : GUID (+36, 16byte)  varptr(st)+36 を基点に操作(16byte:入れ子/配列)
; subSessionId : INT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AAAccountingData サイズ: 88 バイト(x64)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; userName : LPWSTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; clientName : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; authType : AAAuthSchemes (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; resourceName : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; portNumber : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; protocolName : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; numberOfBytesReceived : INT (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; numberOfBytesTransfered : INT (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; reasonForDisconnect : LPWSTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; mainSessionId : GUID (+64, 16byte)  varptr(st)+64 を基点に操作(16byte:入れ子/配列)
; subSessionId : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; ※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 AAAccountingData
    #field intptr userName
    #field intptr clientName
    #field int authType
    #field intptr resourceName
    #field int portNumber
    #field intptr protocolName
    #field int numberOfBytesReceived
    #field int numberOfBytesTransfered
    #field intptr reasonForDisconnect
    #field GUID mainSessionId
    #field int subSessionId
#endstruct

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