ReactOS 0.4.15-dev-8127-g6338913
eventqueueum.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft. All rights reserved.
4
5Module Name:
6
7 EventQueueUm.cpp
8
9Abstract:
10
11 This module implements user mode specific functionality of event queue
12
13 This functionality needed to be separated out since the KM portion takes
14 a reference on driver object because KM MxWorkItem::_Free does not wait for
15 callback to return (i.e. rundown synchronously).
16
17 MxWorkItem::_Free in UM currently waits for callback to return (i.e. runs
18 down synchronously) hence does not need a reference on driver/devstack
19 object (see comments on top of MxWorkItemUm.h file).
20
21 In future if UM work-item is made similar to km workitem, UMDF may need to
22 ensure that modules stay loaded, though the mechanism to ensure that would
23 likely be different from a reference on the driver. It would likely be a
24 reference on the devicestack object.
25
26Environment:
27
28 User mode only
29
30Revision History:
31
32
33
34
35--*/
36
37#include "pnppriv.hpp"
38
39VOID
41 VOID
42 )
43{
44 //
45 // In user mode WorkItem::_Free waits for workitem callbacks to return
46 // So we don't need outstanding reference on driver object or the devstack
47 //
48
51 (FxEventQueue*) this);
52}
53
54VOID
58 )
59/*++
60
61Routine Description:
62 This is the work item that attempts to run the machine on a thread
63 separate from the one the caller was using. It implements step 9 above.
64
65--*/
66{
68
70
71 //
72 // In user mode WorkItem::_Free waits for workitem callbacks to return
73 // So we don't need outstanding reference on driver object
74 //
75
76 This->EventQueueWorker();
77}
__inline VOID Enqueue(__in PMX_WORKITEM_ROUTINE Callback, __in PVOID Context)
Definition: mxworkitemkm.h:58
#define __in
Definition: dbghelp.h:35
IO_WORKITEM_ROUTINE * PMX_WORKITEM_ROUTINE
Definition: mxworkitemkm.h:26
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
static MX_WORKITEM_ROUTINE _WorkItemCallback
VOID QueueWorkItem(VOID)
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055