ReactOS 0.4.15-dev-8116-gf69e256
mxworkitemum.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5ModuleName:
6
7 MxWorkItemUm.cpp
8
9Abstract:
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
16Author:
17
18
19
20Revision History:
21
22
23
24--*/
25
26#include "Mx.h"
27
28VOID
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
51VOID
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
VOID WaitForCallbacksToComplete(VOID)
MdWorkItem m_WorkItem
Definition: mxworkitem.h:32
static VOID CALLBACK _WorkerThunk(_Inout_ PTP_CALLBACK_INSTANCE Instance, _Inout_opt_ PVOID Parameter, _Inout_ PTP_WAIT Wait, _In_ TP_WAIT_RESULT WaitResult)
static __inline VOID MxAssert(__in BOOLEAN Condition)
Definition: mxgeneralkm.h:165
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define CALLBACK
Definition: compat.h:35
#define _Inout_
Definition: ms_sal.h:378
#define _Inout_opt_
Definition: ms_sal.h:379
#define _In_
Definition: ms_sal.h:308
PIO_WORKITEM MdWorkItem
Definition: mxworkitemkm.h:27
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
PDEVICE_OBJECT DeviceObject
Definition: io.h:313
PVOID Context
Definition: io.h:315
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
struct _TP_CALLBACK_INSTANCE * PTP_CALLBACK_INSTANCE
Definition: winnt_old.h:4453
_Inout_opt_ PVOID Parameter
Definition: rtltypes.h:323