24#define CLASS_INIT_GUID 1
25#define DEBUG_MAIN_SOURCE 1
39 #pragma alloc_text(INIT, DriverEntry)
40 #pragma alloc_text(PAGE, ClassAddDevice)
41 #pragma alloc_text(PAGE, ClassClaimDevice)
42 #pragma alloc_text(PAGE, ClassCreateDeviceObject)
43 #pragma alloc_text(PAGE, ClassDispatchPnp)
44 #pragma alloc_text(PAGE, ClassGetDescriptor)
45 #pragma alloc_text(PAGE, ClassGetPdoId)
46 #pragma alloc_text(PAGE, ClassInitialize)
47 #pragma alloc_text(PAGE, ClassInitializeEx)
48 #pragma alloc_text(PAGE, ClassInvalidateBusRelations)
49 #pragma alloc_text(PAGE, ClassMarkChildMissing)
50 #pragma alloc_text(PAGE, ClassMarkChildrenMissing)
51 #pragma alloc_text(PAGE, ClassModeSense)
52 #pragma alloc_text(PAGE, ClassPnpQueryFdoRelations)
53 #pragma alloc_text(PAGE, ClassPnpStartDevice)
54 #pragma alloc_text(PAGE, ClassQueryPnpCapabilities)
55 #pragma alloc_text(PAGE, ClassQueryTimeOutRegistryValue)
56 #pragma alloc_text(PAGE, ClassRemoveDevice)
57 #pragma alloc_text(PAGE, ClassRetrieveDeviceRelations)
58 #pragma alloc_text(PAGE, ClassUpdateInformationInRegistry)
59 #pragma alloc_text(PAGE, ClassSendDeviceIoControlSynchronous)
60 #pragma alloc_text(PAGE, ClassUnload)
61 #pragma alloc_text(PAGE, ClasspAllocateReleaseRequest)
62 #pragma alloc_text(PAGE, ClasspFreeReleaseRequest)
63 #pragma alloc_text(PAGE, ClasspInitializeHotplugInfo)
64 #pragma alloc_text(PAGE, ClasspRegisterMountedDeviceInterface)
65 #pragma alloc_text(PAGE, ClasspScanForClassHacks)
66 #pragma alloc_text(PAGE, ClasspScanForSpecialInRegistry)
67 #pragma alloc_text(PAGE, ClasspModeSense)
68 #pragma alloc_text(PAGE, ClasspIsPortable)
69 #pragma alloc_text(PAGE, ClassAcquireChildLock)
70 #pragma alloc_text(PAGE, ClassDetermineTokenOperationCommandSupport)
71 #pragma alloc_text(PAGE, ClassDeviceProcessOffloadRead)
72 #pragma alloc_text(PAGE, ClassDeviceProcessOffloadWrite)
73 #pragma alloc_text(PAGE, ClasspServicePopulateTokenTransferRequest)
74 #pragma alloc_text(PAGE, ClasspServiceWriteUsingTokenTransferRequest)
75#if (NTDDI_VERSION >= NTDDI_WINBLUE)
76 #pragma alloc_text(PAGE, ClassModeSenseEx)
81#pragma prefast(disable:28159, "There are certain cases when we have to bugcheck...")
92#define FirstDriveLetter 'C'
93#define LastDriveLetter 'Z'
254 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassInitialize: Class driver wrong version\n"));
274 "ClassInitialize: Class device-specific driver missing required "
290 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassInitialize: Class device-specific missing "
291 "required PDO entry\n"));
304 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassInitialize: Class device-specific missing "
305 "required PDO entry\n"));
337 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_INIT,
"ClassInitialize: driver does not support unload %wZ\n",
345#pragma warning(suppress:4054)
393#pragma warning(suppress:4054)
401 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassInitialize: Class driver extension could not be "
402 "allocated %lx\n",
status));
413#pragma prefast(disable:28175, "Accessing DRIVER_OBJECT fileds is OK here since this function " \
414 "is supposed to be invoked from DriverEntry only")
534#pragma warning(suppress:4054)
538 if (driverExtension ==
NULL)
679 else if (
info->HistoryCount == 0)
775#pragma warning(suppress:4054)
780 if (driverExtension ==
NULL)
813 EtwUnregister(driverExtension->
EtwHandle);
848#pragma prefast(suppress:28152, "We expect the class driver to clear the DO_DEVICE_INITIALIZING flag in its AddDevice routine.")
857#pragma warning(suppress:4054)
921#pragma warning(suppress:4054)
925 if (driverExtension){
927 initData = &(driverExtension->
InitData);
930 devInfo = &(initData->
FdoData);
932 devInfo = &(initData->
PdoData);
940 isFdo ?
"fdo" :
"pdo",
994 if(deviceRelations !=
NULL) {
999 Irp->IoStatus.Information = (
ULONG_PTR) deviceRelations;
1001 deviceRelations->
Count = 1;
1043 completeRequest =
TRUE;
1053 completeRequest =
FALSE;
1076 completeRequest =
FALSE;
1114 "STOP" :
"REMOVE")));
1123 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_PNP,
"ClassDispatchPnp (%p,%p): device is in paging "
1124 "path and cannot be removed\n",
1158 "STOP" :
"REMOVE")));
1217 completeRequest =
FALSE;
1235 (isFdo ?
"fdo" :
"pdo")
1264 commonExtension->PreviousState = 0xff;
1290 logSurpriseRemove =
FALSE;
1293 logSurpriseRemove =
FALSE;
1302 logSurpriseRemove =
FALSE;
1305 if (logSurpriseRemove) {
1320 lockReleased =
TRUE;
1344 completeRequest =
FALSE;
1356 commonExtension->PreviousState = commonExtension->CurrentState;
1357 commonExtension->CurrentState = removeType;
1402 if (commonExtension->
IsFdo){
1434 "paging file removed, but "
1435 "DO_POWER_INRUSH was set, so NOT "
1436 "setting DO_POWER_PAGABLE\n",
1441 "paging file removed, "
1442 "setting DO_POWER_PAGABLE\n",
1472 "Clearing PAGABLE bit\n",
1487 if (setPagable ==
TRUE) {
1489 "PAGABLE bit due to irp failure\n",
1499 if (commonExtension->
IsFdo) {
1539 "hiber file removed, but "
1540 "DO_POWER_INRUSH was set, so NOT "
1541 "setting DO_POWER_PAGABLE\n",
1546 "hiber file removed, "
1547 "setting DO_POWER_PAGABLE\n",
1558 if (setPagable ==
TRUE) {
1560 "PAGABLE bit due to irp failure\n",
1576 "Clearing PAGABLE bit\n",
1605 "dump file removed, but "
1606 "DO_POWER_INRUSH was set, so NOT "
1607 "setting DO_POWER_PAGABLE\n",
1612 "dump file removed, "
1613 "setting DO_POWER_PAGABLE\n",
1624 if (setPagable ==
TRUE) {
1626 "PAGABLE bit due to irp failure\n",
1642 "Clearing PAGABLE bit\n",
1664 if ((fdoData !=
NULL) &&
1710 fdoData = fdoExtension->PrivateFdoData;
1711 deviceCapabilities =
1738 if (deviceCapabilities->SurpriseRemovalOK) {
1740 "device capabilities due to hotplug "
1741 "device or media\n"));
1743 deviceCapabilities->SurpriseRemovalOK =
FALSE;
1764 completeRequest =
FALSE;
1776 if (completeRequest){
1840#pragma warning(suppress:4054)
1844 initData = &(driverExtension->
InitData);
1846 devInfo = &(initData->
FdoData);
1848 devInfo = &(initData->
PdoData);
1867 if (fdoExtension->PrivateFdoData ==
NULL) {
1874 if (fdoExtension->PrivateFdoData ==
NULL) {
1875 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Cannot allocate for private fdo data\n"));
1882#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
1887 if (fdoExtension->AdditionalFdoData ==
NULL) {
1889 sizeof(ADDITIONAL_FDO_DATA),
1894 if (fdoExtension->AdditionalFdoData ==
NULL) {
1895 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Cannot allocate memory for the additional data structure.\n"));
1899 RtlZeroMemory(fdoExtension->AdditionalFdoData,
sizeof(ADDITIONAL_FDO_DATA));
1904 FREE_POOL(fdoExtension->PrivateFdoData);
1905#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
1906 FREE_POOL(fdoExtension->AdditionalFdoData);
1908 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Failed to initialize tick timer\n"));
1916 if (fdoExtension->FunctionSupportInfo ==
NULL) {
1923 if (fdoExtension->FunctionSupportInfo ==
NULL) {
1925 FREE_POOL(fdoExtension->PrivateFdoData);
1926#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
1927 FREE_POOL(fdoExtension->AdditionalFdoData);
1929 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Cannot allocate for FunctionSupportInfo\n"));
1947 fdoExtension->FunctionSupportInfo->BlockLimitsData.CommandStatus = -1;
1948 fdoExtension->FunctionSupportInfo->DeviceCharacteristicsData.CommandStatus = -1;
1949 fdoExtension->FunctionSupportInfo->LBProvisioningData.CommandStatus = -1;
1950 fdoExtension->FunctionSupportInfo->ReadCapacity16Data.CommandStatus = -1;
1951 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.CommandStatus = -1;
1968 fdoExtension->PrivateFdoData->InterpretSenseInfo = driverExtension->
InterpretSenseInfo;
1970 fdoExtension->PrivateFdoData->MaxNumberOfIoRetries =
NUM_IO_RETRIES;
1977 sizeof(fdoExtension->PrivateFdoData->
ReleaseQueueSrb.ReleaseQueueSrbBuffer),
1982 "ClassPnpStartDevice: fail to initialize release queue extended SRB 0x%x\n",
status));
2002 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Cannot allocate the private release queue irp\n"));
2008 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Cannot allocate the power process irp\n"));
2024 (
PVOID *)&fdoExtension->MiniportDescriptor);
2035 fdoExtension->MiniportDescriptor->IoTimeoutValue = 0;
2048 status = ClassGetDescriptor(
2053 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: ClassGetDescriptor [ADAPTER] failed %lx\n",
status));
2063 status = ClassGetDescriptor(
2080 ClassGetDeviceParameter(fdoExtension,
2085 fdoExtension->PrivateFdoData->Perf.ReEnableThreshhold =
t;
2120 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Could not initialize hotplug information %lx\n",
status));
2124 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: ClassGetDescriptor [DEVICE] failed %lx\n",
status));
2138 (
PVOID *)&powerDescriptor);
2141 fdoExtension->FunctionSupportInfo->IdlePower.D3ColdSupported = powerDescriptor->
D3ColdSupported;
2142 fdoExtension->FunctionSupportInfo->IdlePower.NoVerifyDuringIdlePower = powerDescriptor->
NoVerifyDuringIdlePower;
2145 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: ClassGetDescriptor [DevicePower] failed %lx\n",
status));
2166 if (commonExtension->
IsFdo) {
2167 fdoExtension->PrivateFdoData->Perf.OriginalSrbFlags = fdoExtension->
SrbFlags;
2175 ULONG accessAlignmentNotSupported = 0;
2180 "ClassPnpStartDevice: Enabling idle timer for %p\n",
DeviceObject));
2195 if (fdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits) {
2196 ClassDetermineTokenOperationCommandSupport(
DeviceObject);
2206 ClassGetDeviceParameter(fdoExtension,
2231 fdoExtension->FunctionSupportInfo->LBProvisioningData.CommandStatus =
STATUS_UNSUCCESSFUL;
2233 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.CommandStatus =
STATUS_UNSUCCESSFUL;
2237 ClassGetDeviceParameter(fdoExtension,
2240 &accessAlignmentNotSupported);
2242 if (accessAlignmentNotSupported > 0) {
2243 fdoExtension->FunctionSupportInfo->RegAccessAlignmentQueryNotSupported =
TRUE;
2246#if (NTDDI_VERSION >= NTDDI_WINBLUE)
2252 ClassGetDeviceParameter(fdoExtension,
2255 &legacyErrorHandling);
2257 if (legacyErrorHandling) {
2263 fdoExtension->PrivateFdoData->LegacyErrorHandling =
TRUE;
2277 &(fdoExtension->PrivateFdoData->CopyOffloadMaxTargetDuration));
2309 (fdoExtension->FunctionSupportInfo !=
NULL) &&
2310 (fdoExtension->FunctionSupportInfo->AsynchronousNotificationSupported ==
FALSE)) ||
2323 &GUID_CONSOLE_DISPLAY_STATE,
2345 isMountedDevice =
FALSE;
2350 isMountedDevice =
FALSE;
2360 isMountedDevice =
TRUE;
2363 if(isMountedDevice) {
2367 if(commonExtension->
IsFdo) {
2374 if (fdoExtension->FunctionSupportInfo !=
NULL &&
2375 fdoExtension->FunctionSupportInfo->IdlePower.IdlePowerEnabled ==
FALSE &&
2376 fdoExtension->MiniportDescriptor !=
NULL &&
2380 ULONG disableIdlePower= 0;
2381 ClassGetDeviceParameter(fdoExtension,
2386 if (!disableIdlePower) {
2446 Irp->IoStatus.Information = 0;
2460 if (
Irp->Tail.Overlay.Thread !=
NULL) {
2464 Irp->IoStatus.Information = 0;
2489 Irp->IoStatus.Information = 0;
2501 if (transferByteCount == 0) {
2507 Irp->IoStatus.Information = 0;
2534 if (commonExtension->
IsFdo){
2557 Irp->IoStatus.Information = 0;
2588 UCHAR uniqueAddr = 0;
2644 ULONG bytesPerSector;
2662 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_INIT,
"ClassReadDriveCapacity: reducing number of sectors by %d\n", fdoExt->
DMSkew));
2676 if (cylinderSize == 0){
2752 IRP pseudoIrp = {0};
2753 ULONG readCapacityDataSize;
2767 if (driveCapMdl !=
NULL) {
2776 if (driveCapMdl ==
NULL) {
2793 pseudoIrp.Tail.Overlay.DriverContext[0] =
LongToPtr(1);
2796 pseudoIrp.MdlAddress = driveCapMdl;
2807 readCapacityDataSize,
2825 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassReadDriveCapacity: read len (%xh) < %xh, retrying ...",
2830 pseudoIrp.Tail.Overlay.DriverContext[0] =
LongToPtr(1);
2836 readCapacityDataSize,
2856 if (use16ByteCdb ==
FALSE) {
2872 use16ByteCdb =
TRUE;
3008 if (driveCapMdl !=
NULL) {
3031 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_INIT,
"ClassReadDriveCapacity: defaulting to cached DriveCapacity data"));
3115 sizeof(
context->Srb.SrbExBuffer),
3318 if (
Irp->MdlAddress !=
NULL) {
3446 deferClientIrp =
TRUE;
3458 if (!deferClientIrp)
3492 numPackets = entireXferLen/hwMaxXferLen;
3493 if (entireXferLen % hwMaxXferLen){
3502 if (driverUsesStartIO) {
3518 for (
i = 0;
i < numPackets;
i++){
3530 if ((
i == numPackets) &&
3531 (!driverUsesStartIO)) {
3538 Irp->IoStatus.Information = 0;
3544 Irp->Tail.Overlay.DriverContext[0] =
LongToPtr(numPackets);
3555 if (numPackets > 1){
3566 while (entireXferLen > 0){
3567 ULONG thisPieceLen =
MIN(hwMaxXferLen, entireXferLen);
3585 if (numPackets > 1) {
3603 pkt->RetryIn100nsUnits = 0;
3622 entireXferLen -= thisPieceLen;
3623 bufPtr += thisPieceLen;
3624 targetLocation.
QuadPart += thisPieceLen;
3656 if (!driverUsesStartIO) {
3657 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_RW,
"Insufficient packets available in ServiceTransferRequest - entering lowMemRetry with pkt=%p.", pkt));
3664 Irp->IoStatus.Information = 0;
3686 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_RW,
"No packets available in ServiceTransferRequest - deferring transfer (Irp=%p)...",
Irp));
3720 deferClientIrp =
TRUE;
3855#pragma warning(suppress:4213)
3905 callStartNextPacket =
FALSE;
3933 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_GENERAL,
"ClassIoComplete is freeing an SRB (possibly) on behalf of another driver."));
3940 "SRB_CLASS_FLAGS_PERSISTANT set\n", srb));
3943 " because SRB_CLASS_FLAGS_PERSISTANT set\n",
3961 (
Irp->Tail.Overlay.Thread !=
NULL)
3970 Irp->IoStatus.Information = 0;
3989 if (
Irp->PendingReturned) {
3994 if (callStartNextPacket) {
4103#if defined(_ARM_) || defined(_ARM64_)
4114 senseInfoBufferLength,
4119 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassSendSrbSynchronous: Can't allocate request sense "
4188 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassSendSrbSynchronous: Can't allocate Irp\n"));
4213 irp->UserIosb = &ioStatus;
4227 if (
irp->MdlAddress ==
NULL) {
4232 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassSendSrbSynchronous: Can't allocate MDL\n"));
4248 #pragma warning(suppress: 6320)
4259 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassSendSrbSynchronous: Exception %lx "
4260 "locking buffer\n",
status));
4315 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassSendSrbSynchronous - srb %ph failed (op=%s srbstat=%s(%xh), irpstat=%xh, sense=%s/%s/%s)",
Srb,
4365 if (retryInterval < 2*1000*1000*10) {
4366 retryInterval = 2*1000*1000*10;
4490 ULONG retryInterval = 0;
4493 UCHAR cdbOpcode = 0;
4533 "ClassInterpretSenseInfo: Internal Error code is %x\n",
4551 isReservationConflict =
TRUE;
4560 UCHAR errorCode = 0;
4562 UCHAR addlSenseCode = 0;
4563 UCHAR addlSenseCodeQual = 0;
4570 validSense = ScsiGetSenseKeyAndCodes(senseBuffer,
4575 &addlSenseCodeQual);
4581 validSense = ScsiGetFixedSenseKeyAndCodes(senseBuffer,
4585 &addlSenseCodeQual);
4589 goto __ClassInterpretSenseInfo_ProcessingInvalidSenseBuffer;
4594 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL,
"ClassInterpretSenseInfo: Error code is %x\n", errorCode));
4596 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL,
"ClassInterpretSenseInfo: Additional sense code is %x\n", addlSenseCode));
4597 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL,
"ClassInterpretSenseInfo: Additional sense code qualifier is %x\n", addlSenseCodeQual));
4606 UCHAR startBufferLength = 0;
4609 if (ScsiGetSenseDescriptor(senseBuffer,
4612 &startBufferLength)) {
4615 UCHAR outBufferLength = 0;
4623 while ((!foundBlockCommandType || !foundInformationType) &&
4624 ScsiGetNextSenseDescriptorByType(startBuffer,
4630 &outBufferLength)) {
4647 if (!foundBlockCommandType) {
4649 foundBlockCommandType =
TRUE;
4651 if (ScsiValidateBlockCommandSenseDescriptor(
outBuffer, outBufferLength)) {
4653 isIncorrectLengthValid =
TRUE;
4672 if (!foundInformationType) {
4674 foundInformationType =
TRUE;
4676 if (ScsiValidateInformationSenseDescriptor(
outBuffer, outBufferLength)) {
4678 isInformationValid =
TRUE;
4715 isInformationValid =
TRUE;
4716 isIncorrectLengthValid =
TRUE;
4728 if (isIncorrectLengthValid && incorrectLength) {
4731 "Incorrect length detected.\n"));
4738 "No specific sense key\n"));
4749 "Recovered error\n"));
4755 switch(addlSenseCode) {
4773 wmiEventData[
sizeof(
ULONG)] = addlSenseCodeQual;
4791 ClassNotifyFailurePredicted(fdoExtension,
4793 sizeof(wmiEventData),
4811 if (isIncorrectLengthValid && incorrectLength) {
4814 "Incorrect length detected.\n"));
4825 "Device not ready\n"));
4828 switch (addlSenseCode) {
4833 "Lun not ready\n"));
4837 switch (addlSenseCodeQual) {
4842 logRetryableError =
FALSE;
4844 "In process of becoming ready\n"));
4849 ClassSendNotification(fdoExtension,
4850 &GUID_IO_DEVICE_BECOMING_READY,
4858 "Manual intervention required\n"));
4866 "Format in progress\n"));
4874 logRetryableError =
FALSE;
4876 "Operation In Progress\n"));
4881 ClassSendNotification(fdoExtension,
4882 &GUID_IO_DEVICE_BECOMING_READY,
4891 "Long write in progress\n"));
4903 logRetryableError =
FALSE;
4905 "The device (%p) is busy allocating space.\n",
4926 "ClassInterpretSenseInfo: "
4927 "not ready, cause unknown\n"));
4953 "Initializing command required\n"));
4955 logRetryableError =
FALSE;
4977 "No Media in device.\n"));
4986 "No Media in a non-removable device %p\n",
4990 if (addlSenseCodeQual == 0xCC){
5011 "Medium Error (bad block)\n"));
5024 switch (addlSenseCodeQual) {
5061 "Hardware error\n"));
5082 logHardwareError =
FALSE;
5098 logHardwareError =
TRUE;
5110 logHardwareError =
FALSE;
5119 if (logHardwareError) {
5121 UCHAR senseBufferSize = 0;
5123 if (ScsiGetTotalSenseByteCountIndicated(senseBuffer,
5124 senseInfoBufferLength,
5125 &senseBufferSize)) {
5127 senseBufferSize =
min(senseBufferSize, senseInfoBufferLength);
5134 senseBufferSize = senseInfoBufferLength;
5154 "Illegal SCSI request\n"));
5158 switch (addlSenseCode) {
5162 switch (addlSenseCodeQual) {
5179 "ClassInterpretSenseInfo (%p): Duplicate List Identifier (command %x, parameter field offset 0x%016llx)\n",
5199 switch (addlSenseCodeQual) {
5208 "ClassInterpretSenseInfo (%p): Source-Destination LUNs can't communicate (command %x)\n",
5221 switch (addlSenseCodeQual) {
5231 "ClassInterpretSenseInfo (%p): Host specified a transfer length greater than what is represented by the token (considering the offset) [command %x]\n",
5235 NT_ASSERTMSG(
"Host specified blocks to write beyond what is represented by the token",
FALSE);
5251 "ClassInterpretSenseInfo (%p): Target truncated the block device range descriptors in the parameter list (command %x)\n",
5263 "Illegal command\n"));
5271 ULONG numTransferBlocks = 0;
5275 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassInterpretSenseInfo: Illegal block address\n"));
5294 ((logicalBlockAddr.
QuadPart + numTransferBlocks - 1) > lastLBA.
QuadPart)) {
5297 "Request beyond boundary. Last LBA: 0x%I64X Read LBA: 0x%I64X Length: 0x%X\n",
5321 "ClassInterpretSenseInfo (%p): LBA out of range (command %x, parameter field offset 0x%016llx)\n",
5350 "ClassInterpretSenseInfo (%p): Invalid/Expired/Modified token specified (command %x, parameter field offset 0x%016llx)\n",
5367 "ClassInterpretSenseInfo (%p): Incorrect I_T nexus likely used (command %x)\n",
5408 switch (addlSenseCodeQual) {
5417 "ClassInterpretSenseInfo (%p): Alignment violation for command %x.\n",
5434 "ClassInterpretSenseInfo (%p): Too many descriptors in parameter list for command %x (parameter field offset 0x%016llx)\n",
5461 "ClassInterpretSenseInfo (%p): Illegal field in parameter list for command %x (parameter field offset 0x%016llx) [AddSense %x, AddSenseQ %x]\n",
5466 addlSenseCodeQual));
5481 "Copy protection failure\n"));
5485 switch (addlSenseCodeQual) {
5488 "ClassInterpretSenseInfo: "
5489 "Authentication failure\n"));
5494 "ClassInterpretSenseInfo: "
5495 "Key not present\n"));
5500 "ClassInterpretSenseInfo: "
5501 "Key not established\n"));
5506 "ClassInterpretSenseInfo: "
5507 "Read of scrambled sector w/o "
5508 "authentication\n"));
5513 "ClassInterpretSenseInfo: "
5514 "Media region does not logical unit "
5520 "ClassInterpretSenseInfo: "
5521 "Region set error -- region may "
5544 "Volume overflow\n"));
5564 "Media change count for device %d incremented to %#lx\n",
5568 switch (addlSenseCode) {
5570 logRetryableError =
FALSE;
5572 "Media changed\n"));
5576 "Media Changed on non-removable device %p\n",
5590 logRetryableError =
FALSE;
5593 "Device capacity changed (e.g. thinly provisioned LUN). Retry the request.\n"));
5608 switch (addlSenseCodeQual) {
5612 logRetryableError =
FALSE;
5614 "Device (%p) has hit a soft threshold.\n",
5641 logRetryableError =
TRUE;
5643 "Device firmware has been changed.\n"));
5652 logRetryableError =
FALSE;
5654 "Device information changed. Invalidate the bus\n"));
5679 switch (addlSenseCodeQual) {
5683 "Ejection request received!\n"));
5690 "Operator selected write permit?! "
5691 "(unsupported!)\n"));
5697 "Operator selected write protect?! "
5698 "(unsupported!)\n"));
5709 wmiEventData[
sizeof(
ULONG)] = addlSenseCodeQual;
5727 ClassNotifyFailurePredicted(fdoExtension,
5729 sizeof(wmiEventData),
5749 "Unit attention\n"));
5789 switch (addlSenseCodeQual) {
5794 "Device's (%p) resources are exhausted.\n",
5819 "Media write protected\n"));
5823 "Access denied\n"));
5832 "Media blank check\n"));
5840 switch (addlSenseCode) {
5844 switch (addlSenseCodeQual) {
5853 "ClassInterpretSenseInfo (%p): Data transfer was truncated (command %x)\n",
5871 switch (addlSenseCode) {
5875 switch (addlSenseCodeQual) {
5884 "ClassInterpretSenseInfo (%p): Target has truncated the data transfer (command %x)\n",
5898 switch (addlSenseCodeQual) {
5908 "ClassInterpretSenseInfo (%p): Target has insufficient resources (command %x)\n",
5922 "Command aborted\n"));
5931 "Unrecognized sense code\n"));
5948 if (isInformationValid)
5973 if (!(badSector >= readSector && badSector < readSector +
index)) {
5974 badSector = readSector;
5980__ClassInterpretSenseInfo_ProcessingInvalidSenseBuffer:
5990 "Request sense info not valid. SrbStatus %2x\n",
6002 incrementErrorCount =
TRUE;
6019 incrementErrorCount =
TRUE;
6024 logRetryableError =
FALSE;
6061 incrementErrorCount =
TRUE;
6073 incrementErrorCount =
TRUE;
6078 logRetryableError =
FALSE;
6099 logErrorInternal =
FALSE;
6106 logErrorInternal =
FALSE;
6110 ULONG allocationLength;
6114 logErrorInternal =
FALSE;
6128 incrementErrorCount =
TRUE;
6136 if (RetryCount > 1 ) {
6158 logRetryableError =
FALSE;
6170 unhandledError =
TRUE;
6171 logRetryableError =
FALSE;
6198 if (incrementErrorCount) {
6205 if (retryInterval == 0) {
6243 *RetryInterval = retryInterval;
6286 if (logErrorInternal || logError) {
6288 ULONG senseBufferSize = 0;
6292 UCHAR convertedSenseBufferLength = 0;
6321 UCHAR validSenseBytes = 0;
6322 UCHAR senseInfoBufferLength = 0;
6333 convertedSenseBufferLength =
sizeof(convertedSenseBuffer);
6335 senseDataConverted = ScsiConvertToFixedSenseFormat(senseBuffer,
6336 senseInfoBufferLength,
6337 (
PVOID)&convertedSenseBuffer,
6338 convertedSenseBufferLength);
6345 if (ScsiGetTotalSenseByteCountIndicated(senseBuffer,
6346 senseInfoBufferLength,
6347 &validSenseBytes)) {
6359 senseBufferSize =
max(validSenseBytes,
sizeof(staticErrLogData.
SenseData));
6360 senseBufferSize =
min(senseBufferSize, senseInfoBufferLength);
6367 senseBufferSize = senseInfoBufferLength;
6375 if (senseBufferSize >
sizeof(staticErrLogData.
SenseData)){
6376 totalSize += senseBufferSize-
sizeof(staticErrLogData.
SenseData);
6412 if (unhandledError) {
6421 if (logStatus == -1){
6424 staticErrLogEntry.
ErrorCode = logStatus;
6454 if ((senseBufferSize != 0) && senseBuffer) {
6469 if (senseDataConverted) {
6481 if (logErrorInternal) {
6496 (RetryCount != 0)) {
6498 logRetryableError =
FALSE;
6501 if (logRetryableError) {
6520 switch (cdb->
CDB10.OperationCode)
6555 if (logRetryableError) {
6586 *errorLogEntry = staticErrLogEntry;
6587 *errlogData = staticErrLogData;
6592 if ((senseBufferSize != 0) && senseBuffer) {
6665#if (NTDDI_VERSION >= NTDDI_WINBLUE)
6717 ULONG lengthTransferred = 0;
6718 PMDL senseBufferMdl;
6723 if (senseBufferMdl){
6728 IRP pseudoIrp = {0};
6737 pseudoIrp.Tail.Overlay.DriverContext[0] =
LongToPtr(1);
6740 pseudoIrp.MdlAddress = senseBufferMdl;
6769 return lengthTransferred;
6806 ULONG parameterHeaderLength;
6812 if (
Length >= parameterHeaderLength) {
6815 ULONG blockDescriptorLength;
6828 ModeSenseBuffer += parameterHeaderLength + blockDescriptorLength;
6835 while (ModeSenseBuffer +
6852 result = ModeSenseBuffer;
6880#if (NTDDI_VERSION >= NTDDI_WINBLUE)
6927 PMDL senseBufferMdl;
6931 if (senseBufferMdl) {
6936 IRP pseudoIrp = {0};
6945 pseudoIrp.Tail.Overlay.DriverContext[0] =
LongToPtr(1);
6948 pseudoIrp.MdlAddress = senseBufferMdl;
7107 if (
Irp->MdlAddress ==
NULL) {
7333 ULONG modifiedIoControlCode = 0;
7334 GUID activityId = {0};
7357 #if BUILD_WOW64_ENABLED && defined(_WIN64)
7359 if (IoIs32bitProcess(
Irp)) {
7369 goto SetStatusAndReturn;
7386 goto SetStatusAndReturn;
7400 goto SetStatusAndReturn;
7404 Irp->IoStatus.Information = 0;
7407 switch (controlCode) {
7426 uniqueId =
Irp->AssociatedIrp.SystemBuffer;
7444 Irp->IoStatus.Information =
sizeof(
USHORT) +
7463 name =
Irp->AssociatedIrp.SystemBuffer;
7479 Irp->IoStatus.Information =
sizeof(
USHORT) +
name->NameLength;
7486 WCHAR driveLetterNameBuffer[10] = {0};
7513 driveLetterName.
Buffer = driveLetterNameBuffer;
7514 driveLetterName.
MaximumLength =
sizeof(driveLetterNameBuffer);
7515 driveLetterName.
Length = 0;
7520 queryTable[0].
Name = valueName;
7525 L"\\Registry\\Machine\\System\\DISK",
7533 if (driveLetterName.
Length == 4 &&
7534 driveLetterName.
Buffer[0] ==
'%' &&
7535 driveLetterName.
Buffer[1] ==
':') {
7537 driveLetterName.
Buffer[0] = 0xFF;
7539 }
else if (driveLetterName.
Length != 4 ||
7542 driveLetterName.
Buffer[1] !=
':') {
7549 suggestedName =
Irp->AssociatedIrp.SystemBuffer;
7554 Irp->IoStatus.Information =
7558 Irp->IoStatus.Information) {
7560 Irp->IoStatus.Information =
7568 L"\\Registry\\Machine\\System\\DISK",
7574 suggestedName->
Name[12] = driveLetterName.
Buffer[0];
7575 suggestedName->
Name[13] =
':';
7599 if (commonExtension->
IsFdo){
7628 goto SetStatusAndReturn;
7646 goto SetStatusAndReturn;
7678 modifiedIoControlCode = (controlCode & ~0xffff0000);
7683 modifiedIoControlCode = controlCode;
7690 switch (modifiedIoControlCode) {
7710 }
else if (!commonExtension->
IsFdo) {
7728 info =
Irp->AssociatedIrp.SystemBuffer;
7730 *
info = fdoExtension->PrivateFdoData->HotplugInfo;
7756 goto SetStatusAndReturn;
7760 if (!commonExtension->
IsFdo) {
7779 if (
info->Size != fdoExtension->PrivateFdoData->HotplugInfo.Size)
7784 if (
info->MediaRemovable != fdoExtension->PrivateFdoData->HotplugInfo.MediaRemovable)
7789 if (
info->MediaHotplug != fdoExtension->PrivateFdoData->HotplugInfo.MediaHotplug)
7796 if (
info->WriteCacheEnableOverride != fdoExtension->PrivateFdoData->HotplugInfo.WriteCacheEnableOverride)
7798 fdoExtension->PrivateFdoData->HotplugInfo.WriteCacheEnableOverride =
info->WriteCacheEnableOverride;
7804 ClassSetDeviceParameter(fdoExtension,
7807 info->WriteCacheEnableOverride);
7810 fdoExtension->PrivateFdoData->HotplugInfo.DeviceHotplug =
info->DeviceHotplug;
7816 ClassSetDeviceParameter(fdoExtension,
7857 "buffer too small\n"));
7860 Irp->IoStatus.Information =
sizeof(
ULONG);
7868 goto SetStatusAndReturn;
7872 if (!commonExtension->
IsFdo) {
7886 goto SetStatusAndReturn;
7914 Irp->IoStatus.Information = 0;
7919 goto SetStatusAndReturn;
7930 irp2->Tail.Overlay.Thread =
Irp->Tail.Overlay.Thread;
8040 goto SetStatusAndReturn;
8043 if (!commonExtension->
IsFdo) {
8064 ((modifiedIoControlCode ==
8089 Irp->IoStatus.Information = 0;
8096 goto SetStatusAndReturn;
8099 if (!commonExtension->
IsFdo) {
8123 goto SetStatusAndReturn;
8135 if (!commonExtension->
IsFdo) {
8142 goto SetStatusAndReturn;
8189 if (!commonExtension->
IsFdo) {
8195 goto SetStatusAndReturn;
8218 if (!commonExtension->
IsFdo) {
8226 goto SetStatusAndReturn;
8233 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_IOCTL,
"ClassDeviceControl: call to eject paging device - "
8239 Irp->IoStatus.Information = 0;
8245 goto SetStatusAndReturn;
8262 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_IOCTL,
"ClassDeviceControl: call to eject protected locked "
8263 "device - failure\n"));
8267 Irp->IoStatus.Information = 0;
8279 goto SetStatusAndReturn;
8316 if (commonExtension->
IsFdo) {
8347 Irp->AssociatedIrp.SystemBuffer;
8391 if (!commonExtension->
IsFdo) {
8420 readCapacity->NumberOfBlocks.QuadPart++;
8428 diskLength.
QuadPart = readCapacity->NumberOfBlocks.QuadPart *
8429 readCapacity->BlockLength;
8438 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_IOCTL,
"ClassDeviceControl: ClassReadDriveCapacity failed: 0x%X IsCachedDriveCapDataValid: %d\n",
8441 Irp->IoStatus.Information = 0;
8464 if (!commonExtension->
IsFdo) {
8480 switch (
query->PropertyId ) {
8555 if (!commonExtension->
IsFdo) {
8598 if (!commonExtension->
IsFdo) {
8609 switch(dsmAttributes->
Action) {
8654 if (commonExtension->
IsFdo) {
8679#if (NTDDI_VERSION >= NTDDI_WINTRHESHOLD)
8688 if (!commonExtension->
IsFdo) {
8694 goto SetStatusAndReturn;
8702 if (!commonExtension->
IsFdo) {
8708 goto SetStatusAndReturn;
8719 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_IOCTL,
"IoDeviceControl: Unsupported device IOCTL %x for %p\n",
8850 *IsPortable =
FALSE;
8858 &DEVPKEY_Device_InLocalMachineContainer,
8896 *IsPortable = isPortable;
8937ClassCreateDeviceObject(
8953 ULONG characteristics;
8959#pragma warning(suppress:4054)
9006 "ClassCreateFdo: Cannot convert string %s\n",
9039 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassCreateFdo: Can not create device object %lx\n",
9048 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_INIT,
"ClassCreateFdo: Freeing unicode name buffer\n"));
9065 commonExtension->
Version = 0x03;
9114 commonExtension->
DevInfo = devInfo;
9151 if ((isPartitionable ==
TRUE) ||
9190 LowerDevice->DeviceExtension;
9226 commonExtension->
DeviceName = ntUnicodeString;
9313 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_INIT,
"ClassClaimDevice: Can't allocate Irp\n"));
9431 if(commonExtension->
IsFdo) {
9468ClassQueryTimeOutRegistryValue(
9477#pragma warning(suppress:4054)
9524 parameters[0].
Name =
L"TimeOutValue";
9544 "ClassQueryTimeOutRegistryValue: Timeout value %d\n",
9603 "device %d is %lx - saved as %lx\n",
9692 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassGetDescriptor: error %lx trying to "
9693 "query properties #1\n", ioStatus.
Status));
9703 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassGetDescriptor: size returned was zero?! (status "
9704 "%x\n", ioStatus.
Status));
9722 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassGetDescriptor: unable to memory for descriptor "
9723 "(%d bytes)\n",
length));
9758 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassGetDescriptor: error %lx trying to "
9759 "query properties #1\n", ioStatus.
Status));
9850#pragma warning(suppress:4054)
9873 return Irp->IoStatus.Status;
9898ClassMarkChildrenMissing(
9907 ClassAcquireChildLock(
Fdo);
9916 tmpChild = nextChild;
9918 ClassMarkChildMissing(tmpChild,
FALSE);
9952ClassMarkChildMissing(
10018 ULONG relationsSize;
10028 ClassAcquireChildLock(fdoExtension);
10036 while (nextChild !=
NULL) {
10041 NT_ASSERTMSG(
"ClassPnp internal error: missing child on active list\n",
10044 nextChild = commonExtension->
ChildList;
10054 if (oldRelations) {
10063 if (deviceRelations ==
NULL) {
10065 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_ENUM,
"ClassRetrieveDeviceRelations: unable to allocate "
10066 "%d bytes for device relations\n", relationsSize));
10075 if (oldRelations) {
10081 for (
i = 0;
i < oldRelations->
Count;
i++) {
10091 while (nextChild !=
NULL) {
10096 NT_ASSERTMSG(
"ClassPnp internal error: missing child on active list\n",
10108 NT_ASSERT(!
"Error referencing child device by pointer");
10110 "ClassRetrieveDeviceRelations: Error referencing child "
10115 nextChild = commonExtension->
ChildList;
10121 *DeviceRelations = deviceRelations;
10158#pragma warning(suppress:4054)
10201 PCLASS_QUERY_PNP_CAPABILITIES queryRoutine =
NULL;
10208 if(commonExtension->
IsFdo) {
10245ClassInvalidateBusRelations(
10251#pragma warning(suppress:4054)
10271 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_ENUM,
"ClassInvalidateBusRelations: EnumerateDevice routine "
10272 "returned %lx\n",
status));
10311#pragma warning(suppress:4054)
10328 if (commonExtension->
IsFdo ||
10358 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_PNP,
"ClasspRemoveDevice - Reference count is now %d\n",
10381 if (commonExtension->
IsFdo) {
10383 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_PNP,
"ClasspRemoveDevice - FDO %p has received a "
10420 proceedWithRemove =
FALSE;
10426 if (proceedWithRemove) {
10438 if (commonExtension->
IsFdo) {
10451 if (fdoExtension->FunctionSupportInfo &&
10452 fdoExtension->FunctionSupportInfo->IdlePower.IdlePowerEnabled) {
10464 fdoEntry = nextEntry;
10475 ClassCleanupMediaChangeDetection(fdoExtension);
10490 ClassAcquireChildLock(fdoExtension);
10513 ClassMarkChildrenMissing(fdoExtension);
10523 if (fdoExtension->PrivateFdoData) {
10528 PLIST_ENTRY allFdosListEntry = &fdoExtension->PrivateFdoData->AllFdosListEntry;
10529 if (allFdosListEntry->
Flink && allFdosListEntry->
Blink) {
10546 FREE_POOL(fdoExtension->PrivateFdoData->PowerProcessIrp);
10547 FREE_POOL(fdoExtension->PrivateFdoData->FreeTransferPacketsLists);
10548 FREE_POOL(fdoExtension->PrivateFdoData);
10551#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
10552 FREE_POOL(fdoExtension->AdditionalFdoData);
10560#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
10561 if (fdoExtension->FunctionSupportInfo !=
NULL) {
10562 FREE_POOL(fdoExtension->FunctionSupportInfo->HwFirmwareInfo);
10565 FREE_POOL(fdoExtension->FunctionSupportInfo);
10567 FREE_POOL(fdoExtension->MiniportDescriptor);
10634ClassGetDriverExtension(
10639#pragma warning(suppress:4054)
10680#pragma warning(suppress:4054)
10689#pragma warning(suppress:4054)
10733ClassUpdateInformationInRegistry(
10777 "UpdateInformationInRegistry: Get Address failed %lx\n",
10784 "GetAddress: Port %x, Path %x, Target %x, Lun %x\n",
10794 "\\Registry\\Machine\\Hardware\\DeviceMap\\Scsi\\Scsi Port %d\\Scsi Bus %d\\Target Id %d\\Logical Unit Id %d",
10820 &unicodeRegistryPath,
10825 status = ZwOpenKey(&targetKey,
10827 &objectAttributes);
10851 status = ZwSetValueKey(targetKey,
10868 status = ZwSetValueKey(targetKey,
10882 "Failure to update information in registry: %08x\n",
10887 if (unicodeData.
Buffer) {
10890 if (unicodeRegistryPath.
Buffer) {
10938 *(
Irp->UserIosb) =
Irp->IoStatus;
10944 if(
Irp->MdlAddress) {
10988 functionalExtension =
10990 pdo = functionalExtension->
LowerPdo;
10996#pragma prefast(suppress:6014, "The allocated memory that interfaceName points to will be freed in ClassRemoveDevice().")
11000 &MOUNTDEV_MOUNTED_DEVICE_GUID,
11152 if (
irp->AssociatedIrp.SystemBuffer ==
NULL)
11180 irp->AssociatedIrp.SystemBuffer =
Buffer;
11206 #pragma warning(suppress: 6320)
11227 NT_ASSERT(!
"ClassSendDeviceIoControlSynchronous does not support METHOD_NEITHER Ioctls");
11269 #pragma warning(suppress: 6386)
11272 irp->AssociatedIrp.SystemBuffer,
11404 ClasspnpGlobals.SecondsToWaitForIrps);
11424 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassSendIrpSynchronous: (%p) irp %p did not "
11425 "complete within %x seconds\n",
11427 ClasspnpGlobals.SecondsToWaitForIrps
11430 if (ClasspnpGlobals.BreakOnLostIrps != 0) {
11431 NT_ASSERT(!
" - Irp failed to complete within 30 seconds - ");
11478#pragma prefast(suppress:28175)
11554 if ((fdoExtension->PrivateFdoData) &&
11555 (fdoExtension->PrivateFdoData->ReleaseQueueIrpAllocated)) {
11558 fdoExtension->PrivateFdoData->ReleaseQueueIrpAllocated =
FALSE;
11625 UCHAR lowerStackSize;
11631 if (
FdoExtension->PrivateFdoData->ReleaseQueueIrpAllocated) {
11636 lowerStackSize =
FdoExtension->CommonExtension.LowerDeviceObject->StackSize;
11652 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_PNP,
"ClassPnpStartDevice: Cannot allocate for "
11653 "release queue irp\n"));
11691 stackSize =
FdoExtension->CommonExtension.LowerDeviceObject->StackSize + 1;
11781 NT_ASSERT(fdoExtension->PrivateFdoData->ReleaseQueueIrpAllocated);
11782 if (!fdoExtension->PrivateFdoData->ReleaseQueueIrpAllocated) {
11785 if (!fdoExtension->PrivateFdoData->ReleaseQueueIrpAllocated) {
11808 if (ReleaseQueueIrp) {
11809 irp = ReleaseQueueIrp;
11851 srb->Function = (
UCHAR)function;
11941 if(releaseQueueNeeded) {
11976ClassAcquireChildLock(
12065 ClassAcquireChildLock(
Parent);
12075 for (testChild =
Parent->CommonExtension.ChildList;
12084 Child->CommonExtension.ChildList =
Parent->CommonExtension.ChildList;
12126 ClassAcquireChildLock(
Parent);
12136 if(
Parent->CommonExtension.ChildList ==
NULL) {
12161 previousChild = &previousChild->
ChildList->CommonExtension;
12162 }
while(previousChild !=
NULL);
12164 if(previousChild ==
NULL) {
12176 Child->CommonExtension.ChildList =
NULL;
12220 fdoData = fdoExtension->PrivateFdoData;
12236 if (
now.QuadPart < fdoData->
Retry.Tick.QuadPart) {
12243 retryList = fdoData->
Retry.ListHead;
12252 while (retryList !=
NULL) {
12259 retryList = retryList->
Next;
12261 irp->Tail.Overlay.DriverContext[0] =
ULongToPtr(0xdddddddd);
12262 irp->Tail.Overlay.DriverContext[1] =
ULongToPtr(0xdddddddd);
12263 irp->Tail.Overlay.DriverContext[2] =
ULongToPtr(0xdddddddd);
12264 irp->Tail.Overlay.DriverContext[3] =
ULongToPtr(0xdddddddd);
12302 irp->IoStatus.Information = 0;
12335 fdoExtension = SelfDeviceObject->DeviceExtension;
12344 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassRetryRequestEx: LOST IRP %p\n",
Irp));
12345 NT_ASSERT(!
"ClassRetryRequestEx Called From PDO? LOST IRP");
12350 fdoData = fdoExtension->PrivateFdoData;
12352 if (TimeDelta100ns < 0) {
12353 NT_ASSERT(!
"ClassRetryRequest - must use positive delay");
12354 TimeDelta100ns *= -1;
12371 delta.
QuadPart = (TimeDelta100ns / fdoData->
Retry.Granularity);
12372 if (TimeDelta100ns % fdoData->
Retry.Granularity) {
12389 retryInfo->
Next = fdoData->
Retry.ListHead;
12390 fdoData->
Retry.ListHead = retryInfo;
12412 }
else if (delta.
QuadPart > fdoData->
Retry.Delta.QuadPart) {
12430 fdoData->
Retry.Tick.QuadPart -= fdoData->
Retry.Delta.QuadPart;
12474 fire.
QuadPart *= FdoData->Retry.Granularity;
12488 "ClassRetry: ======= %I64x ticks\n",
12501 KeSetTimerEx(&FdoData->Retry.Timer, fire, 0, &FdoData->Retry.Dpc);
12514 ULONG resultLength = 0;
12515 ULONG writeCacheOverride;
12562 (
PVOID)&deviceRemovalPolicy,
12586 (
PULONG)&userRemovalPolicy);
12594 deviceRemovalPolicy = userRemovalPolicy;
12617 writeCacheOverride =
FALSE;
12621 &writeCacheOverride);
12623 if (writeCacheOverride) {
12655 HANDLE deviceParameterHandle;
12656 HANDLE classParameterHandle;
12669 deviceParameterHandle =
NULL;
12670 classParameterHandle =
NULL;
12676 &deviceParameterHandle
12680 goto cleanupScanForSpecial;
12687 deviceParameterHandle,
12691 status = ZwOpenKey( &classParameterHandle,
12697 goto cleanupScanForSpecial;
12716 (
PWSTR)classParameterHandle,
12722 goto cleanupScanForSpecial;
12733cleanupScanForSpecial:
12735 if (deviceParameterHandle) {
12736 ZwClose(deviceParameterHandle);
12739 if (classParameterHandle) {
12740 ZwClose(classParameterHandle);
12830 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_INIT,
"ClasspUpdateDiskProperties: Disk property update for fdo %p failed with status 0x%X.\n",
Fdo,
status));
12832 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_INIT,
"ClasspUpdateDiskProperties: Drive capacity has changed for %p.\n",
Fdo));
12902 tmpRetry = ((
LONGLONG)seconds) * 1000 * 1000 * 10;
12906 if (RetryIn100nsUnits !=
NULL)
12908 *RetryIn100nsUnits = tmpRetry;
12928#if defined(_ARM_) || defined(_ARM64_)
12935 allocationBufferLength,
12946 if (supportedPages ==
NULL) {
12957 #pragma prefast(suppress:26015, "InitializeStorageRequestBlock ensures buffer access is bounded")
12961 sizeof(srbExBuffer),
12998 allocationBufferLength,
13024 FdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits =
FALSE;
13026 FdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceCharacteristics =
FALSE;
13034 FdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits =
TRUE;
13042 FdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceCharacteristics =
TRUE;
13046 FdoExtension->FunctionSupportInfo->ValidInquiryPages.LBProvisioning =
TRUE;
13107 if ((
FdoExtension->FunctionSupportInfo->ValidInquiryPages.LBProvisioning ==
TRUE) ||
13108 (
FdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockLimits ==
TRUE)) {
13150ClassDetermineTokenOperationCommandSupport(
13182 "ClassDetermineTokenOperationCommandSupport (%p): Entering function.\n",
13210 "ClassDetermineTokenOperationCommandSupport (%p): Exiting function with status %x.\n",
13254 ULONG dataTransferLength = 0;
13260 "ClasspGetBlockDeviceTokenLimitsInfo (%p): Entering function.\n",
13279 "ClasspGetBlockDeviceTokenLimitsInfo (%p): Couldn't allocate SRB.\n",
13283 goto __ClasspGetBlockDeviceTokenLimitsInfo_Exit;
13286#if defined(_ARM_) || defined(_ARM64_)
13301 "ClasspGetBlockDeviceTokenLimitsInfo (%p): Couldn't allocate dataBuffer.\n",
13305 goto __ClasspGetBlockDeviceTokenLimitsInfo_Exit;
13332 "ClasspGetBlockDeviceTokenLimitsInfo (%p): Falling back to using SRB (instead of SRB_EX).\n",
13362 allocationBufferLength,
13383 "ClasspGetBlockDeviceTokenLimitsInfo (%p): Inquiry for TPC VPD failed with %x.\n",
13400 fdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits =
TRUE;
13410 "ClasspGetBlockDeviceTokenLimitsInfo (%p): %s %s (rev %s) reported following parameters: \
13411 \n\t\t\tMaxRangeDescriptors: %u\n\t\t\tMaxIAT: %u\n\t\t\tDefaultIAT: %u \
13412 \n\t\t\tMaxTokenTransferSize: %I64u\n\t\t\tOptimalTransferCount: %I64u\n\t\t\tOptimalTransferLengthGranularity: %u \
13413 \n\t\t\tOptimalTransferLength: %u\n\t\t\tMaxTransferLength: %u\n",
13418 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumRangeDescriptors,
13419 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumInactivityTimer,
13420 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.DefaultInactivityTimer,
13421 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumTokenTransferSize,
13422 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.OptimalTransferCount,
13423 fdoExtension->FunctionSupportInfo->BlockLimitsData.OptimalTransferLengthGranularity,
13424 fdoExtension->FunctionSupportInfo->BlockLimitsData.OptimalTransferLength,
13425 fdoExtension->FunctionSupportInfo->BlockLimitsData.MaximumTransferLength));
13430 "ClasspGetBlockDeviceTokenLimitsInfo (%p): ThirdPartyCopy VPD data doesn't have Windows OffloadDataTransfer descriptor.\n",
13433 fdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits =
FALSE;
13440 "ClasspGetBlockDeviceTokenLimitsInfo (%p): TPC VPD data didn't return TPC descriptors of interest.\n",
13443 fdoExtension->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits =
FALSE;
13447__ClasspGetBlockDeviceTokenLimitsInfo_Exit:
13451 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.CommandStatus =
status;
13455 "ClasspGetBlockDeviceTokenLimitsInfo (%p): Exiting function with status %x.\n",
13467ClassDeviceProcessOffloadRead(
13512 "ClassDeviceProcessOffloadRead (%p): Entering function. Irp %p\n",
13524 goto __ClassDeviceProcessOffloadRead_CompleteAndExit;
13532 "ClassDeviceProcessOffloadRead (%p): Called at raised IRQL.\n",
13536 goto __ClassDeviceProcessOffloadRead_CompleteAndExit;
13546 "ClassDeviceProcessOffloadRead (%p): Called from user mode.\n",
13550 goto __ClassDeviceProcessOffloadRead_CompleteAndExit;
13555 goto __ClassDeviceProcessOffloadRead_CompleteAndExit;
13558 dsmAttributes =
Irp->AssociatedIrp.SystemBuffer;
13567 "ClassDeviceProcessOffloadRead (%p): Parameter block size (%u) too small. Required %u.\n",
13573 goto __ClassDeviceProcessOffloadRead_CompleteAndExit;
13584 if ((fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumInactivityTimer > 0) &&
13585 (offloadReadParameters->
TimeToLive > fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumInactivityTimer)) {
13589 "ClassDeviceProcessOffloadRead (%p): Requested TTL (%u) greater than max supported (%u).\n",
13592 fdoExtension->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumInactivityTimer));
13595 goto __ClassDeviceProcessOffloadRead_CompleteAndExit;
13602 "ClassDeviceProcessOffloadRead (%p): Output buffer size (%u) too small.\n",
13607 goto __ClassDeviceProcessOffloadRead_CompleteAndExit;
13615 goto __ClassDeviceProcessOffloadRead_Exit;
13618__ClassDeviceProcessOffloadRead_CompleteAndExit:
13620__ClassDeviceProcessOffloadRead_Exit:
13623 "ClassDeviceProcessOffloadRead (%p): Exiting function Irp %p with status %x.\n",
13653ClassDeviceProcessOffloadWrite(
13695 "ClassDeviceProcessOffloadWrite (%p): Entering function. Irp %p\n",
13707 goto __ClassDeviceProcessOffloadWrite_CompleteAndExit;
13715 "ClassDeviceProcessOffloadWrite (%p): Called at raised IRQL.\n",
13719 goto __ClassDeviceProcessOffloadWrite_CompleteAndExit;
13729 "ClassDeviceProcessOffloadWrite (%p): Called from user mode.\n",
13733 goto __ClassDeviceProcessOffloadWrite_CompleteAndExit;
13738 goto __ClassDeviceProcessOffloadWrite_CompleteAndExit;
13741 dsmAttributes =
Irp->AssociatedIrp.SystemBuffer;
13750 "ClassDeviceProcessOffloadWrite (%p): Parameter block size (%u) too small. Required %u.\n",
13756 goto __ClassDeviceProcessOffloadWrite_CompleteAndExit;
13763 "ClassDeviceProcessOffloadWrite (%p): Output buffer size (%u) too small.\n",
13768 goto __ClassDeviceProcessOffloadWrite_CompleteAndExit;
13776 goto __ClassDeviceProcessOffloadWrite_Exit;
13779__ClassDeviceProcessOffloadWrite_CompleteAndExit:
13781__ClassDeviceProcessOffloadWrite_Exit:
13784 "ClassDeviceProcessOffloadWrite (%p): Exiting function Irp %p with status %x\n",
13797ClasspServicePopulateTokenTransferRequest(
13821 BOOLEAN allDataSetRangeFullyConverted;
13823 ULONG blockDescrIndex;
13827 ULONG dataSetRangeIndex;
13829 ULONG dataSetRangesCount;
13835 ULONG listIdentifier;
13836 ULONG maxBlockDescrCount;
13841 USHORT populateTokenDataLength;
13842 USHORT populateTokenDescriptorsLength;
13843 PMDL populateTokenMdl;
13845 ULONG receiveTokenInformationBufferLength;
13848 BOOLEAN tempDataSetRangeFullyConverted;
13851 ULONG tokenOperationBufferLength;
13854 ULONG transferSize;
13860 "ClasspServicePopulateTokenTransferRequest (%p): Entering function. Irp %p\n",
13864 fdoExt =
Fdo->DeviceExtension;
13866 dsmAttributes =
Irp->AssociatedIrp.SystemBuffer;
13869 populateTokenMdl =
NULL;
13873 totalSectorsToProcess = 0;
13877 offloadReadContext =
NULL;
13879 NT_ASSERT(fdoExt->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits &&
13880 NT_SUCCESS(fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.CommandStatus));
13883 for (
i = 0, entireXferLen = 0;
i < dataSetRangesCount;
i++) {
13922 &tokenOperationBufferLength,
13923 &receiveTokenInformationBufferLength);
13932 if (!offloadReadContext) {
13936 "ClasspServicePopulateTokenTransferRequest (%p): Failed to allocate buffer for PopulateToken operations.\n",
13940 goto __ClasspServicePopulateTokenTransferRequest_ErrorExit;
13945 offloadReadContext->
Fdo =
Fdo;
13951 buffer = (offloadReadContext + 1);
13962 "ClasspServicePopulateTokenTransferRequest (%p): Failed to retrieve transfer packet for TokenOperation (PopulateToken) operation.\n",
13966 goto __ClasspServicePopulateTokenTransferRequest_ErrorExit;
13969 offloadReadContext->
Pkt = pkt;
13973 tokenOperationBufferLength,
13974 &maxBlockDescrCount,
13982 if ((offloadReadParameters->
TimeToLive == 0) && (fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.OptimalTransferCount > 0)) {
13984 maxLbaCount =
MIN(maxLbaCount, fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.OptimalTransferCount);
13996 "ClasspServicePopulateTokenTransferRequest (%p): Using MaxBlockDescrCount %u and MaxLbaCount %I64u.\n",
13998 maxBlockDescrCount,
14001 allDataSetRangeFullyConverted =
FALSE;
14002 tempDataSetRangeFullyConverted =
TRUE;
14003 dataSetRangeIndex = (
ULONG)-1;
14008 RtlZeroMemory(&tempDataSetRange,
sizeof(tempDataSetRange));
14010 blockDescrIndex = 0;
14016 while (!((blockDescrIndex == maxBlockDescrCount) ||
14017 (lbaCount == maxLbaCount) ||
14018 (allDataSetRangeFullyConverted))) {
14024 if (tempDataSetRangeFullyConverted) {
14025 dataSetRangeIndex++;
14030 totalSectorCount = 0;
14032 ClasspConvertDataSetRangeToBlockDescr(
Fdo,
14035 maxBlockDescrCount,
14039 &totalSectorCount);
14043 allDataSetRangeFullyConverted = tempDataSetRangeFullyConverted && ((dataSetRangeIndex + 1) == dataSetRangesCount);
14045 totalSectorsToProcess += totalSectorCount;
14071 bufferLength =
max(transferSize, receiveTokenInformationBufferLength);
14074 if (!populateTokenMdl) {
14078 "ClasspServicePopulateTokenTransferRequest (%p): Failed to allocate MDL for PopulateToken operations.\n",
14082 goto __ClasspServicePopulateTokenTransferRequest_ErrorExit;
14087 pseudoIrp = &offloadReadContext->
PseudoIrp;
14092 pseudoIrp->Tail.Overlay.DriverContext[0] =
LongToPtr(1);
14093 pseudoIrp->MdlAddress = populateTokenMdl;
14098 ClasspSetupPopulateTokenTransferPacket(
14099 offloadReadContext,
14108 "ClasspServicePopulateTokenTransferRequest (%p): Generate token for %I64u bytes (versus %I64u) [via %u descriptors]. \
14109 \n\t\t\tDataLength: %u, DescriptorsLength: %u. Pkt %p (list id %x). Requested TTL: %u secs.\n",
14114 populateTokenDataLength,
14115 populateTokenDescriptorsLength,
14137 goto __ClasspServicePopulateTokenTransferRequest_Exit;
14143__ClasspServicePopulateTokenTransferRequest_ErrorExit:
14147 if (offloadReadContext !=
NULL) {
14149 offloadReadContext =
NULL;
14152__ClasspServicePopulateTokenTransferRequest_Exit:
14156 "ClasspServicePopulateTokenTransferRequest (%p): Exiting function (Irp %p) with status %x.\n",
14193 ULONG listIdentifier;
14199 offloadReadContext =
Context;
14200 pseudoIrp = &offloadReadContext->
PseudoIrp;
14201 pkt = offloadReadContext->
Pkt;
14202 fdo = offloadReadContext->
Fdo;
14205 offloadReadContext->
Pkt =
NULL;
14214 "ClasspPopulateTokenTransferPacketDone (%p): Generate token for list Id %x failed with %x (Pkt %p).\n",
14219 goto __ClasspPopulateTokenTransferPacketDone_ErrorExit;
14240__ClasspPopulateTokenTransferPacketDone_ErrorExit:
14290 status = CompletionStatus;
14291 dsmAttributes = OffloadReadContext->OffloadReadDsmIrp->AssociatedIrp.SystemBuffer;
14292 totalSectorsProcessed = OffloadReadContext->TotalSectorsProcessed;
14293 fdoExt = OffloadReadContext->Fdo->DeviceExtension;
14294 entireXferLen = OffloadReadContext->EntireXferLen;
14295 token = OffloadReadContext->Token;
14296 irp = OffloadReadContext->OffloadReadDsmIrp;
14297 fdo = OffloadReadContext->Fdo;
14307 "ClasspCompleteOffloadRead (%p): Successfully populated token with %I64u (out of %I64u) bytes (list Id %x).\n",
14309 totalBytesProcessed,
14311 OffloadReadContext->ListIdentifier));
14313 if (totalBytesProcessed < entireXferLen) {
14328 OffloadReadContext =
NULL;
14357 PMDL populateTokenMdl;
14359 populateTokenMdl = OffloadReadContext->PopulateTokenMdl;
14363 if (populateTokenMdl) {
14409 ULONG listIdentifier;
14412 ULONG receiveTokenInformationBufferLength;
14415 ULONG tempSizeUlong;
14418 totalSectorsProcessed = &OffloadReadContext->TotalSectorsProcessed;
14419 buffer = OffloadReadContext + 1;
14421 fdo = OffloadReadContext->Fdo;
14422 irp = OffloadReadContext->OffloadReadDsmIrp;
14423 receiveTokenInformationBufferLength = OffloadReadContext->ReceiveTokenInformationBufferLength;
14424 listIdentifier = OffloadReadContext->ListIdentifier;
14428 "ClasspReceivePopulateTokenInformation (%p): Entering function. Irp %p\n",
14432 srb = &OffloadReadContext->Srb;
14433 *totalSectorsProcessed = 0;
14440 "ClasspReceivePopulateTokenInformation (%p): Failed to retrieve transfer packet for ReceiveTokenInformation (PopulateToken) operation.\n",
14444 goto __ClasspReceivePopulateTokenInformation_ErrorExit;
14447 OffloadReadContext->Pkt = pkt;
14451 tempSizeUlong = receiveTokenInformationBufferLength - 4;
14454 pseudoIrp = &OffloadReadContext->PseudoIrp;
14460 pseudoIrp->Tail.Overlay.DriverContext[0] =
LongToPtr(1);
14461 pseudoIrp->MdlAddress = OffloadReadContext->PopulateTokenMdl;
14463 ClasspSetupReceivePopulateTokenInformationTransferPacket(
14464 OffloadReadContext,
14466 receiveTokenInformationBufferLength,
14477 if (cdbLength <= 16) {
14489__ClasspReceivePopulateTokenInformation_ErrorExit:
14530 ULONG availableData;
14532 UCHAR completionStatus;
14533 ULONG estimatedRetryInterval;
14537 ULONG listIdentifier;
14540 UCHAR operationStatus;
14542 USHORT segmentsProcessed;
14544 ULONG senseDataFieldLength;
14545 UCHAR senseDataLength;
14551 ULONG tokenDescriptorLength;
14560 offloadReadContext =
Context;
14561 fdo = offloadReadContext->
Fdo;
14563 buffer = offloadReadContext + 1;
14568 srb = &offloadReadContext->
Srb;
14573 transferBlockCount = 0;
14574 tokenInformationResultsResponse =
NULL;
14575 tokenDescriptor =
NULL;
14576 operationCompleted =
FALSE;
14577 tokenDescriptorLength = 0;
14580 pseudoIrp = &offloadReadContext->
PseudoIrp;
14598 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): Token retrieval failed for list Id %x with %x.\n",
14602 goto __ClasspReceivePopulateTokenInformationTransferPacketDone_Exit;
14626 if (operationCompleted) {
14628 if (transferBlockCount > totalSectorsToProcess) {
14637 NT_ASSERT(transferBlockCount <= totalSectorsToProcess);
14638 transferBlockCount = 0;
14650 transferBlockCount = 0;
14659 NT_ASSERT(senseDataFieldLength >= senseDataLength);
14667 if (tokenDescriptorLength > 0) {
14675 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): Bad firmware, token descriptor length %u.\n",
14677 tokenDescriptorLength));
14679 NT_ASSERT((*totalSectorsProcessed) == 0);
14694 *totalSectorsProcessed = transferBlockCount;
14696 if (transferBlockCount < totalSectorsToProcess) {
14702 if (transferBlockCount == 0) {
14713 NT_ASSERT(transferBlockCount == totalSectorsToProcess);
14725 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): %wsToken %s generated successfully for list Id %x for data size %I64u bytes.\n",
14727 transferBlockCount == totalSectorsToProcess ?
L"" :
L"Target truncated read. ",
14728 (tokenAscii ==
NULL) ?
"" : tokenAscii,
14738 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): Target failed to generate a token for list Id %x for data size %I64u bytes (requested %I64u bytes).\n",
14744 *totalSectorsProcessed = 0;
14766 if (senseDataLength) {
14768 ULONG retryInterval;
14788 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): Reason for truncation/failure: %x - for list Id %x for data size %I64u bytes.\n",
14797 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): No sense data available but reason for truncation/failure, possibly: %x - for list Id %x for data size %I64u bytes.\n",
14805 if (tokenLength > 0) {
14831 goto __ClasspReceivePopulateTokenInformationTransferPacketDone_Exit;
14839 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): Token retrieval failed for list Id %x with %x.\n",
14844 NT_ASSERT(*totalSectorsProcessed == 0);
14845 goto __ClasspReceivePopulateTokenInformationTransferPacketDone_Exit;
14848__ClasspReceivePopulateTokenInformationTransferPacketDone_Exit:
14869 "ClasspReceivePopulateTokenInformationTransferPacketDone (%p): Exiting function (Irp %p) with internal status %x.\n",
14882ClasspServiceWriteUsingTokenTransferRequest(
14906 ULONG allocationSize;
14910 ULONG dataSetRangesCount;
14916 ULONG maxBlockDescrCount;
14920 ULONG receiveTokenInformationBufferLength;
14924 ULONG tokenOperationBufferLength;
14925 PMDL writeUsingTokenMdl;
14931 "ClasspServiceWriteUsingTokenTransferRequest (%p): Entering function. Irp %p.\n",
14935 fdoExt =
Fdo->DeviceExtension;
14938 dsmAttributes =
Irp->AssociatedIrp.SystemBuffer;
14940 writeUsingTokenMdl =
NULL;
14945 tokenInvalidated =
FALSE;
14949 NT_ASSERT(fdoExt->FunctionSupportInfo->ValidInquiryPages.BlockDeviceRODLimits &&
14950 NT_SUCCESS(fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.CommandStatus));
14952 for (
i = 0, entireXferLen = 0;
i < dataSetRangesCount;
i++) {
14991 &tokenOperationBufferLength,
14992 &receiveTokenInformationBufferLength);
15001 if (!offloadWriteContext) {
15005 "ClasspServiceWriteUsingTokenTransferRequest (%p): Failed to allocate buffer for WriteUsingToken operations.\n",
15009 goto __ClasspServiceWriteUsingTokenTransferRequest_ErrorExit;
15018 offloadWriteContext->
Fdo =
Fdo;
15025 buffer = (offloadWriteContext + 1);
15050 tokenOperationBufferLength,
15051 &maxBlockDescrCount,
15054 if (fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.OptimalTransferCount && fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumTokenTransferSize) {
15056 NT_ASSERT(fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.OptimalTransferCount <= fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.MaximumTokenTransferSize);
15066 if (0 == fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.OptimalTransferCount) {
15072 maxLbaCount =
MIN(maxLbaCount, fdoExt->FunctionSupportInfo->BlockDeviceRODLimitsData.OptimalTransferCount);
15088 "ClasspServiceWriteUsingTokenTransferRequest (%p): Using MaxBlockDescrCount %u and MaxLbaCount %I64u.\n",
15090 maxBlockDescrCount,
15104 if (!writeUsingTokenMdl) {
15108 "ClasspServiceWriteUsingTokenTransferRequest (%p): Failed to allocate MDL for WriteUsingToken operations.\n",
15112 goto __ClasspServiceWriteUsingTokenTransferRequest_ErrorExit;
15155 goto __ClasspServiceWriteUsingTokenTransferRequest_Exit;
15161__ClasspServiceWriteUsingTokenTransferRequest_ErrorExit:
15165 if (offloadWriteContext !=
NULL) {
15167 offloadWriteContext =
NULL;
15170__ClasspServiceWriteUsingTokenTransferRequest_Exit:
15174 "ClasspServiceWriteUsingTokenTransferRequest (%p): Exiting function (Irp %p) with status %x.\n",
15185#pragma warning(suppress: 28194)
15214 BOOLEAN allDataSetRangeFullyConverted;
15215 ULONG blockDescrIndex;
15220 ULONG dataSetRangeIndex;
15222 ULONG dataSetRangesCount;
15228 ULONG listIdentifier;
15230 ULONG maxBlockDescrCount;
15237 BOOLEAN tempDataSetRangeFullyConverted;
15241 ULONGLONG totalSectorsProcessedSuccessfully;
15243 ULONG transferSize;
15244 USHORT writeUsingTokenDataLength;
15245 USHORT writeUsingTokenDescriptorsLength;
15246 PMDL writeUsingTokenMdl;
15250 tempDataSetRangeFullyConverted =
FALSE;
15251 allDataSetRangeFullyConverted =
FALSE;
15252 fdo = OffloadWriteContext->Fdo;
15254 irp = OffloadWriteContext->OffloadWriteDsmIrp;
15255 buffer = OffloadWriteContext + 1;
15257 dataSetRanges = OffloadWriteContext->DataSetRanges;
15258 offloadWriteParameters = OffloadWriteContext->OffloadWriteParameters;
15259 pseudoIrp = &OffloadWriteContext->PseudoIrp;
15260 writeUsingTokenMdl = OffloadWriteContext->WriteUsingTokenMdl;
15261 entireXferLen = OffloadWriteContext->EntireXferLen;
15270 "ClasspContinueOffloadWrite (%p): Failed to retrieve transfer packet for TokenOperation (WriteUsingToken) operation.\n",
15274 goto __ClasspContinueOffloadWrite_ErrorExit;
15277 OffloadWriteContext->Pkt = pkt;
15282 blockDescrIndex = 0;
15285 totalSectorsToProcess = 0;
15287 maxBlockDescrCount = OffloadWriteContext->MaxBlockDescrCount;
15288 maxLbaCount = OffloadWriteContext->MaxLbaCount;
15301 dataSetRangeIndex = OffloadWriteContext->DataSetRangeIndex;
15302 dataSetRangesCount = OffloadWriteContext->DataSetRangesCount;
15303 dataSetRangeByteOffset = OffloadWriteContext->DataSetRangeByteOffset;
15304 totalSectorsProcessedSuccessfully = OffloadWriteContext->TotalSectorsProcessedSuccessfully;
15309 while (!((blockDescrIndex == maxBlockDescrCount) ||
15310 (lbaCount == maxLbaCount) ||
15311 (allDataSetRangeFullyConverted))) {
15313 NT_ASSERT(dataSetRangeIndex < dataSetRangesCount);
15314 NT_ASSERT(dataSetRangeByteOffset < dataSetRanges[dataSetRangeIndex].LengthInBytes);
15319 totalSectorCount = 0;
15321 ClasspConvertDataSetRangeToBlockDescr(fdo,
15324 maxBlockDescrCount,
15328 &totalSectorCount);
15332 allDataSetRangeFullyConverted = tempDataSetRangeFullyConverted && ((dataSetRangeIndex + 1) == dataSetRangesCount);
15334 if (tempDataSetRangeFullyConverted) {
15335 dataSetRangeIndex += 1;
15336 dataSetRangeByteOffset = 0;
15337 NT_ASSERT(dataSetRangeIndex <= dataSetRangesCount);
15340 NT_ASSERT(dataSetRangeByteOffset < dataSetRanges[dataSetRangeIndex].LengthInBytes);
15343 totalSectorsToProcess += totalSectorCount;
15352 OffloadWriteContext->TotalSectorsToProcess = totalSectorsToProcess;
15353 OffloadWriteContext->TotalSectorsProcessed = 0;
15367 logicalBlockOffset = OffloadWriteContext->LogicalBlockOffset + totalSectorsProcessedSuccessfully;
15371 &offloadWriteParameters->
Token,
15381 pseudoIrp->Tail.Overlay.DriverContext[0] =
LongToPtr(1);
15382 pseudoIrp->MdlAddress = writeUsingTokenMdl;
15387 ClasspSetupWriteUsingTokenTransferPacket(
15388 OffloadWriteContext,
15401 "ClasspContinueOffloadWrite (%p): Offloading write for %I64u bytes (versus %I64u) [via %u descriptors]. \
15402 \n\t\t\tDataLength: %u, DescriptorsLength: %u. Pkt %p (list id %x) [Token: %s]\n",
15407 writeUsingTokenDataLength,
15408 writeUsingTokenDescriptorsLength,
15411 (tokenAscii ==
NULL) ?
"" : tokenAscii));
15415 OffloadWriteContext->ListIdentifier = listIdentifier;
15430__ClasspContinueOffloadWrite_ErrorExit:
15482 PULONG dataSetRangeIndex;
15486 PULONGLONG totalSectorsProcessedSuccessfully;
15488 fdo = OffloadWriteContext->Fdo;
15490 dataSetRanges = OffloadWriteContext->DataSetRanges;
15491 dataSetRangeByteOffset = &OffloadWriteContext->DataSetRangeByteOffset;
15492 dataSetRangeIndex = &OffloadWriteContext->DataSetRangeIndex;
15493 totalSectorsProcessedSuccessfully = &OffloadWriteContext->TotalSectorsProcessedSuccessfully;
15496 (*totalSectorsProcessedSuccessfully) += SectorsToAdvance;
15497 NT_ASSERT((*totalSectorsProcessedSuccessfully) <= OffloadWriteContext->TotalRequestSizeSectors);
15499 while (bytesToAdvance != 0) {
15500 bytesToDo = dataSetRanges[*dataSetRangeIndex].
LengthInBytes - *dataSetRangeByteOffset;
15501 if (bytesToDo > bytesToAdvance) {
15502 bytesToDo = bytesToAdvance;
15504 (*dataSetRangeByteOffset) += bytesToDo;
15505 bytesToAdvance -= bytesToDo;
15506 if ((*dataSetRangeByteOffset) == dataSetRanges[*dataSetRangeIndex].LengthInBytes) {
15507 (*dataSetRangeIndex) += 1;
15508 (*dataSetRangeByteOffset) = 0;
15512 NT_ASSERT((*dataSetRangeIndex) <= OffloadWriteContext->DataSetRangesCount);
15553 ULONG listIdentifier;
15561 offloadWriteContext =
Context;
15562 pseudoIrp = &offloadWriteContext->
PseudoIrp;
15563 fdo = offloadWriteContext->
Fdo;
15569 pkt = offloadWriteContext->
Pkt;
15571 offloadWriteContext->
Pkt =
NULL;
15589 "ClasspWriteUsingTokenTransferPacketDone (%p): Write failed with %x (list id %x).\n",
15600 *tokenInvalidated =
TRUE;
15604 goto __ClasspWriteUsingTokenTransferPacketDone_Exit;
15625 "ClasspWriteUsingTokenTransferPacketDone (%p): Successfully wrote using token %I64u (out of %I64u) bytes (list Id %x).\n",
15642 "ClasspWriteUsingTokenTransferPacketDone (%p): Target truncated write using token %I64u (out of %I64u) bytes (list Id %x).\n",
15662 goto __ClasspWriteUsingTokenTransferPacketDone_Exit;
15672 "ClasspWriteUsingTokenTransferPacketDone (%p): Write failed with status %x, %x (list id %x).\n",
15675 pkt->
Srb->SrbStatus,
15681 goto __ClasspWriteUsingTokenTransferPacketDone_Exit;
15684__ClasspWriteUsingTokenTransferPacketDone_Exit:
15738 OffloadWriteContext->TotalSectorsProcessedSuccessfully <=
15739 OffloadWriteContext->TotalRequestSizeSectors);
15742 if (OffloadWriteContext->TotalSectorsProcessedSuccessfully == OffloadWriteContext->TotalRequestSizeSectors) {
15746 goto __ClasspReceiveWriteUsingTokenInformationDone_Exit;
15753 if (maxTargetDuration <= durationIn100ns) {
15757 "ClasspReceiveWriteUsingTokenInformationDone (%p): Truncating write (list id %x) because of max-duration-rule.\n",
15758 OffloadWriteContext->Fdo,
15759 OffloadWriteContext->ListIdentifier));
15768 goto __ClasspReceiveWriteUsingTokenInformationDone_Exit;
15772 OffloadWriteContext->TotalSectorsProcessedSuccessfully <
15773 OffloadWriteContext->TotalRequestSizeSectors);
15781__ClasspReceiveWriteUsingTokenInformationDone_Exit:
15828 PULONGLONG totalSectorsProcessedSuccessfully;
15832 ULONG listIdentifier;
15837 fdo = OffloadWriteContext->Fdo;
15839 dsmAttributes = OffloadWriteContext->DsmAttributes;
15840 totalSectorsProcessedSuccessfully = &OffloadWriteContext->TotalSectorsProcessedSuccessfully;
15841 entireXferLen = OffloadWriteContext->EntireXferLen;
15842 irp = OffloadWriteContext->OffloadWriteDsmIrp;
15843 tokenInvalidated = &OffloadWriteContext->TokenInvalidated;
15844 listIdentifier = OffloadWriteContext->ListIdentifier;
15845 totalSectorsProcessed = OffloadWriteContext->TotalSectorsProcessed;
15846 status = CompletionCausingStatus;
15855 "ClasspCompleteOffloadWrite (%p): %ws wrote using token %I64u (out of %I64u) bytes (Irp %p).\n",
15858 totalBytesProcessed,
15862 if (totalBytesProcessed > 0 && totalBytesProcessed < entireXferLen) {
15865 if (*tokenInvalidated) {
15875 "ClasspCompleteOffloadWrite (%p): TokenOperation for WriteUsingToken (list Id %u) completed with %x writing %I64u blocks (currentTotal %I64u blocks).\n",
15879 totalSectorsProcessed,
15880 *totalSectorsProcessedSuccessfully));
15886 if (*totalSectorsProcessedSuccessfully) {
15895 OffloadWriteContext =
NULL;
15924 PMDL writeUsingTokenMdl = OffloadWriteContext->WriteUsingTokenMdl;
15926 if (writeUsingTokenMdl) {
15969 ULONG listIdentifier;
15972 ULONG receiveTokenInformationBufferLength;
15975 ULONG tempSizeUlong;
15976 PMDL writeUsingTokenMdl;
15978 fdo = OffloadWriteContext->Fdo;
15979 irp = OffloadWriteContext->OffloadWriteDsmIrp;
15980 pseudoIrp = &OffloadWriteContext->PseudoIrp;
15981 buffer = OffloadWriteContext + 1;
15983 receiveTokenInformationBufferLength = OffloadWriteContext->ReceiveTokenInformationBufferLength;
15984 writeUsingTokenMdl = OffloadWriteContext->WriteUsingTokenMdl;
15985 listIdentifier = OffloadWriteContext->ListIdentifier;
15986 srb = &OffloadWriteContext->Srb;
15991 "ClasspReceiveWriteUsingTokenInformation (%p): Entering function. Irp %p\n",
16002 NT_ASSERT(OffloadWriteContext->TotalSectorsProcessed == 0);
16010 "ClasspReceiveWriteUsingTokenInformation (%p): Failed to retrieve transfer packet for ReceiveTokenInformation (WriteUsingToken) operation.\n",
16015 goto __ClasspReceiveWriteUsingTokenInformation_ErrorExit;
16020 tempSizeUlong = receiveTokenInformationBufferLength - 4;
16027 pseudoIrp->Tail.Overlay.DriverContext[0] =
LongToPtr(1);
16028 pseudoIrp->MdlAddress = writeUsingTokenMdl;
16030 ClasspSetupReceiveWriteUsingTokenInformationTransferPacket(
16031 OffloadWriteContext,
16044 if (cdbLength <= 16) {
16056__ClasspReceiveWriteUsingTokenInformation_ErrorExit:
16101 ULONG availableData;
16103 UCHAR completionStatus;
16104 ULONG estimatedRetryInterval;
16108 ULONG listIdentifier;
16110 UCHAR operationStatus;
16112 USHORT segmentsProcessed;
16114 ULONG senseDataFieldLength;
16115 UCHAR senseDataLength;
16118 ULONG tokenDescriptorLength;
16126 fdo = OffloadWriteContext->Fdo;
16128 listIdentifier = OffloadWriteContext->ListIdentifier;
16129 totalSectorsProcessed = &OffloadWriteContext->TotalSectorsProcessed;
16130 totalSectorsToProcess = OffloadWriteContext->TotalSectorsToProcess;
16131 irp = OffloadWriteContext->OffloadWriteDsmIrp;
16132 pseudoIrp = &OffloadWriteContext->PseudoIrp;
16133 tokenInvalidated = &OffloadWriteContext->TokenInvalidated;
16134 srb = &OffloadWriteContext->Srb;
16135 operationCompleted =
FALSE;
16136 buffer = OffloadWriteContext + 1;
16139 transferBlockCount = 0;
16140 tokenInformationResponsePadding =
NULL;
16141 tokenDescriptorLength = 0;
16143 NT_ASSERT((*totalSectorsProcessed) == 0);
16145 OffloadWriteContext->Pkt =
NULL;
16164 "ClasspReceiveWriteUsingTokenInformationTransferPacketDone (%p): Failed with %x to retrieve write results for list Id %x for data size %I64u bytes.\n",
16170 NT_ASSERT((*totalSectorsProcessed) == 0);
16172 goto __ClasspReceiveWriteUsingTokenInformationTransferPacketDone_ErrorExit;
16191 NT_ASSERT(senseDataFieldLength >= senseDataLength);
16206 if (operationCompleted) {
16208 if (transferBlockCount > totalSectorsToProcess) {
16217 NT_ASSERT(transferBlockCount <= totalSectorsToProcess);
16218 transferBlockCount = 0;
16230 transferBlockCount = 0;
16238 NT_ASSERT((*totalSectorsProcessed) == 0);
16239 *totalSectorsProcessed = transferBlockCount;
16242 if (transferBlockCount < totalSectorsToProcess) {
16255 "ClasspReceiveWriteUsingTokenInformationTransferPacketDone (%p): %wsSuccessfully wrote (for list Id %x) for data size %I64u bytes\n",
16257 transferBlockCount == totalSectorsToProcess ?
L"" :
L"Target truncated write. ",
16278 if (senseDataLength) {
16280 ULONG retryInterval;
16300 "ClasspReceiveWriteUsingTokenInformationTransferPacketDone (%p): Reason for truncation/failure: %x - for list Id %x for data size %I64u bytes.\n",
16312 *tokenInvalidated =
TRUE;
16318 "ClasspReceiveWriteUsingTokenInformationTransferPacketDone (%p): No sense data available but reason for truncation/failure, possibly: %x - for list Id %x for data size %I64u bytes.\n",
16335 if (transferBlockCount != 0) {
16351 goto __ClasspReceiveWriteUsingTokenInformationTransferPacketDone_ErrorExit;
16356 goto __ClasspReceiveWriteUsingTokenInformationTransferPacketDone_Exit;
16362 goto __ClasspReceiveWriteUsingTokenInformationTransferPacketDone_ErrorExit;
16369__ClasspReceiveWriteUsingTokenInformationTransferPacketDone_ErrorExit:
16375__ClasspReceiveWriteUsingTokenInformationTransferPacketDone_Exit:
16385 "ClasspReceiveWriteUsingTokenInformationTransferPacketDone (%p): Exiting function (Irp %p) with status %x.\n",
16427 ULONG generationCount;
16428 ULONG changeRequestCount;
16438 generationCount =
FdoExtension->FunctionSupportInfo->GenerationCount;
16439 changeRequestCount =
FdoExtension->FunctionSupportInfo->ChangeRequestCount;
16440 if (!ForceQuery && generationCount == changeRequestCount) {
16464 &blockLimitsDataNew);
16475 if (generationCount ==
FdoExtension->FunctionSupportInfo->GenerationCount) {
16477 blockLimitsDataOriginal = &
FdoExtension->FunctionSupportInfo->BlockLimitsData;
16483 *blockLimitsDataOriginal = blockLimitsDataNew;
16493 FdoExtension->FunctionSupportInfo->GenerationCount = changeRequestCount;
16546 *BlockLimitsData =
FdoExtension->FunctionSupportInfo->BlockLimitsData;
16547 *GenerationCount =
FdoExtension->FunctionSupportInfo->GenerationCount;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define ALIGN_UP_BY(size, align)
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
#define InterlockedIncrement
#define InterlockedExchange
#define InterlockedDecrement
PDEVICE_OBJECT PhysicalDeviceObject
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
_In_ PSCSI_REQUEST_BLOCK Srb
_In_ size_t _In_ UCHAR _In_ BOOLEAN Use6Byte
FORCEINLINE BOOLEAN PORT_ALLOCATED_SENSE(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
#define DEV_SAFE_START_UNIT
_In_ size_t _In_ UCHAR PageMode
#define FREE_POOL(_PoolPtr)
#define START_UNIT_TIMEOUT
FORCEINLINE VOID FREE_PORT_ALLOCATED_SENSE_BUFFER(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
#define IS_SCSIOP_READWRITE(opCode)
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID BufferAddress
_In_ PSTORAGE_PROPERTY_ID PropertyId
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN _In_opt_ WDFREQUEST OriginalRequest
#define SRB_CLASS_FLAGS_LOW_PRIORITY
_In_ PSCSI_REQUEST_BLOCK _In_opt_ PVOID _In_ ULONG _In_ BOOLEAN WriteToDevice
#define IS_SCSIOP_WRITE(opCode)
_In_ ULONG _In_ UCHAR PageCode
#define SRB_CLASS_FLAGS_PAGING
#define TEST_FLAG(Flags, Bit)
#define CLEAR_FLAG(Flags, Bit)
#define SET_FLAG(Flags, Bit)
_In_ ULONG _In_ UCHAR _In_ UCHAR PageControl
#define FDO_HACK_NO_RESERVE6
#define CLASS_PERF_RESTORE_MINIMUM
#define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS
#define CLASSP_REG_HACK_VALUE_NAME
#define CLASSP_REG_PERF_RESTORE_VALUE_NAME
#define NUM_ERROR_LOG_ENTRIES
#define CLASSP_REG_WRITE_CACHE_VALUE_NAME
#define FDO_HACK_INVALID_FLAGS
#define FDO_HACK_CANNOT_LOCK_MEDIA
#define CLASSP_REG_REMOVAL_POLICY_VALUE_NAME
#define CLASSP_REG_SUBKEY_NAME
#define SCSI_ADSENSE_ILLEGAL_BLOCK
#define SCSI_ADSENSE_LUN_NOT_READY
#define SCSIOP_MODE_SENSE10
#define SCSI_SENSEQ_INVALID_RELEASE_OF_PERSISTENT_RESERVATION
#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED
#define SCSI_SENSE_NO_SENSE
#define SCSI_SENSEQ_CLEANING_CARTRIDGE_INSTALLED
struct _READ_CAPACITY_DATA * PREAD_CAPACITY_DATA
#define SCSI_SENSEQ_OPERATION_IN_PROGRESS
#define SCSISTAT_RESERVATION_CONFLICT
#define SCSI_SENSEQ_AUTHENTICATION_FAILURE
#define SCSI_ADSENSE_SEEK_ERROR
#define SCSIOP_TEST_UNIT_READY
struct _READ_CAPACITY_DATA READ_CAPACITY_DATA
#define SCSI_ADSENSE_REC_DATA_NOECC
#define SCSI_SENSE_COPY_ABORTED
#define SCSI_ADSENSE_INVALID_LUN
#define SCSI_SENSE_DATA_PROTECT
#define SCSI_ADSENSE_INVALID_CDB
#define SCSI_ADSENSE_WRITE_PROTECT
#define SCSI_ADSENSE_MUSIC_AREA
#define SCSI_ADSENSE_TRACK_ERROR
#define SCSIOP_RELEASE_UNIT
#define SCSI_SENSEQ_KEY_NOT_ESTABLISHED
#define SCSI_SENSE_MEDIUM_ERROR
struct _MODE_PARAMETER_HEADER10 MODE_PARAMETER_HEADER10
#define SCSI_SENSEQ_READ_OF_SCRAMBLED_SECTOR_WITHOUT_AUTHENTICATION
struct _SENSE_DATA * PSENSE_DATA
#define SCSI_ADSENSE_ILLEGAL_COMMAND
#define SCSI_SENSEQ_UNKNOWN_FORMAT
struct _MODE_PARAMETER_HEADER10 * PMODE_PARAMETER_HEADER10
#define SCSI_SENSEQ_MEDIA_CODE_MISMATCHED_TO_LOGICAL_UNIT
#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE
#define SCSI_SENSEQ_KEY_NOT_PRESENT
#define SCSIOP_RESERVE_UNIT
#define SCSI_ADSENSE_REC_DATA_ECC
#define IOCTL_SCSI_EXECUTE_NONE
#define NOT_READY_RETRY_INTERVAL
#define SCSI_SENSEQ_BECOMING_READY
#define MODE_SENSE_CURRENT_VALUES
#define SCSI_ADSENSE_INVALID_MEDIA
#define SCSI_SENSE_ILLEGAL_REQUEST
#define SCSI_SENSEQ_LOGICAL_UNIT_RESET_COUNT_ERROR
#define SCSIOP_MODE_SENSE
#define SCSI_ADSENSE_NO_SENSE
#define SCSI_SENSE_UNIT_ATTENTION
#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE
#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED
#define SCSI_ADSENSE_DATA_AREA
#define SCSI_ADSENSE_MEDIUM_CHANGED
#define SCSIOP_START_STOP_UNIT
#define SCSI_SENSE_BLANK_CHECK
#define SCSI_SENSE_HARDWARE_ERROR
#define SCSI_ADSENSE_VOLUME_OVERFLOW
struct _MODE_PARAMETER_HEADER * PMODE_PARAMETER_HEADER
#define SCSI_SENSE_RECOVERED_ERROR
#define SCSI_SENSE_NOT_READY
#define SCSI_SENSE_ABORTED_COMMAND
#define SCSI_ADSENSE_BUS_RESET
#define SCSI_SENSEQ_FORMAT_IN_PROGRESS
#define SCSIOP_SYNCHRONIZE_CACHE
#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS
VOID ClassQueueResourceExhaustionEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
NTSTATUS InitializeStorageRequestBlock(_Inout_bytecount_(ByteSize) PSTORAGE_REQUEST_BLOCK Srb, _In_ USHORT AddressType, _In_ ULONG ByteSize, _In_ ULONG NumSrbExData,...)
NTSTATUS ClasspDeviceLBProvisioningProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
_IRQL_requires_same_ NTSTATUS ClasspGetTokenOperationDescriptorLimits(_In_ PDEVICE_OBJECT Fdo, _In_ ULONG ServiceAction, _In_ ULONG MaxParameterBufferLength, _Out_ PULONG MaxBlockDescriptorsCount, _Out_ PULONGLONG MaxBlockDescriptorsLength)
BOOLEAN StepLowMemRetry(PTRANSFER_PACKET Pkt)
FORCEINLINE VOID ClasspMarkIrpAsIdle(PIRP Irp, BOOLEAN Idle)
#define MAX_TOKEN_OPERATION_PARAMETER_DATA_LENGTH
#define REG_DISK_CLASS_CONTROL
FORCEINLINE BOOLEAN ClasspIsTokenOperationComplete(_In_ ULONG CurrentStatus)
NTSTATUS ClasspWriteCacheProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
NTSTATUS ClasspDeviceTrimProcess(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ PGUID ActivityId, _Inout_ PSCSI_REQUEST_BLOCK Srb)
struct _CLASS_RETRY_INFO * PCLASS_RETRY_INFO
VOID ClasspZeroQERR(_In_ PDEVICE_OBJECT DeviceObject)
VOID ClassQueueCapacityChangedEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
VOID ClasspQueueLogIOEventWithContextWorker(_In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG SenseBufferSize, _In_ PVOID SenseData, _In_ UCHAR SrbStatus, _In_ UCHAR ScsiStatus, _In_ ULONG ErrorCode, _In_ ULONG CdbLength, _In_opt_ PCDB Cdb, _In_opt_ PTRANSFER_PACKET Pkt)
#define CLASSPNP_POOL_TAG_VPD
struct _OFFLOAD_WRITE_CONTEXT OFFLOAD_WRITE_CONTEXT
_IRQL_requires_same_ NTSTATUS ClasspStorageEventNotification(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
VOID ClasspFreeDeviceMdl(PMDL Mdl)
#define CLASS_MAX_INTERLEAVE_PER_CRITICAL_IO
FORCEINLINE VOID SimpleInitSlistHdr(SINGLE_LIST_ENTRY *SListHdr)
NTSTATUS ClassDeviceHwFirmwareDownloadProcess(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
NTSTATUS NTAPI ClassMinimalPowerHandler(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS ClasspDeviceGetLBAStatus(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
VOID SetupModeSenseTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSenseBuffer, UCHAR ModeSenseBufferLen, UCHAR PageMode, UCHAR SubPage, PIRP OriginalIrp, UCHAR PageControl)
FORCEINLINE BOOLEAN ClasspIsOffloadDataTransferCommand(_In_ PCDB Cdb)
#define DEFAULT_MAX_NUMBER_BYTES_PER_SYNC_WRITE_USING_TOKEN
struct _OFFLOAD_READ_CONTEXT OFFLOAD_READ_CONTEXT
#define CLASSP_REG_ACCESS_ALIGNMENT_NOT_SUPPORTED
CLASSPNP_SCAN_FOR_SPECIAL_INFO ClassBadItems[]
FORCEINLINE LARGE_INTEGER ClasspGetCurrentTime(VOID)
VOID FreeDeviceInputMdl(PMDL Mdl)
#define CLASSPNP_POOL_TAG_SRB
NTSTATUS ClasspPersistentReserve(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
FORCEINLINE SINGLE_LIST_ENTRY * SimplePopSlist(SINGLE_LIST_ENTRY *SListHdr)
ULONG ClasspCalculateLogicalSectorSize(_In_ PDEVICE_OBJECT Fdo, _In_ ULONG BytesPerBlockInBigEndian)
VOID RetryRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, PSCSI_REQUEST_BLOCK Srb, BOOLEAN Associated, LONGLONG TimeDelta100ns)
VOID ClasspInitializeIdleTimer(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
_IRQL_requires_same_ PUCHAR ClasspBinaryToAscii(_In_reads_(Length) PUCHAR HexBuffer, _In_ ULONG Length, _Inout_ PULONG UpdateLength)
VOID ClasspPerfIncrementSuccessfulIo(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
#define VPD_PAGE_HEADER_SIZE
NTSTATUS ClasspDuidQueryProperty(PDEVICE_OBJECT DeviceObject, PIRP Irp)
#define CLASSP_REG_QERR_OVERRIDE_MODE
VOID EnqueueFreeTransferPacket(PDEVICE_OBJECT Fdo, __drv_aliasesMem PTRANSFER_PACKET Pkt)
DRIVER_STARTIO ClasspStartIo
NTSTATUS ClasspLogSystemEventWithDeviceNumber(_In_ PDEVICE_OBJECT DeviceObject, _In_ NTSTATUS IoErrorCode)
VOID InitializeDictionary(IN PDICTIONARY Dictionary)
NTSTATUS InitializeTransferPackets(PDEVICE_OBJECT Fdo)
#define CLASSPNP_POOL_TAG_TOKEN_OPERATION
NTSTATUS ClasspAccessAlignmentProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
IO_COMPLETION_ROUTINE ClassReleaseQueueCompletion
PTRANSFER_PACKET DequeueFreeTransferPacket(PDEVICE_OBJECT Fdo, BOOLEAN AllocIfNeeded)
VOID ClasspUninitializeRemoveTracking(_In_ PDEVICE_OBJECT DeviceObject)
DRIVER_UNLOAD ClassUnload
#define CLASSPNP_POOL_TAG_ADDITIONAL_DATA
GUID ClassGuidQueryRegInfoEx
FORCEINLINE BOOLEAN SimpleIsSlistEmpty(SINGLE_LIST_ENTRY *SListHdr)
VOID SetupDriveCapacityTransferPacket(TRANSFER_PACKET *Pkt, PVOID ReadCapacityBuffer, ULONG ReadCapacityBufferLen, PKEVENT SyncEventPtr, PIRP OriginalIrp, BOOLEAN Use16ByteCdb)
FORCEINLINE BOOLEAN ClasspIsObsoletePortDriver(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
_IRQL_requires_same_ NTSTATUS ClasspGetTokenOperationCommandBufferLength(_In_ PDEVICE_OBJECT Fdo, _In_ ULONG ServiceAction, _Inout_ PULONG CommandBufferLength, _Out_opt_ PULONG TokenOperationBufferLength, _Out_opt_ PULONG ReceiveTokenInformationBufferLength)
#define FDO_HACK_NO_SYNC_CACHE
VOID DestroyAllTransferPackets(PDEVICE_OBJECT Fdo)
#define QERR_SET_ZERO_ODX_OR_TP_ONLY
#define QERR_SET_ZERO_ALWAYS
PMDL ClasspBuildDeviceMdl(PVOID Buffer, ULONG BufferLen, BOOLEAN WriteToDevice)
FORCEINLINE VOID SimplePushSlist(SINGLE_LIST_ENTRY *SListHdr, SINGLE_LIST_ENTRY *SListEntry)
VOID EnqueueDeferredClientIrp(PDEVICE_OBJECT Fdo, PIRP Irp)
NTSTATUS ClasspDeviceGetLBProvisioningVPDPage(_In_ PDEVICE_OBJECT DeviceObject, _Inout_opt_ PSCSI_REQUEST_BLOCK Srb)
VOID SetupModeSelectTransferPacket(TRANSFER_PACKET *Pkt, PKEVENT SyncEventPtr, PVOID ModeSelectBuffer, UCHAR ModeSelectBufferLen, BOOLEAN SavePages, PIRP OriginalIrp)
FORCEINLINE BOOLEAN ClasspIsThinProvisioned(_In_ PCLASS_FUNCTION_SUPPORT_INFO SupportInfo)
NTSTATUS ClassDeviceHwFirmwareGetInfoProcess(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
NTSTATUS ClasspPriorityHint(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS ClasspDeviceSeekPenaltyProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
KDEFERRED_ROUTINE ClasspRetryRequestDpc
NTSTATUS SubmitTransferPacket(PTRANSFER_PACKET Pkt)
NTSTATUS ClasspDeviceTrimProperty(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
FORCEINLINE BOOLEAN ClasspIsReceiveTokenInformation(_In_ PCDB Cdb)
FORCEINLINE BOOLEAN ClasspIsIdleRequestSupported(PCLASS_PRIVATE_FDO_DATA FdoData, PIRP Irp)
#define CLASS_TAG_WORKING_SET
NTSTATUS ClasspEjectionControl(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN MEDIA_LOCK_TYPE LockType, IN BOOLEAN Lock)
PMDL BuildDeviceInputMdl(PVOID Buffer, ULONG BufferLen)
#define CLASSP_REG_LEGACY_ERROR_HANDLING
VOID ClasspInitializeRemoveTracking(_In_ PDEVICE_OBJECT DeviceObject)
FORCEINLINE BOOLEAN PORT_ALLOCATED_SENSE_EX(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PSTORAGE_REQUEST_BLOCK_HEADER Srb)
VOID TransferPacketQueueRetryDpc(PTRANSFER_PACKET Pkt)
VOID ClassFreeOrReuseSrb(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN __drv_freesMem(mem) PSCSI_REQUEST_BLOCK Srb)
_IRQL_requires_same_ NTSTATUS ClasspEnableIdlePower(_In_ PDEVICE_OBJECT DeviceObject)
VOID ClassQueueThresholdEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
VOID InitLowMemRetry(PTRANSFER_PACKET Pkt, PVOID BufPtr, ULONG Len, LARGE_INTEGER TargetLocation)
#define MAX_TOKEN_LIST_IDENTIFIERS
#define CLASS_TAG_PRIVATE_DATA
struct _IDLE_POWER_FDO_LIST_ENTRY * PIDLE_POWER_FDO_LIST_ENTRY
#define MINIMUM_RETRY_UNITS
#define CLASSP_REG_DISBALE_IDLE_POWER_NAME
#define MIN_TOKEN_LIST_IDENTIFIERS
NTSTATUS ClasspDeviceGetBlockLimitsVPDPage(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _Inout_bytecount_(SrbSize) PSCSI_REQUEST_BLOCK Srb, _In_ ULONG SrbSize, _Out_ PCLASS_VPD_B0_DATA BlockLimitsData)
#define LEGACY_NUM_IO_RETRIES
VOID SetupReadWriteTransferPacket(PTRANSFER_PACKET pkt, PVOID Buf, ULONG Len, LARGE_INTEGER DiskLocation, PIRP OriginalIrp)
IO_WORKITEM_ROUTINE ClasspUpdateDiskProperties
VOID ClassQueueProvisioningTypeChangedEventWorker(_In_ PDEVICE_OBJECT DeviceObject)
struct _CLASS_ERROR_LOG_DATA * PCLASS_ERROR_LOG_DATA
FORCEINLINE VOID FREE_PORT_ALLOCATED_SENSE_BUFFER_EX(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PSTORAGE_REQUEST_BLOCK_HEADER Srb)
NTSTATUS ClassDeviceGetLBProvisioningResources(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
NTSTATUS ClasspEnqueueIdleRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS ClassDeviceHwFirmwareActivateProcess(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
VOID ClasspPerfIncrementErrorCount(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
IO_COMPLETION_ROUTINE ClasspSendSynchronousCompletion
#define MAX_NUMBER_BLOCK_DEVICE_DESCRIPTORS
VOID ClassInitializeDispatchTables(PCLASS_DRIVER_EXTENSION DriverExtension)
VOID ClasspConvertToScsiRequestBlock(_Out_ PSCSI_REQUEST_BLOCK Srb, _In_ PSTORAGE_REQUEST_BLOCK SrbEx)
#define MAX_NUMBER_BYTES_PER_SYNC_WRITE_USING_TOKEN
#define CLASSP_VOLUME_VERIFY_CHECKED
NTSTATUS ClasspDeviceMediaTypeProperty(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _Inout_ PSCSI_REQUEST_BLOCK Srb)
POWER_SETTING_CALLBACK ClasspPowerSettingCallback
NTSTATUS ClasspInitializeTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
NTSTATUS ClasspMcnControl(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PIRP Irp, IN PSCSI_REQUEST_BLOCK Srb)
VOID ClasspEnableTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
VOID ClassSendEjectionNotification(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
VOID ClasspDeleteTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
VOID ClasspDisableTimer(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
#define SRB_CLASS_FLAGS_FREE_MDL
IO_COMPLETION_ROUTINE ClassSignalCompletion
struct _CLASS_PRIVATE_COMMON_DATA * PCLASS_PRIVATE_COMMON_DATA
_In_ BUS_QUERY_ID_TYPE IdType
struct _CLASS_PRIVATE_COMMON_DATA CLASS_PRIVATE_COMMON_DATA
_In_ PVOID _In_ PCLASS_INIT_DATA InitializationData
FORCEINLINE UCHAR GET_FDO_EXTENSON_SENSE_DATA_LENGTH(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
#define CLASS_WORKING_SET_MAXIMUM
_In_z_ PCCHAR _In_ PDEVICE_OBJECT LowerDeviceObject
struct _CLASS_INTERPRET_SENSE_INFO2 * PCLASS_INTERPRET_SENSE_INFO2
_In_z_ PCCHAR _In_ PDEVICE_OBJECT _In_ BOOLEAN IsFdo
#define ClassAcquireRemoveLock(devobj, tag)
_In_ PCHAR _In_ ULONG _In_ ULONG InquiryDataLength
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR MajorFunctionCode
struct _FUNCTIONAL_DEVICE_EXTENSION * PFUNCTIONAL_DEVICE_EXTENSION
struct _CLASS_WORKING_SET * PCLASS_WORKING_SET
#define CLASS_SRB_SCSI_REQUEST_BLOCK
struct _CLASS_FUNCTION_SUPPORT_INFO * PCLASS_FUNCTION_SUPPORT_INFO
_In_ BOOLEAN AcquireChildLock
#define CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE
_In_ BUS_QUERY_ID_TYPE _In_ PUNICODE_STRING IdString
#define DEV_USE_16BYTE_CDB
_In_ PCHAR _In_ ULONG DeviceNumber
#define CLASS_SRB_STORAGE_REQUEST_BLOCK
struct _CLASS_QUERY_WMI_REGINFO_EX_LIST * PCLASS_QUERY_WMI_REGINFO_EX_LIST
struct _PHYSICAL_DEVICE_EXTENSION * PPHYSICAL_DEVICE_EXTENSION
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG IoDeviceCode
#define CLASS_TAG_DEVICE_CONTROL
SCSIPORT_API NTSTATUS NTAPI ClassSendSrbAsynchronous(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PSCSI_REQUEST_BLOCK Srb, _In_ PIRP Irp, _In_reads_bytes_opt_(BufferLength) __drv_aliasesMem PVOID BufferAddress, _In_ ULONG BufferLength, _In_ BOOLEAN WriteToDevice)
_In_z_ PCCHAR ObjectNameBuffer
#define CLASS_INTERPRET_SENSE_INFO2_MAXIMUM_HISTORY_COUNT
#define CLASS_DRIVER_EXTENSION_KEY
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR _In_ ULONG _In_ ULONG PreviousRetryCount
#define SRB_CLASS_FLAGS_PERSISTANT
#define CLASS_TAG_RELEASE_QUEUE
#define STATUS_NOT_SUPPORTED
#define STATUS_NOT_IMPLEMENTED
static PDB_INFORMATION information
#define DEVPROP_TYPE_EMPTY
#define DEVPROP_TYPE_BOOLEAN
#define NT_SUCCESS(StatCode)
static void cleanup(void)
VOID NTAPI KeInitializeDpc(IN PKDPC Dpc, IN PKDEFERRED_ROUTINE DeferredRoutine, IN PVOID DeferredContext)
DRIVER_INITIALIZE DriverEntry
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
#define WPP_INIT_TRACING(a, b)
PVOID NTAPI ClassFindModePage(_In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode, _In_ BOOLEAN Use6Byte)
NTSTATUS NTAPI ClassIoComplete(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN PVOID Context)
ULONG ClassPnpAllowUnload
VOID NTAPI ClasspScanForClassHacks(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN ULONG_PTR Data)
ULONG NTAPI ClassModeSense(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode)
_IRQL_requires_same_ VOID ClasspReceiveWriteUsingTokenInformation(_In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
NTSTATUS ClassPnpStartDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI ClassInternalIoControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS ClassGetPdoId(IN PDEVICE_OBJECT Pdo, IN BUS_QUERY_ID_TYPE IdType, IN PUNICODE_STRING IdString)
VOID ClasspContinueOffloadWrite(_In_ __drv_aliasesMem POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
NTSTATUS NTAPI ClassReadWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI ClassDeviceControlDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
VOID ClasspReleaseQueue(IN PDEVICE_OBJECT Fdo, IN PIRP ReleaseQueueIrp OPTIONAL)
VOID ClasspAdvanceOffloadWritePosition(_In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext, _In_ ULONGLONG SectorsToAdvance)
NTSTATUS ClasspRefreshFunctionSupportInfo(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ BOOLEAN ForceQuery)
NTSTATUS NTAPI ClassSendSrbSynchronous(_In_ PDEVICE_OBJECT Fdo, _Inout_ PSCSI_REQUEST_BLOCK _Srb, _In_reads_bytes_opt_(BufferLength) PVOID BufferAddress, _In_ ULONG BufferLength, _In_ BOOLEAN WriteToDevice)
VOID ClasspFreeReleaseRequest(IN PDEVICE_OBJECT Fdo)
NTSTATUS ClasspBlockLimitsDataSnapshot(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ BOOLEAN ForceQuery, _Out_ PCLASS_VPD_B0_DATA BlockLimitsData, _Out_ PULONG GenerationCount)
VOID ClasspCompleteOffloadRead(_In_ POFFLOAD_READ_CONTEXT OffloadReadContext, _In_ NTSTATUS CompletionStatus)
PVPB NTAPI ClassGetVpb(_In_ PDEVICE_OBJECT DeviceObject)
PVOID ScreenStateNotificationHandle
VOID ClasspCompleteOffloadWrite(_In_ __drv_freesMem(Mem) POFFLOAD_WRITE_CONTEXT OffloadWriteContext, _In_ NTSTATUS CompletionCausingStatus)
BOOLEAN InitSecurityCookie
NTSTATUS NTAPI ClassModeSelect(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSelectBuffer, _In_ ULONG Length, _In_ BOOLEAN SavePages)
NTSTATUS ClasspAllocateReleaseRequest(IN PDEVICE_OBJECT Fdo)
ULONG MaxTokenOperationListIdentifier
IO_COMPLETION_ROUTINE ClassCheckVerifyComplete
VOID ClasspReceiveWriteUsingTokenInformationDone(_In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext, _In_ NTSTATUS CompletionCausingStatus)
VOID ClasspReceiveWriteUsingTokenInformationTransferPacketDone(_In_ POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
NTSTATUS ClasspModeSelect(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSelectBuffer, _In_ ULONG Length, _In_ BOOLEAN SavePages)
ULONG ClassMaxInterleavePerCriticalIo
VOID ClasspGetInquiryVpdSupportInfo(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
VOID NTAPI ClassReleaseChildLock(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
ULONG ClasspModeSense(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode, _In_ UCHAR PageControl)
VOID ClasspScanForSpecialInRegistry(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
NTSTATUS ClasspAllocateReleaseQueueIrp(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
KGUARDED_MUTEX IdlePowerFDOListMutex
NTSTATUS ClassQueryPnpCapabilities(IN PDEVICE_OBJECT DeviceObject, IN PDEVICE_CAPABILITIES Capabilities)
NTSTATUS ClasspGetLBProvisioningInfo(_Inout_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
VOID ClassRetryRequest(IN PDEVICE_OBJECT SelfDeviceObject, IN PIRP Irp, _In_ _In_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) IN LONGLONG TimeDelta100ns)
_IRQL_requires_same_ VOID ClasspReceivePopulateTokenInformation(_In_ POFFLOAD_READ_CONTEXT OffloadReadContext)
VOID ClasspWriteUsingTokenTransferPacketDone(_In_ PVOID Context)
VOID NTAPI ClassSendStartUnit(_In_ PDEVICE_OBJECT Fdo)
VOID ClassAddChild(_In_ PFUNCTIONAL_DEVICE_EXTENSION Parent, _In_ PPHYSICAL_DEVICE_EXTENSION Child, _In_ BOOLEAN AcquireLock)
NTSTATUS ClasspIsPortable(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _Out_ PBOOLEAN IsPortable)
_IRQL_requires_same_ NTSTATUS ClasspGetBlockDeviceTokenLimitsInfo(_Inout_ PDEVICE_OBJECT DeviceObject)
ULONG DiskIdleTimeoutInMS
NTSTATUS NTAPI ClassAsynchronousCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
VOID NTAPI ClassSendDeviceIoControlSynchronous(_In_ ULONG IoControlCode, _In_ PDEVICE_OBJECT TargetDeviceObject, _Inout_updates_opt_(_Inexpressible_(max(InputBufferLength, OutputBufferLength))) PVOID Buffer, _In_ ULONG InputBufferLength, _In_ ULONG OutputBufferLength, _In_ BOOLEAN InternalDeviceIoControl, _Out_ PIO_STATUS_BLOCK IoStatus)
VOID ClasspRegisterMountedDeviceInterface(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS ServiceTransferRequest(PDEVICE_OBJECT Fdo, PIRP Irp, BOOLEAN PostToDpc)
NTSTATUS ClasspAllocatePowerProcessIrp(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
VOID ClasspReceivePopulateTokenInformationTransferPacketDone(_In_ PVOID Context)
NTSTATUS ClassPnpQueryFdoRelations(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
GUID StoragePredictFailureDPSGuid
_Must_inspect_result_ NTSTATUS NTAPI ClassReadDriveCapacity(_In_ PDEVICE_OBJECT Fdo)
NTSTATUS NTAPI ClassDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
CONST LARGE_INTEGER Magic10000
VOID NTAPI ClassReleaseQueue(_In_ PDEVICE_OBJECT Fdo)
PPHYSICAL_DEVICE_EXTENSION ClassRemoveChild(IN PFUNCTIONAL_DEVICE_EXTENSION Parent, IN PPHYSICAL_DEVICE_EXTENSION Child, IN BOOLEAN AcquireLock)
VOID ClasspRetryDpcTimer(IN PCLASS_PRIVATE_FDO_DATA FdoData)
VOID ClasspCompleteOffloadRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ NTSTATUS CompletionStatus)
ULONG NTAPI ClassModeSenseEx(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode, _In_ UCHAR PageControl)
VOID ClasspPopulateTokenTransferPacketDone(_In_ PVOID Context)
volatile ULONG TokenOperationListIdentifier
VOID ClasspCleanupOffloadWriteContext(_In_ __drv_freesMem(mem) POFFLOAD_WRITE_CONTEXT OffloadWriteContext)
BOOLEAN NTAPI ClassInterpretSenseInfo(_In_ PDEVICE_OBJECT Fdo, _In_ PSCSI_REQUEST_BLOCK _Srb, _In_ UCHAR MajorFunctionCode, _In_ ULONG IoDeviceCode, _In_ ULONG RetryCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, 100) ULONG *RetryInterval)
NTSTATUS NTAPI ClassSendIrpSynchronous(_In_ PDEVICE_OBJECT TargetDeviceObject, _In_ PIRP Irp)
VOID InterpretCapacityData(PDEVICE_OBJECT Fdo, PREAD_CAPACITY_DATA_EX ReadCapacityData)
NTSTATUS ClassRetrieveDeviceRelations(IN PDEVICE_OBJECT Fdo, IN DEVICE_RELATION_TYPE RelationType, OUT PDEVICE_RELATIONS *DeviceRelations)
PVOID PowerSettingNotificationHandle
BOOLEAN InterpretSenseInfoWithoutHistory(_In_ PDEVICE_OBJECT Fdo, _In_opt_ PIRP OriginalRequest, _In_ PSCSI_REQUEST_BLOCK Srb, UCHAR MajorFunctionCode, ULONG IoDeviceCode, ULONG PreviousRetryCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIn100nsUnits)
NTSTATUS ClasspInitializeHotplugInfo(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
VOID ClasspCleanupOffloadReadContext(_In_ __drv_freesMem(mem) POFFLOAD_READ_CONTEXT OffloadReadContext)
NTSTATUS NTAPI ClassShutdownFlush(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI ClassForwardIrpSynchronous(_In_ PCOMMON_DEVICE_EXTENSION CommonExtension, _In_ PIRP Irp)
LIST_ENTRY IdlePowerFDOList
#define DBGGETSCSIOPSTR(_pSrb)
#define DBGLOGFLUSHINFO(_fdoData, _isIO, _isFUA, _isFlush)
#define DBGGETADSENSECODESTR(_pSrb)
#define ClasspInitializeDebugGlobals()
#define DBGGETADSENSEQUALIFIERSTR(_pSrb)
#define DBGGETSRBSTATUSSTR(_pSrb)
#define DBGGETSENSECODESTR(_pSrb)
#define SnapDiskStartup()
#define DBGGETIOCTLSTR(_ioctl)
NTSTATUS NTAPI ClassGlobalDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NTAPI ClassCompleteRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ CCHAR PriorityBoost)
VOID NTAPI ClassReleaseRemoveLock(_In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIRP Tag)
#define SRB_STATUS_INVALID_LUN
#define SRB_STATUS_REQUEST_FLUSHED
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE
struct _SCSI_REQUEST_BLOCK SCSI_REQUEST_BLOCK
#define SRB_STATUS_NO_HBA
#define SRB_FUNCTION_RELEASE_DEVICE
#define SCSI_REQUEST_BLOCK_SIZE
#define SRB_STATUS_BUS_RESET
#define SRB_STATUS_INVALID_TARGET_ID
#define SRB_FUNCTION_CLAIM_DEVICE
#define SRB_FLAGS_FREE_SENSE_BUFFER
#define SRB_STATUS_UNEXPECTED_BUS_FREE
#define SRB_FLAGS_CLASS_DRIVER_RESERVED
#define SRB_FUNCTION_RELEASE_QUEUE
#define SRB_FUNCTION_EXECUTE_SCSI
#define SRB_FLAGS_DONT_START_NEXT_PACKET
#define SRB_STATUS_DATA_OVERRUN
#define SRB_FLAGS_DATA_OUT
#define SRB_STATUS_ABORTED
#define SRB_FLAGS_NO_DATA_TRANSFER
#define SRB_SIMPLE_TAG_REQUEST
#define SRB_STATUS_INVALID_PATH_ID
#define SRB_ORDERED_QUEUE_TAG_REQUEST
#define SRB_FLAGS_QUEUE_ACTION_ENABLE
#define SRB_FUNCTION_FLUSH
#define SRB_FUNCTION_FLUSH_QUEUE
#define SRB_STATUS_TIMEOUT
#define SRB_STATUS_AUTOSENSE_VALID
#define SRB_FLAGS_DISABLE_AUTOSENSE
#define SRB_HEAD_OF_QUEUE_TAG_REQUEST
struct _SCSI_REQUEST_BLOCK * PSCSI_REQUEST_BLOCK
#define SRB_FLAGS_DATA_IN
#define SRB_STATUS_SELECTION_TIMEOUT
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER
#define SRB_STATUS(Status)
#define SRB_STATUS_INTERNAL_ERROR
#define SRB_STATUS_COMMAND_TIMEOUT
#define SRB_STATUS_PARITY_ERROR
#define SRB_STATUS_QUEUE_FROZEN
#define SRB_STATUS_NO_DEVICE
#define SRB_FLAGS_NO_QUEUE_FREEZE
#define SRB_STATUS_SUCCESS
#define SRB_STATUS_INVALID_REQUEST
#define _IRQL_requires_same_
#define __drv_freesMem(kind)
#define _IRQL_requires_min_(irql)
#define _IRQL_requires_max_(irql)
#define __drv_allocatesMem(kind)
#define _IRQL_requires_(irql)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define PsGetCurrentThread()
#define KeRaiseIrql(irql, oldIrql)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
struct _DEVICE_OBJECT * PDEVICE_OBJECT
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeLowerIrql(oldIrql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define KeQuerySystemTime(t)
#define KeGetCurrentIrql()
#define InitializeListHead(ListHead)
#define KeDelayExecutionThread(mode, foo, t)
#define KeInitializeSpinLock(sl)
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
#define IOCTL_STORAGE_CHECK_VERIFY2
#define IOCTL_STORAGE_LOAD_MEDIA2
MxDeviceObject deviceObject
pPkgPnp m_DeviceInterfaceLock AcquireLock(pFxDriverGlobals)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLuint GLsizei GLsizei * length
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
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 token
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeReleaseGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeAcquireGuardedMutex(IN PKGUARDED_MUTEX GuardedMutex)
VOID FASTCALL KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
VOID FASTCALL KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
#define KeGetCurrentThread
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR)
#define FILE_PORTABLE_DEVICE
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
#define EXCEPTION_EXECUTE_HANDLER
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
#define InterlockedCompareExchange
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
#define Add2Ptr(PTR, INC)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
static DRIVER_DISPATCH ClassDeviceControl
static DRIVER_ADD_DEVICE ClassAddDevice
#define DbgPrintEx(cmpid, lvl, fmt,...)
#define RtlEqualMemory(dst, src, len)
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
VOID NTAPI MmBuildMdlForNonPagedPool(IN PMDL Mdl)
struct _MOUNTDEV_NAME MOUNTDEV_NAME
struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID
struct _STORAGE_HOTPLUG_INFO STORAGE_HOTPLUG_INFO
#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
#define IOCTL_STORAGE_GET_HOTPLUG_INFO
struct _MOUNTDEV_SUGGESTED_LINK_NAME MOUNTDEV_SUGGESTED_LINK_NAME
#define InitializeObjectAttributes(p, n, a, r, s)
#define __on_failure(annotes)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
#define FILE_AUTOGENERATED_DEVICE_NAME
#define DPFLTR_INFO_LEVEL
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define _In_reads_bytes_(s)
#define _Deref_out_range_(l, h)
#define _Must_inspect_result_
#define _Post_satisfies_(e)
#define _Analysis_assume_
#define _Outptr_result_nullonfailure_
#define _Inout_updates_opt_(s)
#define _In_reads_bytes_opt_(s)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define RTL_REGISTRY_ABSOLUTE
#define RTL_QUERY_REGISTRY_REQUIRED
#define RTL_QUERY_REGISTRY_DIRECT
#define METHOD_OUT_DIRECT
#define FILE_FLOPPY_DISKETTE
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define RTL_REGISTRY_OPTIONAL
#define RTL_REGISTRY_HANDLE
#define FILE_REMOVABLE_MEDIA
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
#define UNREFERENCED_PARAMETER(P)
#define IOCTL_DISK_UPDATE_PROPERTIES
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IOCTL_STORAGE_QUERY_PROPERTY
#define STORAGE_OFFLOAD_WRITE_RANGE_TRUNCATED
* PSTORAGE_DESCRIPTOR_HEADER
#define IOCTL_STORAGE_RELEASE
enum _STORAGE_PROPERTY_ID STORAGE_PROPERTY_ID
#define DeviceDsmAction_OffloadRead
#define STORAGE_OFFLOAD_MAX_TOKEN_LENGTH
#define IOCTL_STORAGE_EVENT_NOTIFICATION
#define DeviceDsmAction_Allocation
struct _STORAGE_DEVICE_NUMBER STORAGE_DEVICE_NUMBER
#define IOCTL_STORAGE_SET_HOTPLUG_INFO
#define IOCTL_STORAGE_GET_DEVICE_NUMBER
#define IOCTL_STORAGE_FIRMWARE_ACTIVATE
#define IOCTL_STORAGE_CHECK_VERIFY
#define IOCTL_STORAGE_READ_CAPACITY
#define IsKeyReadCopyNumber(_k)
#define IOCTL_STORAGE_FIRMWARE_DOWNLOAD
#define DeviceDsmAction_OffloadWrite
@ BusTypeFileBackedVirtual
#define STORAGE_OFFLOAD_TOKEN_INVALID
#define IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES
#define IOCTL_STORAGE_PERSISTENT_RESERVE_IN
#define IOCTL_STORAGE_PERSISTENT_RESERVE_OUT
#define IOCTL_STORAGE_LOAD_MEDIA
struct _STORAGE_OFFLOAD_WRITE_OUTPUT * PSTORAGE_OFFLOAD_WRITE_OUTPUT
#define IOCTL_STORAGE_RESERVE
struct _STORAGE_OFFLOAD_READ_OUTPUT * PSTORAGE_OFFLOAD_READ_OUTPUT
@ StorageMiniportProperty
@ StorageDeviceUniqueIdProperty
@ StorageDeviceMediumProductType
@ StorageDeviceSeekPenaltyProperty
@ StorageDeviceLBProvisioningProperty
@ StorageDeviceWriteCacheProperty
@ StorageDeviceTrimProperty
@ StorageDevicePowerProperty
@ StorageDeviceCopyOffloadProperty
@ StorageAccessAlignmentProperty
#define STORAGE_OFFLOAD_READ_RANGE_TRUNCATED
#define IOCTL_STORAGE_FIRMWARE_GET_INFO
#define IOCTL_STORAGE_GET_LB_PROVISIONING_MAP_RESOURCES
enum _STORAGE_BUS_TYPE STORAGE_BUS_TYPE
#define IOCTL_STORAGE_FIND_NEW_DEVICES
struct _STORAGE_OFFLOAD_WRITE_OUTPUT STORAGE_OFFLOAD_WRITE_OUTPUT
struct _STORAGE_OFFLOAD_READ_OUTPUT STORAGE_OFFLOAD_READ_OUTPUT
enum _STORAGE_PROPERTY_ID * PSTORAGE_PROPERTY_ID
#define IOCTL_STORAGE_BASE
#define IOCTL_STORAGE_MCN_CONTROL
@ StoragePortCodeSetStorport
@ StoragePortCodeSetUSBport
@ StoragePortCodeSetSDport
#define IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT
#define DeviceDsmAction_Trim
struct _DEVICE_DATA_SET_RANGE DEVICE_DATA_SET_RANGE
#define IOCTL_STORAGE_EJECT_MEDIA
#define IOCTL_STORAGE_EJECTION_CONTROL
#define IOCTL_STORAGE_MEDIA_REMOVAL
* PSTORAGE_ADAPTER_DESCRIPTOR
#define ARGUMENT_PRESENT(ArgumentPointer)
#define IRP_MN_SURPRISE_REMOVAL
#define IoCopyCurrentIrpStackLocationToNext(Irp)
#define IO_ERR_SEEK_ERROR
#define IO_WRN_FAILURE_PREDICTED
#define IO_WARNING_DISK_SURPRISE_REMOVED
#define IO_WARNING_PAGING_FAILURE
#define IO_ERR_CONTROLLER_ERROR
#define IO_WARNING_DISK_FIRMWARE_UPDATED
#define IO_WARNING_IO_OPERATION_RETRIED
#define IO_ERROR_IO_HARDWARE_ERROR
#define IO_RECOVERED_VIA_ECC
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
VOID NTAPI IoStartPacket(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PULONG Key, IN PDRIVER_CANCEL CancelFunction)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoSetStartIoAttributes(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN DeferredStartIo, IN BOOLEAN NonCancelable)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
VOID NTAPI IoStartNextPacket(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN Cancelable)
NTSTATUS NTAPI IoRegisterDeviceInterface(IN PDEVICE_OBJECT PhysicalDeviceObject, IN CONST GUID *InterfaceClassGuid, IN PUNICODE_STRING ReferenceString OPTIONAL, OUT PUNICODE_STRING SymbolicLinkName)
NTSTATUS NTAPI IoSetDeviceInterfaceState(IN PUNICODE_STRING SymbolicLinkName, IN BOOLEAN Enable)
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
VOID NTAPI IoWriteErrorLogEntry(IN PVOID ElEntry)
PVOID NTAPI IoAllocateErrorLogEntry(IN PVOID IoObject, IN UCHAR EntrySize)
VOID NTAPI IoInitializeIrp(IN PIRP Irp, IN USHORT PacketSize, IN CCHAR StackSize)
#define IoCompleteRequest
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
IO_PAGING_PRIORITY FASTCALL IoGetPagingIoPriority(IN PIRP Irp)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
VOID NTAPI IoSetHardErrorOrVerifyDevice(IN PIRP Irp, IN PDEVICE_OBJECT DeviceObject)
ULONG NTAPI KeGetRecommendedSharedDataAlignment(VOID)
ULONG NTAPI KeQueryTimeIncrement(VOID)
NTSTATUS NTAPI IoWMIRegistrationControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG Action)
#define STATUS_INTERNAL_ERROR
#define STATUS_CLEANER_CARTRIDGE_INSTALLED
#define STATUS_CSS_AUTHENTICATION_FAILURE
#define STATUS_COPY_PROTECTION_FAILURE
#define STATUS_DISK_RESOURCES_EXHAUSTED
#define STATUS_FT_READ_FROM_COPY
#define STATUS_CSS_REGION_MISMATCH
#define STATUS_INVALID_INITIATOR_TARGET_PATH
#define STATUS_CSS_KEY_NOT_ESTABLISHED
#define STATUS_INVALID_PARAMETER_2
#define STATUS_DEVICE_FEATURE_NOT_SUPPORTED
#define STATUS_CSS_SCRAMBLED_SECTOR
#define STATUS_INVALID_LEVEL
#define STATUS_TOO_MANY_SEGMENT_DESCRIPTORS
#define STATUS_CSS_KEY_NOT_PRESENT
#define STATUS_INVALID_OFFSET_ALIGNMENT
#define STATUS_INVALID_TOKEN
#define STATUS_INVALID_PARAMETER_1
#define STATUS_DEVICE_DOES_NOT_EXIST
#define STATUS_DEVICE_UNREACHABLE
#define STATUS_OPERATION_IN_PROGRESS
#define STATUS_DEVICE_HARDWARE_ERROR
#define STATUS_INVALID_FIELD_IN_PARAMETER_LIST
#define STATUS_INVALID_PARAMETER_3
#define STATUS_FILES_OPEN
#define STATUS_CSS_RESETS_EXHAUSTED
#define STATUS_REVISION_MISMATCH
NTSTRSAFEVAPI RtlStringCchPrintfA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
_Null_terminated_ char * NTSTRSAFE_PSTR
NTSTATUS NTAPI ObReferenceObjectByPointer(IN PVOID Object, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode)
NTSTATUS NTAPI IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, IN ULONG DevInstKeyType, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DevInstRegKey)
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
NTKRNLVISTAAPI NTSTATUS NTAPI PoRegisterPowerSettingCallback(_In_opt_ PDEVICE_OBJECT DeviceObject, _In_ LPCGUID SettingGuid, _In_ PPOWER_SETTING_CALLBACK Callback, _In_opt_ PVOID Context, _Outptr_opt_ PVOID *Handle)
#define IsEqualGUID(rguid1, rguid2)
#define FILE_DEVICE_CD_ROM
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
#define IRP_MJ_DEVICE_CONTROL
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
VOID NTAPI ExInitializeRundownProtectionCacheAware(IN PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, IN SIZE_T Size)
SIZE_T NTAPI ExSizeOfRundownProtectionCacheAware(VOID)
#define IOCTL_SCSI_PASS_THROUGH
#define IOCTL_SCSI_GET_ADDRESS
#define IOCTL_SCSI_PASS_THROUGH_DIRECT
#define CLASS_SPECIAL_CAUSE_NOT_REPORTABLE_HACK
void __cdecl __security_init_cookie(void)
#define SCSI_ADSENSE_INVALID_FIELD_PARAMETER_LIST
#define SCSIOP_RELEASE_UNIT10
#define VPD_BLOCK_DEVICE_CHARACTERISTICS
#define VPD_MAX_BUFFER_SIZE
struct _READ_CAPACITY_DATA_EX READ_CAPACITY_DATA_EX
UCHAR additionalSenseCode
#define ScsiGetSenseDescriptorLength(DescriptorBuffer)
#define VPD_LOGICAL_BLOCK_PROVISIONING
#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE
#define SCSI_ADSENSE_INVALID_TOKEN
#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED
#define SCSI_SENSEQ_TOO_MANY_SEGMENT_DESCRIPTORS
#define SCSI_ADSENSE_LB_PROVISIONING
struct BLOCK_DEVICE_TOKEN_DESCRIPTOR * PBLOCK_DEVICE_TOKEN_DESCRIPTOR
struct POPULATE_TOKEN_HEADER * PPOPULATE_TOKEN_HEADER
#define BLOCK_DEVICE_TOKEN_SIZE
#define SCSI_SENSEQ_OPERATION_IS_IN_PROGRESS
#define SCSI_SENSEQ_OPERATING_DEFINITION_CHANGED
struct _VPD_THIRD_PARTY_COPY_PAGE * PVPD_THIRD_PARTY_COPY_PAGE
#define SCSI_SENSEQ_INSUFFICIENT_RESOURCES
struct BLOCK_DEVICE_RANGE_DESCRIPTOR * PBLOCK_DEVICE_RANGE_DESCRIPTOR
#define SCSIOP_RESERVE_UNIT10
struct WRITE_USING_TOKEN_HEADER * PWRITE_USING_TOKEN_HEADER
#define SCSI_SENSE_DESCRIPTOR_TYPE_INFORMATION
#define SCSI_SENSEQ_INITIATOR_RESPONSE_TIMEOUT
#define SERVICE_ACTION_POPULATE_TOKEN
#define SCSI_SENSEQ_INQUIRY_DATA_CHANGED
#define SCSI_SENSEQ_SPACE_ALLOC_IN_PROGRESS
#define SCSI_ADSENSE_RESOURCE_FAILURE
#define SCSI_SESNEQ_COMM_CRC_ERROR
#define SCSI_SENSEQ_SOFT_THRESHOLD_REACHED
#define SCSI_ADSENSE_LUN_COMMUNICATION
#define SCSI_SENSE_OPTIONS_FIXED_FORMAT_IF_UNKNOWN_FORMAT_INDICATED
#define SCSI_SENSEQ_TIMEOUT_ON_LOGICAL_UNIT
#define BLOCK_DEVICE_TOKEN_LIMITS_DESCRIPTOR_TYPE_WINDOWS
#define IsSenseDataFormatValueValid(SenseInfoBuffer)
#define VPD_SUPPORTED_PAGES
#define SCSI_SENSE_DESCRIPTOR_TYPE_BLOCK_COMMAND
#define SCSI_SENSEQ_WRITE_PROTECT_DISABLE
struct _MODE_DISCONNECT_PAGE * PMODE_DISCONNECT_PAGE
#define REVERSE_BYTES_QUAD(Destination, Source)
#define REVERSE_BYTES_SHORT(Destination, Source)
struct RECEIVE_TOKEN_INFORMATION_HEADER * PRECEIVE_TOKEN_INFORMATION_HEADER
#define SCSI_SENSEQ_MICROCODE_CHANGED
#define SCSI_ADSENSE_PARAMETERS_CHANGED
struct _WINDOWS_BLOCK_DEVICE_TOKEN_LIMITS_DESCRIPTOR * PWINDOWS_BLOCK_DEVICE_TOKEN_LIMITS_DESCRIPTOR
#define SCSI_SENSEQ_UNREACHABLE_TARGET
#define SCSI_SENSEQ_MEDIUM_REMOVAL
PFIXED_SENSE_DATA senseInfoBuffer
struct _SENSE_DATA * PFIXED_SENSE_DATA
#define ScsiGetSenseErrorCode(SenseInfoBuffer)
@ OPERATION_COMPLETED_WITH_SUCCESS
@ OPERATION_COMPLETED_WITH_ERROR
@ OPERATION_COMPLETED_WITH_RESIDUAL_DATA
#define SCSI_SENSEQ_CAPACITY_DATA_CHANGED
#define SCSI_ADSENSE_OPERATOR_REQUEST
#define SCSI_ADSENSE_COPY_TARGET_DEVICE_ERROR
#define SERVICE_ACTION_WRITE_USING_TOKEN
#define SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED
#define SCSI_ADSENSE_DATA_TRANSFER_ERROR
struct RECEIVE_TOKEN_INFORMATION_RESPONSE_HEADER * PRECEIVE_TOKEN_INFORMATION_RESPONSE_HEADER
#define SENSE_BUFFER_SIZE_EX
#define VPD_THIRD_PARTY_COPY
#define SCSI_SENSEQ_DATA_UNDERRUN
#define REVERSE_BYTES(Destination, Source)
PFIXED_SENSE_DATA outBuffer
struct _SCSI_SENSE_DESCRIPTOR_BLOCK_COMMAND * PSCSI_SENSE_DESCRIPTOR_BLOCK_COMMAND
#define SCSI_ADSENSE_PARAMETER_LIST_LENGTH
@ TRANSFER_COUNT_UNITS_NUMBER_BLOCKS
#define SCSI_ADSENSE_LOGICAL_UNIT_ERROR
#define MAX_SENSE_BUFFER_SIZE
#define SCSI_SENSEQ_WRITE_PROTECT_ENABLE
#define SCSI_SENSEQ_SPACE_ALLOC_FAILED_WRITE_PROTECT
#define SCSI_SENSE_OPTIONS_NONE
#define IsDescriptorSenseDataFormat(SenseInfoBuffer)
#define SRB_TYPE_STORAGE_REQUEST_BLOCK
#define SRB_FUNCTION_STORAGE_REQUEST_BLOCK
#define STORAGE_ADDRESS_TYPE_BTL8
#define SRB_TYPE_SCSI_REQUEST_BLOCK
struct SRB_ALIGN _STORAGE_REQUEST_BLOCK_HEADER * PSTORAGE_REQUEST_BLOCK_HEADER
#define IOCTL_SCSI_PASS_THROUGH_DIRECT_EX
#define IOCTL_SCSI_PASS_THROUGH_EX
#define KeQueryTickCount(CurrentCount)
#define KeQueryInterruptTime()
#define KeAcquireSpinLockAtDpcLevel(SpinLock)
#define KeReleaseSpinLockFromDpcLevel(SpinLock)
#define STATUS_DEVICE_NOT_READY
#define STATUS_MORE_PROCESSING_REQUIRED
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
FORCEINLINE UCHAR SrbGetCdbLength(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetSrbFlags(_In_ PVOID Srb, _In_ ULONG Flags)
FORCEINLINE VOID SrbSetRequestAttribute(_In_ PVOID Srb, _In_ UCHAR RequestAttribute)
FORCEINLINE VOID SrbAssignSrbFlags(_In_ PVOID Srb, _In_ ULONG Flags)
FORCEINLINE VOID SrbSetDataTransferLength(_In_ PVOID Srb, _In_ ULONG DataTransferLength)
FORCEINLINE UCHAR SrbGetTargetId(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetNextSrb(_In_ PVOID Srb, _In_opt_ PVOID NextSrb)
FORCEINLINE UCHAR SrbGetLun(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetOriginalRequest(_In_ PVOID Srb, _In_opt_ PVOID OriginalRequest)
FORCEINLINE UCHAR SrbGetPathId(_In_ PVOID Srb)
FORCEINLINE VOID SrbClearSrbFlags(_In_ PVOID Srb, _In_ ULONG Flags)
FORCEINLINE VOID SrbSetScsiStatus(_In_ PVOID Srb, _In_ UCHAR ScsiStatus)
FORCEINLINE UCHAR SrbGetScsiStatus(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetSenseInfoBufferLength(_In_ PVOID Srb, _In_ UCHAR SenseInfoBufferLength)
FORCEINLINE ULONG SrbGetSrbFlags(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetSenseInfoBuffer(_In_ PVOID Srb, _In_opt_ PVOID SenseInfoBuffer)
FORCEINLINE ULONG SrbGetRequestAttribute(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetDataBuffer(_In_ PVOID Srb, _In_opt_ __drv_aliasesMem PVOID DataBuffer)
FORCEINLINE VOID SrbSetCdbLength(_In_ PVOID Srb, _In_ UCHAR CdbLength)
FORCEINLINE VOID SrbSetTimeOutValue(_In_ PVOID Srb, _In_ ULONG TimeOutValue)
FORCEINLINE PVOID SrbGetSenseInfoBuffer(_In_ PVOID Srb)
FORCEINLINE ULONG SrbGetSystemStatus(_In_ PVOID Srb)
FORCEINLINE UCHAR SrbGetSenseInfoBufferLength(_In_ PVOID Srb)
FORCEINLINE ULONG SrbGetDataTransferLength(_In_ PVOID Srb)
PULONG MinorVersion OPTIONAL
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
UCHAR Token[BLOCK_DEVICE_TOKEN_SIZE]
ULONG DeviceCharacteristics
PCLASS_INIT_DEVICE ClassInitDevice
PCLASS_QUERY_PNP_CAPABILITIES ClassQueryPnpCapabilities
PCLASS_SHUTDOWN_FLUSH ClassShutdownFlush
PCLASS_READ_WRITE ClassReadWriteVerification
ULONG DeviceExtensionSize
PCLASS_REMOVE_DEVICE ClassRemoveDevice
PCLASS_START_DEVICE ClassStartDevice
PCLASS_DEVICE_CONTROL ClassDeviceControl
PCLASS_STOP_DEVICE ClassStopDevice
CLASS_WMI_INFO ClassWmiInfo
PCLASS_WORKING_SET WorkingSet
PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx
PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx
UNICODE_STRING RegistryPath
PDRIVER_DISPATCH DeviceMajorFunctionTable[IRP_MJ_MAXIMUM_FUNCTION+1]
PCLASS_INTERPRET_SENSE_INFO2 InterpretSenseInfo
PDRIVER_STARTIO ClassStartIo
PCLASS_QUERY_ID ClassQueryId
PCLASS_UNLOAD ClassUnload
PCLASS_ENUM_DEVICE ClassEnumerateDevice
PCLASS_ADD_DEVICE ClassAddDevice
__callback PCLASS_INTERPRET_SENSE_INFO Interpret
LONG RemoveLockFailAcquire
BOOLEAN IsCachedDriveCapDataValid
BOOLEAN IdlePrioritySupported
ULONG MaxInterleavedNormalIo
ULONG UpdateDiskPropertiesWorkItemActive
STORAGE_HOTPLUG_INFO HotplugInfo
BOOLEAN LegacyErrorHandling
LARGE_INTEGER LongestThrottlePeriod
PCLASS_INTERPRET_SENSE_INFO2 InterpretSenseInfo
READ_CAPACITY_DATA_EX LastKnownDriveCapacityData
struct _CLASS_PRIVATE_FDO_DATA::@1095 Retry
ULONG CopyOffloadMaxTargetDuration
LARGE_INTEGER ThrottleStartTime
ULONG NumHighPriorityPagingIo
BOOLEAN LoggedSYNCFailure
LARGE_INTEGER LastNonIdleIoTime
LARGE_INTEGER ThrottleStopTime
BOOLEAN LoggedTURFailureSinceLastIO
CLASS_ERROR_LOG_DATA ErrorLogs[NUM_ERROR_LOG_ENTRIES]
struct _CLASS_RETRY_INFO * Next
ULONG UnmapGranularityAlignment
ULONG OptimalUnmapGranularity
LARGE_INTEGER StartingOffset
PDEVICE_OBJECT DeviceObject
DICTIONARY FileObjectDictionary
PCLASS_DRIVER_EXTENSION DriverExtension
PDEVICE_OBJECT LowerDeviceObject
ULONG HibernationPathCount
struct _PHYSICAL_DEVICE_EXTENSION * ChildList
UNICODE_STRING DeviceName
struct _FUNCTIONAL_DEVICE_EXTENSION * PartitionZeroExtension
BOOLEAN IsSrbLookasideListInitialized
UNICODE_STRING MountedDeviceInterfaceName
LARGE_INTEGER PartitionLength
PCLASS_PRIVATE_COMMON_DATA PrivateCommonData
PDRIVER_DISPATCH * DispatchTable
STORAGE_OFFLOAD_TOKEN Token
ULONG Estimated100msToReady
DEVICE_DATA_MANAGEMENT_SET_ACTION Action
ULONG ParameterBlockLength
ULONG ParameterBlockOffset
ULONG DataSetRangesOffset
ULONG DataSetRangesLength
BOOLEAN NoVerifyDuringIdlePower
BOOLEAN AsynchronousNotificationSupported
PDEVICE_OBJECT Objects[1]
BOOLEAN ReleaseQueueInProgress
PDEVICE_OBJECT DeviceObject
BOOLEAN ReleaseQueueNeeded
KSPIN_LOCK ReleaseQueueSpinLock
ULONG ScanForSpecialFlags
DISK_GEOMETRY DiskGeometry
struct _FAILURE_PREDICTION_INFO * FailurePredictionInfo
COMMON_DEVICE_EXTENSION CommonExtension
ULONG EnumerationInterlock
SCSI_REQUEST_BLOCK ReleaseQueueSrb
KEVENT EjectSynchronizationEvent
BOOLEAN ReleaseQueueIrpFromPool
PSTORAGE_ADAPTER_DESCRIPTOR AdapterDescriptor
DEVICE_POWER_STATE DevicePowerState
PMEDIA_CHANGE_DETECTION_INFO MediaChangeDetectionInfo
PSTORAGE_DEVICE_DESCRIPTOR DeviceDescriptor
LARGE_INTEGER DeviceOffset
struct _IO_STACK_LOCATION::@4104::@4143 Others
struct _IO_STACK_LOCATION::@4104::@4108 Read
struct _IO_STACK_LOCATION::@4104::@4131 DeviceCapabilities
PDEVICE_OBJECT DeviceObject
struct _IO_STACK_LOCATION::@4104::@4126 Scsi
struct _IO_STACK_LOCATION::@4104::@4129 QueryDeviceRelations
union _IO_STACK_LOCATION::@1611 Parameters
struct _IO_STACK_LOCATION::@4104::@4135 QueryId
struct _IO_STACK_LOCATION::@4104::@4137 UsageNotification
struct _IO_STACK_LOCATION::@1611::@1612 DeviceIoControl
union _IRP::@1613 AssociatedIrp
struct _LIST_ENTRY * Blink
struct _LIST_ENTRY * Flink
BOOLEAN UseOnlyIfThereAreNoOtherLinks
ULONG ReceiveTokenInformationBufferLength
ULONGLONG TotalSectorsToProcess
ULONGLONG TotalSectorsProcessed
ULONGLONG OperationStartTime
PDEVICE_MANAGE_DATA_SET_ATTRIBUTES DsmAttributes
ULONGLONG TotalRequestSizeSectors
ULONGLONG DataSetRangeByteOffset
ULONGLONG TotalSectorsProcessedSuccessfully
PDEVICE_DATA_SET_RANGE DataSetRanges
ULONGLONG LogicalBlockOffset
ULONG ReceiveTokenInformationBufferLength
PDEVICE_DSM_OFFLOAD_WRITE_PARAMETERS OffloadWriteParameters
ULONGLONG TotalSectorsToProcess
ULONGLONG TotalSectorsProcessed
COMMON_DEVICE_EXTENSION CommonExtension
PDEVICE_OBJECT DeviceObject
LARGE_INTEGER LogicalBlockAddress
ULONG LogicalBlockAddress
BOOLEAN WriteCacheEnableOverride
PSTORAGE_REQUEST_BLOCK_HEADER Srb
UCHAR SupportedPageList[0]
UCHAR ThirdPartyCopyDescriptors[ANYSIZE_ARRAY]
UCHAR DescriptorLength[2]
UCHAR MaximumTokenTransferSize[8]
UCHAR MaximumInactivityTimer[4]
UCHAR MaximumRangeDescriptors[2]
UCHAR OptimalTransferCount[8]
UCHAR DefaultInactivityTimer[4]
BOOLEAN NTAPI KeSetTimerEx(IN OUT PKTIMER Timer, IN LARGE_INTEGER DueTime, IN LONG Period, IN PKDPC Dpc OPTIONAL)
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_IO_DEVICE_ERROR
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_UNRECOGNIZED_MEDIA
#define STATUS_INVALID_BLOCK_LENGTH
#define STATUS_MEDIA_WRITE_PROTECTED
#define STATUS_ACCESS_DENIED
#define STATUS_DATA_OVERRUN
#define STATUS_DEVICE_NOT_CONNECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_IO_TIMEOUT
#define STATUS_NO_SUCH_DEVICE
#define STATUS_NONEXISTENT_SECTOR
#define STATUS_UNSUCCESSFUL
#define STATUS_NO_MEDIA_IN_DEVICE
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_INFO_LENGTH_MISMATCH
#define STATUS_DEVICE_BUSY
#define STATUS_NO_DATA_DETECTED
#define STATUS_VERIFY_REQUIRED
#define STATUS_DEVICE_DATA_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
struct _CDB::_CDB10 CDB10
struct _CDB::_CDB6INQUIRY3 CDB6INQUIRY3
struct _CDB::_CDB6GENERIC CDB6GENERIC
struct _CDB::_MODE_SENSE10 MODE_SENSE10
struct _CDB::_CDB12 CDB12
struct _CDB::_CDB6INQUIRY CDB6INQUIRY
struct _CDB::_START_STOP START_STOP
struct _CDB::_MODE_SENSE MODE_SENSE
struct _CDB::_RECEIVE_TOKEN_INFORMATION RECEIVE_TOKEN_INFORMATION
struct _CDB::_CDB16 CDB16
struct _CDB::_CDB6READWRITE CDB6READWRITE
_In_ PDEVICE_OBJECT DeviceObject
_In_ DEVICE_RELATION_TYPE RelationType
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_In_opt_ PVOID _In_ ULONG bufferLength
_Must_inspect_result_ _In_ WDFDEVICE Fdo
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_In_ WDFREQUEST _In_ size_t OutputBufferLength
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_Must_inspect_result_ _In_ WDFCMRESLIST List
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
_Must_inspect_result_ _In_ ULONG Flags
_IRQL_requires_same_ _In_opt_ PVOID Argument1
NTKERNELAPI VOID FASTCALL ExReInitializeRundownProtectionCacheAware(_Inout_ PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware)
NTKERNELAPI VOID FASTCALL ExWaitForRundownProtectionReleaseCacheAware(IN OUT PEX_RUNDOWN_REF_CACHE_AWARE RunRef)
struct _EX_RUNDOWN_REF_CACHE_AWARE * PEX_RUNDOWN_REF_CACHE_AWARE
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define IoIsErrorUserInduced(Status)
#define IoAdjustPagingPathCount(_Count, _Increment)
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
#define IoSizeOfIrp(_StackSize)
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID _In_ ULONG _In_ BOOLEAN InternalDeviceIoControl
#define PLUGPLAY_REGKEY_DEVICE
#define IRP_MN_CANCEL_STOP_DEVICE
#define SL_OVERRIDE_VERIFY_VOLUME
enum _IO_PAGING_PRIORITY IO_PAGING_PRIORITY
#define ERROR_LOG_MAXIMUM_SIZE
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
#define IRP_MN_START_DEVICE
@ IoPagingPriorityInvalid
enum _DEVICE_REMOVAL_POLICY DEVICE_REMOVAL_POLICY
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
#define WMIREG_ACTION_REGISTER
IO_COMPLETION_ROUTINE * PIO_COMPLETION_ROUTINE
#define IRP_MN_REMOVE_DEVICE
@ DevicePropertyRemovalPolicy
#define WMIREG_ACTION_DEREGISTER
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MJ_SYSTEM_CONTROL
struct _IO_WORKITEM * PIO_WORKITEM
struct _IO_ERROR_LOG_PACKET * PIO_ERROR_LOG_PACKET
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MJ_FLUSH_BUFFERS
#define IO_DISK_INCREMENT
struct _DEVICE_RELATIONS DEVICE_RELATIONS
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MN_STOP_DEVICE
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
#define IRP_MN_SCSI_CLASS
enum _DEVICE_USAGE_NOTIFICATION_TYPE DEVICE_USAGE_NOTIFICATION_TYPE
struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET
@ RemovalPolicyExpectSurpriseRemoval
@ RemovalPolicyExpectOrderlyRemoval
@ DeviceUsageTypeHibernation
@ DeviceUsageTypeDumpFile
#define IRP_MN_QUERY_REMOVE_DEVICE
_In_opt_ PVOID DeferredContext
#define MmGetMdlVirtualAddress(_Mdl)
#define ObDereferenceObject
#define ObReferenceObject
#define RTL_QUERY_REGISTRY_TYPECHECK
#define RTL_QUERY_REGISTRY_TYPECHECK_SHIFT