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

Hibernation stop not working #2

Closed
gbakeman opened this issue May 5, 2022 · 1 comment
Closed

Hibernation stop not working #2

gbakeman opened this issue May 5, 2022 · 1 comment
Assignees

Comments

@gbakeman
Copy link
Contributor

gbakeman commented May 5, 2022

Imported from gawindx/WinNUT-Client#89

When I configure WinNUT to Hibernate my computer the Shutdown GUI will display when the NUT Server sends the FSD signal. The Shutdown GUI will perform the countdown and then hang. When configured to Shutdown instead of hibernate, the shutdown process executes properly.

Steps to reproduce:

Configure WinNUT Shutdown Options as follows

Type of Stop = Hibernate
Delay to SHutdown (sec) = 15
Shutdown on Nut's FSD Signal = Checked

Disconnect UPS from AC power, wait for NUT Server to send FDS
Shutdown GUI will appear, wait for counter to reach zero
Shutdown GUI will hang and computer will stay powered on

I suspect this has something to do with the calls to SetSystemPowerState in the Select Cast statement at line 979 in WinNUT.vb. It looks a bit odd passing a Boolean value when the function is declared as expecting an integer. https://www.tek-tips.com/viewthread.cfm?qid=1086465 talks about similar code only passing integers 1 and 0 instead of Booleans. It has been years since I messed with VB.Net so passing a Boolean could be valid, it just looks off.

My computer is running Windows 10 21H1, NUT Server is the built in Synology NUT server, running latest version of WinNUT

@gbakeman
Copy link
Contributor Author

Created a debug build with changes built in, looking for test results:

WinNUTv2.1.8241.26516-debug.zip

gbakeman added a commit that referenced this issue Jul 28, 2022
Windows 10 Hibernate & Clear Shutdown Timer (redo)
Repository owner moved this from In Progress to Done in Import from @gawindx Jul 28, 2022
@gbakeman gbakeman self-assigned this Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant