summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv-junyli <[email protected]>2025-06-25 17:15:21 -0700
committerGitHub <[email protected]>2025-06-25 17:15:21 -0700
commit69e8b5f87dc3fc92fef842f7c50f0cd5668cfb94 (patch)
tree6b7cc3c2d5b2a81aa3a1c5094f492fd50a6ed880
parent7244af00aa48af08fce37d12d1ee3311e61b4ff0 (diff)
parent7c01d67dcdafcf2a04bac77d9bd564fda0af4c1d (diff)
Merge pull request #1294 from 1Sisyphus/main
Fixes and updates for StorageCore driver sample components
-rw-r--r--storage/class/classpnp/src/class.c6
-rw-r--r--storage/class/classpnp/src/obsolete.c6
-rw-r--r--storage/class/disk/src/disk.c4
-rw-r--r--storage/class/disk/src/diskwmi.c4
-rw-r--r--storage/miniports/lsi_u3/src/lsi_u3.inf13
5 files changed, 13 insertions, 20 deletions
diff --git a/storage/class/classpnp/src/class.c b/storage/class/classpnp/src/class.c
index 58d1835a..6da2b146 100644
--- a/storage/class/classpnp/src/class.c
+++ b/storage/class/classpnp/src/class.c
@@ -3740,7 +3740,7 @@ ClassIoComplete(
PSCSI_REQUEST_BLOCK srb = Context;
PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = Fdo->DeviceExtension;
PCLASS_PRIVATE_FDO_DATA fdoData = fdoExtension->PrivateFdoData;
- NTSTATUS status;
+ NTSTATUS status = STATUS_SUCCESS;
BOOLEAN retry;
BOOLEAN callStartNextPacket;
ULONG srbFlags;
@@ -6055,7 +6055,7 @@ __ClassInterpretSenseInfo_ProcessingInvalidSenseBuffer:
logErrorInternal = FALSE;
logError = FALSE;
} else if (cdbOpcode == SCSIOP_MODE_SENSE10) {
- USHORT allocationLength;
+ USHORT allocationLength = 0;
REVERSE_BYTES_SHORT(&(cdb->MODE_SENSE10.AllocationLength), &allocationLength);
if (SrbGetDataTransferLength(Srb) <= allocationLength) {
*Status = STATUS_SUCCESS;
@@ -6063,7 +6063,7 @@ __ClassInterpretSenseInfo_ProcessingInvalidSenseBuffer:
logError = FALSE;
}
} else if (ClasspIsReceiveTokenInformation(cdb)) {
- ULONG allocationLength;
+ ULONG allocationLength = 0;
REVERSE_BYTES(&(cdb->RECEIVE_TOKEN_INFORMATION.AllocationLength), &allocationLength);
if (SrbGetDataTransferLength(Srb) <= allocationLength) {
*Status = STATUS_SUCCESS;
diff --git a/storage/class/classpnp/src/obsolete.c b/storage/class/classpnp/src/obsolete.c
index aeeef81d..e0fe3d13 100644
--- a/storage/class/classpnp/src/obsolete.c
+++ b/storage/class/classpnp/src/obsolete.c
@@ -119,7 +119,7 @@ ClassIoCompleteAssociated(
PIRP originalIrp = Irp->AssociatedIrp.MasterIrp;
LONG irpCount;
- NTSTATUS status;
+ NTSTATUS status = STATUS_SUCCESS;
BOOLEAN retry;
TracePrint((TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL, "ClassIoCompleteAssociated is OBSOLETE !"));
@@ -390,8 +390,8 @@ RetryRequest(
//
NT_ASSERT(SrbGetDataBuffer(srbHeader) == MmGetMdlVirtualAddress(Irp->MdlAddress));
- _Analysis_assume_(Irp->MdlAddress->ByteCount <= dataTransferLength);
- transferByteCount = Irp->MdlAddress->ByteCount;
+ _Analysis_assume_(MmGetMdlByteCount(Irp->MdlAddress) <= dataTransferLength);
+ transferByteCount = MmGetMdlByteCount(Irp->MdlAddress);
} else {
diff --git a/storage/class/disk/src/disk.c b/storage/class/disk/src/disk.c
index c8dbeb59..ce3395f7 100644
--- a/storage/class/disk/src/disk.c
+++ b/storage/class/disk/src/disk.c
@@ -707,7 +707,7 @@ Return Value:
mediaTypes->MediaInfoCount = 1;
mediaInfo->DeviceSpecific.DiskInfo.Cylinders.QuadPart = fdoExtension->DiskGeometry.Cylinders.QuadPart;
- mediaInfo->DeviceSpecific.DiskInfo.MediaType = FixedMedia;
+ mediaInfo->DeviceSpecific.DiskInfo.MediaType = (STORAGE_MEDIA_TYPE)FixedMedia;
mediaInfo->DeviceSpecific.DiskInfo.TracksPerCylinder = fdoExtension->DiskGeometry.TracksPerCylinder;
mediaInfo->DeviceSpecific.DiskInfo.SectorsPerTrack = fdoExtension->DiskGeometry.SectorsPerTrack;
mediaInfo->DeviceSpecific.DiskInfo.BytesPerSector = fdoExtension->DiskGeometry.BytesPerSector;
@@ -899,7 +899,7 @@ SkipTable:
mediaTypes->MediaInfoCount = 1;
mediaInfo->DeviceSpecific.RemovableDiskInfo.Cylinders.QuadPart = fdoExtension->DiskGeometry.Cylinders.QuadPart;
- mediaInfo->DeviceSpecific.RemovableDiskInfo.MediaType = RemovableMedia;
+ mediaInfo->DeviceSpecific.RemovableDiskInfo.MediaType = (STORAGE_MEDIA_TYPE)RemovableMedia;
mediaInfo->DeviceSpecific.RemovableDiskInfo.TracksPerCylinder = fdoExtension->DiskGeometry.TracksPerCylinder;
mediaInfo->DeviceSpecific.RemovableDiskInfo.SectorsPerTrack = fdoExtension->DiskGeometry.SectorsPerTrack;
mediaInfo->DeviceSpecific.RemovableDiskInfo.BytesPerSector = fdoExtension->DiskGeometry.BytesPerSector;
diff --git a/storage/class/disk/src/diskwmi.c b/storage/class/disk/src/diskwmi.c
index 7503e5a1..de2d7eee 100644
--- a/storage/class/disk/src/diskwmi.c
+++ b/storage/class/disk/src/diskwmi.c
@@ -1739,7 +1739,7 @@ DiskInfoExceptionComplete(
//
// Reset byte count of transfer in SRB Extension.
//
- srbEx->DataTransferLength = Irp->MdlAddress->ByteCount;
+ srbEx->DataTransferLength = MmGetMdlByteCount(Irp->MdlAddress);
//
// Zero SRB statuses.
@@ -1768,7 +1768,7 @@ DiskInfoExceptionComplete(
//
// Reset byte count of transfer in SRB Extension.
//
- srb->DataTransferLength = Irp->MdlAddress->ByteCount;
+ srb->DataTransferLength = MmGetMdlByteCount(Irp->MdlAddress);
//
// Zero SRB statuses.
diff --git a/storage/miniports/lsi_u3/src/lsi_u3.inf b/storage/miniports/lsi_u3/src/lsi_u3.inf
index 5a879f51..52a4d4df 100644
--- a/storage/miniports/lsi_u3/src/lsi_u3.inf
+++ b/storage/miniports/lsi_u3/src/lsi_u3.inf
@@ -36,18 +36,11 @@ lsi_u3.sys = 1
[DestinationDirs]
DefaultDestDir = 12 ; DIRID_DRIVERS
+; Use NT$ARCH$ for platform-specific stamping via Stampinf
[Manufacturer]
-%LSI%=LSI,NTamd64,NTia64,NTarm64
+%LSI%=LSI,NT$ARCH$
-[LSI.NTamd64]
-%DevDesc1% = LSI_U3_Inst, PCI\VEN_1000&DEV_0020
-%DevDesc2% = LSI_U3_Inst, PCI\VEN_1000&DEV_0021
-
-[LSI.NTia64]
-%DevDesc1% = LSI_U3_Inst, PCI\VEN_1000&DEV_0020
-%DevDesc2% = LSI_U3_Inst, PCI\VEN_1000&DEV_0021
-
-[LSI.NTarm64]
+[LSI.NT$ARCH$]
%DevDesc1% = LSI_U3_Inst, PCI\VEN_1000&DEV_0020
%DevDesc2% = LSI_U3_Inst, PCI\VEN_1000&DEV_0021