28 6月 2010

how to enable/disable drivers that with identical friendly names.

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.

19 6月 2010

something had remembered

也許是最近開始push自己紀錄生活 所以花比較多的時間看別人的blog、網路上的文章
想著這邊 那邊的差異

很多東西 剛看到的瞬間忍不住點頭 或心頭裡有句 "對 我也是這麼想的.."
可能記性不好吧 許多諸如此類的文字 感動 都無法一直記在腦裡

早上賴床時在想 如果每個人都有個習慣 把自己感動的片段文字記錄下來
也許50 100篇Blog 可以很快的讓人知道 你我的相似度

生活、職場、朋友間 有太多應付 或表面的東西 心裡偶而覺得 一種米養百種人
從認識到了解 從了解到認識 或許網路的抽想空間 可以顛倒一些既有的生活方式


昨晚睡覺前 本期商周網站的一篇 當超業好?還是主管好? 有這麼一段:

16 6月 2010

comparing is necessary

不管是最近的代工案子、或是無意間逛到的good blog
都深深覺得comparison不是壞事
有比較才知道自己的不足 看過別人的好 學起來 才會更好...

接觸到部門以外的事務 才知道其實我們還是很有一套制度的
免強可以算是比上不足比下有餘吧
雖然產品走向、銷售方面還有很大進步空間 但至少哪個phase該做到哪些事情
也都沒少過
嗯...我們算挺扎實的

接觸到真正好的blog 才知道什麼樣的版面讓人舒服閱讀 雖然沒有標準的逗點符號
仍然可以這麼棒
排版、照片、內容、流暢的敘述 都可以在這個棒球blog看到

模仿了他的blog寫法 不加逗點 挺有趣的
雖然還是沒啥料 只是寫下心情