29 0, 0, 0, 0, 0, 0, 0, 0 };
36#define BugCheckFileId (CDFS_BUG_CHECK_CDDATA)
63CHAR CdXaId[] = {
'C',
'D',
'-',
'X',
'A',
'0',
'0',
'1' };
76CHAR CdAudioFileName[] = {
'T',
'r',
'a',
'c',
'k',
'0',
'0',
'.',
'c',
'd',
'a' };
181#ifdef CDFS_TELEMETRY_DATA
187CDFS_TELEMETRY_DATA_CONTEXT CdTelemetryData;
192#pragma alloc_text(PAGE, CdFastIoCheckIfPossible)
193#pragma alloc_text(PAGE, CdSerial32)
194#pragma alloc_text(PAGE, CdSetThreadContext)
260 PVOID PreviousTopLevel;
298 if (IrpContext ==
NULL) {
349 switch (IrpContext->MajorFunction) {
353 Status = CdCommonCreate( IrpContext,
Irp );
358 Status = CdCommonClose( IrpContext,
Irp );
374 Status = CdCommonRead( IrpContext,
Irp );
381 Status = CdCommonWrite( IrpContext,
Irp );
386 Status = CdCommonQueryInfo( IrpContext,
Irp );
391 Status = CdCommonSetInfo( IrpContext,
Irp );
396 Status = CdCommonQueryVolInfo( IrpContext,
Irp );
401 Status = CdCommonDirControl( IrpContext,
Irp );
406 Status = CdCommonFsControl( IrpContext,
Irp );
421 Status = CdCommonCleanup( IrpContext,
Irp );
431 Status = CdCommonShutdown( IrpContext,
Irp );
480 if (CdTestRaisedStatus && !CdBreakOnAnyRaise) {
485 Index < (
sizeof( CdInterestingExceptionCodes) /
sizeof( CdInterestingExceptionCodes[0]));
497 if (BreakIn || CdBreakOnAnyRaise) {
499 DbgPrint(
"CDFS: Breaking on raised status %08x (BI=%d,BA=%d)\n",
Status, BreakIn, CdBreakOnAnyRaise);
501 DbgPrint(
"CDFS: Contact CDFS.SYS component owner for triage.\n");
502 DbgPrint(
"CDFS: 'eb %p 0;eb %p 0' to disable this alert.\n", &CdTestRaisedStatus, &CdBreakOnAnyRaise);
507 if (NormalizeStatus) {
513 IrpContext->ExceptionStatus =
Status;
516 IrpContext->RaisedAtLineFile = (FileId << 16) |
Line;
555 ExceptionCode = ExceptionPointer->ExceptionRecord->ExceptionCode;
563 (ExceptionPointer->ExceptionRecord->NumberParameters >= 3)) {
566 (
NTSTATUS)ExceptionPointer->ExceptionRecord->ExceptionInformation[2];
602#pragma prefast( suppress: __WARNING_USE_OTHER_FUNCTION, "We're corrupted." )
605 (
ULONG_PTR) ExceptionPointer->ContextRecord,
606 (
ULONG_PTR) ExceptionPointer->ExceptionRecord->ExceptionAddress );
782 if (IrpContext->Vcb) {
784 Device = IrpContext->Vcb->Vpb->RealDevice;
806 return CdPerformVerify( IrpContext,
Irp,
Device );
860 if (IrpContext->Vcb) {
862 Device = IrpContext->Vcb->Vpb->RealDevice;
966 Irp->IoStatus.Information = 0;
1030 if (CurrentThreadContext ==
NULL) {
1055#pragma warning(suppress: 6011)
1062 ((
ULONG_PTR) CurrentThreadContext <= StackTop) ||
1065 (CurrentThreadContext->
Cdfs != 0x53464443))) {
1067 ThreadContext->Cdfs = 0x53464443;
1068 ThreadContext->SavedTopLevelIrp = (PIRP) CurrentThreadContext;
1069 ThreadContext->TopLevelIrpContext = IrpContext;
1070 IoSetTopLevelIrp( (PIRP) ThreadContext );
1072 IrpContext->TopLevel = IrpContext;
1073 IrpContext->ThreadContext = ThreadContext;
1075 SetFlag( IrpContext->Flags, IRP_CONTEXT_FLAG_TOP_LEVEL_CDFS );
1083 IrpContext->TopLevel = CurrentThreadContext->TopLevelIrpContext;
1221 Checksum.SerialId = 0;
1240 return Checksum.SerialId;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LONG CdXAAudioPhileHeader[]
USHORT CdAudioLabelLength
UCHAR CdAudioFileNameLength
WCHAR CdUnicodeSelfArray[]
VOID CdCompleteRequest(_Inout_opt_ PIRP_CONTEXT IrpContext, _Inout_opt_ PIRP Irp, _In_ NTSTATUS Status)
WCHAR CdUnicodeParentArray[]
ULONG CdSerial32(_In_reads_bytes_(ByteCount) PCHAR Buffer, _In_ ULONG ByteCount)
LONG CdExceptionFilter(_Inout_ PIRP_CONTEXT IrpContext, _In_ PEXCEPTION_POINTERS ExceptionPointer)
ULONG CdAudioDirentsPerSector
VOID CdSetThreadContext(_Inout_ PIRP_CONTEXT IrpContext, _In_ PTHREAD_CONTEXT ThreadContext)
FAST_IO_DISPATCH CdFastIoDispatch
UNICODE_STRING CdUnicodeDirectoryNames[]
ULONG CdAudioSystemUseOffset
#define ASSERT_OPTIONAL_IRP_CONTEXT(IC)
#define ASSERT_IRP_CONTEXT(IC)
#define ASSERT_OPTIONAL_IRP(I)
NTSTATUS CdCompleteMdl(_In_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
_In_ PFCB _In_ LONGLONG FileOffset
VOID CdCleanupIrpContext(_In_ PIRP_CONTEXT IrpContext, _In_ BOOLEAN Post)
_Inout_ PIRP _In_ NTSTATUS ExceptionCode
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN TypeOfOpen
INLINE DECLSPEC_NORETURN VOID CdRaiseStatusEx(_In_ PIRP_CONTEXT IrpContext, _In_ NTSTATUS Status, _In_ BOOLEAN NormalizeStatus, _In_ ULONG Fileid, _In_ ULONG Line)
FAST_IO_CHECK_IF_POSSIBLE CdFastIoCheckIfPossible
#define AssertVerifyDevice(C, S)
#define AssertVerifyDeviceIrp(I)
TYPE_OF_OPEN CdFastDecodeFileObject(_In_ PFILE_OBJECT FileObject, _Out_ PFCB *Fcb)
NTSTATUS CdCommonLockControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
enum _TYPE_OF_OPEN TYPE_OF_OPEN
NTSTATUS CdCommonDevControl(_Inout_ PIRP_CONTEXT IrpContext, _Inout_ PIRP Irp)
_Ret_valid_ PIRP_CONTEXT CdCreateIrpContext(_In_ PIRP Irp, _In_ BOOLEAN Wait)
#define IRP_CONTEXT_FLAG_FORCE_POST
THREAD_CONTEXT * PTHREAD_CONTEXT
#define IRP_CONTEXT_FLAG_DISABLE_POPUPS
#define IRP_CONTEXT_FLAG_TOP_LEVEL
#define IRP_CONTEXT_FLAG_MORE_PROCESSING
#define _Requires_lock_held_(lock)
#define CdBugCheck(A, B, C)
#define CDFS_NTC_IRP_CONTEXT
#define SafeNodeType(Ptr)
#define _IRQL_requires_same_
#define __drv_dispatchType(x)
#define _IRQL_requires_max_(irql)
#define PsGetCurrentThread()
#define KeGetCurrentIrql()
#define ClearFlag(_F, _SF)
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN CheckForReadOperation
BOOLEAN NTAPI FsRtlFastCheckLockForRead(IN PFILE_LOCK FileLock, IN PLARGE_INTEGER FileOffset, IN PLARGE_INTEGER Length, IN ULONG Key, IN PFILE_OBJECT FileObject, IN PVOID Process)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define EXCEPTION_EXECUTE_HANDLER
#define _Function_class_(x)
#define _In_reads_bytes_(size)
#define _Post_equal_to_(expr)
#define _When_(expr, annos)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
DRIVER_DISPATCH(nfs41_FsdDispatch)
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define ARGUMENT_PRESENT(ArgumentPointer)
BOOLEAN NTAPI FsRtlIsNtstatusExpected(IN NTSTATUS NtStatus)
NTSTATUS NTAPI FsRtlNormalizeNtstatus(IN NTSTATUS NtStatusToNormalize, IN NTSTATUS NormalizedNtStatus)
VOID NTAPI IoRaiseHardError(IN PIRP Irp, IN PVPB Vpb, IN PDEVICE_OBJECT RealDeviceObject)
#define IoCompleteRequest
PIRP NTAPI IoGetTopLevelIrp(VOID)
VOID NTAPI IoSetDeviceToVerify(IN PETHREAD Thread, IN PDEVICE_OBJECT DeviceObject)
VOID NTAPI IoGetStackLimits(OUT PULONG_PTR LowLimit, OUT PULONG_PTR HighLimit)
PDEVICE_OBJECT NTAPI IoGetDeviceToVerify(IN PETHREAD Thread)
BOOLEAN NTAPI KeAreAllApcsDisabled(VOID)
#define STATUS_IN_PAGE_ERROR
#define STATUS_UNEXPECTED_IO_ERROR
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
#define IRP_MJ_DIRECTORY_CONTROL
#define IRP_MJ_DEVICE_CONTROL
#define IRP_MJ_QUERY_VOLUME_INFORMATION
#define IRP_MJ_LOCK_CONTROL
#define IRP_MJ_SET_INFORMATION
#define IRP_MJ_QUERY_INFORMATION
#define FIELD_OFFSET(t, f)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_DRIVER_INTERNAL_ERROR
#define STATUS_INVALID_PARAMETER
#define STATUS_DISK_CORRUPT_ERROR
#define STATUS_VERIFY_REQUIRED
#define STATUS_FILE_CORRUPT_ERROR
_Must_inspect_result_ _In_ WDFDEVICE Device
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_In_ WDFDPC _In_ BOOLEAN Wait
#define IoIsErrorUserInduced(Status)
LOGICAL NTAPI IoWithinStackLimits(_In_ ULONG_PTR RegionStart, _In_ SIZE_T RegionSize)
#define IRP_INPUT_OPERATION
#define IRP_MJ_FILE_SYSTEM_CONTROL
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
#define IO_CD_ROM_INCREMENT
#define PsGetCurrentProcess