23#define Dbg (DEBUG_TRACE_VOLINFO)
72#if (NTDDI_VERSION >= NTDDI_WIN8)
83#pragma alloc_text(PAGE, FatCommonQueryVolumeInfo)
84#pragma alloc_text(PAGE, FatCommonSetVolumeInfo)
85#pragma alloc_text(PAGE, FatFsdQueryVolumeInformation)
86#pragma alloc_text(PAGE, FatFsdSetVolumeInformation)
87#pragma alloc_text(PAGE, FatQueryFsAttributeInfo)
88#pragma alloc_text(PAGE, FatQueryFsDeviceInfo)
89#pragma alloc_text(PAGE, FatQueryFsSizeInfo)
90#pragma alloc_text(PAGE, FatQueryFsVolumeInfo)
91#pragma alloc_text(PAGE, FatQueryFsFullSizeInfo)
92#pragma alloc_text(PAGE, FatSetFsLabelInfo)
93#if (NTDDI_VERSION >= NTDDI_WIN8)
94#pragma alloc_text(PAGE, FatQueryFsSectorSizeInfo)
103FatFsdQueryVolumeInformation (
150 Status = FatCommonQueryVolumeInfo( IrpContext,
Irp );
184FatFsdSetVolumeInformation (
231 Status = FatCommonSetVolumeInfo( IrpContext,
Irp );
263FatCommonQueryVolumeInfo (
319 Buffer =
Irp->AssociatedIrp.SystemBuffer;
339 FatVerifyFcb( IrpContext,
Vcb->RootDcb );
358 if (!FatAcquireSharedVcb( IrpContext,
Vcb )) {
368 WeAcquiredVcb =
TRUE;
395#if (NTDDI_VERSION >= NTDDI_WIN8)
396 case FileFsSectorSizeInformation:
440FatCommonSetVolumeInfo (
493 Buffer =
Irp->AssociatedIrp.SystemBuffer;
505 DebugTrace(-1,
Dbg,
"FatCommonSetVolumeInfo -> STATUS_ACCESS_DENIED\n", 0);
534 FatVerifyFcb( IrpContext,
Vcb->RootDcb );
625 Buffer->VolumeSerialNumber =
Vcb->Vpb->SerialNumber;
652 Buffer->VolumeLabelLength =
Vcb->Vpb->VolumeLabelLength;
655 &
Vcb->Vpb->VolumeLabel[0],
715 Buffer->TotalAllocationUnits.LowPart =
716 Vcb->AllocationSupport.NumberOfClusters;
717 Buffer->AvailableAllocationUnits.LowPart =
718 Vcb->AllocationSupport.NumberOfFreeClusters;
720 Buffer->SectorsPerAllocationUnit =
Vcb->Bpb.SectorsPerCluster;
721 Buffer->BytesPerSector =
Vcb->Bpb.BytesPerSector;
786 Buffer->Characteristics =
Vcb->TargetDeviceObject->Characteristics;
869 FileSystemName[0] )) >= 10 ) {
873 FileSystemName[0] ) + 10;
894 FileSystemName[0] )) >= 6 ) {
898 FileSystemName[0] ) + 6;
968 Buffer->TotalAllocationUnits.LowPart =
969 Vcb->AllocationSupport.NumberOfClusters;
970 Buffer->CallerAvailableAllocationUnits.LowPart =
971 Vcb->AllocationSupport.NumberOfFreeClusters;
972 Buffer->ActualAvailableAllocationUnits.LowPart =
973 Buffer->CallerAvailableAllocationUnits.LowPart;
974 Buffer->SectorsPerAllocationUnit =
Vcb->Bpb.SectorsPerCluster;
975 Buffer->BytesPerSector =
Vcb->Bpb.BytesPerSector;
1029 WCHAR TmpBuffer[11];
1030 UCHAR OemBuffer[11];
1060 OemLabel.Buffer = (
PCHAR)&OemBuffer[0];
1061 OemLabel.Length = 0;
1062 OemLabel.MaximumLength = 11;
1084 if (OemLabel.Length > 0) {
1093 for (
i = 0;
i < (
ULONG)OemLabel.Length;
i += 1 ) {
1103 (OemLabel.Buffer[
i] ==
'.')) {
1112 if (OemLabel.Buffer[
i] ==
' ' &&
1121 OemLabel.Length = LastSpaceIndex;
1131 UpcasedLabel.
Buffer = &TmpBuffer[0];
1160 if (OemLabel.Length > 0) {
1166 if ((
UCHAR)OemLabel.Buffer[0] == 0xe5) {
1175 FatLocateVolumeLabel( IrpContext,
1194 FatPrepareWriteDirectoryFile( IrpContext,
1216 FatSetDirtyBcb( IrpContext, DirentBcb,
Vcb,
TRUE );
1243 Vcb->Vpb->VolumeLabelLength = UpcasedLabel.
Length;
1252 FatLocateVolumeLabel( IrpContext,
1273 NT_ASSERT( (
Vcb->RootDcb->Specific.Dcb.UnusedDirentVbo == 0xffffffff) ||
1282 FatSetDirtyBcb( IrpContext, DirentBcb,
Vcb,
TRUE );
1296 Vcb->Vpb->VolumeLabelLength = 0;
1308 DebugTrace(-1,
Dbg,
"FatSetFsALabelInfo -> STATUS_SUCCESS\n", 0);
1314#if (NTDDI_VERSION >= NTDDI_WIN8)
1358 ASSERT( *
Length >=
sizeof( FILE_FS_SECTOR_SIZE_INFORMATION ));
1365 Status = FsRtlGetSectorSizeInformation(
Vcb->Vpb->RealDevice,
1374 *
Length -=
sizeof( FILE_FS_SECTOR_SIZE_INFORMATION );
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ PFCB _In_ PDIRENT_ENUM_CONTEXT _Inout_ PDIRENT Dirent
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN TypeOfOpen
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
enum _TYPE_OF_OPEN TYPE_OF_OPEN
#define _Requires_lock_held_(lock)
#define NT_SUCCESS(StatCode)
#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR)
_In_ PIO_STACK_LOCATION IrpSp
#define FAT_DIRENT_REALLY_0E5
#define FAT_DIRENT_DELETED
#define IRP_CONTEXT_FLAG_WRITE_THROUGH
VOID FatUnpinRepinnedBcbs(IN PIRP_CONTEXT IrpContext)
VOID FatConstructLabelDirent(IN PIRP_CONTEXT IrpContext, IN OUT PDIRENT Dirent, IN POEM_STRING Label)
NTSTATUS FatQueryFsSectorSizeInfo(_In_ PIRP_CONTEXT IrpContext, _In_ PVCB Vcb, _Out_writes_bytes_(*Length) PFILE_FS_SECTOR_SIZE_INFORMATION Buffer, _Inout_ PULONG Length)
NTSTATUS FatQueryFsDeviceInfo(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_FS_DEVICE_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS FatQueryFsAttributeInfo(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS FatQueryFsVolumeInfo(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_FS_VOLUME_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS FatQueryFsFullSizeInfo(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_FS_FULL_SIZE_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS FatQueryFsSizeInfo(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_FS_SIZE_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS FatSetFsLabelInfo(IN PIRP_CONTEXT IrpContext, IN PVCB Vcb, IN PFILE_FS_LABEL_INFORMATION Buffer)
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
#define DebugTrace(INDENT, LEVEL, X, Y)
#define FatUnpinBcb(IRPCONTEXT, BCB)
NTSTATUS FatFsdPostRequest(IN PIRP_CONTEXT IrpContext, IN PIRP Irp)
TYPE_OF_OPEN FatDecodeFileObject(_In_ PFILE_OBJECT FileObject, _Outptr_ PVCB *Vcb, _Outptr_ PFCB *FcbOrDcb, _Outptr_ PCCB *Ccb)
IN PFCB IN PCCB IN TYPE_OF_OPEN IN BOOLEAN IN BOOLEAN TopLevel
#define FatCompleteRequest(IRPCONTEXT, IRP, STATUS)
#define FatAcquireExclusiveVcb(IC, V)
IN PDCB IN PCCB IN VBO IN OUT PULONG OUT PDIRENT OUT PBCB OUT PVBO ByteOffset
#define FatReleaseVcb(IRPCONTEXT, Vcb)
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
#define VCB_STATE_FLAG_WRITE_PROTECTED
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ FS_INFORMATION_CLASS FsInformationClass
#define FILE_READ_ONLY_VOLUME
@ FileFsDeviceInformation
@ FileFsAttributeInformation
@ FileFsVolumeInformation
struct _FILE_FS_SIZE_INFORMATION FILE_FS_SIZE_INFORMATION
enum _FSINFOCLASS FS_INFORMATION_CLASS
struct _FILE_FS_FULL_SIZE_INFORMATION FILE_FS_FULL_SIZE_INFORMATION
#define FILE_CASE_PRESERVED_NAMES
#define FILE_UNICODE_ON_DISK
#define FsRtlEnterFileSystem
#define FsRtlIsAnsiCharacterLegalFat(C, WILD)
#define FsRtlExitFileSystem
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
NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING *, const UNICODE_STRING *, BOOLEAN)
#define _Function_class_(x)
#define _Out_writes_bytes_(size)
#define _Analysis_assume_(expr)
_In_ UINT _In_ UINT BytesToCopy
DRIVER_DISPATCH(nfs41_FsdDispatch)
struct _FILE_FS_DEVICE_INFORMATION FILE_FS_DEVICE_INFORMATION
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define FileFsFullSizeInformation
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
#define _SEH2_AbnormalTermination()
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
#define IRP_MJ_QUERY_VOLUME_INFORMATION
NTSTATUS NTAPI RtlOemStringToCountedUnicodeString(IN OUT PUNICODE_STRING UniDest, IN PCOEM_STRING OemSource, IN BOOLEAN AllocateDestinationString)
#define STATUS_BUFFER_OVERFLOW
struct _IO_STACK_LOCATION::@3974::@3987 QueryVolume
union _IO_STACK_LOCATION::@1575 Parameters
struct _IO_STACK_LOCATION::@3974::@3988 SetVolume
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INVALID_VOLUME_LABEL
#define IRP_MJ_SET_VOLUME_INFORMATION