23 {
NtfsInfoMain,
_T(
"ntfsinfo"),
_T(
"Displays informations about a NTFS volume") },
43 for (
i = 0;
i < 26;
i++)
45 if (Drives & (1 <<
i))
110#define HANDLE_FLAG(Flags, Flag, Desc) \
112 _ftprintf(stdout, Desc)
202 _ftprintf(
stdout,
_T(
"NTFS volume serial number:\t\t0x%0.16I64x\n"),
Data.VolumeSerialNumber.QuadPart);
211 _ftprintf(
stdout,
_T(
"Total number of reserved clusters:\t0x%0.16I64x\n"),
Data.TotalReserved.QuadPart);
216 _ftprintf(
stdout,
_T(
"MFT valid data length:\t\t\t0x%0.16I64x\n"),
Data.MftValidDataLength.QuadPart);
225#define DUMP_VALUE(stats, value) fprintf(stdout, "%s: %lu\n", #value, stats->value)
339#define GET_NEXT(stats, length, iter, type) (type)((ULONG_PTR)stats + (length * iter))
340#define SUM_VALUE(stats, new, value) stats->value += new->value
397 for (
i = 1;
i < ProcCount; ++
i)
409 SUM_VALUE(ExFat, NextExFat, SuccessfulCreates);
410 SUM_VALUE(ExFat, NextExFat, FailedCreates);
411 SUM_VALUE(ExFat, NextExFat, NonCachedReads);
412 SUM_VALUE(ExFat, NextExFat, NonCachedReadBytes);
413 SUM_VALUE(ExFat, NextExFat, NonCachedWrites);
414 SUM_VALUE(ExFat, NextExFat, NonCachedWriteBytes);
415 SUM_VALUE(ExFat, NextExFat, NonCachedDiskReads);
416 SUM_VALUE(ExFat, NextExFat, NonCachedDiskWrites);
439 for (
i = 1;
i < ProcCount; ++
i)
451 SUM_VALUE(Fat, NextFat, SuccessfulCreates);
454 SUM_VALUE(Fat, NextFat, NonCachedReadBytes);
455 SUM_VALUE(Fat, NextFat, NonCachedWrites);
456 SUM_VALUE(Fat, NextFat, NonCachedWriteBytes);
457 SUM_VALUE(Fat, NextFat, NonCachedDiskReads);
458 SUM_VALUE(Fat, NextFat, NonCachedDiskWrites);
481 for (
i = 1;
i < ProcCount; ++
i)
495 SUM_VALUE(Ntfs, NextNtfs, MftWriteBytes);
497 SUM_VALUE(Ntfs, NextNtfs, Mft2WriteBytes);
498 SUM_VALUE(Ntfs, NextNtfs, RootIndexReads);
499 SUM_VALUE(Ntfs, NextNtfs, RootIndexReadBytes);
500 SUM_VALUE(Ntfs, NextNtfs, RootIndexWrites);
501 SUM_VALUE(Ntfs, NextNtfs, RootIndexWriteBytes);
503 SUM_VALUE(Ntfs, NextNtfs, BitmapReadBytes);
505 SUM_VALUE(Ntfs, NextNtfs, BitmapWriteBytes);
506 SUM_VALUE(Ntfs, NextNtfs, MftBitmapReads);
507 SUM_VALUE(Ntfs, NextNtfs, MftBitmapReadBytes);
508 SUM_VALUE(Ntfs, NextNtfs, MftBitmapWrites);
509 SUM_VALUE(Ntfs, NextNtfs, MftBitmapWriteBytes);
510 SUM_VALUE(Ntfs, NextNtfs, UserIndexReads);
511 SUM_VALUE(Ntfs, NextNtfs, UserIndexReadBytes);
512 SUM_VALUE(Ntfs, NextNtfs, UserIndexWrites);
513 SUM_VALUE(Ntfs, NextNtfs, UserIndexWriteBytes);
515 SUM_VALUE(Ntfs, NextNtfs, LogFileReadBytes);
516 SUM_VALUE(Ntfs, NextNtfs, LogFileWrites);
517 SUM_VALUE(Ntfs, NextNtfs, LogFileWriteBytes);
571 if (Statistics ==
NULL)
603 if (Statistics != &
Buffer)
615 if (Statistics != &
Buffer)
627 if (Statistics != &
Buffer)
int() HandlerProc(int argc, const TCHAR *argv[])
static VOID PrintErrorMessage(DWORD dwError)
HANDLE OpenVolume(const TCHAR *Volume, BOOLEAN AllowRemote, BOOLEAN NtfsOnly)
void PrintDefaultUsage(const TCHAR *Command, const TCHAR *SubCommand, HandlerItem *HandlersList, int HandlerListCount)
int FindHandler(int argc, const TCHAR *argv[], HandlerItem *HandlersList, int HandlerListCount, void(*UsageHelper)(const TCHAR *))
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
#define INVALID_HANDLE_VALUE
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
#define FILE_SUPPORTS_TRANSACTIONS
#define FILE_SUPPORTS_ENCRYPTION
#define FILE_NAMED_STREAMS
#define FILE_SUPPORTS_USN_JOURNAL
#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES
#define FILE_SEQUENTIAL_WRITE_ONCE
#define FILE_SUPPORTS_SPARSE_FILES
#define FILE_SUPPORTS_REPARSE_POINTS
#define FILE_READ_ONLY_VOLUME
#define FILE_FILE_COMPRESSION
#define FILE_SUPPORTS_HARD_LINKS
#define FILE_SUPPORTS_OBJECT_IDS
#define FILE_VOLUME_IS_COMPRESSED
#define FILE_PERSISTENT_ACLS
#define FILE_CASE_SENSITIVE_SEARCH
#define FILE_CASE_PRESERVED_NAMES
#define FILE_VOLUME_QUOTAS
#define FILE_SUPPORTS_OPEN_BY_FILE_ID
#define FILE_UNICODE_ON_DISK
static HandlerProc DriveTypeMain
static int SumNtfs(PVOID Statistics, PVOID Specific, ULONG Length, DWORD ProcCount, DWORD BytesRead)
static HandlerProc VolumeInfoMain
static void SumBase(PFILESYSTEM_STATISTICS Base, PFILESYSTEM_STATISTICS NextBase)
#define GET_NEXT(stats, length, iter, type)
#define HANDLE_FLAG(Flags, Flag, Desc)
static void DumpFat(PVOID Statistics, PVOID Specific)
#define SUM_VALUE(stats, new, value)
static void DumpNtfs(PVOID Statistics, PVOID Specific)
static void DumpExFat(PVOID Statistics, PVOID Specific)
static int ValidateSizes(ULONG Length, DWORD ProcCount, DWORD BytesRead, DWORD SpecificSize)
static int SumFat(PVOID Statistics, PVOID Specific, ULONG Length, DWORD ProcCount, DWORD BytesRead)
static HandlerProc DrivesMain
static HandlerProc StatisticsMain
static void DumpBase(PFILESYSTEM_STATISTICS Base, TCHAR *Name)
static HandlerItem HandlersList[]
#define DUMP_VALUE(stats, value)
static int SumExFat(PVOID Statistics, PVOID Specific, ULONG Length, DWORD ProcCount, DWORD BytesRead)
static HandlerProc NtfsInfoMain
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define FSCTL_FILESYSTEM_GET_STATISTICS
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define FSCTL_GET_NTFS_VOLUME_DATA
#define FILESYSTEM_STATISTICS_TYPE_EXFAT
#define FILESYSTEM_STATISTICS_TYPE_NTFS
struct _FILESYSTEM_STATISTICS FILESYSTEM_STATISTICS
ULONG SizeOfCompleteStructure
DWORD dwNumberOfProcessors
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
#define DRIVE_NO_ROOT_DIR
#define GetVolumeInformation
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetLogicalDrives(void)
_Must_inspect_result_ _In_ ULONG Flags