ReactOS  0.4.14-dev-342-gdc047f9
iowork.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for iowork.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI IopWorkItemCallback (IN PVOID Parameter)
 
VOID NTAPI IoQueueWorkItem (IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
 
VOID NTAPI IoFreeWorkItem (IN PIO_WORKITEM IoWorkItem)
 
PIO_WORKITEM NTAPI IoAllocateWorkItem (IN PDEVICE_OBJECT DeviceObject)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file iowork.c.

Function Documentation

◆ IoAllocateWorkItem()

PIO_WORKITEM NTAPI IoAllocateWorkItem ( IN PDEVICE_OBJECT  DeviceObject)

Definition at line 75 of file iowork.c.

76 {
78 
79  /* Allocate the work item */
81  sizeof(IO_WORKITEM),
82  TAG_IOWI);
83  if (!IoWorkItem) return NULL;
84 
85  /* Initialize it */
86  IoWorkItem->DeviceObject = DeviceObject;
88 
89  /* Return it */
90  return IoWorkItem;
91 }
_In_opt_ PVOID _In_ PIO_WORKITEM IoWorkItem
Definition: iotypes.h:488
smooth NULL
Definition: ftsmooth.c:416
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define TAG_IOWI
Definition: tag.h:76
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
VOID NTAPI IopWorkItemCallback(IN PVOID Parameter)
Definition: iowork.c:20

Referenced by CdInitializeGlobalData(), CdRomAllocateMmcResources(), ChewCreate(), ClasspTimerTick(), CreateRemoteDatabase(), DiskDeviceControl(), DiskFdoProcessError(), DispTdiQueryIpHwAddress(), DpcRoutine(), DriverEntry(), enqueue_pnp_callback(), HidUsb_ReadReportCompletion(), HoldIoRequests(), i8042KbdInternalDeviceControl(), i8042MouInternalDeviceControl(), IKsDevice_PnpStartDevice(), IssueUniqueIdChangeNotify(), MiniWorkItemComplete(), NdisAllocateIoWorkItem(), NdisMAllocateSharedMemoryAsync(), NdisMFreeSharedMemory(), PopAddRemoveSysCapsCallback(), queue_notification_fcb(), ReconcileThisDatabaseWithMaster(), SendIrpToThread(), SerialRead(), USBH_AllocateWorkItem(), USBSTOR_FdoHandleStartDevice(), and WdmaudAddDevice().

◆ IoFreeWorkItem()

◆ IopWorkItemCallback()

VOID NTAPI IopWorkItemCallback ( IN PVOID  Parameter)

Definition at line 20 of file iowork.c.

21 {
23  PDEVICE_OBJECT DeviceObject = IoWorkItem->DeviceObject;
24  PAGED_CODE();
25 
26  /* Call the work routine */
27  IoWorkItem->WorkerRoutine(DeviceObject, IoWorkItem->Context);
28 
29  /* Dereference the device object */
31 }
_In_opt_ PVOID _In_ PIO_WORKITEM IoWorkItem
Definition: iotypes.h:488
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
_In_ PVOID Parameter
Definition: ldrtypes.h:241
#define PAGED_CODE()
Definition: video.h:57
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
struct _IO_WORKITEM * PIO_WORKITEM
Definition: iotypes.h:474

Referenced by IoAllocateWorkItem().

◆ IoQueueWorkItem()

VOID NTAPI IoQueueWorkItem ( IN PIO_WORKITEM  IoWorkItem,
IN PIO_WORKITEM_ROUTINE  WorkerRoutine,
IN WORK_QUEUE_TYPE  QueueType,
IN PVOID  Context 
)

Definition at line 40 of file iowork.c.

44 {
45  /* Make sure we're called at DISPATCH or lower */
47 
48  /* Reference the device object */
49  ObReferenceObject(IoWorkItem->DeviceObject);
50 
51  /* Setup the work item */
52  IoWorkItem->WorkerRoutine = WorkerRoutine;
53  IoWorkItem->Context = Context;
54 
55  /* Queue the work item */
57 }
#define ASSERT_IRQL_LESS_OR_EQUAL(x)
Definition: debug.h:251
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:717
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine
Definition: fltkernel.h:1977
_In_opt_ PVOID _In_ PIO_WORKITEM IoWorkItem
Definition: iotypes.h:488
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define ObReferenceObject
Definition: obfuncs.h:204
struct tagContext Context
Definition: acpixf.h:1030
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE _In_ WORK_QUEUE_TYPE QueueType
Definition: fltkernel.h:1977

Referenced by CdQueueClose(), CdRomStartIo(), ChewCreate(), ClasspTimerTick(), CreateRemoteDatabase(), DiskDeviceControl(), DiskFdoProcessError(), DispTdiQueryIpHwAddress(), DpcRoutine(), enqueue_pnp_callback(), HandlePowerKeys(), HidUsb_ReadReportCompletion(), HoldIoRequests(), i8042KbdInternalDeviceControl(), i8042MouInternalDeviceControl(), IKsDevice_PnpStartDevice(), MiniWorkItemComplete(), NdisMAllocateSharedMemoryAsync(), NdisMFreeSharedMemory(), NdisQueueIoWorkItem(), PopAddRemoveSysCapsCallback(), queue_notification_fcb(), QueueWorkItem(), SendIrpToThread(), SerialRead(), UniqueIdChangeNotifyCompletion(), USBH_QueueWorkItem(), USBSTOR_QueueResetDevice(), USBSTOR_QueueResetPipe(), VfatPostCloseFile(), and WdmAudTimerRoutine().