mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 23:14:53 +00:00
Using a lock inside a slab of memory to lock against moving the same memory
is definitely a bug. This fixes it, but the intention of the previous code might not be what I thought it was. I won't be sad if this fix is reverted and something else takes its place. svn path=/trunk/; revision=39873
This commit is contained in:
parent
34e0264ab9
commit
ab0b3f0bd4
|
@ -29,6 +29,7 @@ extern BOOLEAN PnpSystemInit;
|
|||
/* DATA **********************************************************************/
|
||||
|
||||
PDRIVER_OBJECT IopRootDriverObject;
|
||||
FAST_MUTEX IopBusTypeGuidListLock;
|
||||
PIO_BUS_TYPE_GUID_LIST IopBusTypeGuidList = NULL;
|
||||
|
||||
#if defined (ALLOC_PRAGMA)
|
||||
|
@ -279,7 +280,7 @@ IopGetBusTypeGuidIndex(LPGUID BusTypeGuid)
|
|||
PVOID NewList;
|
||||
|
||||
/* Acquire the lock */
|
||||
ExAcquireFastMutex(&IopBusTypeGuidList->Lock);
|
||||
ExAcquireFastMutex(&IopBusTypeGuidListLock);
|
||||
|
||||
/* Loop all entries */
|
||||
while (i < IopBusTypeGuidList->GuidCount)
|
||||
|
@ -333,7 +334,7 @@ IopGetBusTypeGuidIndex(LPGUID BusTypeGuid)
|
|||
IopBusTypeGuidList->GuidCount++;
|
||||
|
||||
Quickie:
|
||||
ExReleaseFastMutex(&IopBusTypeGuidList->Lock);
|
||||
ExReleaseFastMutex(&IopBusTypeGuidListLock);
|
||||
return FoundIndex;
|
||||
}
|
||||
|
||||
|
@ -2843,6 +2844,7 @@ PnpInit(VOID)
|
|||
DPRINT("PnpInit()\n");
|
||||
|
||||
KeInitializeSpinLock(&IopDeviceTreeLock);
|
||||
ExInitializeFastMutex(&IopBusTypeGuidListLock);
|
||||
|
||||
/* Initialize the Bus Type GUID List */
|
||||
IopBusTypeGuidList = ExAllocatePool(PagedPool, sizeof(IO_BUS_TYPE_GUID_LIST));
|
||||
|
|
Loading…
Reference in a new issue