ReactOS  0.4.14-dev-384-g5b37caa
chew.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

VOID ChewInit (PDEVICE_OBJECT DeviceObject)
 
VOID ChewShutdown (VOID)
 
BOOLEAN ChewCreate (VOID(*Worker)(PVOID), PVOID WorkerContext)
 

Function Documentation

◆ ChewCreate()

BOOLEAN ChewCreate ( VOID(*)(PVOID Worker,
PVOID  WorkerContext 
)

Creates and queues a work item.

Definition at line 65 of file workqueue.c.

66 {
67  PWORK_ITEM Item;
69  sizeof(WORK_ITEM),
70  CHEW_TAG);
71 
72  if (Item)
73  {
75  if (!Item->WorkItem)
76  {
77  ExFreePool(Item);
78  return FALSE;
79  }
80 
81  Item->Worker = Worker;
82  Item->WorkerContext = WorkerContext;
86 
87  return TRUE;
88  }
89  else
90  {
91  return FALSE;
92  }
93 }
#define TRUE
Definition: types.h:120
VOID(* Worker)(PVOID WorkerContext)
Definition: workqueue.c:28
#define CHEW_TAG
Definition: workqueue.c:17
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
Definition: interlocked.c:140
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
Definition: iowork.c:75
KSPIN_LOCK WorkQueueLock
Definition: workqueue.c:21
LIST_ENTRY WorkQueue
Definition: workqueue.c:20
PIO_WORKITEM WorkItem
Definition: workqueue.c:27
PVOID WorkerContext
Definition: workqueue.c:29
PDEVICE_OBJECT WorkQueueDevice
Definition: workqueue.c:19
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID NTAPI ChewWorkItem(PDEVICE_OBJECT DeviceObject, PVOID ChewItem)
Definition: workqueue.c:45
LIST_ENTRY Entry
Definition: workqueue.c:26
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 KeClearEvent(IN PKEVENT Event)
Definition: eventobj.c:22
KEVENT WorkQueueClear
Definition: workqueue.c:22
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by CompleteBucket(), LanSubmitReceiveWork(), LoopTransmit(), and ProtocolStatus().

◆ ChewInit()

VOID ChewInit ( PDEVICE_OBJECT  DeviceObject)

Initialize CHEW, given a device object (since IoAllocateWorkItem relies on it).

Definition at line 32 of file workqueue.c.

33 {
38 }
#define TRUE
Definition: types.h:120
KSPIN_LOCK WorkQueueLock
Definition: workqueue.c:21
LIST_ENTRY WorkQueue
Definition: workqueue.c:20
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:251
PDEVICE_OBJECT WorkQueueDevice
Definition: workqueue.c:19
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
KEVENT WorkQueueClear
Definition: workqueue.c:22

Referenced by DriverEntry().

◆ ChewShutdown()

VOID ChewShutdown ( VOID  )

Shutdown CHEW, waits for remaining work items.

Definition at line 40 of file workqueue.c.

41 {
43 }
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
smooth NULL
Definition: ftsmooth.c:416
KEVENT WorkQueueClear
Definition: workqueue.c:22

Referenced by TiUnload().