Best Practices for Optimizing Device Drivers (Windows Embedded CE 6.0)
1/6/2010
You may need to optimize your device driver for size or speed.
The following list shows best practices for optimizing device drivers:
- Conserve RAM usage by specifying the XXX_PowerUp (Device Manager) and XXX_PowerDown (Device Manager) entry points as non-pageable, and specify the rest of the entry points as pageable. Some components are non-pageable because ActivateDeviceEx loaded them with LoadDriver to load the driver DLL in non-pageable RAM. Device drivers get loaded as non-pageable because their XXX_PowerUp and XXX_PowerDown functions cannot be pageable because they are called in a critical context.
Remove unused XXX_PowerUp and XXX_PowerDown functions from .def files and add DEVFLAGS_LOADLIBRARY flag to the Flags registry keys for the driver. If drivers do not do anything in their XXX_PowerUp and XXX_PowerDown functions, remove these functions and enable the driver to receive power notifications.
See Also
Other Resources
Best Practices for Developing a Device Driver
Notification Interface
Stream Interface Drivers