Device Power Management
-
Howdy: I'm new to the driver scene and I need a small pointer or insight to a situation I'm encountering. The Vista (Server 2K8) SDK has a plethora of power management calls, making power management trivial. Unfortunately, we still support Windows 2K, so we cannot rely on these calls. After a bit of registry and internet trolling I found which registry entries need to be modified in order to allow a device to bring the computer out of a sleep state. My question is: how do I ensure that the changes are applied to the hardware, rather than just being a new entry in the registry? It occurs to me that reboot would do the trick, but that seems a little drastic to me. Is there a less disruptive way of telling Windows that a device's PnP (where the power settings are stored) settings have changed? Maybe I don't need to?
cheers, -B
-
Howdy: I'm new to the driver scene and I need a small pointer or insight to a situation I'm encountering. The Vista (Server 2K8) SDK has a plethora of power management calls, making power management trivial. Unfortunately, we still support Windows 2K, so we cannot rely on these calls. After a bit of registry and internet trolling I found which registry entries need to be modified in order to allow a device to bring the computer out of a sleep state. My question is: how do I ensure that the changes are applied to the hardware, rather than just being a new entry in the registry? It occurs to me that reboot would do the trick, but that seems a little drastic to me. Is there a less disruptive way of telling Windows that a device's PnP (where the power settings are stored) settings have changed? Maybe I don't need to?
cheers, -B
OK, you dont need to make any registry changes directly, you do it through device manager. Change the view to 'view by connection' and then, on the power management tab of any device (usb hubs for example) check the two power options. Power saving and wake computer (if possible. If one is greyed then that functionality is not enabled on that device controler). Secondly, the driver itself for the device attatched ot that controler has to be capable of sending a wait wake. To do this it examines the device characteristics data to see if the device is capable of sleeping, what the relevant device sleep state is for a respective syystem sleep state and if both that device state is wakable and if that system state is wakable. If you get all that lot right then you system will wake when the device gets an external input.
Morality is indistinguishable from social proscription
-
OK, you dont need to make any registry changes directly, you do it through device manager. Change the view to 'view by connection' and then, on the power management tab of any device (usb hubs for example) check the two power options. Power saving and wake computer (if possible. If one is greyed then that functionality is not enabled on that device controler). Secondly, the driver itself for the device attatched ot that controler has to be capable of sending a wait wake. To do this it examines the device characteristics data to see if the device is capable of sleeping, what the relevant device sleep state is for a respective syystem sleep state and if both that device state is wakable and if that system state is wakable. If you get all that lot right then you system will wake when the device gets an external input.
Morality is indistinguishable from social proscription
Sorry, I should have made myself clearer. This is to be done programmatically. We would like to determine if a network interface can wake a machine. Also, we would like to give our user's the option to turn this on for any network adapter they may be using to route our application's traffic.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
modified on Monday, September 15, 2008 10:48 AM
-
Sorry, I should have made myself clearer. This is to be done programmatically. We would like to determine if a network interface can wake a machine. Also, we would like to give our user's the option to turn this on for any network adapter they may be using to route our application's traffic.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
modified on Monday, September 15, 2008 10:48 AM
-
Take a look at the setupdi functions. They are how you can query device informaitonm from usermode.
Morality is indistinguishable from social proscription
I actually have an implementation that uses those functions; unfortunately, they are not all necessarily supported on Windows 2000: it depends on how up-to-date the machine is. Sorry, I'm just making this really difficult :) (It's not intentional, however; it just our current predicament.)
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
-
I actually have an implementation that uses those functions; unfortunately, they are not all necessarily supported on Windows 2000: it depends on how up-to-date the machine is. Sorry, I'm just making this really difficult :) (It's not intentional, however; it just our current predicament.)
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
-
If SP4 gives you those functions then surely you can mandate it?
Morality is indistinguishable from social proscription
We may just have to; I was just hoping that we could cover everyone, including those who do not want to touch any of their perfectly-ok-and-running-machines. If I had any say in it, I'd make XP the base requirements, period; unfortunately, we have far too many people with production Windows 2000 machines for this to be feasible. Thank you for your help. I'll need to further contemplate how backwards compatible we care to--or can--be.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
-
We may just have to; I was just hoping that we could cover everyone, including those who do not want to touch any of their perfectly-ok-and-running-machines. If I had any say in it, I'd make XP the base requirements, period; unfortunately, we have far too many people with production Windows 2000 machines for this to be feasible. Thank you for your help. I'll need to further contemplate how backwards compatible we care to--or can--be.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
I know what you mean. I've still got an NT4 box for testing one of the apps I'm responsible for.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall
-
I know what you mean. I've still got an NT4 box for testing one of the apps I'm responsible for.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall
My condolences ;) I believe we dropped that flavour of Windows just before I joined the team. A lot of the core kernel calls was there, but some of the niceties are only just being address now.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
-
My condolences ;) I believe we dropped that flavour of Windows just before I joined the team. A lot of the core kernel calls was there, but some of the niceties are only just being address now.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
I'm doing C# work, not drivers so it's not as bad, but there've been more than a few places where I've been burned by win32 changes. Two that I recall are the behavior of a listbox if you click in the empty area below the last item, and that NT4 doesn't correctly display 32bit color depth icons. The customer this software is for has never moved past 2k to XP (claimed not to be able to turn off some XP services that tried doing auto updates when on isolated networks). We think, but aren't sure that all the NT4 boxes are finally gone, and that the next rev of the software (whenever that is) can be 2k only.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall
-
We may just have to; I was just hoping that we could cover everyone, including those who do not want to touch any of their perfectly-ok-and-running-machines. If I had any say in it, I'd make XP the base requirements, period; unfortunately, we have far too many people with production Windows 2000 machines for this to be feasible. Thank you for your help. I'll need to further contemplate how backwards compatible we care to--or can--be.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]
-
I'm doing C# work, not drivers so it's not as bad, but there've been more than a few places where I've been burned by win32 changes. Two that I recall are the behavior of a listbox if you click in the empty area below the last item, and that NT4 doesn't correctly display 32bit color depth icons. The customer this software is for has never moved past 2k to XP (claimed not to be able to turn off some XP services that tried doing auto updates when on isolated networks). We think, but aren't sure that all the NT4 boxes are finally gone, and that the next rev of the software (whenever that is) can be 2k only.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall
dan neely wrote:
I'm doing C# work, not drivers
Thats worse. The kernel never changes that much, 95% of todays kernel api on Windows 7 is just the same as NT4 (its probably the same as NT 3 but I didnt start writing drivers till NT4). The only new bit is PnP and power stuff, and in fact an NT4 driver can still run on Vista etc. They are also all written in C. By comparison, having new apis / languages thrust on you every time the latest catchword technology hits the streets, COM, Java, .Net etc, many of which end up dying after 5 or 10 years wasting all the effort one invested as a career move. Give me the kernel anyday.
Morality is indistinguishable from social proscription
-
Anyone not using a tried and tested service pack for an OS is a dick anyway so just tell them feature 'X' isnt available unless they do.
Morality is indistinguishable from social proscription
I'm pretty sure they wouldn't take to kindly to that :) Like I mentioned before, if I had my druthers, they'd all be forced to use XP SP3, no exception. Unfortunately, the reality is that this will not happen, and there is no reason for them to update the old machines, in their minds, since none of the boxes face the outside world. It will slowly happen, however, as they retire old hardware: so I'll just bide my time.
Regards, -B "[F]reedom isn't a licence, it's responsibility." [David Gerrold, Author's Note in "The Man Who Folded Himself", 2003, p. 119]