Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power Manage Mode - Can Not Sleep #1

Open
Thompson-NO3 opened this issue Mar 10, 2020 · 1 comment
Open

Power Manage Mode - Can Not Sleep #1

Thompson-NO3 opened this issue Mar 10, 2020 · 1 comment

Comments

@Thompson-NO3
Copy link

I've installed it in windows. But I have just found it can't enter sleep mode. So the computer can't enter sleep mode. Woud you please fix this issue by modifying code about IRP_MJ_POWER.

@Thompson-NO3
Copy link
Author

I noticed that the two functions below are the related functions:

NTSTATUS device::power(PIRP Irp) {
  NTSTATUS Status = Irp->IoStatus.Status;
  PoStartNextPowerIrp(Irp);

  return Status;
}


NTSTATUS control_device::power(PIRP Irp) {
  NTSTATUS Status;
  PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);

  if (IrpSp->MinorFunction == IRP_MN_SET_POWER || IrpSp->MinorFunction == IRP_MN_QUERY_POWER)
      Irp->IoStatus.Status = STATUS_SUCCESS;

  Status = Irp->IoStatus.Status;
  PoStartNextPowerIrp(Irp);

  return Status;
}

They are in winmd.cpp, the code manipulate IRP_MJ_POWER correctly, but for some reason, the function control_device::power is not called during running, but the function device::power is called.

I don't know why, but code indicates we should use control_device::power which inheritage from device::power. So we can use function control_device::power instead of device::power.

Could the author please tell me the reason why the correct function is NOT called?

This issue cause we can not enter Stand By mode in Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant