ホーム › System.Ioctl › FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX
FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| EnableIntegrity | BYTE | 1 | +0 | +0 | 整合性を有効化するかを示すバイト値。 |
| KeepIntegrityStateUnchanged | BYTE | 1 | +1 | +1 | 整合性状態を変更せず維持するかを示すバイト値。 |
| Reserved | WORD | 2 | +2 | +2 | 予約領域。0でなければならない。 |
| Flags | DWORD | 4 | +4 | +4 | 整合性に関する追加フラグ。 |
| Version | BYTE | 1 | +8 | +8 | この構造体のバージョン番号。 |
| Reserved2 | BYTE | 7 | +9 | +9 | 予約領域その2。0でなければならない。 |
各言語での定義
#include <windows.h>
// FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX (x64 16 / x86 16 バイト)
typedef struct FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX {
BYTE EnableIntegrity;
BYTE KeepIntegrityStateUnchanged;
WORD Reserved;
DWORD Flags;
BYTE Version;
BYTE Reserved2[7];
} FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX
{
public byte EnableIntegrity;
public byte KeepIntegrityStateUnchanged;
public ushort Reserved;
public uint Flags;
public byte Version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] public byte[] Reserved2;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX
Public EnableIntegrity As Byte
Public KeepIntegrityStateUnchanged As Byte
Public Reserved As UShort
Public Flags As UInteger
Public Version As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=7)> Public Reserved2() As Byte
End Structureimport ctypes
from ctypes import wintypes
class FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX(ctypes.Structure):
_fields_ = [
("EnableIntegrity", ctypes.c_ubyte),
("KeepIntegrityStateUnchanged", ctypes.c_ubyte),
("Reserved", ctypes.c_ushort),
("Flags", wintypes.DWORD),
("Version", ctypes.c_ubyte),
("Reserved2", ctypes.c_ubyte * 7),
]#[repr(C)]
pub struct FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX {
pub EnableIntegrity: u8,
pub KeepIntegrityStateUnchanged: u8,
pub Reserved: u16,
pub Flags: u32,
pub Version: u8,
pub Reserved2: [u8; 7],
}import "golang.org/x/sys/windows"
type FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX struct {
EnableIntegrity byte
KeepIntegrityStateUnchanged byte
Reserved uint16
Flags uint32
Version byte
Reserved2 [7]byte
}type
FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX = record
EnableIntegrity: Byte;
KeepIntegrityStateUnchanged: Byte;
Reserved: Word;
Flags: DWORD;
Version: Byte;
Reserved2: array[0..6] of Byte;
end;const FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX = extern struct {
EnableIntegrity: u8,
KeepIntegrityStateUnchanged: u8,
Reserved: u16,
Flags: u32,
Version: u8,
Reserved2: [7]u8,
};type
FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX {.bycopy.} = object
EnableIntegrity: uint8
KeepIntegrityStateUnchanged: uint8
Reserved: uint16
Flags: uint32
Version: uint8
Reserved2: array[7, uint8]struct FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX
{
ubyte EnableIntegrity;
ubyte KeepIntegrityStateUnchanged;
ushort Reserved;
uint Flags;
ubyte Version;
ubyte[7] Reserved2;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; EnableIntegrity : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; KeepIntegrityStateUnchanged : BYTE (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; Reserved : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; Flags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Version : BYTE (+8, 1byte) poke st,8,値 / 値 = peek(st,8)
; Reserved2 : BYTE (+9, 7byte) varptr(st)+9 を基点に操作(7byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX
#field byte EnableIntegrity
#field byte KeepIntegrityStateUnchanged
#field short Reserved
#field int Flags
#field byte Version
#field byte Reserved2 7
#endstruct
stdim st, FSCTL_SET_INTEGRITY_INFORMATION_BUFFER_EX ; NSTRUCT 変数を確保
st->EnableIntegrity = 100
mes "EnableIntegrity=" + st->EnableIntegrity