ReactOS 0.4.16-dev-199-g898cc56
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}
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NonPagedPool
Definition: env_spec_w32.h:307
VOID NTAPI IopWorkItemCallback(IN PVOID Parameter)
Definition: iowork.c:20
#define TAG_IOWI
Definition: tag.h:85
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
_In_opt_ PVOID _In_ PIO_WORKITEM IoWorkItem
Definition: iotypes.h:521

Referenced by _Dispatch_type_(), _Function_class_(), MxWorkItem::Allocate(), CdInitializeGlobalData(), ChewCreate(), ClasspInternalSetMediaChangeState(), ClasspMediaChangeDetectionCompletion(), ClassQueueCapacityChangedEventWorker(), ClassQueueProvisioningTypeChangedEventWorker(), ClassQueueResourceExhaustionEventWorker(), ClassQueueThresholdEventWorker(), ClassReadDriveCapacity(), CreateRemoteDatabase(), DiskFdoProcessError(), DiskIoctlVerify(), DiskPostReregisterRequest(), DispEchoRequest(), DispTdiQueryIpHwAddress(), DpcRoutine(), DriverEntry(), enqueue_pnp_callback(), EnqueueFreeTransferPacket(), event_notification(), HidUsb_ReadReportCompletion(), HoldIoRequests(), i8042KbdInternalDeviceControl(), i8042MouInternalDeviceControl(), IKsDevice_PnpStartDevice(), IssueUniqueIdChangeNotify(), MiniWorkItemComplete(), NdisAllocateIoWorkItem(), NdisMAllocateSharedMemoryAsync(), NdisMFreeSharedMemory(), PopAddRemoveSysCapsCallback(), FxWmiIrpHandler::PostCreateDeviceInitialize(), queue_notification_fcb(), ReconcileThisDatabaseWithMaster(), SendIrpToThread(), SerialRead(), TCPAllocateConnectionEndpoint(), USBH_AllocateWorkItem(), USBSTOR_FdoHandleStartDevice(), and WdmaudAddDevice().

◆ IoFreeWorkItem()

◆ IopWorkItemCallback()

VOID NTAPI IopWorkItemCallback ( IN PVOID  Parameter)

Definition at line 20 of file iowork.c.

21{
24 PAGED_CODE();
25
26 /* Call the work routine */
27 IoWorkItem->WorkerRoutine(DeviceObject, IoWorkItem->Context);
28
29 /* Dereference the device object */
31}
#define PAGED_CODE()
struct _IO_WORKITEM * PIO_WORKITEM
Definition: iotypes.h:506
#define ObDereferenceObject
Definition: obfuncs.h:203
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336

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 DISPATCH_LEVEL
Definition: env_spec_w32.h:696
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE _In_ WORK_QUEUE_TYPE QueueType
Definition: fltkernel.h:1978
_Must_inspect_result_ _In_ PFLT_CALLBACK_DATA _In_ PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine
Definition: fltkernel.h:1977
#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:723
#define ObReferenceObject
Definition: obfuncs.h:204

Referenced by _Dispatch_type_(), _Function_class_(), CdQueueClose(), ChewCreate(), ClasspInternalSetMediaChangeState(), ClasspMediaChangeDetectionCompletion(), ClassQueueCapacityChangedEventWorker(), ClassQueueProvisioningTypeChangedEventWorker(), ClassQueueResourceExhaustionEventWorker(), ClassQueueThresholdEventWorker(), ClassReadDriveCapacity(), CreateRemoteDatabase(), FxWmiIrpHandler::DeferUpdateLocked(), DisconnectTimeoutDpc(), DiskFdoProcessError(), DiskIoctlVerify(), DiskPostReregisterRequest(), DispTdiQueryIpHwAddress(), DpcRoutine(), MxWorkItem::Enqueue(), enqueue_pnp_callback(), event_notification(), HandlePowerKeys(), HidUsb_ReadReportCompletion(), HoldIoRequests(), i8042KbdInternalDeviceControl(), i8042MouInternalDeviceControl(), IKsDevice_PnpStartDevice(), IoQueueWorkItemEx(), MiniWorkItemComplete(), NdisMAllocateSharedMemoryAsync(), NdisMFreeSharedMemory(), NdisQueueIoWorkItem(), PopAddRemoveSysCapsCallback(), queue_notification_fcb(), QueueWorkItem(), ReceiveDatagram(), SendIrpToThread(), SerialRead(), TimeoutHandler(), UniqueIdChangeNotifyCompletion(), USBH_QueueWorkItem(), USBSTOR_QueueResetDevice(), USBSTOR_QueueResetPipe(), VfatPostCloseFile(), and WdmAudTimerRoutine().