ホーム › Storage.DistributedFileSystem › DFS_INFO_106
DFS_INFO_106
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| State | DWORD | 4 | +0 | +0 | ターゲットの状態を示すフラグ。オンライン/オフライン等。 |
| TargetPriority | DFS_TARGET_PRIORITY | 8 | +4 | +4 | DFSターゲットの優先順位を保持する構造体。 |
各言語での定義
#include <windows.h>
// DFS_TARGET_PRIORITY (x64 8 / x86 8 バイト)
typedef struct DFS_TARGET_PRIORITY {
DFS_TARGET_PRIORITY_CLASS TargetPriorityClass;
WORD TargetPriorityRank;
WORD Reserved;
} DFS_TARGET_PRIORITY;
// DFS_INFO_106 (x64 12 / x86 12 バイト)
typedef struct DFS_INFO_106 {
DWORD State;
DFS_TARGET_PRIORITY TargetPriority;
} DFS_INFO_106;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DFS_TARGET_PRIORITY
{
public int TargetPriorityClass;
public ushort TargetPriorityRank;
public ushort Reserved;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DFS_INFO_106
{
public uint State;
public DFS_TARGET_PRIORITY TargetPriority;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DFS_TARGET_PRIORITY
Public TargetPriorityClass As Integer
Public TargetPriorityRank As UShort
Public Reserved As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DFS_INFO_106
Public State As UInteger
Public TargetPriority As DFS_TARGET_PRIORITY
End Structureimport ctypes
from ctypes import wintypes
class DFS_TARGET_PRIORITY(ctypes.Structure):
_fields_ = [
("TargetPriorityClass", ctypes.c_int),
("TargetPriorityRank", ctypes.c_ushort),
("Reserved", ctypes.c_ushort),
]
class DFS_INFO_106(ctypes.Structure):
_fields_ = [
("State", wintypes.DWORD),
("TargetPriority", DFS_TARGET_PRIORITY),
]#[repr(C)]
pub struct DFS_TARGET_PRIORITY {
pub TargetPriorityClass: i32,
pub TargetPriorityRank: u16,
pub Reserved: u16,
}
#[repr(C)]
pub struct DFS_INFO_106 {
pub State: u32,
pub TargetPriority: DFS_TARGET_PRIORITY,
}import "golang.org/x/sys/windows"
type DFS_TARGET_PRIORITY struct {
TargetPriorityClass int32
TargetPriorityRank uint16
Reserved uint16
}
type DFS_INFO_106 struct {
State uint32
TargetPriority DFS_TARGET_PRIORITY
}type
DFS_TARGET_PRIORITY = record
TargetPriorityClass: Integer;
TargetPriorityRank: Word;
Reserved: Word;
end;
DFS_INFO_106 = record
State: DWORD;
TargetPriority: DFS_TARGET_PRIORITY;
end;const DFS_TARGET_PRIORITY = extern struct {
TargetPriorityClass: i32,
TargetPriorityRank: u16,
Reserved: u16,
};
const DFS_INFO_106 = extern struct {
State: u32,
TargetPriority: DFS_TARGET_PRIORITY,
};type
DFS_TARGET_PRIORITY {.bycopy.} = object
TargetPriorityClass: int32
TargetPriorityRank: uint16
Reserved: uint16
DFS_INFO_106 {.bycopy.} = object
State: uint32
TargetPriority: DFS_TARGET_PRIORITYstruct DFS_TARGET_PRIORITY
{
int TargetPriorityClass;
ushort TargetPriorityRank;
ushort Reserved;
}
struct DFS_INFO_106
{
uint State;
DFS_TARGET_PRIORITY TargetPriority;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DFS_INFO_106 サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; State : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TargetPriority : DFS_TARGET_PRIORITY (+4, 8byte) varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DFS_TARGET_PRIORITY
#field int TargetPriorityClass
#field short TargetPriorityRank
#field short Reserved
#endstruct
#defstruct global DFS_INFO_106
#field int State
#field DFS_TARGET_PRIORITY TargetPriority
#endstruct
stdim st, DFS_INFO_106 ; NSTRUCT 変数を確保
st->State = 100
mes "State=" + st->State