Author: hbelusca
Date: Sun May 15 00:16:31 2016
New Revision: 71330
URL:
http://svn.reactos.org/svn/reactos?rev=71330&view=rev
Log:
[DRIVERS][NTOSKRNL]
Don't use PWORK_QUEUE_ITEM casts in ExQueueWorkItem calls, but use the explicit
underlaying work queue item object instead.
Modified:
trunk/reactos/drivers/filters/mountmgr/mntmgr.h
trunk/reactos/drivers/filters/mountmgr/notify.c
trunk/reactos/ntoskrnl/cache/cachesub.c
trunk/reactos/ntoskrnl/cache/pinsup.c
Modified: trunk/reactos/drivers/filters/mountmgr/mntmgr.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/m…
==============================================================================
--- trunk/reactos/drivers/filters/mountmgr/mntmgr.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filters/mountmgr/mntmgr.h [iso-8859-1] Sun May 15 00:16:31 2016
@@ -112,7 +112,7 @@
typedef struct _ONLINE_NOTIFICATION_WORK_ITEM
{
- WORK_QUEUE_ITEM; // 0x00
+ WORK_QUEUE_ITEM WorkItem; // 0x00
PDEVICE_EXTENSION DeviceExtension; // 0x10
UNICODE_STRING SymbolicName; // 0x14
} ONLINE_NOTIFICATION_WORK_ITEM, *PONLINE_NOTIFICATION_WORK_ITEM; // 0x1C
Modified: trunk/reactos/drivers/filters/mountmgr/notify.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/n…
==============================================================================
--- trunk/reactos/drivers/filters/mountmgr/notify.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filters/mountmgr/notify.c [iso-8859-1] Sun May 15 00:16:31 2016
@@ -119,11 +119,11 @@
{
/* Queue a new one for execution */
Head = RemoveHeadList(&(DeviceExtension->OnlineNotificationListHead));
- NewWorkItem = CONTAINING_RECORD(Head, ONLINE_NOTIFICATION_WORK_ITEM, List);
+ NewWorkItem = CONTAINING_RECORD(Head, ONLINE_NOTIFICATION_WORK_ITEM,
WorkItem.List);
KeReleaseSpinLock(&(DeviceExtension->WorkerLock), OldIrql);
- NewWorkItem->List.Blink = NULL;
- NewWorkItem->List.Flink = NULL;
- ExQueueWorkItem((PWORK_QUEUE_ITEM)NewWorkItem, DelayedWorkQueue);
+ NewWorkItem->WorkItem.List.Blink = NULL;
+ NewWorkItem->WorkItem.List.Flink = NULL;
+ ExQueueWorkItem(&NewWorkItem->WorkItem, DelayedWorkQueue);
}
else
{
@@ -155,10 +155,8 @@
return;
}
- WorkItem->List.Flink = NULL;
+ ExInitializeWorkItem(&WorkItem->WorkItem, SendOnlineNotificationWorker,
WorkItem);
WorkItem->DeviceExtension = DeviceExtension;
- WorkItem->WorkerRoutine = SendOnlineNotificationWorker;
- WorkItem->Parameter = WorkItem;
WorkItem->SymbolicName.Length = SymbolicName->Length;
WorkItem->SymbolicName.MaximumLength = SymbolicName->Length + sizeof(WCHAR);
WorkItem->SymbolicName.Buffer =
AllocatePool(WorkItem->SymbolicName.MaximumLength);
@@ -179,12 +177,12 @@
{
/* Queue that one for execution */
DeviceExtension->OnlineNotificationWorkerActive = 1;
- ExQueueWorkItem((PWORK_QUEUE_ITEM)WorkItem, DelayedWorkQueue);
+ ExQueueWorkItem(&WorkItem->WorkItem, DelayedWorkQueue);
}
else
{
/* Otherwise, just put it in the queue list */
- InsertTailList(&(DeviceExtension->OnlineNotificationListHead),
&(WorkItem->List));
+ InsertTailList(&(DeviceExtension->OnlineNotificationListHead),
&(WorkItem->WorkItem.List));
}
KeReleaseSpinLock(&(DeviceExtension->WorkerLock), OldIrql);
Modified: trunk/reactos/ntoskrnl/cache/cachesub.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/cachesub.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/cachesub.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/cachesub.c [iso-8859-1] Sun May 15 00:16:31 2016
@@ -108,11 +108,11 @@
WorkItem->FileOffset = *FileOffset;
WorkItem->Length = Length;
- ExInitializeWorkItem(((PWORK_QUEUE_ITEM)WorkItem),
+ ExInitializeWorkItem(&WorkItem->WorkItem,
(PWORKER_THREAD_ROUTINE)CcpReadAhead,
WorkItem);
- ExQueueWorkItem((PWORK_QUEUE_ITEM)WorkItem, DelayedWorkQueue);
+ ExQueueWorkItem(&WorkItem->WorkItem, DelayedWorkQueue);
DPRINT("Done\n");
}
Modified: trunk/reactos/ntoskrnl/cache/pinsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/pinsup.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/pinsup.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/pinsup.c [iso-8859-1] Sun May 15 00:16:31 2016
@@ -273,7 +273,7 @@
WorkItem->ReleaseFromLazyWrite =
Bcb->Map->Callbacks.ReleaseFromLazyWrite;
WorkItem->LazyContext = Bcb->Map->LazyContext;
- ExInitializeWorkItem(((PWORK_QUEUE_ITEM)WorkItem),
+ ExInitializeWorkItem(&WorkItem->WorkItem,
(PWORKER_THREAD_ROUTINE)CcpUnmapCache,
WorkItem);
@@ -287,7 +287,7 @@
RemoveEntryList(&Bcb->ThisFileList);
CcpUnlock();
- ExQueueWorkItem((PWORK_QUEUE_ITEM)WorkItem, DelayedWorkQueue);
+ ExQueueWorkItem(&WorkItem->WorkItem, DelayedWorkQueue);
CcpLock();
}
DPRINT("Done\n");