ReactOS 0.4.15-dev-7918-g2a2556c
poxinterfaceum.cpp
Go to the documentation of this file.
1//
2// Copyright (C) Microsoft. All rights reserved.
3//
4#include "../pnppriv.hpp"
5
6#include <initguid.h>
7#include <wdmguid.h>
8
9extern "C" {
10#if defined(EVENT_TRACING)
11#include "PoxInterfaceUm.tmh"
12#endif
13}
14
15VOID
17 )
18{
19 m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxStartDevicePowerManagement();
20
21 return;
22}
23
26 )
27{
28 HRESULT hr;
29
30 hr = m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxRegisterDevice();
31
32 if (S_OK == hr)
33 {
34 return STATUS_SUCCESS;
35 }
36 else
37 {
38 PUMDF_VERSION_DATA driverVersion = m_PkgPnp->GetDevice()->GetDeviceStack()->GetMinDriverVersion();
39
40 return CHostFxUtil::NtStatusFromHr(
41 hr,
42 driverVersion->MajorNumber,
43 driverVersion->MinorNumber,
44 m_PkgPnp->GetDevice()->GetDeviceStack()->ShouldPreserveIrpCompletionStatusCompatibility()
45 );
46 }
47
48}
49
50VOID
52 VOID
53 )
54{
55 m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxUnregisterDevice();
56 return;
57}
58
59VOID
61 VOID
62 )
63{
64 m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxActivateComponent();
65 return;
66}
67
68VOID
70 VOID
71 )
72{
73 m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxIdleComponent();
74 return;
75}
76
77VOID
79 VOID
80 )
81{
82 m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxReportDevicePoweredOn();
83 return;
84}
85
86VOID
88 __in ULONGLONG IdleTimeout
89 )
90{
91 m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxSetDeviceIdleTimeout(IdleTimeout);
92 return;
93}
94
95
96VOID
98 VOID
99 )
100{
101 PowerRequiredCallbackWorker(FALSE /* InvokedFromPoxCallback */);
102 return;
103}
104
105VOID
107 VOID
108 )
109{
110 //
111 // Notice that it is important that we first acknowledge the callback
112 // because once we queue an event in the state machine, the state machine
113 // could end up calling PoFxUnregister from the same thread
114 //
115 m_PkgPnp->GetDevice()->GetDeviceStack2()->PoFxCompleteDevicePowerNotRequired();
116
117 //
118 // The contract with the reflector is that the reflector guarantees to
119 // not send this event from the PoFx callback
120 //
121 PowerNotRequiredCallbackWorker(FALSE /* InvokedFromPoxCallback */);
122
123 return;
124}
125
LONG NTSTATUS
Definition: precomp.h:26
IWudfDeviceStack2 * GetDeviceStack2(VOID)
Definition: fxdeviceum.hpp:444
IWudfDeviceStack * GetDeviceStack(VOID)
Definition: fxdeviceum.hpp:435
__inline CfxDevice * GetDevice(VOID)
Definition: fxpackage.hpp:46
VOID PoxActivateComponent(VOID)
VOID PoxReportDevicePoweredOn(VOID)
VOID PowerRequiredCallbackWorker(__in BOOLEAN InvokedFromPoxCallback)
VOID PoxStartDevicePowerManagement(VOID)
VOID PoxIdleComponent(VOID)
VOID PowerNotRequiredCallbackWorker(__in BOOLEAN InvokedFromPoxCallback)
VOID PowerNotRequiredCallbackInvoked(VOID)
VOID PoxUnregisterDevice(VOID)
VOID PowerRequiredCallbackInvoked(VOID)
NTSTATUS PoxRegisterDevice(VOID)
VOID PoxSetDeviceIdleTimeout(__in ULONGLONG IdleTimeout)
FxPkgPnp * m_PkgPnp
#define __in
Definition: dbghelp.h:35
#define FALSE
Definition: types.h:117
#define S_OK
Definition: intsafe.h:52
#define STATUS_SUCCESS
Definition: shellext.h:65
HRESULT hr
Definition: shlfolder.c:183
uint64_t ULONGLONG
Definition: typedefs.h:67