ReactOS 0.4.16-dev-199-g898cc56
iowork.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/io/iomgr/iowork.c
5 * PURPOSE: I/O Wrappers for the Executive Work Item Functions
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 * Robert Dickenson (odin@pnc.com.au)
8 */
9
10/* INCLUDES ******************************************************************/
11
12#include <ntoskrnl.h>
13#define NDEBUG
14#include <debug.h>
15
16/* PRIVATE FUNCTIONS *********************************************************/
17
18VOID
21{
24 PAGED_CODE();
25
26 /* Call the work routine */
27 IoWorkItem->WorkerRoutine(DeviceObject, IoWorkItem->Context);
28
29 /* Dereference the device object */
31}
32
33/* PUBLIC FUNCTIONS **********************************************************/
34
35/*
36 * @implemented
37 */
38VOID
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}
58
59/*
60 * @implemented
61 */
62VOID
65{
66 /* Free the work item */
68}
69
70/*
71 * @implemented
72 */
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}
92
93/* EOF */
#define PAGED_CODE()
#define NULL
Definition: types.h:112
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
#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
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
Definition: iowork.c:40
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
Definition: iowork.c:64
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
Definition: iowork.c:75
VOID NTAPI IopWorkItemCallback(IN PVOID Parameter)
Definition: iowork.c:20
#define ASSERT_IRQL_LESS_OR_EQUAL(x)
Definition: debug.h:251
#define TAG_IOWI
Definition: tag.h:85
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:723
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
_In_opt_ PVOID _In_ PIO_WORKITEM IoWorkItem
Definition: iotypes.h:521
struct _IO_WORKITEM * PIO_WORKITEM
Definition: iotypes.h:506
IO_WORKITEM_ROUTINE * PIO_WORKITEM_ROUTINE
Definition: iotypes.h:515
#define ObDereferenceObject
Definition: obfuncs.h:203
#define ObReferenceObject
Definition: obfuncs.h:204
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:336