ホーム › Storage.FileSystem › CLFS_MGMT_POLICY
CLFS_MGMT_POLICY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | 管理ポリシー構造体のバージョン。 |
| LengthInBytes | DWORD | 4 | +4 | +4 | 本構造体のバイト長。 |
| PolicyFlags | DWORD | 4 | +8 | +8 | ポリシーに適用するフラグ。 |
| PolicyType | CLFS_MGMT_POLICY_TYPE | 4 | +12 | +12 | 管理ポリシーの種類を示す値。 |
| PolicyParameters | _PolicyParameters_e__Union | 8/4 | +16 | +16 | ポリシー種別ごとのパラメータを保持する共用体。 |
共用体: _PolicyParameters_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| MaximumSize | _MaximumSize_e__Struct | 8/4 | +0 | +0 |
| MinimumSize | _MinimumSize_e__Struct | 8/4 | +0 | +0 |
| NewContainerSize | _NewContainerSize_e__Struct | 8/4 | +0 | +0 |
| GrowthRate | _GrowthRate_e__Struct | 8/4 | +0 | +0 |
| LogTail | _LogTail_e__Struct | 8/4 | +0 | +0 |
| AutoShrink | _AutoShrink_e__Struct | 8/4 | +0 | +0 |
| AutoGrow | _AutoGrow_e__Struct | 8/4 | +0 | +0 |
| NewContainerPrefix | _NewContainerPrefix_e__Struct | 8/4 | +0 | +0 |
| NewContainerSuffix | _NewContainerSuffix_e__Struct | 8/4 | +0 | +0 |
| NewContainerExtension | _NewContainerExtension_e__Struct | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// CLFS_MGMT_POLICY (x64 24 / x86 20 バイト)
typedef struct CLFS_MGMT_POLICY {
DWORD Version;
DWORD LengthInBytes;
DWORD PolicyFlags;
CLFS_MGMT_POLICY_TYPE PolicyType;
_PolicyParameters_e__Union PolicyParameters;
} CLFS_MGMT_POLICY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLFS_MGMT_POLICY
{
public uint Version;
public uint LengthInBytes;
public uint PolicyFlags;
public int PolicyType;
public _PolicyParameters_e__Union PolicyParameters;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLFS_MGMT_POLICY
Public Version As UInteger
Public LengthInBytes As UInteger
Public PolicyFlags As UInteger
Public PolicyType As Integer
Public PolicyParameters As _PolicyParameters_e__Union
End Structureimport ctypes
from ctypes import wintypes
class CLFS_MGMT_POLICY(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("LengthInBytes", wintypes.DWORD),
("PolicyFlags", wintypes.DWORD),
("PolicyType", ctypes.c_int),
("PolicyParameters", _PolicyParameters_e__Union),
]#[repr(C)]
pub struct CLFS_MGMT_POLICY {
pub Version: u32,
pub LengthInBytes: u32,
pub PolicyFlags: u32,
pub PolicyType: i32,
pub PolicyParameters: _PolicyParameters_e__Union,
}import "golang.org/x/sys/windows"
type CLFS_MGMT_POLICY struct {
Version uint32
LengthInBytes uint32
PolicyFlags uint32
PolicyType int32
PolicyParameters _PolicyParameters_e__Union
}type
CLFS_MGMT_POLICY = record
Version: DWORD;
LengthInBytes: DWORD;
PolicyFlags: DWORD;
PolicyType: Integer;
PolicyParameters: _PolicyParameters_e__Union;
end;const CLFS_MGMT_POLICY = extern struct {
Version: u32,
LengthInBytes: u32,
PolicyFlags: u32,
PolicyType: i32,
PolicyParameters: _PolicyParameters_e__Union,
};type
CLFS_MGMT_POLICY {.bycopy.} = object
Version: uint32
LengthInBytes: uint32
PolicyFlags: uint32
PolicyType: int32
PolicyParameters: _PolicyParameters_e__Unionstruct CLFS_MGMT_POLICY
{
uint Version;
uint LengthInBytes;
uint PolicyFlags;
int PolicyType;
_PolicyParameters_e__Union PolicyParameters;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CLFS_MGMT_POLICY サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; LengthInBytes : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; PolicyFlags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; PolicyType : CLFS_MGMT_POLICY_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; PolicyParameters : _PolicyParameters_e__Union (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLFS_MGMT_POLICY サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; LengthInBytes : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; PolicyFlags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; PolicyType : CLFS_MGMT_POLICY_TYPE (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; PolicyParameters : _PolicyParameters_e__Union (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CLFS_MGMT_POLICY
#field int Version
#field int LengthInBytes
#field int PolicyFlags
#field int PolicyType
#field byte PolicyParameters 8
#endstruct
stdim st, CLFS_MGMT_POLICY ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。