Leaked source code of windows server 2003
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

  1. /*++
  2. Copyright (c) 1991 - 2001 Microsoft Corporation
  3. Module Name:
  4. ##### ##### ## # ## ##### ##### #### ##### #####
  5. ## ## ## ## ## ### ## ## ## ## ## # ## ## ## ##
  6. ## ## ## ## ## ### ## ## ## ## ## ## ## ## ##
  7. ## ## ## ## ## # # ## ##### ##### ## ## ## ## ##
  8. ##### ## ## ### ### ## #### ## ##### #####
  9. ## ## ## ### ### ## ## ## ## ## # ## ##
  10. ## ##### ## ## ##### ## ## ## #### ## ##
  11. Abstract:
  12. This module process all power management IRPs.
  13. Author:
  14. Wesley Witt (wesw) 1-Oct-2001
  15. Environment:
  16. Kernel mode only.
  17. Notes:
  18. --*/
  19. #include "internal.h"
  20. #ifdef ALLOC_PRAGMA
  21. #pragma alloc_text(PAGE,SaPortPower)
  22. #endif
  23. NTSTATUS
  24. SaPortPower(
  25. IN PDEVICE_OBJECT DeviceObject,
  26. IN PIRP Irp
  27. )
  28. /*++
  29. Routine Description:
  30. Arguments:
  31. DeviceObject - a pointer to the object that represents the device
  32. that I/O is to be done on.
  33. Irp - a pointer to the I/O Request Packet for this request.
  34. Return Value:
  35. --*/
  36. {
  37. NTSTATUS Status = STATUS_SUCCESS;
  38. PDEVICE_EXTENSION DeviceExtension = (PDEVICE_EXTENSION) DeviceObject->DeviceExtension;
  39. PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
  40. switch (IrpSp->MinorFunction) {
  41. case IRP_MN_WAIT_WAKE:
  42. case IRP_MN_POWER_SEQUENCE:
  43. case IRP_MN_SET_POWER:
  44. case IRP_MN_QUERY_POWER:
  45. Status = STATUS_SUCCESS;
  46. break;
  47. default:
  48. Status = Irp->IoStatus.Status;
  49. break;
  50. }
  51. Irp->IoStatus.Status = Status;
  52. PoStartNextPowerIrp(Irp);
  53. IoSkipCurrentIrpStackLocation( Irp );
  54. return PoCallDriver( DeviceExtension->TargetObject, Irp );
  55. }