ReactOS  0.4.15-dev-1619-g69dffed
power.c File Reference
#include "green.h"
#include <debug.h>
Include dependency graph for power.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS GreenPower (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file power.c.

Function Documentation

◆ GreenPower()

NTSTATUS GreenPower ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 15 of file power.c.

18 {
21  ULONG_PTR Information = Irp->IoStatus.Information;
22  NTSTATUS Status = Irp->IoStatus.Status;
23 
24  Type = ((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Type;
26 
27  switch (Stack->MinorFunction)
28  {
29  case IRP_MN_SET_POWER: /* 0x02 */
30  {
31  DPRINT("IRP_MJ_POWER / IRP_MN_SET_POWER\n");
32  if (Type == GreenFDO)
33  {
36  }
37  else
38  {
39  DPRINT1("IRP_MJ_POWER / IRP_MN_SET_POWER / Unknown type 0x%lx\n",
40  Type);
41  ASSERT(FALSE);
42  }
43  break;
44  }
45  default:
46  {
47  DPRINT1("IRP_MJ_POWER / unknown minor function 0x%lx\n", Stack->MinorFunction);
48  break;
49  }
50  }
51 
52  Irp->IoStatus.Status = Status;
53  Irp->IoStatus.Information = Information;
54  if (Status != STATUS_PENDING)
56 
57  return Status;
58 }
LONG NTSTATUS
Definition: precomp.h:26
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
Status
Definition: gdiplustypes.h:24
#define ASSERT(a)
Definition: mode.c:45
#define STATUS_PENDING
Definition: ntstatus.h:82
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
Type
Definition: Type.h:6
Definition: green.h:26
#define IRP_MN_SET_POWER
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:737
GREEN_DEVICE_TYPE
Definition: green.h:21
#define DPRINT1
Definition: precomp.h:8
#define IO_NO_INCREMENT
Definition: iotypes.h:598
DEVICE_RELATION_TYPE Type
Definition: iotypes.h:3238
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by GreenDispatch().