22#define UDF_BUG_CHECK_ID UDF_FILE_VOL_INFORMATION
113 Irp->IoStatus.Status = RC;
114 Irp->IoStatus.Information = 0;
167 UDFPrint((
"UDFCommonQueryVolInfo: \n"));
188#ifdef UDF_ENABLE_SECURITY
190 Ccb->PreviouslyGrantedAccess,
243 Irp->IoStatus.Information = 0;
273 Irp->IoStatus.Status = RC;
312 UDFPrint((
" UDFQueryFsVolumeInfo: \n"));
314 Buffer->VolumeCreationTime.QuadPart =
Vcb->VolCreationTime;
315 Buffer->VolumeSerialNumber =
Vcb->PhSerialNumber;
361 UDFPrint((
" UDFQueryFsSizeInfo: \n"));
363 if(
Vcb->BitmapModified) {
364 Vcb->TotalAllocUnits =
366 Vcb->FreeAllocUnits =
370 Buffer->TotalAllocationUnits.QuadPart =
Vcb->TotalAllocUnits;
371 Buffer->AvailableAllocationUnits.QuadPart =
Vcb->FreeAllocUnits;
374 if(!
Buffer->TotalAllocationUnits.QuadPart)
375 Buffer->TotalAllocationUnits.QuadPart =
max(1,
Vcb->LastPossibleLBA);
376 Buffer->SectorsPerAllocationUnit =
Vcb->LBlockSize /
Vcb->BlockSize;
377 if(!
Buffer->SectorsPerAllocationUnit)
378 Buffer->SectorsPerAllocationUnit = 1;
380 if(!
Buffer->BytesPerSector)
381 Buffer->BytesPerSector = 2048;
383 UDFPrint((
" Space: Total %I64x, Free %I64x\n",
384 Buffer->TotalAllocationUnits.QuadPart,
385 Buffer->AvailableAllocationUnits.QuadPart));
413 UDFPrint((
" UDFQueryFsFullSizeInfo: \n"));
415 if(
Vcb->BitmapModified) {
416 Vcb->TotalAllocUnits =
418 Vcb->FreeAllocUnits =
419 Buffer->CallerAvailableAllocationUnits.QuadPart =
423 Buffer->TotalAllocationUnits.QuadPart =
Vcb->TotalAllocUnits;
424 Buffer->CallerAvailableAllocationUnits.QuadPart =
425 Buffer->ActualAvailableAllocationUnits.QuadPart =
Vcb->FreeAllocUnits;
427 if(!
Buffer->TotalAllocationUnits.QuadPart)
428 Buffer->TotalAllocationUnits.QuadPart =
max(1,
Vcb->LastPossibleLBA);
429 Buffer->SectorsPerAllocationUnit =
Vcb->LBlockSize /
Vcb->BlockSize;
430 if(!
Buffer->SectorsPerAllocationUnit)
431 Buffer->SectorsPerAllocationUnit = 1;
433 if(!
Buffer->BytesPerSector)
434 Buffer->BytesPerSector = 2048;
436 UDFPrint((
" Space: Total %I64x, Free %I64x\n",
437 Buffer->TotalAllocationUnits.QuadPart,
438 Buffer->ActualAvailableAllocationUnits.QuadPart));
466 UDFPrint((
" UDFQueryFsDeviceInfo: \n"));
475 Buffer->Characteristics =
Vcb->TargetDeviceObject->Characteristics;
477 Buffer->DeviceType =
Vcb->TargetDeviceObject->DeviceType;
478 UDFPrint((
" Characteristics %x, DeviceType %x\n",
Buffer->Characteristics,
Buffer->DeviceType));
507 ULONG FsTypeTitleLen;
510 UDFPrint((
" UDFQueryFsAttributeInfo: \n"));
518#ifdef UDF_ENABLE_SECURITY
532#define UDFSetFsTitle(tit) \
533 FsTypeTitle = UDF_FS_TITLE_##tit; \
534 FsTypeTitleLen = sizeof(UDF_FS_TITLE_##tit) - sizeof(WCHAR);
536 switch(
Vcb->TargetDeviceObject->DeviceType) {
597 if (*
Length >= FsTypeTitleLen) {
613#ifndef UDF_READ_ONLY_BUILD
684 UDFPrint((
"UDFCommonSetVolInfo: \n"));
698 UDFPrint((
" Can't change Label on Non-volume object\n"));
708 UDFPrint((
" Can't change Label on blank volume ;)\n"));
720#ifdef UDF_ENABLE_SECURITY
722 Ccb->PreviouslyGrantedAccess,
737 Irp->IoStatus.Information = 0;
743 Irp->IoStatus.Information = 0;
774 Irp->IoStatus.Status = RC;
804 UDFPrint((
" UDFSetLabelInfo: STATUS_INVALID_VOLUME_LABEL\n"));
815 Vcb->VolIdent.Buffer[
Buffer->VolumeLabelLength/
sizeof(
WCHAR)] = 0;
818 UDFPrint((
" UDFSetLabelInfo: OK\n"));
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
int64 __fastcall UDFGetTotalSpace(IN PVCB Vcb)
int64 __fastcall UDFGetFreeSpace(IN PVCB Vcb)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
#define CdMediaClass_DVDR
#define CdMediaClass_DVDRW
#define CdMediaClass_CDROM
#define CdMediaClass_DVDRAM
#define CdMediaClass_DVDROM
#define CdMediaClass_DVDpR
#define CdMediaClass_DVDpRW
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
NTSTATUS UDFExceptionHandler(PtrUDFIrpContext PtrIrpContext, PIRP Irp)
BOOLEAN __fastcall UDFIsIrpTopLevel(PIRP Irp)
VOID UDFLogEvent(NTSTATUS UDFEventLogId, NTSTATUS RC)
NTSTATUS UDFPostRequest(IN PtrUDFIrpContext PtrIrpContext, IN PIRP Irp)
PtrUDFIrpContext UDFAllocateIrpContext(PIRP Irp, PDEVICE_OBJECT PtrTargetDeviceObject)
VOID UDFReleaseIrpContext(PtrUDFIrpContext PtrIrpContext)
long UDFExceptionFilter(PtrUDFIrpContext PtrIrpContext, PEXCEPTION_POINTERS PtrExceptionPointers)
#define UDFReleaseResource(Resource)
#define UDFAcquireResourceShared(Resource, CanWait)
#define UDF_ERROR_INTERNAL_ERROR
VOID UDFFlushTryBreak(IN PVCB Vcb)
#define FILE_NAMED_STREAMS
#define FILE_SUPPORTS_SPARSE_FILES
#define FILE_READ_ONLY_VOLUME
@ FileFsDeviceInformation
@ FileFsAttributeInformation
@ FileFsVolumeInformation
struct _FILE_FS_SIZE_INFORMATION FILE_FS_SIZE_INFORMATION
#define FILE_PERSISTENT_ACLS
#define FILE_CASE_SENSITIVE_SEARCH
struct _FILE_FS_FULL_SIZE_INFORMATION FILE_FS_FULL_SIZE_INFORMATION
#define FILE_CASE_PRESERVED_NAMES
#define FILE_UNICODE_ON_DISK
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
VOID UDFSetModified(IN PVCB Vcb)
_In_ UINT _In_ UINT BytesToCopy
#define FILE_WRITE_ONCE_MEDIA
struct _FILE_FS_DEVICE_INFORMATION FILE_FS_DEVICE_INFORMATION
#define FILE_READ_ONLY_DEVICE
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define FileFsFullSizeInformation
#define IoCompleteRequest
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
NTSTATUS NTAPI IoCheckFunctionAccess(IN ACCESS_MASK GrantedAccess, IN UCHAR MajorFunction, IN UCHAR MinorFunction, IN ULONG IoControlCode, IN PVOID ExtraData OPTIONAL, IN PVOID ExtraData2 OPTIONAL)
#define UDF_VOL_LABEL_LEN
#define FILE_DEVICE_CD_ROM
#define _SEH2_AbnormalTermination()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
#define STATUS_BUFFER_OVERFLOW
#define UDF_IRP_CONTEXT_CAN_BLOCK
struct _UDFContextControlBlock * PtrUDFCCB
#define UDF_NODE_TYPE_VCB
struct _FCB::@729::@732 Fcb
struct _IO_STACK_LOCATION::@3978::@3991 QueryVolume
struct _IO_STACK_LOCATION::@3978::@3992 SetVolume
PDEVICE_OBJECT DeviceObject
union _IO_STACK_LOCATION::@1579 Parameters
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define UDF_VCB_FLAGS_VOLUME_READ_ONLY
#define UDF_VCB_FLAGS_RAW_DISK
#define UDF_VCB_SKIP_EJECT_CHECK
#define UDFStreamsSupported(Vcb)
#define UDFNtAclSupported(Vcb)
#define UDF_DEFAULT_FE_CHARGE
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_INVALID_VOLUME_LABEL
#define STATUS_INSUFFICIENT_RESOURCES
NTSTATUS NTAPI UDFQueryVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS UDFQueryFsFullSizeInfo(IN PtrUDFIrpContext PtrIrpContext, IN PVCB Vcb, IN PFILE_FS_FULL_SIZE_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS UDFCommonQueryVolInfo(PtrUDFIrpContext PtrIrpContext, PIRP Irp)
NTSTATUS UDFCommonSetVolInfo(PtrUDFIrpContext PtrIrpContext, PIRP Irp)
NTSTATUS UDFQueryFsDeviceInfo(IN PtrUDFIrpContext PtrIrpContext, IN PVCB Vcb, IN PFILE_FS_DEVICE_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS UDFSetLabelInfo(IN PtrUDFIrpContext PtrIrpContext, IN PVCB Vcb, IN PFILE_FS_LABEL_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS UDFQueryFsVolumeInfo(IN PtrUDFIrpContext PtrIrpContext, IN PVCB Vcb, IN PFILE_FS_VOLUME_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS UDFQueryFsSizeInfo(IN PtrUDFIrpContext PtrIrpContext, IN PVCB Vcb, IN PFILE_FS_SIZE_INFORMATION Buffer, IN OUT PULONG Length)
NTSTATUS UDFQueryFsAttributeInfo(IN PtrUDFIrpContext PtrIrpContext, IN PVCB Vcb, IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer, IN OUT PULONG Length)
#define UDFSetFsTitle(tit)
NTSTATUS NTAPI UDFSetVolInfo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
#define IO_DISK_INCREMENT