ReactOS  0.4.15-dev-3165-gdf6fff7
mxworkitemum.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxWorkItemUm.cpp
8 
9 Abstract:
10 
11  Work item callback thunk implementation for user mode
12 
13  We need this thunk to wire the um callback to a mode agnostic work item
14  callback.
15 
16 Author:
17 
18 
19 
20 Revision History:
21 
22 
23 
24 --*/
25 
26 #include "Mx.h"
27 
28 VOID
33  _Inout_ PTP_WAIT Wait,
34  _In_ TP_WAIT_RESULT WaitResult
35  )
36 {
37  MdWorkItem workItem = (MdWorkItem) Parameter;
38 
41  UNREFERENCED_PARAMETER(WaitResult);
42 
43  (*workItem->Callback)(
44  workItem->DeviceObject,
45  workItem->Context
46  );
47 
48  return;
49 }
50 
51 VOID
53  VOID
54  )
55 {
56  Mx::MxAssert(NULL != m_WorkItem->WaitBlock);
57 
58  //
59  // Wait for outstanding callbacks to complete.
60  //
61  WaitForThreadpoolWaitCallbacks(m_WorkItem->WaitBlock,
62  FALSE // donot cancel pending waits
63  );
64 
65 }
66 
PVOID Context
Definition: io.h:315
static VOID CALLBACK _WorkerThunk(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Parameter, _Inout_ PTP_WAIT Wait, _In_ TP_WAIT_RESULT WaitResult)
#define _Inout_
Definition: ms_sal.h:378
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
#define CALLBACK
Definition: compat.h:35
_In_ PVOID Parameter
Definition: ldrtypes.h:241
MdWorkItem m_WorkItem
Definition: mxworkitem.h:32
static __inline VOID MxAssert(__in BOOLEAN Condition)
Definition: mxgeneralkm.h:165
#define FALSE
Definition: types.h:117
PDEVICE_OBJECT DeviceObject
Definition: io.h:313
#define _In_
Definition: ms_sal.h:308
struct _TP_CALLBACK_INSTANCE * PTP_CALLBACK_INSTANCE
Definition: winnt_old.h:4356
PIO_WORKITEM MdWorkItem
Definition: mxworkitemkm.h:27
#define _Inout_opt_
Definition: ms_sal.h:379
VOID WaitForCallbacksToComplete(VOID)
#define NULL
Definition: types.h:112
IN PVOID Instance
Definition: pci.h:361