ホーム › Storage.DistributedFileSystem › DFS_INFO_104
DFS_INFO_104
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| TargetPriority | DFS_TARGET_PRIORITY | 8 | +0 | +0 | 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_104 (x64 8 / x86 8 バイト)
typedef struct DFS_INFO_104 {
DFS_TARGET_PRIORITY TargetPriority;
} DFS_INFO_104;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_104
{
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_104
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_104(ctypes.Structure):
_fields_ = [
("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_104 {
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_104 struct {
TargetPriority DFS_TARGET_PRIORITY
}type
DFS_TARGET_PRIORITY = record
TargetPriorityClass: Integer;
TargetPriorityRank: Word;
Reserved: Word;
end;
DFS_INFO_104 = record
TargetPriority: DFS_TARGET_PRIORITY;
end;const DFS_TARGET_PRIORITY = extern struct {
TargetPriorityClass: i32,
TargetPriorityRank: u16,
Reserved: u16,
};
const DFS_INFO_104 = extern struct {
TargetPriority: DFS_TARGET_PRIORITY,
};type
DFS_TARGET_PRIORITY {.bycopy.} = object
TargetPriorityClass: int32
TargetPriorityRank: uint16
Reserved: uint16
DFS_INFO_104 {.bycopy.} = object
TargetPriority: DFS_TARGET_PRIORITYstruct DFS_TARGET_PRIORITY
{
int TargetPriorityClass;
ushort TargetPriorityRank;
ushort Reserved;
}
struct DFS_INFO_104
{
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_104 サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; TargetPriority : DFS_TARGET_PRIORITY (+0, 8byte) varptr(st)+0 を基点に操作(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_104
#field DFS_TARGET_PRIORITY TargetPriority
#endstruct
stdim st, DFS_INFO_104 ; NSTRUCT 変数を確保