發表文章

目前顯示的是 8月, 2020的文章

開發 驅動程式 遇到的困難

一.無法安裝驅動程式  1.用 Devcon 安裝驅動時,顯示怪怪的 C:\Windows\system32> "C:\Program Files (x86)\Windows Kits\10\Tools\x64\devcon" install D:\Code\VS_Project\C\KMDFHelloWorld\Release\KMDFHelloWorld\KMDFHelloWorld.inf Root\KMDFHelloWorld Device node created. Install is complete when drivers are installed... Updating drivers for Root\KMDFHelloWorld from D:\Code\VS_Project\C\KMDFHelloWorld\Release\KMDFHelloWorld\KMDFHelloWorld.inf. devcon failed.   2.然後用 DriverView 檢查有沒有被載入到記憶體,結果沒有 以上是根據微軟2018年的官方文檔做的 :  https://docs.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/writing-a-very-small-kmdf--driver#feedback 上面寫說 devcon install <inf file> 後要接 hardware id , 而 hardware id 在 inf 檔 有寫 , 可是不管在 2019年以後 或 2019年以前 inf 檔 都沒有清楚的標明 hardware id 在哪 (2019年以前 跟 2019年以後 inf 檔 的格式不一樣) 。 所以我就依樣畫葫蘆的填 Root\KMDFHelloWorld。 後續:已經可以安裝驅動程式,只要在專案存放 .sys 檔 的目錄中對 .inf 檔 右鍵->安裝 就可以了。只不過我是在執行 >bcdedit /set loadoptions DDISABLE_INTEGRITY_CHECKS & bcdedit /set testsigning on 後安裝的。而且安裝完後並沒有被載入到記憶體
 驅動程式資源 1. 驅動程式是什麼? https://docs.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/what-is-a-driver-    2.什麼是 Hardware ID https://docs.microsoft.com/zh-tw/windows-hardware/drivers/install/hardware-ids   3. Before a driver is installed for a new device, the bus or hub driver to which the device is connected assigns a hardware identifier (ID) to the device. Windows uses hardware IDs to find the closest match between a device and a driver package that contains the driver for the device.   4. The USB hub driver notifies the Plug and Play (PnP) manager that a new device was detected. The PnP manager queries the hub driver for all of the device's hardware IDs. The hub driver can create multiple hardware IDs for the same device. 問題   1.一個 device 可不可以有多個 驅動程式?    2.在安裝完驅動程式後驅動程式是馬上被載入記憶體還是要等到重新開機以後? 注意事項 1. The following commands use the DevCon Find operation to display all legacy devices on the local computer. Because legacy devices do not have a hardware ID, you must s

編譯 Driver 時的問題 (Visaul Studio 2019) (WDK version 2004)

圖片
跳出錯誤依然可以編譯成功 (專案選 Kernel Mode Driver (KMDF))  錯誤清單:    輸出: 1>------ 已開始建置: 專案: KMDFHelloWorld, 組態: Release Win32 ------ 1>Building 'KMDFHelloWorld' with toolset 'WindowsKernelModeDriver10.0' and the 'Universal' target platform. 1>Stamping Release\KMDFHelloWorld.inf 1>Stamping [Version] section with DriverVer=08/31/2020,12.15.6.565 1>D:\Code\VS_Project\C\KMDFHelloWorld\KMDFHelloWorld.inf(5-5): warning 1324: [Version] section should specify PnpLockdown=1. 1>KMDFHelloWorld.vcxproj -> D:\Code\VS_Project\C\KMDFHelloWorld\Release\KMDFHelloWorld.sys 1>Driver is 'Universal'. 1>........................ 1>Signability test complete. 1> 1>Errors: 1>None 1> 1>Warnings: 1>None 1> 1>Catalog generation complete. 1>D:\Code\VS_Project\C\KMDFHelloWorld\Release\KMDFHelloWorld\kmdfhelloworld.cat 1>Done Adding Additional Store 1>Successfully signed: D:\Code\VS_Project\C\KMDFHelloWorld\Release\KMDFHelloWorld\kmdfhe

景觀

 景觀 1. 納米比亞 https://www.msn.com/zh-tw/lifestyle/travel/%E7%B5%B6%E7%BE%8E%E5%A4%9C%E6%99%AF/ss-AADYGVi?ocid=ems.071519.TwillightNamibia