I am assigned to join a OEM project recently.
Target platform has 4 chips driven by same drivers.
So, all labels in the driver that we can check using Device Manager are almost identical.
How can I write a program to enable/disable those drivers without manual mouse control?
Answer is to use the devcon.exe from Windows Driver Development Kit (WDK) from: http://support.microsoft.com/kb/311272/zh-tw
In my case, the few different items between four drivers is the "Device Instance Path".
For example,
PCI\VEN_1AF2&DEV_A001&SUBSYS_A0011AF2&REV_00\
4&2D325CF4&0&00E3
PCI\VEN_1AF2&DEV_A001&SUBSYS_A0011AF2&REV_00\
4&30419C1C&0&00E5
Checking the "Hardware IDs" and "Device Instance IDs" chapters in "WDK documentation",
you will find some definitions about which part called hardware ID and instance ID.
At the same time, type "devcon.exe help enable" in the cmd.exe to look how to use devcon.
Finally, in my case:
I use "devcon.exe enable @*00e3" (or use disable) to control driver with the batch file.
PS. this tool is only workable in Windows enrivonment, not under pure DOS.
沒有留言:
張貼留言