Source code of Windows XP (NT5)
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.

59 lines
1.5 KiB

  1. #include "wdmpower.h"
  2. #pragma PAGEDCODE
  3. CPower* CWDMPower::create(VOID)
  4. { return new (NonPagedPool) CWDMPower; }
  5. #pragma PAGEDCODE
  6. PULONG CWDMPower::registerDeviceForIdleDetection (
  7. IN PDEVICE_OBJECT DeviceObject,
  8. IN ULONG ConservationIdleTime,
  9. IN ULONG PerformanceIdleTime,
  10. IN DEVICE_POWER_STATE State )
  11. {
  12. return ::PoRegisterDeviceForIdleDetection (DeviceObject,
  13. ConservationIdleTime,PerformanceIdleTime,State);
  14. }
  15. #pragma PAGEDCODE
  16. POWER_STATE CWDMPower::declarePowerState(IN PDEVICE_OBJECT DeviceObject,IN POWER_STATE_TYPE Type,IN POWER_STATE State)
  17. {
  18. return ::PoSetPowerState(DeviceObject,Type,State);
  19. }
  20. #pragma PAGEDCODE
  21. VOID CWDMPower::startNextPowerIrp(IN PIRP Irp)
  22. {
  23. ::PoStartNextPowerIrp(Irp);
  24. }
  25. #pragma PAGEDCODE
  26. NTSTATUS CWDMPower::callPowerDriver (IN PDEVICE_OBJECT pFdo,IN OUT PIRP Irp)
  27. {
  28. return ::PoCallDriver (pFdo,Irp);
  29. }
  30. #pragma PAGEDCODE
  31. VOID CWDMPower::setPowerDeviceBusy(PULONG IdlePointer)
  32. {
  33. PoSetDeviceBusy(IdlePointer);
  34. }
  35. #pragma PAGEDCODE
  36. VOID CWDMPower::skipCurrentStackLocation(IN PIRP Irp)
  37. {
  38. IoSkipCurrentIrpStackLocation(Irp);
  39. }
  40. #pragma PAGEDCODE
  41. NTSTATUS CWDMPower::requestPowerIrp(
  42. IN PDEVICE_OBJECT DeviceObject,
  43. IN UCHAR MinorFunction,
  44. IN POWER_STATE PowerState,
  45. IN PREQUEST_POWER_COMPLETE CompletionFunction,
  46. IN PVOID Context,
  47. OUT PIRP *Irp OPTIONAL)
  48. {
  49. return ::PoRequestPowerIrp(DeviceObject,MinorFunction,PowerState,
  50. CompletionFunction,Context,Irp);
  51. }