ReactOS 0.4.16-dev-122-g325d74c
filesystems.c File Reference
#include "diskpart.h"
#include <debug.h>
Include dependency graph for filesystems.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static BOOL ShowFileSystemInfo (PVOLENTRY VolumeEntry)
 
static VOID ShowInstalledFileSystems (VOID)
 
BOOL filesystems_main (_In_ INT argc, _In_ PWSTR *argv)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file filesystems.c.

Function Documentation

◆ filesystems_main()

BOOL filesystems_main ( _In_ INT  argc,
_In_ PWSTR argv 
)

Definition at line 155 of file filesystems.c.

158{
159 if (CurrentVolume == NULL)
160 {
162 return TRUE;
163 }
164
165 ConPuts(StdOut, L"\n");
166
168 {
170 }
171
172 return TRUE;
173}
void ConPuts(FILE *fp, LPCWSTR psz)
Definition: fc.c:16
#define StdOut
Definition: fc.c:14
void ConResPuts(FILE *fp, UINT nID)
Definition: fc.c:27
#define IDS_SELECT_NO_VOLUME
Definition: resource.h:92
PVOLENTRY CurrentVolume
Definition: partlist.c:76
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static VOID ShowInstalledFileSystems(VOID)
Definition: filesystems.c:128
static BOOL ShowFileSystemInfo(PVOLENTRY VolumeEntry)
Definition: filesystems.c:16
#define L(x)
Definition: ntvdm.h:50

◆ ShowFileSystemInfo()

static BOOL ShowFileSystemInfo ( PVOLENTRY  VolumeEntry)
static

Definition at line 16 of file filesystems.c.

18{
19 WCHAR VolumeNameBuffer[MAX_PATH];
24 ULONG ulSize, ulClusterSize = 0;
27 PFILE_FS_ATTRIBUTE_INFORMATION pAttributeInfo = NULL;
30
31 wcscpy(VolumeNameBuffer, VolumeEntry->DeviceName);
32 wcscat(VolumeNameBuffer, L"\\");
33
34 RtlInitUnicodeString(&VolumeName, VolumeNameBuffer);
35
38 0,
39 NULL,
40 NULL);
41
46 0,
48 if (!NT_SUCCESS(Status))
49 {
51 {
53 return FALSE;
54 }
56 {
58 ConPuts(StdOut, L"\n");
61 }
62
63 return TRUE;
64 }
65
66 ulSize = sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 255 * sizeof(WCHAR);
67 pAttributeInfo = RtlAllocateHeap(RtlGetProcessHeap(),
69 ulSize);
70 if (pAttributeInfo == NULL)
71 {
72 Result = FALSE;
73 goto done;
74 }
75
78 pAttributeInfo,
79 ulSize,
81 if (!NT_SUCCESS(Status))
82 {
83 Result = FALSE;
84 goto done;
85 }
86
89 &FullSizeInfo,
92 if (NT_SUCCESS(Status))
93 {
94 ulClusterSize = FullSizeInfo.BytesPerSector * FullSizeInfo.SectorsPerAllocationUnit;
95 }
96 else
97 {
100 &SizeInfo,
103 if (NT_SUCCESS(Status))
104 {
105 ulClusterSize = SizeInfo.BytesPerSector * SizeInfo.SectorsPerAllocationUnit;
106 }
107 }
108
109
111 ConPuts(StdOut, L"\n");
112
115 ConPuts(StdOut, L"\n");
116
117done:
118 if (pAttributeInfo)
119 RtlFreeHeap(RtlGetProcessHeap(), 0, pAttributeInfo);
120
122
123 return Result;
124}
void ConResPrintf(FILE *fp, UINT nID,...)
Definition: fc.c:33
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
#define IDS_FILESYSTEMS_CURRENT
Definition: resource.h:59
#define IDS_ERROR_NO_MEDIUM
Definition: resource.h:188
#define IDS_FILESYSTEMS_CLUSTERSIZE
Definition: resource.h:62
#define IDS_FILESYSTEMS_TYPE
Definition: resource.h:61
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define MAX_PATH
Definition: compat.h:34
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned int BOOL
Definition: ntddk_ex.h:94
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
_Must_inspect_result_ _Out_ PHANDLE VolumeHandle
Definition: fltkernel.h:2283
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
struct _FILE_FS_ATTRIBUTE_INFORMATION FILE_FS_ATTRIBUTE_INFORMATION
@ FileFsAttributeInformation
Definition: from_kernel.h:223
@ FileFsSizeInformation
Definition: from_kernel.h:221
#define FILE_OPEN_FOR_BACKUP_INTENT
Definition: from_kernel.h:42
Status
Definition: gdiplustypes.h:25
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3952
#define SYNCHRONIZE
Definition: nt_native.h:61
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define FileFsFullSizeInformation
Definition: ntifs_ex.h:389
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, ULONG Length, FS_INFORMATION_CLASS FsInformationClass)
WCHAR DeviceName[MAX_PATH]
Definition: diskpart.h:195
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNRECOGNIZED_VOLUME
Definition: udferr_usr.h:173
#define STATUS_NO_MEDIA_IN_DEVICE
Definition: udferr_usr.h:141
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by filesystems_main().

◆ ShowInstalledFileSystems()

static VOID ShowInstalledFileSystems ( VOID  )
static

Definition at line 128 of file filesystems.c.

129{
130 WCHAR szBuffer[256];
131 BOOLEAN ret;
132 DWORD dwIndex;
133 UCHAR uMajor, uMinor;
134 BOOLEAN bLatest;
135
137
138 for (dwIndex = 0; ; dwIndex++)
139 {
141 szBuffer,
142 &uMajor,
143 &uMinor,
144 &bLatest);
145 if (ret == FALSE)
146 break;
147
148 ConPrintf(StdOut, L" %s\n", szBuffer);
149 }
150
151 ConPuts(StdOut, L"\n");
152}
unsigned char BOOLEAN
void ConPrintf(FILE *fp, LPCWSTR psz,...)
Definition: fc.c:20
#define IDS_FILESYSTEMS_FORMATTING
Definition: resource.h:60
BOOLEAN NTAPI QueryAvailableFileSystemFormat(IN DWORD Index, IN OUT PWCHAR FileSystem, OUT UCHAR *Major, OUT UCHAR *Minor, OUT BOOLEAN *LatestVersion)
Definition: query.c:20
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by filesystems_main().