ホーム › Storage.DistributedFileSystem › DFS_GET_PKT_ENTRY_STATE_ARG
DFS_GET_PKT_ENTRY_STATE_ARG
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| DfsEntryPathLen | WORD | 2 | +0 | +0 | DFSエントリパス部分の長さ。バイト数で指定する。 |
| ServerNameLen | WORD | 2 | +2 | +2 | サーバー名部分の長さ。バイト数で指定する。 |
| ShareNameLen | WORD | 2 | +4 | +4 | 共有名部分の長さ。バイト数で指定する。 |
| Level | DWORD | 4 | +8 | +8 | 取得する情報レベルを示す値。 |
| Buffer | WCHAR | 2 | +12 | +12 | パス・サーバー名・共有名を連結して格納する可変長バッファ。 |
各言語での定義
#include <windows.h>
// DFS_GET_PKT_ENTRY_STATE_ARG (x64 16 / x86 16 バイト)
typedef struct DFS_GET_PKT_ENTRY_STATE_ARG {
WORD DfsEntryPathLen;
WORD ServerNameLen;
WORD ShareNameLen;
DWORD Level;
WCHAR Buffer[1];
} DFS_GET_PKT_ENTRY_STATE_ARG;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DFS_GET_PKT_ENTRY_STATE_ARG
{
public ushort DfsEntryPathLen;
public ushort ServerNameLen;
public ushort ShareNameLen;
public uint Level;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)] public string Buffer;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DFS_GET_PKT_ENTRY_STATE_ARG
Public DfsEntryPathLen As UShort
Public ServerNameLen As UShort
Public ShareNameLen As UShort
Public Level As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=1)> Public Buffer As String
End Structureimport ctypes
from ctypes import wintypes
class DFS_GET_PKT_ENTRY_STATE_ARG(ctypes.Structure):
_fields_ = [
("DfsEntryPathLen", ctypes.c_ushort),
("ServerNameLen", ctypes.c_ushort),
("ShareNameLen", ctypes.c_ushort),
("Level", wintypes.DWORD),
("Buffer", ctypes.c_wchar * 1),
]#[repr(C)]
pub struct DFS_GET_PKT_ENTRY_STATE_ARG {
pub DfsEntryPathLen: u16,
pub ServerNameLen: u16,
pub ShareNameLen: u16,
pub Level: u32,
pub Buffer: [u16; 1],
}import "golang.org/x/sys/windows"
type DFS_GET_PKT_ENTRY_STATE_ARG struct {
DfsEntryPathLen uint16
ServerNameLen uint16
ShareNameLen uint16
Level uint32
Buffer [1]uint16
}type
DFS_GET_PKT_ENTRY_STATE_ARG = record
DfsEntryPathLen: Word;
ServerNameLen: Word;
ShareNameLen: Word;
Level: DWORD;
Buffer: array[0..0] of WideChar;
end;const DFS_GET_PKT_ENTRY_STATE_ARG = extern struct {
DfsEntryPathLen: u16,
ServerNameLen: u16,
ShareNameLen: u16,
Level: u32,
Buffer: [1]u16,
};type
DFS_GET_PKT_ENTRY_STATE_ARG {.bycopy.} = object
DfsEntryPathLen: uint16
ServerNameLen: uint16
ShareNameLen: uint16
Level: uint32
Buffer: array[1, uint16]struct DFS_GET_PKT_ENTRY_STATE_ARG
{
ushort DfsEntryPathLen;
ushort ServerNameLen;
ushort ShareNameLen;
uint Level;
wchar[1] Buffer;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DFS_GET_PKT_ENTRY_STATE_ARG サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; DfsEntryPathLen : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; ServerNameLen : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; ShareNameLen : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; Level : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Buffer : WCHAR (+12, 2byte) varptr(st)+12 を基点に操作(2byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DFS_GET_PKT_ENTRY_STATE_ARG
#field short DfsEntryPathLen
#field short ServerNameLen
#field short ShareNameLen
#field int Level
#field wchar Buffer 1
#endstruct
stdim st, DFS_GET_PKT_ENTRY_STATE_ARG ; NSTRUCT 変数を確保
st->DfsEntryPathLen = 100
mes "DfsEntryPathLen=" + st->DfsEntryPathLen