ReactOS  0.4.15-dev-2704-gd5265b0
supportum.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  supportUM.cpp
8 
9 Abstract:
10 
11  This module implements the pnp support routines.
12 
13 Author:
14 
15 
16 Environment:
17 
18  User mode only
19 
20 Revision History:
21 
22 --*/
23 
24 #include "../pnppriv.hpp"
25 
26 VOID
28  __in PPOWER_THREAD_INTERFACE PowerThreadInterface,
29  __in FxIrp* Irp
30  )
31 {
32  UNREFERENCED_PARAMETER(PowerThreadInterface);
34 
35  ASSERTMSG("Not implemented for UMDF\n", FALSE);
36 }
37 
42  __in MxDeviceObject* DeviceInStack,
43  __in_opt PD3COLD_SUPPORT_INTERFACE D3ColdInterface,
45  )
46 {
47  HRESULT hr;
50  IWudfDeviceStack* deviceStack;
51 
53  UNREFERENCED_PARAMETER(D3ColdInterface);
54 
55  deviceObject = DeviceInStack->GetObject();
56  deviceStack = deviceObject->GetDeviceStackInterface();
57 
58  hr = deviceStack->GetStackCapabilities(Capabilities);
59 
60  if (S_OK == hr) {
62  }
63  else {
64  PUMDF_VERSION_DATA driverVersion = deviceStack->GetMinDriverVersion();
65  BOOL preserveCompat =
66  deviceStack->ShouldPreserveIrpCompletionStatusCompatibility();
67 
68  status = CHostFxUtil::NtStatusFromHr(hr,
69  driverVersion->MajorNumber,
70  driverVersion->MinorNumber,
71  preserveCompat);
72  }
73 
74  return status;
75 }
76 
77 VOID
80  __in MxDeviceObject* DeviceInStack,
81  __in PD3COLD_SUPPORT_INTERFACE D3ColdInterface,
82  __in BOOLEAN UseD3Cold
83  )
84 {
86  IWudfDeviceStack* deviceStack;
87 
89  UNREFERENCED_PARAMETER(D3ColdInterface);
90 
91  deviceObject = DeviceInStack->GetObject();
92  deviceStack = deviceObject->GetDeviceStackInterface();
93 
94  deviceStack->SetD3ColdSupport(UseD3Cold);
95 }
96 
97 PVOID
99  VOID
100  )
101 /*++
102 Routine description:
103  Returns an IO manager object that can be passed in to IoAllocateWorkItem
104 
105 Arguments:
106  None
107 
108 Return value:
109  Pointer to the object that can be passed in to IoAllocateWorkItem
110 --*/
111 {
112  //
113  // In user-mode we don't need an IO manager object for work item allocation
114  // so we return NULL.
115  //
116  return NULL;
117 }
118 
119 BOOLEAN
121  VOID
122  )
123 {
124 
125  return TRUE;
126 }
127 
129 NTSTATUS
131  __in MxDeviceObject* RelatedDevice,
132  __inout FxIrp* RelatedIrp,
133  __in MxWorkItem* Workitem,
135  __in BOOLEAN Revert
136  )
137 {
138  UNREFERENCED_PARAMETER(RelatedDevice);
139  UNREFERENCED_PARAMETER(RelatedIrp);
140  UNREFERENCED_PARAMETER(Workitem);
142  UNREFERENCED_PARAMETER(Revert);
143 
144  ASSERTMSG("Not implemented for UMDF\n", FALSE);
145 
146  return STATUS_NOT_IMPLEMENTED;
147 }
148 
149 
#define _Must_inspect_result_
Definition: no_sal2.h:62
HRESULT hr
Definition: shlfolder.c:183
#define __in_opt
Definition: dbghelp.h:38
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
static BOOLEAN _SystemManagedIdleTimeoutAvailable(VOID)
Definition: supportkm.cpp:211
LONG NTSTATUS
Definition: precomp.h:26
Definition: fxirp.hpp:28
_Must_inspect_result_ NTSTATUS GetStackCapabilities(__in PFX_DRIVER_GLOBALS DriverGlobals, __in MxDeviceObject *DeviceInStack, __in_opt PD3COLD_SUPPORT_INTERFACE D3ColdInterface, __out PSTACK_DEVICE_CAPABILITIES Capabilities)
Definition: supportum.cpp:40
_Must_inspect_result_ NTSTATUS SendDeviceUsageNotification(__in MxDeviceObject *RelatedDevice, __inout FxIrp *RelatedIrp, __in MxWorkItem *Workitem, __in FxIrp *OriginalIrp, __in BOOLEAN Revert)
Definition: supportum.cpp:130
IWudfDeviceStack * deviceStack
DriverGlobals
return STATUS_NOT_IMPLEMENTED
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define __out
Definition: dbghelp.h:62
VOID CopyQueryInterfaceToIrpStack(__in PPOWER_THREAD_INTERFACE PowerThreadInterface, __in FxIrp *Irp)
Definition: supportum.cpp:27
unsigned char BOOLEAN
VOID SetD3ColdSupport(__in PFX_DRIVER_GLOBALS DriverGlobals, __in MxDeviceObject *DeviceInStack, __in PD3COLD_SUPPORT_INTERFACE D3ColdInterface, __in BOOLEAN UseD3Cold)
Definition: supportum.cpp:78
LONG HRESULT
Definition: typedefs.h:79
#define __inout
Definition: dbghelp.h:50
_In_ PTRANSFER_PACKET _In_ ULONG _In_ PIRP OriginalIrp
Definition: classp.h:1757
MxDeviceObject deviceObject
__inline MdDeviceObject GetObject(VOID)
#define S_OK
Definition: intsafe.h:51
#define NULL
Definition: types.h:112
PVOID GetIoMgrObjectForWorkItemAllocation(VOID)
Definition: supportum.cpp:98
#define STATUS_SUCCESS
Definition: shellext.h:65
#define __in
Definition: dbghelp.h:35
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97