![](/img/trans.png)
[英]How to search a specific SD card and read from\write to it using Qt c++ on Windows?
[英]How to identify SD card reader from removable devices in c++ windows?
我想區分pen-drives
和SD card reader
,因為兩者都與Removable Devices
屬於同一類別。
我使用UINT GetDriveTypeA(lpRootPathName)
來了解設備類型,並從中找到設備的類別。
當GetDriveTypeA
function 的返回值為2
時,對應的設備為 REMOVABLE。
但接下來如何區分普通pen-drives
和SD card reader
,因為它們屬於同一類別。
有什么辦法可以做到這一點?
我會非常感謝你。
SetupDiGetDeviceRegistryPropertyA 將讓您領先,使用 SPDRP_DEVICEDESC 作為第三個參數:
SetupDiGetDeviceRegistryPropertyA(hDevInfo, DevInfoData, SPDRP_DEVICEDESC, &Data, (PBYTE)buf, sizeof(buf), &size);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.