ReactOS  0.4.15-dev-3456-g4a17d4b
mxdeviceobjectum.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 ModuleName:
6 
7  MxDeviceObjectUm.cpp
8 
9 Abstract:
10 
11  User Mode implementation of Device Object defined in MxDeviceObject.h
12 
13 --*/
14 
15 #include "fxmin.hpp"
16 
17 CCHAR
19  VOID
20  )
21 {
22  return (CCHAR) (static_cast<IWudfDevice2*>(m_DeviceObject))->GetStackSize2();
23 }
24 
25 VOID
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 
48 VOID
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 
61 ULONG
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 
88 VOID
91  )
92 {
94 
95  ASSERTMSG("Not implemented for UMDF\n", FALSE);
96 
97  //IoInvalidateDeviceRelations(DeviceObject, Type);
98 }
99 
100 VOID
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 
112 PVOID
114  VOID
115  )
116 {
117  ASSERTMSG("Not implemented for UMDF\n", FALSE);
118  return NULL;
119 }
120 
121 VOID
123  PVOID Value
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 
141 ULONG
143  VOID
144  )
145 {
146  ASSERTMSG("Not implemented for UMDF\n", FALSE);
147  return 0;
148 }
149 
150 VOID
152  DEVICE_TYPE /* Value */
153  )
154 {
155  ASSERTMSG("Not implemented for UMDF\n", FALSE);
156 }
157 
158 VOID
160  ULONG /* Characteristics */
161  )
162 {
163  ASSERTMSG("Not implemented for UMDF\n", FALSE);
164 }
165 
166 VOID
168  _In_ ULONG /* Value */
169  )
170 {
171  ASSERTMSG("Not implemented for UMDF\n", FALSE);
172 }
173 
174 ULONG
176  VOID
177  )
178 {
179  ASSERTMSG("Not implemented for UMDF\n", FALSE);
180  return 0;
181 }
182 
183 VOID
185  _In_ CCHAR Size
186  )
187 {
188  (static_cast<IWudfDevice2*>(m_DeviceObject))->SetStackSize2((ULONG)Size);
189 }
190 
191 VOID
193  ULONG Flags
194  )
195 {
197 
198 
199 
200 
201 
202 
203 
204 
205 }
206 
POWER_STATE SetPowerState(__in POWER_STATE_TYPE Type, __in POWER_STATE State)
enum _POWER_STATE_TYPE POWER_STATE_TYPE
ULONG GetCharacteristics(VOID)
CCHAR GetStackSize(VOID)
VOID SetFlags(ULONG Flags)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
VOID InvalidateDeviceState(__in MdDeviceObject Fdo)
PVOID GetDeviceExtension(VOID)
#define FALSE
Definition: types.h:117
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
MdDeviceObject m_DeviceObject
#define _In_
Definition: ms_sal.h:308
MdDeviceObject GetAttachedDeviceReference(VOID)
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
char CCHAR
Definition: typedefs.h:51
Type
Definition: Type.h:6
DEVICE_POWER_STATE DeviceState
Definition: ntpoapi.h:58
_Must_inspect_result_ _In_ WDFDEVICE Fdo
Definition: wdffdo.h:461
DEVICE_TYPE GetDeviceType(VOID)
VOID SetDeviceExtension(PVOID Value)
ULONG GetAlignmentRequirement(VOID)
VOID SetCharacteristics(ULONG Characteristics)
VOID InvalidateDeviceRelations(__in DEVICE_RELATION_TYPE Type)
#define DEVICE_TYPE
Definition: guid.c:10
VOID DereferenceObject()
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
VOID SetAlignmentRequirement(_In_ ULONG Value)
ULONG GetFlags(VOID)
#define __in
Definition: dbghelp.h:35
VOID SetDeviceType(DEVICE_TYPE Value)
VOID SetStackSize(_In_ CCHAR Size)