Skip to content

Commit f79d24e

Browse files
committed
other classpnp and disk fixes
1 parent a4440c5 commit f79d24e

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

storage/class/classpnp/src/class.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3740,7 +3740,7 @@ ClassIoComplete(
37403740
PSCSI_REQUEST_BLOCK srb = Context;
37413741
PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = Fdo->DeviceExtension;
37423742
PCLASS_PRIVATE_FDO_DATA fdoData = fdoExtension->PrivateFdoData;
3743-
NTSTATUS status;
3743+
NTSTATUS status = STATUS_SUCCESS;
37443744
BOOLEAN retry;
37453745
BOOLEAN callStartNextPacket;
37463746
ULONG srbFlags;
@@ -6055,15 +6055,15 @@ ClassInterpretSenseInfo(
60556055
logErrorInternal = FALSE;
60566056
logError = FALSE;
60576057
} else if (cdbOpcode == SCSIOP_MODE_SENSE10) {
6058-
USHORT allocationLength;
6058+
USHORT allocationLength = 0;
60596059
REVERSE_BYTES_SHORT(&(cdb->MODE_SENSE10.AllocationLength), &allocationLength);
60606060
if (SrbGetDataTransferLength(Srb) <= allocationLength) {
60616061
*Status = STATUS_SUCCESS;
60626062
logErrorInternal = FALSE;
60636063
logError = FALSE;
60646064
}
60656065
} else if (ClasspIsReceiveTokenInformation(cdb)) {
6066-
ULONG allocationLength;
6066+
ULONG allocationLength = 0;
60676067
REVERSE_BYTES(&(cdb->RECEIVE_TOKEN_INFORMATION.AllocationLength), &allocationLength);
60686068
if (SrbGetDataTransferLength(Srb) <= allocationLength) {
60696069
*Status = STATUS_SUCCESS;

storage/class/classpnp/src/obsolete.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ ClassIoCompleteAssociated(
119119
PIRP originalIrp = Irp->AssociatedIrp.MasterIrp;
120120
LONG irpCount;
121121

122-
NTSTATUS status;
122+
NTSTATUS status = STATUS_SUCCESS;
123123
BOOLEAN retry;
124124

125125
TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL, "ClassIoCompleteAssociated is OBSOLETE !"));
@@ -390,8 +390,8 @@ RetryRequest(
390390
//
391391

392392
NT_ASSERT(SrbGetDataBuffer(srbHeader) == MmGetMdlVirtualAddress(Irp->MdlAddress));
393-
_Analysis_assume_(Irp->MdlAddress->ByteCount <= dataTransferLength);
394-
transferByteCount = Irp->MdlAddress->ByteCount;
393+
_Analysis_assume_(MmGetMdlByteCount(Irp->MdlAddress) <= dataTransferLength);
394+
transferByteCount = MmGetMdlByteCount(Irp->MdlAddress);
395395

396396
} else {
397397

storage/class/disk/src/diskwmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ DiskInfoExceptionComplete(
17391739
//
17401740
// Reset byte count of transfer in SRB Extension.
17411741
//
1742-
srbEx->DataTransferLength = Irp->MdlAddress->ByteCount;
1742+
srbEx->DataTransferLength = MmGetMdlByteCount(Irp->MdlAddress);
17431743

17441744
//
17451745
// Zero SRB statuses.
@@ -1768,7 +1768,7 @@ DiskInfoExceptionComplete(
17681768
//
17691769
// Reset byte count of transfer in SRB Extension.
17701770
//
1771-
srb->DataTransferLength = Irp->MdlAddress->ByteCount;
1771+
srb->DataTransferLength = MmGetMdlByteCount(Irp->MdlAddress);
17721772

17731773
//
17741774
// Zero SRB statuses.

0 commit comments

Comments
 (0)