there is a conflict in the definition mentioned for ExRegisterCallback() and DxgkDdiNotifyAcpiEvent () for PO_CB_LID_SWITCH_STATE case.
in ExRegisterCallback()
-> Argument2 for PO_CB_LID_SWITCH_STATE gives TRUE if the current state of the lid switch is CLOSED and FALSE otherwise.
and in DxgkDdiNotifyAcpiEvent()
-> Argument for PO_CB_LID_SWITCH_STATE gives 1 for lid open and 0 for lid closed.
i have a small doubt …how can the same power object give different notification argument values ?
I am using ExRegisterCallback() for Lid Open/Close and when i close the lid i get FALSE and when i open the lid i get TRUE in Argument2 ie., essentially i am getting opposite notifications …
am I doing something wrong …or have i missed something ? or is it that the ExRegisterCallback gives what was the status just before the close/open event happening ?
Sounds like the docs for ExRegisterCallback PO_CB_LID_SWITCH_STATE have it backwards? I mean, try it and it does what it does, right?
I, personally, never believe the WDK documentation more than I believe my own eyes. Try three laptops with different BIOSes. If they all behave similarly, file a bug on the doc page.
@Peter Viscarola:
ya … looks like the WDK has it backwards… i tried with two different laptops … HP and Sony … both give the opposite status … i have raised a report to MSDN also … waiting for their response …
@Tim Roberts:
but i am using ExRegisterCallback(http://msdn.microsoft.com/en-us/library/windows/hardware/ff545534(v=vs.85).aspx) function for which Argument2 value gives TRUE(1) when lid is closed and FALSE(0) when lid is open … hence i am getting opposite status of lid open/close.
i mentioned DxgkDdiNotifyAcpiEvent() function as a reference for PO_CB_LID_SWITCH_STATE status values returned. Also another reference i found was in GUID_LIDSWITCH_STATE_CHANGE definition in wdm.h which mentions in the comments that
// 0 - closed
// 1 - opened
so … now i am in a little confusion about how to proceed …
@Tim Roberts:
but i am using ExRegisterCallback(http://msdn.microsoft.com/en-us/library/windows/hardware/ff545534(v=vs.85).aspx) function for which Argument2 value gives TRUE(1) when lid is closed and FALSE(0) when lid is open … hence i am getting opposite status of lid open/close.
i mentioned DxgkDdiNotifyAcpiEvent() function as a reference for PO_CB_LID_SWITCH_STATE status values returned. Also another reference i found was in GUID_LIDSWITCH_STATE_CHANGE definition in wdm.h which mentions in the comments that
// 0 - closed
// 1 - opened
so … now i am in a little confusion about how to proceed …
Personally, and this is really my personal opinion, those things should
not be documented on the ExRegisterCallback page to begin with.
ExRegisterCallback is a general-purpose kernel API. The fact that there
happen to be drivers in the system that offer callbacks is completely
unrelated to the API itself. They have gathered here options from a
wide variety of other kernel sources, and since their primary purpose on
this page is to document the API, it is perhaps not surprising that they
have mistakes in the details from other drivers.
I would consider the DxgkDdiNotifyAcpiEvent documentation more reliable,
since that API is closer to the creator of the event.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
now i am using PoRegisterPowerSettingCallback() with GUID of GUID_LIDSWITCH_STATES_CHANGE. I get the callback when lid is closed/open.
so i am not using the ExRegisterCallback() …