I am trying to understand the pros and 开发者_如何学运维cons of using DeactivateDevice vs. IOCTL_BUS_DEACTIVATE_CHILD, to unload a device driver, in terms of power consumption. If I would like to check the power consumption of the device when the driver was 1)loaded and 2)unloaded, which one would give me the most appropriate value in the latter case? Please suggest and let me know if I am missing any more info needed to answer my question. TIA.
EDIT: Also, it might be helpful in evaluating the answer for the above question if we know how the above two ways to unload a driver are fundamentally different.
It depends on what you want to do. IOCTL_BUS_ACTIVATE_CHILD
is for bus drivers only (USB, PCI, etc...). upper level client drivers will use ActivateDeviceEx
.
There is no equivalent wrapper function in the DDK for IOCTL_BUS_ACTIVATE_CHILD
.
see: http://blogs.msdn.com/b/ce_base/archive/2007/04/19/how-bus-drivers-work.aspx
You can also use SetDevicePower to change the power state of a given physical device. (like the WiFi, BT, screen, etc...)
-PaulH
精彩评论