You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.8 KiB
82 lines
1.8 KiB
/*++
|
|
|
|
Copyright (c) 1991 - 2001 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
##### ##### ## # ## ##### ##### #### ##### #####
|
|
## ## ## ## ## ### ## ## ## ## ## # ## ## ## ##
|
|
## ## ## ## ## ### ## ## ## ## ## ## ## ## ##
|
|
## ## ## ## ## # # ## ##### ##### ## ## ## ## ##
|
|
##### ## ## ### ### ## #### ## ##### #####
|
|
## ## ## ### ### ## ## ## ## ## # ## ##
|
|
## ##### ## ## ##### ## ## ## #### ## ##
|
|
|
|
Abstract:
|
|
|
|
This module process all power management IRPs.
|
|
|
|
Author:
|
|
|
|
Wesley Witt (wesw) 1-Oct-2001
|
|
|
|
Environment:
|
|
|
|
Kernel mode only.
|
|
|
|
Notes:
|
|
|
|
|
|
--*/
|
|
|
|
#include "internal.h"
|
|
|
|
#ifdef ALLOC_PRAGMA
|
|
#pragma alloc_text(PAGE,SaPortPower)
|
|
#endif
|
|
|
|
|
|
|
|
NTSTATUS
|
|
SaPortPower(
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
IN PIRP Irp
|
|
)
|
|
/*++
|
|
|
|
Routine Description:
|
|
|
|
Arguments:
|
|
|
|
DeviceObject - a pointer to the object that represents the device
|
|
that I/O is to be done on.
|
|
|
|
Irp - a pointer to the I/O Request Packet for this request.
|
|
|
|
Return Value:
|
|
|
|
--*/
|
|
{
|
|
NTSTATUS Status = STATUS_SUCCESS;
|
|
PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
|
|
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
switch (IrpSp->MinorFunction) {
|
|
case IRP_MN_WAIT_WAKE:
|
|
case IRP_MN_POWER_SEQUENCE:
|
|
case IRP_MN_SET_POWER:
|
|
case IRP_MN_QUERY_POWER:
|
|
Status = STATUS_SUCCESS;
|
|
break;
|
|
|
|
default:
|
|
Status = Irp->IoStatus.Status;
|
|
break;
|
|
|
|
}
|
|
|
|
Irp->IoStatus.Status = Status;
|
|
PoStartNextPowerIrp(Irp);
|
|
IoSkipCurrentIrpStackLocation( Irp );
|
|
return PoCallDriver( DeviceExtension->TargetObject, Irp );
|
|
}
|