#include <windows.h>
// NTFS_STATISTICS (x64 216 / x86 216 バイト)
typedef struct NTFS_STATISTICS {
DWORD LogFileFullExceptions;
DWORD OtherExceptions;
DWORD MftReads;
DWORD MftReadBytes;
DWORD MftWrites;
DWORD MftWriteBytes;
_MftWritesUserLevel_e__Struct MftWritesUserLevel;
WORD MftWritesFlushForLogFileFull;
WORD MftWritesLazyWriter;
WORD MftWritesUserRequest;
DWORD Mft2Writes;
DWORD Mft2WriteBytes;
_Mft2WritesUserLevel_e__Struct Mft2WritesUserLevel;
WORD Mft2WritesFlushForLogFileFull;
WORD Mft2WritesLazyWriter;
WORD Mft2WritesUserRequest;
DWORD RootIndexReads;
DWORD RootIndexReadBytes;
DWORD RootIndexWrites;
DWORD RootIndexWriteBytes;
DWORD BitmapReads;
DWORD BitmapReadBytes;
DWORD BitmapWrites;
DWORD BitmapWriteBytes;
WORD BitmapWritesFlushForLogFileFull;
WORD BitmapWritesLazyWriter;
WORD BitmapWritesUserRequest;
_BitmapWritesUserLevel_e__Struct BitmapWritesUserLevel;
DWORD MftBitmapReads;
DWORD MftBitmapReadBytes;
DWORD MftBitmapWrites;
DWORD MftBitmapWriteBytes;
WORD MftBitmapWritesFlushForLogFileFull;
WORD MftBitmapWritesLazyWriter;
WORD MftBitmapWritesUserRequest;
_MftBitmapWritesUserLevel_e__Struct MftBitmapWritesUserLevel;
DWORD UserIndexReads;
DWORD UserIndexReadBytes;
DWORD UserIndexWrites;
DWORD UserIndexWriteBytes;
DWORD LogFileReads;
DWORD LogFileReadBytes;
DWORD LogFileWrites;
DWORD LogFileWriteBytes;
_Allocate_e__Struct Allocate;
DWORD DiskResourcesExhausted;
} NTFS_STATISTICS;
using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NTFS_STATISTICS
{
public uint LogFileFullExceptions;
public uint OtherExceptions;
public uint MftReads;
public uint MftReadBytes;
public uint MftWrites;
public uint MftWriteBytes;
public _MftWritesUserLevel_e__Struct MftWritesUserLevel;
public ushort MftWritesFlushForLogFileFull;
public ushort MftWritesLazyWriter;
public ushort MftWritesUserRequest;
public uint Mft2Writes;
public uint Mft2WriteBytes;
public _Mft2WritesUserLevel_e__Struct Mft2WritesUserLevel;
public ushort Mft2WritesFlushForLogFileFull;
public ushort Mft2WritesLazyWriter;
public ushort Mft2WritesUserRequest;
public uint RootIndexReads;
public uint RootIndexReadBytes;
public uint RootIndexWrites;
public uint RootIndexWriteBytes;
public uint BitmapReads;
public uint BitmapReadBytes;
public uint BitmapWrites;
public uint BitmapWriteBytes;
public ushort BitmapWritesFlushForLogFileFull;
public ushort BitmapWritesLazyWriter;
public ushort BitmapWritesUserRequest;
public _BitmapWritesUserLevel_e__Struct BitmapWritesUserLevel;
public uint MftBitmapReads;
public uint MftBitmapReadBytes;
public uint MftBitmapWrites;
public uint MftBitmapWriteBytes;
public ushort MftBitmapWritesFlushForLogFileFull;
public ushort MftBitmapWritesLazyWriter;
public ushort MftBitmapWritesUserRequest;
public _MftBitmapWritesUserLevel_e__Struct MftBitmapWritesUserLevel;
public uint UserIndexReads;
public uint UserIndexReadBytes;
public uint UserIndexWrites;
public uint UserIndexWriteBytes;
public uint LogFileReads;
public uint LogFileReadBytes;
public uint LogFileWrites;
public uint LogFileWriteBytes;
public _Allocate_e__Struct Allocate;
public uint DiskResourcesExhausted;
}
Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NTFS_STATISTICS
Public LogFileFullExceptions As UInteger
Public OtherExceptions As UInteger
Public MftReads As UInteger
Public MftReadBytes As UInteger
Public MftWrites As UInteger
Public MftWriteBytes As UInteger
Public MftWritesUserLevel As _MftWritesUserLevel_e__Struct
Public MftWritesFlushForLogFileFull As UShort
Public MftWritesLazyWriter As UShort
Public MftWritesUserRequest As UShort
Public Mft2Writes As UInteger
Public Mft2WriteBytes As UInteger
Public Mft2WritesUserLevel As _Mft2WritesUserLevel_e__Struct
Public Mft2WritesFlushForLogFileFull As UShort
Public Mft2WritesLazyWriter As UShort
Public Mft2WritesUserRequest As UShort
Public RootIndexReads As UInteger
Public RootIndexReadBytes As UInteger
Public RootIndexWrites As UInteger
Public RootIndexWriteBytes As UInteger
Public BitmapReads As UInteger
Public BitmapReadBytes As UInteger
Public BitmapWrites As UInteger
Public BitmapWriteBytes As UInteger
Public BitmapWritesFlushForLogFileFull As UShort
Public BitmapWritesLazyWriter As UShort
Public BitmapWritesUserRequest As UShort
Public BitmapWritesUserLevel As _BitmapWritesUserLevel_e__Struct
Public MftBitmapReads As UInteger
Public MftBitmapReadBytes As UInteger
Public MftBitmapWrites As UInteger
Public MftBitmapWriteBytes As UInteger
Public MftBitmapWritesFlushForLogFileFull As UShort
Public MftBitmapWritesLazyWriter As UShort
Public MftBitmapWritesUserRequest As UShort
Public MftBitmapWritesUserLevel As _MftBitmapWritesUserLevel_e__Struct
Public UserIndexReads As UInteger
Public UserIndexReadBytes As UInteger
Public UserIndexWrites As UInteger
Public UserIndexWriteBytes As UInteger
Public LogFileReads As UInteger
Public LogFileReadBytes As UInteger
Public LogFileWrites As UInteger
Public LogFileWriteBytes As UInteger
Public Allocate As _Allocate_e__Struct
Public DiskResourcesExhausted As UInteger
End Structure
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NTFS_STATISTICS
#field int LogFileFullExceptions
#field int OtherExceptions
#field int MftReads
#field int MftReadBytes
#field int MftWrites
#field int MftWriteBytes
#field _MftWritesUserLevel_e__Struct MftWritesUserLevel
#field short MftWritesFlushForLogFileFull
#field short MftWritesLazyWriter
#field short MftWritesUserRequest
#field int Mft2Writes
#field int Mft2WriteBytes
#field _Mft2WritesUserLevel_e__Struct Mft2WritesUserLevel
#field short Mft2WritesFlushForLogFileFull
#field short Mft2WritesLazyWriter
#field short Mft2WritesUserRequest
#field int RootIndexReads
#field int RootIndexReadBytes
#field int RootIndexWrites
#field int RootIndexWriteBytes
#field int BitmapReads
#field int BitmapReadBytes
#field int BitmapWrites
#field int BitmapWriteBytes
#field short BitmapWritesFlushForLogFileFull
#field short BitmapWritesLazyWriter
#field short BitmapWritesUserRequest
#field _BitmapWritesUserLevel_e__Struct BitmapWritesUserLevel
#field int MftBitmapReads
#field int MftBitmapReadBytes
#field int MftBitmapWrites
#field int MftBitmapWriteBytes
#field short MftBitmapWritesFlushForLogFileFull
#field short MftBitmapWritesLazyWriter
#field short MftBitmapWritesUserRequest
#field _MftBitmapWritesUserLevel_e__Struct MftBitmapWritesUserLevel
#field int UserIndexReads
#field int UserIndexReadBytes
#field int UserIndexWrites
#field int UserIndexWriteBytes
#field int LogFileReads
#field int LogFileReadBytes
#field int LogFileWrites
#field int LogFileWriteBytes
#field _Allocate_e__Struct Allocate
#field int DiskResourcesExhausted
#endstruct
stdim st, NTFS_STATISTICS ; NSTRUCT 変数を確保
st->LogFileFullExceptions = 100
mes "LogFileFullExceptions=" + st->LogFileFullExceptions