ReactOS 0.4.15-dev-7934-g1dc8d80
power.c
Go to the documentation of this file.
1/*
2 * PROJECT: PCI IDE bus driver extension
3 * LICENSE: See COPYING in the top level directory
4 * PURPOSE: Power support functions
5 * COPYRIGHT: Copyright 2023 Dmitry Borisov <di.sean@protonmail.com>
6 */
7
8#include "pciidex.h"
9
10#define NDEBUG
11#include <debug.h>
12
13static
18{
20 PIO_STACK_LOCATION IoStack;
21
23
25 switch (IoStack->MinorFunction)
26 {
30 Irp->IoStatus.Status = Status;
31 break;
32
33 default:
34 Status = Irp->IoStatus.Status;
35 break;
36 }
37
40 return Status;
41}
42
43static
48{
51 return PoCallDriver(FdoExtension->Ldo, Irp);
52}
53
59{
60 PVOID DeviceExtension = DeviceObject->DeviceExtension;
61
62 if (IS_FDO(DeviceExtension))
63 return PciIdeXFdoDispatchPower(DeviceExtension, Irp);
64 else
65 return PciIdeXPdoDispatchPower(DeviceExtension, Irp);
66}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
static NTSTATUS PciIdeXFdoDispatchPower(_In_ PFDO_DEVICE_EXTENSION FdoExtension, _In_ PIRP Irp)
Definition: power.c:45
static NTSTATUS PciIdeXPdoDispatchPower(_In_ PPDO_DEVICE_EXTENSION PdoExtension, _In_ PIRP Irp)
Definition: power.c:15
NTSTATUS NTAPI PciIdeXDispatchPower(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
Definition: power.c:56
@ PdoExtension
Definition: precomp.h:49
@ FdoExtension
Definition: precomp.h:48
Status
Definition: gdiplustypes.h:25
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCompleteRequest
Definition: irp.c:1240
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:758
#define IS_FDO(p)
Definition: pciidex.h:21
#define STATUS_SUCCESS
Definition: shellext.h:65
#define NTAPI
Definition: typedefs.h:36
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_SET_POWER
#define IRP_MN_QUERY_POWER