40#define FirstDriveLetter 'C'
41#define LastDriveLetter 'Z'
56GetConfigurationDataConversionTypeAllToTypeOne(
64GetConfigurationDataSynthesize(
68 _In_ size_t OutputBufferSize,
76RequestGetScsiPassThroughCdb(
82#pragma alloc_text(PAGE, DeviceIsPlayActive)
83#pragma alloc_text(PAGE, RequestHandleGetDvdRegion)
84#pragma alloc_text(PAGE, RequestHandleReadTOC)
85#pragma alloc_text(PAGE, RequestHandleReadTocEx)
86#pragma alloc_text(PAGE, RequestHandleGetConfiguration)
87#pragma alloc_text(PAGE, RequestHandleGetDriveGeometry)
88#pragma alloc_text(PAGE, RequestHandleDiskVerify)
89#pragma alloc_text(PAGE, RequestHandleCheckVerify)
90#pragma alloc_text(PAGE, RequestHandleFakePartitionInfo)
91#pragma alloc_text(PAGE, RequestHandleEjectionControl)
92#pragma alloc_text(PAGE, RequestHandleEnableStreaming)
93#pragma alloc_text(PAGE, RequestHandleSendOpcInformation)
94#pragma alloc_text(PAGE, RequestHandleGetPerformance)
95#pragma alloc_text(PAGE, RequestHandleMcnSyncFakeIoctl)
96#pragma alloc_text(PAGE, RequestHandleLoadEjectMedia)
97#pragma alloc_text(PAGE, RequestHandleReserveRelease)
98#pragma alloc_text(PAGE, RequestHandlePersistentReserve)
99#pragma alloc_text(PAGE, DeviceHandleRawRead)
100#pragma alloc_text(PAGE, DeviceHandlePlayAudioMsf)
101#pragma alloc_text(PAGE, DeviceHandleReadQChannel)
102#pragma alloc_text(PAGE, ReadQChannel)
103#pragma alloc_text(PAGE, DeviceHandlePauseAudio)
104#pragma alloc_text(PAGE, DeviceHandleResumeAudio)
105#pragma alloc_text(PAGE, DeviceHandleSeekAudioMsf)
106#pragma alloc_text(PAGE, DeviceHandleStopAudio)
107#pragma alloc_text(PAGE, DeviceHandleGetSetVolume)
108#pragma alloc_text(PAGE, DeviceHandleReadDvdStructure)
109#pragma alloc_text(PAGE, ReadDvdStructure)
110#pragma alloc_text(PAGE, DeviceHandleDvdEndSession)
111#pragma alloc_text(PAGE, DeviceHandleDvdStartSessionReadKey)
112#pragma alloc_text(PAGE, DvdStartSessionReadKey)
113#pragma alloc_text(PAGE, DeviceHandleDvdSendKey)
114#pragma alloc_text(PAGE, DvdSendKey)
115#pragma alloc_text(PAGE, DeviceHandleSetReadAhead)
116#pragma alloc_text(PAGE, DeviceHandleSetSpeed)
117#pragma alloc_text(PAGE, RequestHandleExclusiveAccessQueryLockState)
118#pragma alloc_text(PAGE, RequestHandleExclusiveAccessLockDevice)
119#pragma alloc_text(PAGE, RequestHandleExclusiveAccessUnlockDevice)
120#pragma alloc_text(PAGE, RequestHandleScsiPassThrough)
121#pragma alloc_text(PAGE, RequestGetScsiPassThroughCdb)
122#pragma alloc_text(PAGE, GetConfigurationDataConversionTypeAllToTypeOne)
123#pragma alloc_text(PAGE, GetConfigurationDataSynthesize)
154 ULONG sendOptionsFlags = 0;
157 WdfRequestFormatRequestUsingCurrentType(
Request);
215 size_t bytesRead = 0;
230 if (currentBuffer ==
NULL)
240 status = ReadQChannel(deviceExtension,
295 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
316 (outputBuffer !=
NULL))
320 cdData->CachedInquiryData,
360 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
364 ULONG sizeNeeded = 0;
390 (mediaTypes !=
NULL))
433 ((zpoddInfo ==
NULL) ||
446 status = DeviceSendSrbSynchronously(DeviceExtension->Device,
472 "RequestHandleGetMediaTypeEx: GET_MEDIA_TYPES status of TUR - %lx\n",
status));
487RequestHandleGetDvdRegion(
513 size_t bytesReturned = 0;
526 "RequestHandleGetDvdRegion: [%p] IOCTL_DVD_GET_REGION\n",
Request));
531 if (DeviceExtension->DeviceAdditionalData.DriveDeviceType !=
FILE_DEVICE_DVD)
549 keyLength =
max(keyLength,
559 if (readStructure ==
NULL)
571 status = ReadDvdStructure(DeviceExtension,
588 dvdRegion = outputBuffer;
600 status = DvdStartSessionReadKey(DeviceExtension,
635 "RequestHandleGetDvdRegion => rpcKey->RpcScheme != 1\n"));
641 if (readStructure !=
NULL)
676 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
706 if (inputBuffer !=
NULL)
752 "RequestValidateRawRead: Invalid TrackMode type %x for XA read\n",
758 endOffset += startingOffset.
QuadPart;
764 "RequestValidateRawRead: Invalid I/O parameters for XA "
765 "Read (zero sectors requested)\n"));
771 "RequestValidateRawRead: Invalid I/O parameters for XA "
772 "Read (TransferBytes Overflow)\n"));
778 "RequestValidateRawRead: Invalid I/O parameters for XA "
779 "Read (EndingOffset Overflow)\n"));
785 "RequestValidateRawRead: Invalid I/O parameters for XA "
786 "Read (Bad buffer size)\n"));
789 else if (endOffset > (
ULONGLONG)DeviceExtension->PartitionLength.QuadPart)
792 "RequestValidateRawRead: Invalid I/O parameters for XA "
793 "Read (Request Out of Bounds)\n"));
806 if (mdlBytes < transferBytes)
809 "RequestValidateRawRead: Invalid MDL %s, Irp %p\n",
821 DeviceExtension->AdapterDescriptor->AlignmentMask )
824 "RequestValidateRawRead: Invalid I/O parameters for "
825 "XA Read (Buffer %p not aligned with mask %x\n",
827 DeviceExtension->AdapterDescriptor->AlignmentMask));
842 bufferIsPageAligned =
TRUE;
845 if (bufferIsPageAligned)
857 "RequestValidateRawRead: The XA Read (type %x) would require %I64x bytes, "
858 "but the adapter can only handle %x bytes (for a%saligned buffer)\n",
862 (bufferIsPageAligned ?
" " :
"n un")
935 DeviceExtension->AdapterDescriptor->AlignmentMask)
1020 DeviceExtension->AdapterDescriptor->AlignmentMask)
1063 DeviceExtension->AdapterDescriptor->AlignmentMask)
1097 ULONG transferByteCount = 0;
1184 "RequestValidateDvdReadStructure - input buffer "
1185 "length too small (was %d should be %d)\n",
1195 "RequestValidateDvdReadStructure - output buffer "
1196 "cannot hold header information\n"));
1205 "RequestValidateDvdReadStructure - output buffer "
1210 DeviceExtension->AdapterDescriptor->AlignmentMask)
1214 else if (DeviceExtension->DeviceAdditionalData.DriveDeviceType !=
FILE_DEVICE_DVD)
1258 "RequestValidateDvdStartSession: DVD_START_SESSION - output "
1259 "buffer too small\n"));
1263 else if (DeviceExtension->DeviceAdditionalData.DriveDeviceType !=
FILE_DEVICE_DVD)
1321 "RequestValidateDvdSendKey: [%p] IOCTL_DVD_SEND_KEY - "
1322 "key is too small or does not match KeyLength\n",
1353 else if (DeviceExtension->DeviceAdditionalData.DriveDeviceType !=
FILE_DEVICE_DVD)
1405 DeviceExtension->AdapterDescriptor->AlignmentMask)
1414#if BUILD_WOW64_ENABLED && defined(_WIN64)
1416 if (WdfRequestIsFrom32BitProcess(
Request))
1418 PGET_CONFIGURATION_IOCTL_INPUT32 inputBuffer =
NULL;
1421 sizeof(GET_CONFIGURATION_IOCTL_INPUT32))
1439 if (inputBuffer->Feature > 0xffff)
1449 else if (inputBuffer->Reserved[0] || inputBuffer->Reserved[1])
1479 if (inputBuffer->
Feature > 0xffff)
1527 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
1529 ULONG requiredLength = 0;
1610 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
1641 if (*layerNumber > 255)
1675 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
1723 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
1783 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
1852 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
1921 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
1981 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
2050 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
2119 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
2189 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
2226 else if (inputBuffer->NumberOfSectors > 255)
2270 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_IOCTL,
"RequestValidateExclusiveAccess: IOCTL must be called at passive level.\n"));
2276 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_IOCTL,
"RequestValidateExclusiveAccess: Input buffer too small\n"));
2300 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_IOCTL,
"RequestValidateExclusiveAccess: Output buffer too small\n"));
2315 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_IOCTL,
"RequestValidateExclusiveAccess: Input buffer too small\n"));
2333 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_IOCTL,
"RequestValidateExclusiveAccess: Invalid request type\n"));
2344RequestHandleExclusiveAccessQueryLockState(
2376 &exclusiveLockState,
2405RequestHandleExclusiveAccessLockDevice(
2434 WDFFILEOBJECT fileObject =
NULL;
2436 ULONG nameLength = 0;
2440 fileObject = WdfRequestGetFileObject(
Request);
2442 if (fileObject ==
NULL)
2447 "RequestHandleExclusiveAccessLockDevice: FileObject is NULL, cannot grant exclusive access\n"));
2466 "RequestHandleExclusiveAccessLockDevice: Invalid characters in caller name\n"));
2480 "RequestHandleExclusiveAccessLockDevice: Not a valid null terminated string.\n"));
2499 "RequestHandleExclusiveAccessLockDevice: Unable to lock device, file system mounted\n"));
2510 "RequestHandleExclusiveAccessLockDevice: Entering exclusive mode! Device locked by file object %p\n", fileObject));
2520 &GUID_IO_CDROM_EXCLUSIVE_LOCK,
2529 if (logEntry !=
NULL)
2554 "RequestHandleExclusiveAccessLockDevice: Unable to lock device, device already locked.\n"));
2567RequestHandleExclusiveAccessUnlockDevice(
2591 WDFFILEOBJECT fileObject =
NULL;
2595 fileObject = WdfRequestGetFileObject(
Request);
2597 if (fileObject ==
NULL)
2603 "RequestHandleExclusiveAccessUnlockDevice: FileObject is NULL, cannot release exclusive access\n"));
2616 status = DeviceUnlockExclusive(deviceExtension, fileObject,
2619 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_IOCTL,
"RequestHandleExclusiveAccessUnlockDevice: Device unlocked\n"));
2678 *
DataLength = DeviceExtension->DeviceDescriptor->Size;
2684 CHAR* localDescriptorBuffer = (
CHAR*)DeviceExtension->DeviceDescriptor;
2695 DeviceExtension->DeviceDescriptor->Size);
2698 DeviceExtension->DeviceDescriptor,
2703 (DeviceExtension->DeviceDescriptor->VendorIdOffset != 0) &&
2704 (DeviceExtension->DeviceDescriptor->VendorIdOffset != 0xFFFFFFFF))
2708 (DeviceExtension->DeviceDescriptor->VendorIdOffset +
strlen(localDescriptorBuffer + DeviceExtension->DeviceDescriptor->VendorIdOffset)))
2710 outputDescriptor->VendorIdOffset = 0;
2715 (DeviceExtension->DeviceDescriptor->ProductIdOffset != 0) &&
2716 (DeviceExtension->DeviceDescriptor->ProductIdOffset != 0xFFFFFFFF))
2720 (DeviceExtension->DeviceDescriptor->ProductIdOffset +
strlen(localDescriptorBuffer + DeviceExtension->DeviceDescriptor->ProductIdOffset)))
2722 outputDescriptor->ProductIdOffset = 0;
2727 (DeviceExtension->DeviceDescriptor->ProductRevisionOffset != 0) &&
2728 (DeviceExtension->DeviceDescriptor->ProductRevisionOffset != 0xFFFFFFFF))
2732 (DeviceExtension->DeviceDescriptor->ProductRevisionOffset +
strlen(localDescriptorBuffer + DeviceExtension->DeviceDescriptor->ProductRevisionOffset)))
2734 outputDescriptor->ProductRevisionOffset = 0;
2739 (DeviceExtension->DeviceDescriptor->SerialNumberOffset != 0) &&
2740 (DeviceExtension->DeviceDescriptor->SerialNumberOffset != 0xFFFFFFFF))
2744 (DeviceExtension->DeviceDescriptor->SerialNumberOffset +
strlen(localDescriptorBuffer + DeviceExtension->DeviceDescriptor->SerialNumberOffset)))
2748 outputDescriptor->SerialNumberOffset = 0;
2767 *
DataLength = DeviceExtension->AdapterDescriptor->Size;
2782 DeviceExtension->AdapterDescriptor->Size);
2785 DeviceExtension->AdapterDescriptor,
2826 size_t outLength = 0;
2831 WdfRequestGetParameters(
Request, &requestParameters);
3008 WdfRequestGetParameters(
Request, &requestParameters);
3090 writeCache->NVCacheEnabled =
FALSE;
3117 writeCache->FlushCacheSupported =
TRUE;
3123 "RequestHandleQueryPropertyWriteCache: Synchronize cache failed with status 0x%X\n",
status));
3124 writeCache->FlushCacheSupported =
FALSE;
3134 if (modeData ==
NULL)
3137 "RequestHandleQueryPropertyWriteCache: Unable to allocate mode data buffer\n"));
3146 length = DeviceRetrieveModeSenseUsingScratch(deviceExtension,
3155 length = DeviceRetrieveModeSenseUsingScratch(deviceExtension,
3163 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_IOCTL,
"RequestHandleQueryPropertyWriteCache: Mode Sense failed\n"));
3179 pageData = ModeSenseFindSpecificPage((
PCHAR)modeData,
3185 if (pageData ==
NULL)
3187 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_IOCTL,
"RequestHandleQueryPropertyWriteCache: Unable to find caching mode page.\n"));
3217 length = DeviceRetrieveModeSenseUsingScratch(deviceExtension,
3226 length = DeviceRetrieveModeSenseUsingScratch(deviceExtension,
3234 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_IOCTL,
"RequestHandleQueryPropertyWriteCache: Mode Sense failed\n"));
3254 pageData = ModeSenseFindSpecificPage((
PCHAR)modeData,
3259 if (pageData ==
NULL)
3261 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_IOCTL,
"RequestHandleQueryPropertyWriteCache: Unable to find caching mode page.\n"));
3313 ULONG keyLength = 0;
3327 "DvdDeviceControl: EstablishDriveKey - challenge "
3328 "key buffer too small\n"));
3335 switch(keyParameters->
KeyType)
3386 "DvdDeviceControl: EstablishDriveKey - output "
3387 "buffer too small\n"));
3392 DeviceExtension->AdapterDescriptor->AlignmentMask)
3396 else if (DeviceExtension->DeviceAdditionalData.DriveDeviceType !=
FILE_DEVICE_DVD)
3451 "DvdDeviceControl: EndSession - input buffer too "
3489 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
3676 (
PVOID*)&writeSpeedRequest,
3695 &performanceRequest,
3753RequestGetScsiPassThroughCdb(
3774 ULONG inputBufferLength = 0;
3784 (
Irp->AssociatedIrp.SystemBuffer !=
NULL))
3787 inputBuffer =
Irp->AssociatedIrp.SystemBuffer;
3788 legacyPassThrough =
TRUE;
3793 legacyPassThrough =
FALSE;
3801#if BUILD_WOW64_ENABLED && defined(_WIN64)
3803 if (IoIs32bitProcess(
Irp))
3805 if (legacyPassThrough)
3807 if (inputBufferLength >=
sizeof(SCSI_PASS_THROUGH32))
3809 cdb = (
PCDB)((PSCSI_PASS_THROUGH32)inputBuffer)->
Cdb;
3814 if (inputBufferLength >=
sizeof(SCSI_PASS_THROUGH32_EX))
3816 cdb = (
PCDB)((PSCSI_PASS_THROUGH32_EX)inputBuffer)->
Cdb;
3826 if (legacyPassThrough)
3848RequestHandleScsiPassThrough(
3892 if ((zpoddInfo !=
NULL) &&
3894 (zpoddInfo->
Load == 0))
3896 cdb = RequestGetScsiPassThroughCdb(
irp);
3898 if ((cdb !=
NULL) &&
3907 WdfRequestFormatRequestUsingCurrentType(
Request);
3925 (isSoftEject !=
FALSE))
3928 "RequestHandleScsiPassThrough: soft eject detected, device marked as active\n"));
3930 DeviceMarkActive(deviceExtension,
TRUE,
FALSE);
3969 if (!DeviceExtension->MountedDeviceInterfaceName.Buffer)
3991 uniqueId->
UniqueIdLength = DeviceExtension->MountedDeviceInterfaceName.Length;
3994 (
sizeof(
USHORT) + DeviceExtension->MountedDeviceInterfaceName.Length))
4004 DeviceExtension->MountedDeviceInterfaceName.Buffer,
4045 NT_ASSERT(DeviceExtension->DeviceName.Buffer);
4064 name->NameLength = DeviceExtension->DeviceName.Length;
4067 (
sizeof(
USHORT) + DeviceExtension->DeviceName.Length))
4077 DeviceExtension->DeviceName.Buffer,
4117 WCHAR driveLetterNameBuffer[10] = {0};
4134 DeviceExtension->DeviceName.Length +
sizeof(
WCHAR),
4136 if (valueName ==
NULL)
4145 DeviceExtension->DeviceName.Buffer,
4146 DeviceExtension->DeviceName.Length);
4147 valueName[DeviceExtension->DeviceName.Length/
sizeof(
WCHAR)] = 0;
4149 driveLetterName.
Buffer = driveLetterNameBuffer;
4150 driveLetterName.
MaximumLength =
sizeof(driveLetterNameBuffer);
4151 driveLetterName.
Length = 0;
4154 queryTable[0].
Name = valueName;
4159 L"\\Registry\\Machine\\System\\DISK",
4165 if ((driveLetterName.
Length == 4) &&
4166 (driveLetterName.
Buffer[0] ==
'%') &&
4167 (driveLetterName.
Buffer[1] ==
':'))
4169 driveLetterName.
Buffer[0] = 0xFF;
4171 else if ((driveLetterName.
Length != 4) ||
4174 (driveLetterName.
Buffer[1] !=
':'))
4206 L"\\Registry\\Machine\\System\\DISK",
4210 suggestedName->
Name[12] = driveLetterName.
Buffer[0];
4211 suggestedName->
Name[13] =
':';
4221RequestHandleReadTOC(
4254 if (DeviceIsPlayActive(DeviceExtension->Device))
4270 size_t transferSize;
4293 cdb.
READ_TOC.AllocationLength[0] = (
UCHAR)(transferSize >> 8);
4294 cdb.
READ_TOC.AllocationLength[1] = (
UCHAR)(transferSize & 0xFF);
4300 *
DataLength = DeviceExtension->ScratchContext.ScratchSrb->DataTransferLength;
4302 DeviceExtension->ScratchContext.ScratchBuffer,
4314RequestHandleReadTocEx(
4347 if (DeviceIsPlayActive(DeviceExtension->Device))
4371 size_t transferSize;
4383 cdb.
READ_TOC.AllocationLength[0] = (
UCHAR)(transferSize >> 8);
4384 cdb.
READ_TOC.AllocationLength[1] = (
UCHAR)(transferSize & 0xFF);
4397 *
DataLength = DeviceExtension->ScratchContext.ScratchSrb->DataTransferLength;
4399 DeviceExtension->ScratchContext.ScratchBuffer,
4413GetConfigurationDataConversionTypeAllToTypeOne(
4443 ULONG totalLength = 0;
4444 ULONG featureLength = 0;
4445 ULONG headerLength = 0;
4478 if (thisFeature == RequestedFeature)
4488 headerLength = totalLength -
4500GetConfigurationDataSynthesize(
4504 _In_ size_t OutputBufferSize,
4534 ULONG validLength = 0;
4535 ULONG featureLength = 0;
4536 ULONG headerLength = 0;
4538 ULONG bytesRemaining = 0;
4541 size_t copyLength = 0;
4542 size_t transferedLength = 0;
4543 size_t requiredLength = 0;
4565 validLength =
min(validLength, InputBufferSize);
4574 transferedLength = copyLength;
4622 if (shouldCopy !=
FALSE)
4624 copyLength =
min(featureLength, bytesRemaining);
4625 copyLength =
min(copyLength, OutputBufferSize - transferedLength);
4631 transferedLength += copyLength;
4632 requiredLength += featureLength;
4635 buffer +=
min(featureLength, bytesRemaining);
4636 bytesRemaining -=
min(featureLength, bytesRemaining);
4657RequestHandleGetConfiguration(
4683 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
4686 size_t transferByteCount = 0;
4719 if ((zpoddInfo !=
NULL) &&
4722 inZeroPowerState =
TRUE;
4725 if ((inZeroPowerState ==
FALSE) ||
4741 transferByteCount =
max(transferByteCount,
4765 "DeviceHandleGetConfiguration: Changing TYPE_ONE Get Config to TYPE_ALL\n"));
4781 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_IOCTL,
"DeviceHandleGetConfiguration: No get config header!\n"));
4793 GetConfigurationDataConversionTypeAllToTypeOne(inputBuffer->
Feature, DeviceExtension->ScratchContext.ScratchSrb,
DataLength);
4799 *
DataLength = DeviceExtension->ScratchContext.ScratchSrb->DataTransferLength;
4806 DeviceExtension->ScratchContext.ScratchBuffer,
4833RequestHandleGetDriveGeometry(
4879 status = MediaReadCapacity(DeviceExtension->Device);
4890 lengthInfo->
Length = DeviceExtension->PartitionLength;
4899 *geometry = DeviceExtension->DiskGeometry;
4908 geometryEx->
DiskSize = DeviceExtension->PartitionLength;
4909 geometryEx->
Geometry = DeviceExtension->DiskGeometry;
4920 readCapacity->BlockLength = DeviceExtension->DiskGeometry.BytesPerSector;
4921 if (readCapacity->BlockLength > 0)
4923 readCapacity->NumberOfBlocks.QuadPart = DeviceExtension->PartitionLength.QuadPart/readCapacity->BlockLength;
4927 readCapacity->NumberOfBlocks.QuadPart = 0;
4930 readCapacity->DiskLength = DeviceExtension->PartitionLength;
4948RequestHandleDiskVerify(
4974 PCDROM_DATA cdData = &(DeviceExtension->DeviceAdditionalData);
5000 byteOffset.
QuadPart = DeviceExtension->StartingOffset.QuadPart +
5004 if (((DeviceExtension->Start