https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dfd876a96b8aa57c5a9a3…
commit dfd876a96b8aa57c5a9a3abb1a8e3f51cb1dc4a9
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Tue Jan 8 05:17:19 2019 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Mon Mar 4 21:58:42 2019 +0100
[CLASSPNP] Fix SLIST_ENTRY vs SINGLE_LIST_ENTRY issues
---
drivers/storage/classpnp/class.c | 4 ++--
drivers/storage/classpnp/classp.h | 12 ++++++------
drivers/storage/classpnp/xferpkt.c | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/storage/classpnp/class.c b/drivers/storage/classpnp/class.c
index f89fa32d23..a1ff1cf9b9 100644
--- a/drivers/storage/classpnp/class.c
+++ b/drivers/storage/classpnp/class.c
@@ -2254,8 +2254,8 @@ VOID NTAPI ServiceTransferRequest(PDEVICE_OBJECT Fdo, PIRP Irp)
PUCHAR bufPtr = MmGetMdlVirtualAddress(Irp->MdlAddress);
LARGE_INTEGER targetLocation = currentSp->Parameters.Read.ByteOffset;
PTRANSFER_PACKET pkt;
- SINGLE_LIST_ENTRY pktList;
- PSINGLE_LIST_ENTRY slistEntry;
+ SLIST_ENTRY pktList;
+ PSLIST_ENTRY slistEntry;
ULONG numPackets;
//KIRQL oldIrql;
ULONG i;
diff --git a/drivers/storage/classpnp/classp.h b/drivers/storage/classpnp/classp.h
index d75882702d..9db575418a 100644
--- a/drivers/storage/classpnp/classp.h
+++ b/drivers/storage/classpnp/classp.h
@@ -283,8 +283,8 @@ typedef struct _CLASS_ERROR_LOG_DATA {
typedef struct _TRANSFER_PACKET {
+ SLIST_ENTRY SlistEntry; // for when in free list (use fast slist)
LIST_ENTRY AllPktsListEntry; // entry in fdoData's static
AllTransferPacketsList
- SINGLE_LIST_ENTRY SlistEntry; // for when in free list (use fast slist)
PIRP Irp;
PDEVICE_OBJECT Fdo;
@@ -475,25 +475,25 @@ struct _CLASS_PRIVATE_FDO_DATA {
/*
* Simple singly-linked-list queuing macros, with no synchronization.
*/
-static inline VOID SimpleInitSlistHdr(SINGLE_LIST_ENTRY *SListHdr)
+static inline VOID SimpleInitSlistHdr(SLIST_ENTRY *SListHdr)
{
SListHdr->Next = NULL;
}
-static inline VOID SimplePushSlist(SINGLE_LIST_ENTRY *SListHdr, SINGLE_LIST_ENTRY
*SListEntry)
+static inline VOID SimplePushSlist(SLIST_ENTRY *SListHdr, SLIST_ENTRY *SListEntry)
{
SListEntry->Next = SListHdr->Next;
SListHdr->Next = SListEntry;
}
-static inline SINGLE_LIST_ENTRY *SimplePopSlist(SINGLE_LIST_ENTRY *SListHdr)
+static inline SLIST_ENTRY *SimplePopSlist(SLIST_ENTRY *SListHdr)
{
- SINGLE_LIST_ENTRY *sListEntry = SListHdr->Next;
+ SLIST_ENTRY *sListEntry = SListHdr->Next;
if (sListEntry){
SListHdr->Next = sListEntry->Next;
sListEntry->Next = NULL;
}
return sListEntry;
}
-static inline BOOLEAN SimpleIsSlistEmpty(SINGLE_LIST_ENTRY *SListHdr)
+static inline BOOLEAN SimpleIsSlistEmpty(SLIST_ENTRY *SListHdr)
{
return (SListHdr->Next == NULL);
}
diff --git a/drivers/storage/classpnp/xferpkt.c b/drivers/storage/classpnp/xferpkt.c
index 390afe7614..865ae7feb4 100644
--- a/drivers/storage/classpnp/xferpkt.c
+++ b/drivers/storage/classpnp/xferpkt.c
@@ -240,8 +240,8 @@ VOID NTAPI EnqueueFreeTransferPacket(PDEVICE_OBJECT Fdo,
PTRANSFER_PACKET Pkt)
* 1. Immediately snap down to our UPPER threshold.
*/
if (fdoData->NumTotalTransferPackets > MaxWorkingSetTransferPackets){
- SINGLE_LIST_ENTRY pktList;
- PSINGLE_LIST_ENTRY slistEntry;
+ SLIST_ENTRY pktList;
+ PSLIST_ENTRY slistEntry;
PTRANSFER_PACKET pktToDelete;
DBGTRACE(ClassDebugTrace, ("Exiting stress, block freeing (%d-%d)
packets.", fdoData->NumTotalTransferPackets, MaxWorkingSetTransferPackets));
@@ -324,7 +324,7 @@ PTRANSFER_PACKET NTAPI DequeueFreeTransferPacket(PDEVICE_OBJECT Fdo,
BOOLEAN All
PFUNCTIONAL_DEVICE_EXTENSION fdoExt = Fdo->DeviceExtension;
PCLASS_PRIVATE_FDO_DATA fdoData = fdoExt->PrivateFdoData;
PTRANSFER_PACKET pkt;
- PSINGLE_LIST_ENTRY slistEntry;
+ PSLIST_ENTRY slistEntry;
//KIRQL oldIrql;
slistEntry = InterlockedPopEntrySList(&fdoData->FreeTransferPacketsList);