ホーム › Storage.DistributedFileSystem › DFS_TARGET_PRIORITY
DFS_TARGET_PRIORITY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| TargetPriorityClass | DFS_TARGET_PRIORITY_CLASS | 4 | +0 | +0 | ターゲットの優先度クラスを表す列挙値。 |
| TargetPriorityRank | WORD | 2 | +4 | +4 | 同一優先度クラス内での順位を表す。0が最高。 |
| Reserved | WORD | 2 | +6 | +6 | 予約済みフィールド。0を設定する。 |
各言語での定義
#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;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;
}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 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),
]#[repr(C)]
pub struct DFS_TARGET_PRIORITY {
pub TargetPriorityClass: i32,
pub TargetPriorityRank: u16,
pub Reserved: u16,
}import "golang.org/x/sys/windows"
type DFS_TARGET_PRIORITY struct {
TargetPriorityClass int32
TargetPriorityRank uint16
Reserved uint16
}type
DFS_TARGET_PRIORITY = record
TargetPriorityClass: Integer;
TargetPriorityRank: Word;
Reserved: Word;
end;const DFS_TARGET_PRIORITY = extern struct {
TargetPriorityClass: i32,
TargetPriorityRank: u16,
Reserved: u16,
};type
DFS_TARGET_PRIORITY {.bycopy.} = object
TargetPriorityClass: int32
TargetPriorityRank: uint16
Reserved: uint16struct DFS_TARGET_PRIORITY
{
int TargetPriorityClass;
ushort TargetPriorityRank;
ushort Reserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DFS_TARGET_PRIORITY サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; TargetPriorityClass : DFS_TARGET_PRIORITY_CLASS (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; TargetPriorityRank : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; Reserved : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DFS_TARGET_PRIORITY
#field int TargetPriorityClass
#field short TargetPriorityRank
#field short Reserved
#endstruct
stdim st, DFS_TARGET_PRIORITY ; NSTRUCT 変数を確保
st->TargetPriorityClass = 100
mes "TargetPriorityClass=" + st->TargetPriorityClass