ホーム › Storage.FileSystem › FILE_REMOTE_PROTOCOL_INFO
FILE_REMOTE_PROTOCOL_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| StructureVersion | WORD | 2 | +0 | +0 | この構造体のバージョン番号。 |
| StructureSize | WORD | 2 | +2 | +2 | この構造体のバイトサイズ。 |
| Protocol | DWORD | 4 | +4 | +4 | リモートアクセスに使用するプロトコル(SMB/WebDAV等)。 |
| ProtocolMajorVersion | WORD | 2 | +8 | +8 | プロトコルのメジャーバージョン。 |
| ProtocolMinorVersion | WORD | 2 | +10 | +10 | プロトコルのマイナーバージョン。 |
| ProtocolRevision | WORD | 2 | +12 | +12 | プロトコルのリビジョン番号。 |
| Reserved | WORD | 2 | +14 | +14 | 予約フィールド。0が設定される。 |
| Flags | DWORD | 4 | +16 | +16 | プロトコル機能を示すフラグ(REMOTE_PROTOCOL_FLAG_*)。 |
| GenericReserved | _GenericReserved_e__Struct | 32 | +20 | +20 | 汎用予約領域(将来用の構造体)。 |
| ProtocolSpecific | _ProtocolSpecific_e__Union | 64 | +56 | +52 | プロトコル固有情報を保持する共用体(SMB等)。 |
構造体: _GenericReserved_e__Struct x64 32B / x86 32B
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Reserved | DWORD | 32 | +0 | +0 | 予約フィールド。0が設定される。 |
共用体: _ProtocolSpecific_e__Union x64 64B / x86 64B
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Smb2 | _Smb2_e__Struct | 8/4 | +0 | +0 | |
| Reserved | DWORD | 64 | +0 | +0 | 予約フィールド。0が設定される。 |
各言語での定義
#include <windows.h>
// FILE_REMOTE_PROTOCOL_INFO (x64 120 / x86 116 バイト)
typedef struct FILE_REMOTE_PROTOCOL_INFO {
WORD StructureVersion;
WORD StructureSize;
DWORD Protocol;
WORD ProtocolMajorVersion;
WORD ProtocolMinorVersion;
WORD ProtocolRevision;
WORD Reserved;
DWORD Flags;
_GenericReserved_e__Struct GenericReserved;
_ProtocolSpecific_e__Union ProtocolSpecific;
} FILE_REMOTE_PROTOCOL_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_REMOTE_PROTOCOL_INFO
{
public ushort StructureVersion;
public ushort StructureSize;
public uint Protocol;
public ushort ProtocolMajorVersion;
public ushort ProtocolMinorVersion;
public ushort ProtocolRevision;
public ushort Reserved;
public uint Flags;
public _GenericReserved_e__Struct GenericReserved;
public _ProtocolSpecific_e__Union ProtocolSpecific;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_REMOTE_PROTOCOL_INFO
Public StructureVersion As UShort
Public StructureSize As UShort
Public Protocol As UInteger
Public ProtocolMajorVersion As UShort
Public ProtocolMinorVersion As UShort
Public ProtocolRevision As UShort
Public Reserved As UShort
Public Flags As UInteger
Public GenericReserved As _GenericReserved_e__Struct
Public ProtocolSpecific As _ProtocolSpecific_e__Union
End Structureimport ctypes
from ctypes import wintypes
class FILE_REMOTE_PROTOCOL_INFO(ctypes.Structure):
_fields_ = [
("StructureVersion", ctypes.c_ushort),
("StructureSize", ctypes.c_ushort),
("Protocol", wintypes.DWORD),
("ProtocolMajorVersion", ctypes.c_ushort),
("ProtocolMinorVersion", ctypes.c_ushort),
("ProtocolRevision", ctypes.c_ushort),
("Reserved", ctypes.c_ushort),
("Flags", wintypes.DWORD),
("GenericReserved", _GenericReserved_e__Struct),
("ProtocolSpecific", _ProtocolSpecific_e__Union),
]#[repr(C)]
pub struct FILE_REMOTE_PROTOCOL_INFO {
pub StructureVersion: u16,
pub StructureSize: u16,
pub Protocol: u32,
pub ProtocolMajorVersion: u16,
pub ProtocolMinorVersion: u16,
pub ProtocolRevision: u16,
pub Reserved: u16,
pub Flags: u32,
pub GenericReserved: _GenericReserved_e__Struct,
pub ProtocolSpecific: _ProtocolSpecific_e__Union,
}import "golang.org/x/sys/windows"
type FILE_REMOTE_PROTOCOL_INFO struct {
StructureVersion uint16
StructureSize uint16
Protocol uint32
ProtocolMajorVersion uint16
ProtocolMinorVersion uint16
ProtocolRevision uint16
Reserved uint16
Flags uint32
GenericReserved _GenericReserved_e__Struct
ProtocolSpecific _ProtocolSpecific_e__Union
}type
FILE_REMOTE_PROTOCOL_INFO = record
StructureVersion: Word;
StructureSize: Word;
Protocol: DWORD;
ProtocolMajorVersion: Word;
ProtocolMinorVersion: Word;
ProtocolRevision: Word;
Reserved: Word;
Flags: DWORD;
GenericReserved: _GenericReserved_e__Struct;
ProtocolSpecific: _ProtocolSpecific_e__Union;
end;const FILE_REMOTE_PROTOCOL_INFO = extern struct {
StructureVersion: u16,
StructureSize: u16,
Protocol: u32,
ProtocolMajorVersion: u16,
ProtocolMinorVersion: u16,
ProtocolRevision: u16,
Reserved: u16,
Flags: u32,
GenericReserved: _GenericReserved_e__Struct,
ProtocolSpecific: _ProtocolSpecific_e__Union,
};type
FILE_REMOTE_PROTOCOL_INFO {.bycopy.} = object
StructureVersion: uint16
StructureSize: uint16
Protocol: uint32
ProtocolMajorVersion: uint16
ProtocolMinorVersion: uint16
ProtocolRevision: uint16
Reserved: uint16
Flags: uint32
GenericReserved: _GenericReserved_e__Struct
ProtocolSpecific: _ProtocolSpecific_e__Unionstruct FILE_REMOTE_PROTOCOL_INFO
{
ushort StructureVersion;
ushort StructureSize;
uint Protocol;
ushort ProtocolMajorVersion;
ushort ProtocolMinorVersion;
ushort ProtocolRevision;
ushort Reserved;
uint Flags;
_GenericReserved_e__Struct GenericReserved;
_ProtocolSpecific_e__Union ProtocolSpecific;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; FILE_REMOTE_PROTOCOL_INFO サイズ: 116 バイト(x86)
dim st, 29 ; 4byte整数×29(構造体サイズ 116 / 4 切り上げ)
; StructureVersion : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; StructureSize : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; Protocol : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ProtocolMajorVersion : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; ProtocolMinorVersion : WORD (+10, 2byte) wpoke st,10,値 / 値 = wpeek(st,10)
; ProtocolRevision : WORD (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; Reserved : WORD (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; Flags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; GenericReserved : _GenericReserved_e__Struct (+20, 32byte) varptr(st)+20 を基点に操作(32byte:入れ子/配列)
; ProtocolSpecific : _ProtocolSpecific_e__Union (+52, 64byte) varptr(st)+52 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILE_REMOTE_PROTOCOL_INFO サイズ: 120 バイト(x64)
dim st, 30 ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; StructureVersion : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; StructureSize : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; Protocol : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ProtocolMajorVersion : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; ProtocolMinorVersion : WORD (+10, 2byte) wpoke st,10,値 / 値 = wpeek(st,10)
; ProtocolRevision : WORD (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; Reserved : WORD (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; Flags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; GenericReserved : _GenericReserved_e__Struct (+20, 32byte) varptr(st)+20 を基点に操作(32byte:入れ子/配列)
; ProtocolSpecific : _ProtocolSpecific_e__Union (+56, 64byte) varptr(st)+56 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILE_REMOTE_PROTOCOL_INFO
#field short StructureVersion
#field short StructureSize
#field int Protocol
#field short ProtocolMajorVersion
#field short ProtocolMinorVersion
#field short ProtocolRevision
#field short Reserved
#field int Flags
#field _GenericReserved_e__Struct GenericReserved
#field byte ProtocolSpecific 64
#endstruct
stdim st, FILE_REMOTE_PROTOCOL_INFO ; NSTRUCT 変数を確保
st->StructureVersion = 100
mes "StructureVersion=" + st->StructureVersion
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。