-
Notifications
You must be signed in to change notification settings - Fork 413
Adding PowerNotifcation APIs #1035
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
Adding PowerNotifcation APIs #1035
Conversation
|
|
||
| namespace ProjectReunionPowerTests | ||
| { | ||
| constexpr auto TIMEOUT = 2000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2000?
What's the expected average and worst case timeouts you'll encounter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I just choose a value where I was sure that it will succeed. Informal testing shows they take <500 ms and the Power team also didn't have data on this. Do you have any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: c_TimeoutInMs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, change this to a std::chrono::duration. Makes it more explicit with what you mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name has been changed. I didn't use chrono as it would need another level of conversion and the variable name makes it clear.
Will take suggestions on a possible better time out value though. :)
Changed check_hresult to Throw_if_failed Moved/removed some variables Added background thread event firing More NIT changes
|
I wanted to push after the renaming to AppSDK but wasn't sure how long that would take and wanted this to be updated from my side. |
Other NIT changes
| </PropertyGroup> | ||
| <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
| <ClCompile> | ||
| <WarningLevel>Level3</WarningLevel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always use Level4
DrusTheAxe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please flip warnings to level4 (in this PR or a follow up) and correct anything it flags
|
The actual PR has only Level4. Did I miss something?
#1142
Thanks,
H.
From: Howard Kapustein ***@***.***>
Sent: Wednesday, August 11, 2021 10:33 PM
To: microsoft/WindowsAppSDK ***@***.***>
Cc: Huzaifa Danish ***@***.***>; Author ***@***.***>
Subject: Re: [microsoft/WindowsAppSDK] Adding PowerNotifcation APIs (#1035)
@DrusTheAxe approved this pull request.
Please flip warnings to level4 (in this PR or a follow up) and correct anything it flags
|
|
My comment predates the Level4 change (or maybe I was looking at an older commit in Codeflow when I made that comment?) But all good now :-) |
DrusTheAxe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments but otherwise looks good
| { | ||
| wil::unique_handle event(CreateEvent(nullptr, false, false, nullptr)); | ||
| THROW_LAST_ERROR_IF_NULL(event.get()); | ||
| auto value = EnergySaverStatus::Disabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <packages> | ||
| <package id="Microsoft.Taef" version="10.58.210222006-develop" targetFramework="native" /> | ||
| <package id="Microsoft.Windows.CppWinRT" version="2.0.210707.1" targetFramework="native" /> | ||
| <package id="Microsoft.Windows.ImplementationLibrary" version="1.0.210204.1" targetFramework="native" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIL reference is rather long in the tooth
I noticed lots of projects referenced WIL but varying versions (4 different ones!). I just updated them and CsWinRT references to latest (which WindowsAppSDK_DLL was using). Take a look at latest commits in #1208
BTW don't update this through VS' UI, it won't update all the references in *.vcxproj. Global search/replace is more effective
|
Is this PR current or obsolete? |
|
It is old. Apologies for the confusion. Closing. |
Adding the PowerNotification APIs as mentioned in this spec