ホーム › NetworkManagement.Rras › RAS_SECURITY_INFO
RAS_SECURITY_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| LastError | DWORD | 4 | +0 | +0 | そのポートに対する最後の RasSecurityDialogReceive 呼び出しの状態を示すエラーコードを指定します。受信操作が失敗した場合、LastError は Raserror.h または Winerror.h で定義されているエラーコードのいずれかになります。それ以外の場合、LastError は次の値のいずれかになります。
| ||||||
| BytesReceived | DWORD | 4 | +4 | +4 | 直近の RasSecurityDialogReceive 操作で受信したバイト数を指定します。このメンバーは、LastError メンバーの値が SUCCESS の場合にのみ有効です。 | ||||||
| DeviceName | CHAR | 129 | +8 | +8 | ポート上のデバイスのユーザーフレンドリーな表示名 (Hayes SmartModem 9600 など) を格納する、null 終端文字列を指定します。 |
公式ドキュメント
RAS_SECURITY_INFO 構造体は、 RasSecurityDialogGetInfo 関数と共に使用し、RAS セキュリティ DLL の認証トランザクションに関連付けられた RAS ポートに関する情報を返します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// RAS_SECURITY_INFO (x64 140 / x86 140 バイト)
typedef struct RAS_SECURITY_INFO {
DWORD LastError;
DWORD BytesReceived;
CHAR DeviceName[129];
} RAS_SECURITY_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RAS_SECURITY_INFO
{
public uint LastError;
public uint BytesReceived;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 129)] public sbyte[] DeviceName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RAS_SECURITY_INFO
Public LastError As UInteger
Public BytesReceived As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=129)> Public DeviceName() As SByte
End Structureimport ctypes
from ctypes import wintypes
class RAS_SECURITY_INFO(ctypes.Structure):
_fields_ = [
("LastError", wintypes.DWORD),
("BytesReceived", wintypes.DWORD),
("DeviceName", ctypes.c_byte * 129),
]#[repr(C)]
pub struct RAS_SECURITY_INFO {
pub LastError: u32,
pub BytesReceived: u32,
pub DeviceName: [i8; 129],
}import "golang.org/x/sys/windows"
type RAS_SECURITY_INFO struct {
LastError uint32
BytesReceived uint32
DeviceName [129]int8
}type
RAS_SECURITY_INFO = record
LastError: DWORD;
BytesReceived: DWORD;
DeviceName: array[0..128] of Shortint;
end;const RAS_SECURITY_INFO = extern struct {
LastError: u32,
BytesReceived: u32,
DeviceName: [129]i8,
};type
RAS_SECURITY_INFO {.bycopy.} = object
LastError: uint32
BytesReceived: uint32
DeviceName: array[129, int8]struct RAS_SECURITY_INFO
{
uint LastError;
uint BytesReceived;
byte[129] DeviceName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RAS_SECURITY_INFO サイズ: 140 バイト(x64)
dim st, 35 ; 4byte整数×35(構造体サイズ 140 / 4 切り上げ)
; LastError : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; BytesReceived : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; DeviceName : CHAR (+8, 129byte) varptr(st)+8 を基点に操作(129byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RAS_SECURITY_INFO
#field int LastError
#field int BytesReceived
#field byte DeviceName 129
#endstruct
stdim st, RAS_SECURITY_INFO ; NSTRUCT 変数を確保
st->LastError = 100
mes "LastError=" + st->LastError