[NTOS:PNP] Rename IopDeviceRelations* to IopDeviceAction*. CORE-10456

This commit is contained in:
Thomas Faber 2017-12-17 22:53:01 +01:00
parent bc826532e3
commit 121146e651
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
3 changed files with 31 additions and 31 deletions

View file

@ -1339,8 +1339,8 @@ extern ULONG IopNumTriageDumpDataBlocks;
extern PVOID IopTriageDumpDataBlocks[64];
extern PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList;
extern PDRIVER_OBJECT IopRootDriverObject;
extern KSPIN_LOCK IopDeviceRelationsSpinLock;
extern LIST_ENTRY IopDeviceRelationsRequestList;
extern KSPIN_LOCK IopDeviceActionLock;
extern LIST_ENTRY IopDeviceActionRequestList;
extern RESERVE_IRP_ALLOCATOR IopReserveIrpAllocator;
//

View file

@ -399,8 +399,8 @@ IopInitializePlugPlayServices(VOID)
/* Initialize locks and such */
KeInitializeSpinLock(&IopDeviceTreeLock);
KeInitializeSpinLock(&IopDeviceRelationsSpinLock);
InitializeListHead(&IopDeviceRelationsRequestList);
KeInitializeSpinLock(&IopDeviceActionLock);
InitializeListHead(&IopDeviceActionRequestList);
/* Get the default interface */
PnpDefaultInterfaceType = IopDetermineDefaultInterfaceType();

View file

@ -34,17 +34,17 @@ extern BOOLEAN PnpSystemInit;
PDRIVER_OBJECT IopRootDriverObject;
PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList = NULL;
LIST_ENTRY IopDeviceRelationsRequestList;
WORK_QUEUE_ITEM IopDeviceRelationsWorkItem;
BOOLEAN IopDeviceRelationsRequestInProgress;
KSPIN_LOCK IopDeviceRelationsSpinLock;
LIST_ENTRY IopDeviceActionRequestList;
WORK_QUEUE_ITEM IopDeviceActionWorkItem;
BOOLEAN IopDeviceActionInProgress;
KSPIN_LOCK IopDeviceActionLock;
typedef struct _INVALIDATE_DEVICE_RELATION_DATA
typedef struct _DEVICE_ACTION_DATA
{
LIST_ENTRY RequestListEntry;
PDEVICE_OBJECT DeviceObject;
DEVICE_RELATION_TYPE Type;
} INVALIDATE_DEVICE_RELATION_DATA, *PINVALIDATE_DEVICE_RELATION_DATA;
} DEVICE_ACTION_DATA, *PDEVICE_ACTION_DATA;
/* FUNCTIONS *****************************************************************/
NTSTATUS
@ -906,20 +906,20 @@ IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode,
static
VOID
NTAPI
IopDeviceRelationsWorker(
IopDeviceActionWorker(
_In_ PVOID Context)
{
PLIST_ENTRY ListEntry;
PINVALIDATE_DEVICE_RELATION_DATA Data;
PDEVICE_ACTION_DATA Data;
KIRQL OldIrql;
KeAcquireSpinLock(&IopDeviceRelationsSpinLock, &OldIrql);
while (!IsListEmpty(&IopDeviceRelationsRequestList))
KeAcquireSpinLock(&IopDeviceActionLock, &OldIrql);
while (!IsListEmpty(&IopDeviceActionRequestList))
{
ListEntry = RemoveHeadList(&IopDeviceRelationsRequestList);
KeReleaseSpinLock(&IopDeviceRelationsSpinLock, OldIrql);
ListEntry = RemoveHeadList(&IopDeviceActionRequestList);
KeReleaseSpinLock(&IopDeviceActionLock, OldIrql);
Data = CONTAINING_RECORD(ListEntry,
INVALIDATE_DEVICE_RELATION_DATA,
DEVICE_ACTION_DATA,
RequestListEntry);
IoSynchronousInvalidateDeviceRelations(Data->DeviceObject,
@ -927,10 +927,10 @@ IopDeviceRelationsWorker(
ObDereferenceObject(Data->DeviceObject);
ExFreePool(Data);
KeAcquireSpinLock(&IopDeviceRelationsSpinLock, &OldIrql);
KeAcquireSpinLock(&IopDeviceActionLock, &OldIrql);
}
IopDeviceRelationsRequestInProgress = FALSE;
KeReleaseSpinLock(&IopDeviceRelationsSpinLock, OldIrql);
IopDeviceActionInProgress = FALSE;
KeReleaseSpinLock(&IopDeviceActionLock, OldIrql);
}
NTSTATUS
@ -4889,10 +4889,10 @@ IoInvalidateDeviceRelations(
IN PDEVICE_OBJECT DeviceObject,
IN DEVICE_RELATION_TYPE Type)
{
PINVALIDATE_DEVICE_RELATION_DATA Data;
PDEVICE_ACTION_DATA Data;
KIRQL OldIrql;
Data = ExAllocatePool(NonPagedPool, sizeof(INVALIDATE_DEVICE_RELATION_DATA));
Data = ExAllocatePool(NonPagedPool, sizeof(DEVICE_ACTION_DATA));
if (!Data)
return;
@ -4900,20 +4900,20 @@ IoInvalidateDeviceRelations(
Data->DeviceObject = DeviceObject;
Data->Type = Type;
KeAcquireSpinLock(&IopDeviceRelationsSpinLock, &OldIrql);
InsertTailList(&IopDeviceRelationsRequestList, &Data->RequestListEntry);
if (IopDeviceRelationsRequestInProgress)
KeAcquireSpinLock(&IopDeviceActionLock, &OldIrql);
InsertTailList(&IopDeviceActionRequestList, &Data->RequestListEntry);
if (IopDeviceActionInProgress)
{
KeReleaseSpinLock(&IopDeviceRelationsSpinLock, OldIrql);
KeReleaseSpinLock(&IopDeviceActionLock, OldIrql);
return;
}
IopDeviceRelationsRequestInProgress = TRUE;
KeReleaseSpinLock(&IopDeviceRelationsSpinLock, OldIrql);
IopDeviceActionInProgress = TRUE;
KeReleaseSpinLock(&IopDeviceActionLock, OldIrql);
ExInitializeWorkItem(&IopDeviceRelationsWorkItem,
IopDeviceRelationsWorker,
ExInitializeWorkItem(&IopDeviceActionWorkItem,
IopDeviceActionWorker,
NULL);
ExQueueWorkItem(&IopDeviceRelationsWorkItem,
ExQueueWorkItem(&IopDeviceActionWorkItem,
DelayedWorkQueue);
}