<?xml version="1.0" standalone="yes"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlackFeather'S Blog-获取设备管理器的信息 - VC</title><link>http://www.fenlog.com/post/110.html</link><generator>RainbowSoft Studio Z-Blog 2.2 Prism Build 140101</generator><language>zh-CN</language><pubDate>Fri, 13 Feb 2015 12:11:43 +0800</pubDate><item><title>Re:获取设备管理器的信息 - VC</title><author>bf</author><link>http://www.fenlog.com/post/110.html#cmt4197</link><pubDate>Wed, 05 Jul 2017 19:29:20 +0800</pubDate><guid>http://www.fenlog.com/post/110.html#cmt4197</guid><description><![CDATA[// 获取设备实例ID  <br/>        if (SetupDiGetDeviceInstanceId(hDevInfo, &amp;amp;DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, NULL))  <br/>        {  <br/>            // 从设备实例ID中提取VID和PID  <br/>            TCHAR* pVidIndex = _tcsstr(DeviceInstanceId, TEXT(&amp;quot;VID_&amp;quot;));  <br/>            if (pVidIndex == NULL) continue;  <br/>  <br/>            TCHAR* pPidIndex = _tcsstr(pVidIndex + 4, TEXT(&amp;quot;PID_&amp;quot;));  <br/>            if (pPidIndex == NULL) continue;  <br/>  <br/>            USHORT VendorID = _tcstoul(pVidIndex + 4, NULL, 16);  <br/>            USHORT ProductID = _tcstoul(pPidIndex + 4, NULL, 16);  <br/>  <br/>            // 剔除重复的VID和PID  <br/>            if (!WDK_isExistVidPid( VendorID, ProductID, pVidPid, iTotal ))  <br/>            {  <br/>                pVidPid[iTotal].VendorID = VendorID;  <br/>                pVidPid[iTotal].ProductID = ProductID;  <br/>                if (++iTotal &amp;gt;= iCapacity) break;  <br/>            }  <br/>        }  ]]></description></item></channel></rss>
