ReactOS 0.4.15-dev-7934-g1dc8d80
mxdeviceobjectum.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5ModuleName:
6
7 MxDeviceObjectUm.cpp
8
9Abstract:
10
11 User Mode implementation of Device Object defined in MxDeviceObject.h
12
13--*/
14
15#include "fxmin.hpp"
16
19 VOID
20 )
21{
22 return (CCHAR) (static_cast<IWudfDevice2*>(m_DeviceObject))->GetStackSize2();
23}
24
25VOID
27 )
28{
29 m_DeviceObject->AddRef();
30
31 //
32 // We take a reference on device stack object as it is the reference on
33 // device stack object that keeps the driver loaded
34 //
35 m_DeviceObject->GetDeviceStackInterface()->AddRef();
36}
37
40 VOID
41 )
42{
43 FX_VERIFY(INTERNAL, TRAPMSG("MxDeviceObject::GetAttachedDeviceReference "
44 "not implemented for UMDF"));
45 return NULL;
46}
47
48VOID
50 )
51{
52 m_DeviceObject->Release();
53
54 //
55 // We also take a device stack reference (see ReferenceObject)
56 // release it now
57 //
58 m_DeviceObject->GetDeviceStackInterface()->Release();
59}
60
63 VOID
64 )
65{
66 return m_DeviceObject->GetDeviceObjectWdmFlags();
67}
68
71 __in POWER_STATE_TYPE /*Type*/,
73 )
74{
75 ULONG oldState;
76 POWER_STATE oldStateEnum;
77
78 m_DeviceObject->GetDeviceStackInterface()->SetPowerState(
79 State.DeviceState,
80 &oldState
81 );
82
83 oldStateEnum.DeviceState = (DEVICE_POWER_STATE) oldState;
84
85 return oldStateEnum;
86}
87
88VOID
91 )
92{
94
95 ASSERTMSG("Not implemented for UMDF\n", FALSE);
96
97 //IoInvalidateDeviceRelations(DeviceObject, Type);
98}
99
100VOID
103 )
104{
105 //
106 // DO NOT use m_DeviceObject. That specifies PDO in this case which is
107 // currently NULL for UMDF. Use the passed in Fdo instead.
108 //
109 Fdo->GetDeviceStackInterface()->InvalidateDeviceState();
110}
111
112PVOID
114 VOID
115 )
116{
117 ASSERTMSG("Not implemented for UMDF\n", FALSE);
118 return NULL;
119}
120
121VOID
124 )
125{
126 //
127 // This will set the context
128 //
129 (static_cast<IWudfDevice2*>(m_DeviceObject))->SetContext(Value);
130}
131
134 VOID
135 )
136{
137 ASSERTMSG("Not implemented for UMDF\n", FALSE);
138 return (DEVICE_TYPE) 0;
139}
140
141ULONG
143 VOID
144 )
145{
146 ASSERTMSG("Not implemented for UMDF\n", FALSE);
147 return 0;
148}
149
150VOID
152 DEVICE_TYPE /* Value */
153 )
154{
155 ASSERTMSG("Not implemented for UMDF\n", FALSE);
156}
157
158VOID
160 ULONG /* Characteristics */
161 )
162{
163 ASSERTMSG("Not implemented for UMDF\n", FALSE);
164}
165
166VOID
168 _In_ ULONG /* Value */
169 )
170{
171 ASSERTMSG("Not implemented for UMDF\n", FALSE);
172}
173
174ULONG
176 VOID
177 )
178{
179 ASSERTMSG("Not implemented for UMDF\n", FALSE);
180 return 0;
181}
182
183VOID
186 )
187{
188 (static_cast<IWudfDevice2*>(m_DeviceObject))->SetStackSize2((ULONG)Size);
189}
190
191VOID
194 )
195{
197
198
199
200
201
202
203
204
205}
206
Type
Definition: Type.h:7
VOID InvalidateDeviceState(__in MdDeviceObject Fdo)
VOID SetDeviceType(DEVICE_TYPE Value)
MdDeviceObject m_DeviceObject
ULONG GetAlignmentRequirement(VOID)
VOID SetAlignmentRequirement(_In_ ULONG Value)
VOID SetCharacteristics(ULONG Characteristics)
VOID InvalidateDeviceRelations(__in DEVICE_RELATION_TYPE Type)
DEVICE_TYPE GetDeviceType(VOID)
CCHAR GetStackSize(VOID)
PVOID GetDeviceExtension(VOID)
ULONG GetFlags(VOID)
VOID DereferenceObject()
ULONG GetCharacteristics(VOID)
VOID SetStackSize(_In_ CCHAR Size)
POWER_STATE SetPowerState(__in POWER_STATE_TYPE Type, __in POWER_STATE State)
MdDeviceObject GetAttachedDeviceReference(VOID)
VOID SetDeviceExtension(PVOID Value)
VOID SetFlags(ULONG Flags)
#define __in
Definition: dbghelp.h:35
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define DEVICE_TYPE
Definition: guid.c:10
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
#define _In_
Definition: ms_sal.h:308
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
enum _POWER_STATE_TYPE POWER_STATE_TYPE
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
uint32_t ULONG
Definition: typedefs.h:59
char CCHAR
Definition: typedefs.h:51
DEVICE_POWER_STATE DeviceState
Definition: ntpoapi.h:58
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE