Determining Device Driver Resource Usage
Most device drivers have an .inf file that contains all of the resources needed for the device driver. When you import the .inf file into Component Designer, the file goes through a conversion process, and the resources are included in the resulting components.
However, there are times when it is useful or necessary to capture driver installation information, and there are times when an .inf file is not available. When this is the case, you must determine the driver's exact use of resources such as binary files, dynamic link libraries (DLLs), and registry keys.
Note Some PnP drivers must be configured on a built or deployed run-time image. Typically this involves changing default configuration parameters in the registry, and can be accomplished through the API.
To determine device driver resource usage
- On a computer running Microsoft® Windows® XP Professional, install a resource-monitoring tool distributed by Microsoft or a third party.
For information about third-party tools, see Third-Party Tools for Windows XP Embedded in the MSDN Library.
- Use the resource-monitoring tool to capture the device driver installation information.
For example, Microsoft provides the following tools:
- The Windows operating system resource kit tool APIMon can monitor all Win32 API calls that belong to an application. You can scan its output for calls that access the registry and the file system.
- The Installation Monitor resource kit tool can show the difference between registry snapshots before and after you run a process like a setup application.
- Microsoft Visual Studio® includes a tool called Depends that can report on the DLLs used by an executable. This tool examines the portable executable (PE) header and reports on all DLLs that have been linked into the executable using import libraries.
- In your registry, search for the driver name and locate its PnPID and Service information.
Typically, PnPIDs can be found under HKLM\System\ControlSet001\Control\Class\, and Services can be found under HKLM\System\ControlSet001\Service\.
- Locate a similar device driver in the component database and review its resource set.
- Determine whether required files are included in other components or already included in your configuration.
- In Target Designer, create a filter that uses the "component contains the following file [filelist]" rule and use the filter to search the component database. If components are not found, consider lowering the Target Designer visibility threshold to 100 or 200.
- View the files in the components in your configuration. One method for doing this is to build your configuration and then search for the files in the build output folder, typically \Windows Embedded Images\.
- If the required files, registry entries, or other resources are included in other components, add those components to your configuration. Otherwise, add the required files, registry entries, and other resources to your component.
- If you add other components to your configuration to satisfy the requirements of your component, you must make your component dependent on those other components. Follow these steps:
- Add the components to your configuration.
- Build the configuration.
- Test the run-time image to ensure that everything functions properly.
- After you ensure that everything functions properly, open your component .sld file by using Component Designer, and in the definition of your component, add component or group dependencies upon the other components.
© 2006 Microsoft Corporation. All rights reserved.