ReactOS  0.4.15-dev-3456-g4a17d4b
fxpkgpnp.cpp File Reference
#include "pnppriv.hpp"
#include <initguid.h>
#include <wdmguid.h>
Include dependency graph for fxpkgpnp.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ NTSTATUS PnpPassThroughQI (__in CfxDevice *Device, __inout FxIrp *Irp)
 
 __drv_maxIRQL (DISPATCH_LEVEL) __drv_minIRQL(DISPATCH_LEVEL) __drv_requiresIRQL(DISPATCH_LEVEL) __drv_sameIRQL VOID FxWatchdog
 

Function Documentation

◆ __drv_maxIRQL()

__drv_maxIRQL ( DISPATCH_LEVEL  )

Definition at line 5064 of file fxpkgpnp.cpp.

5092 {
5094  FxWatchdog* pThis;
5095  CfxDevice* pDevice;
5096 
5100 
5101  pThis = (FxWatchdog*) Context;
5102  pDevice = pThis->m_PkgPnp->GetDevice();
5103 
5106  "The driver failed to return from a callback routine "
5107  "in a reasonable period of time. This prevented the "
5108  "machine from going to sleep or from hibernating. The "
5109  "machine crashed because that was the best way to get "
5110  "data about the cause of the crash into a minidump file.");
5111 
5112  data.PowerState = pDevice->GetDevicePowerState();
5113  data.PowerPolicyState = pDevice->GetDevicePowerPolicyState();
5115  data.Device = pDevice->GetHandle();
5116  data.TimedOutThread = reinterpret_cast<PKTHREAD>(pThis->m_CallingThread);
5117 
5120  (ULONG_PTR) &data);
5121 }
__inline CfxDevice * GetDevice(VOID)
Definition: fxpackage.hpp:46
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:107
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
__inline WDF_DEVICE_POWER_STATE GetDevicePowerState()
Definition: fxdevice.hpp:1157
FxDevice * pDevice
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
return reinterpret_cast< PDEVICE_OBJECT >(DeviceInit->Fdo.PhysicalDevice)
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxPkgPnp * m_PkgPnp
Definition: fxwatchdog.hpp:110
__inline WDF_DEVICE_POWER_POLICY_STATE GetDevicePowerPolicyState()
Definition: fxdevice.hpp:1165
MxThread m_CallingThread
Definition: fxwatchdog.hpp:112
#define ULONG_PTR
Definition: config.h:101

◆ PnpPassThroughQI()

_Must_inspect_result_ NTSTATUS PnpPassThroughQI ( __in CfxDevice Device,
__inout FxIrp Irp 
)

Definition at line 1351 of file fxpkgpnp.cpp.

1377 {
1378  MdIrp pFwdIrp;
1379  NTSTATUS status;
1380  NTSTATUS prevStatus;
1382 
1383  prevStatus = Irp->GetStatus();
1384 
1385 
1386 
1387 
1388 
1389 
1390 
1391 
1392 
1393 
1394 
1395 
1396  pTopOfStack.SetObject(Device->m_ParentDevice->GetAttachedDeviceReference());
1397 
1398  pFwdIrp = FxIrp::AllocateIrp(pTopOfStack.GetStackSize());
1399 
1400  if (pFwdIrp != NULL) {
1401  FxAutoIrp fxFwdIrp(pFwdIrp);
1402 
1403  //
1404  // The worker routine copies stack parameters to forward-Irp, sends it
1405  // down the stack synchronously, then copies back the stack parameters
1406  // from forward-irp to original-irp
1407  //
1408  PnpPassThroughQIWorker(&pTopOfStack, Irp, &fxFwdIrp);
1409 
1410  if (fxFwdIrp.GetStatus() != STATUS_NOT_SUPPORTED) {
1411  status = fxFwdIrp.GetStatus();
1412  }
1413  else {
1414  status = prevStatus;
1415  }
1416 
1417  Irp->SetStatus(status);
1418  Irp->SetInformation(fxFwdIrp.GetInformation());
1419  }
1420  else {
1422 
1424  Device->GetDriverGlobals(), TRACE_LEVEL_ERROR, TRACINGPNP,
1425  "WDFDEVICE %p could not allocate IRP to send QI to parent !devobj "
1426  "%p, %!STATUS!", Device->GetHandle(), pTopOfStack.GetObject(),
1427  status);
1428  }
1429 
1430  pTopOfStack.DereferenceObject();
1431 
1432  return status;
1433 }
return STATUS_NOT_SUPPORTED
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
VOID PnpPassThroughQIWorker(__in MxDeviceObject *Device, __inout FxIrp *Irp, __inout FxIrp *ForwardIrp)
Definition: fxpkgpnpkm.cpp:498
LONG NTSTATUS
Definition: precomp.h:26
PDEVICE_OBJECT pTopOfStack
_In_ PIRP Irp
Definition: csq.h:116
IWudfIrp * MdIrp
Definition: mxum.h:103
static _Must_inspect_result_ MdIrp AllocateIrp(_In_ CCHAR StackSize, _In_opt_ FxDevice *Device=NULL)
Definition: fxirpum.cpp:1089
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by FxPkgPnp::HandleQueryInterface().