ReactOS 0.4.15-dev-7659-ga55345b
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;
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();
5114 data.DeviceObject = reinterpret_cast<PDEVICE_OBJECT>(pDevice->GetDeviceObject());
5115 data.Device = pDevice->GetHandle();
5116 data.TimedOutThread = reinterpret_cast<PKTHREAD>(pThis->m_CallingThread);
5117
5120 (ULONG_PTR) &data);
5121}
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
MdDeviceObject __inline GetDeviceObject(VOID)
Definition: fxdevice.hpp:174
__inline WDF_DEVICE_POWER_POLICY_STATE GetDevicePowerPolicyState()
Definition: fxdevice.hpp:1165
__inline WDF_DEVICE_POWER_STATE GetDevicePowerState()
Definition: fxdevice.hpp:1157
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
__inline CfxDevice * GetDevice(VOID)
Definition: fxpackage.hpp:46
#define TRACINGPNP
Definition: dbgtrace.h:67
FxDevice * pDevice
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define FxVerifierBugCheck(FxDriverGlobals, Error,...)
Definition: fxverifier.h:58
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
FxPkgPnp * m_PkgPnp
Definition: fxwatchdog.hpp:110
MxThread m_CallingThread
Definition: fxwatchdog.hpp:112
uint32_t ULONG_PTR
Definition: typedefs.h:65
@ WDF_POWER_ROUTINE_TIMED_OUT
Definition: wdfbugcodes.h:58
_Must_inspect_result_ _In_ PWDF_DPC_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFDPC * Dpc
Definition: wdfdpc.h:112
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:688
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:689

◆ PnpPassThroughQI()

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

Definition at line 1351 of file fxpkgpnp.cpp.

1377{
1378 MdIrp pFwdIrp;
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 //
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}
LONG NTSTATUS
Definition: precomp.h:26
static _Must_inspect_result_ MdIrp AllocateIrp(_In_ CCHAR StackSize, _In_opt_ FxDevice *Device=NULL)
Definition: fxirpum.cpp:1089
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
PDEVICE_OBJECT pTopOfStack
VOID PnpPassThroughQIWorker(__in MxDeviceObject *Device, __inout FxIrp *Irp, __inout FxIrp *ForwardIrp)
Definition: fxpkgpnpkm.cpp:498
IWudfIrp * MdIrp
Definition: mxum.h:103
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
Definition: ps.c:97
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474

Referenced by FxPkgPnp::HandleQueryInterface().