당신이 보일 것입니다 (없음이없는 것을 의미하지 않는다). 시도하면 그냥 결과 열거 모두 PCI 및 PCI-E 장치입니다.
PCI standard host CPU bridge PCI\VEN_1022&DEV_1400&SUBSYS_00000000&REV_00 PCI bus 0, device 24, function 0
PCI standard host CPU bridge PCI\VEN_1022&DEV_1401&SUBSYS_00000000&REV_00 PCI bus 0, device 24, function 1
PCI standard host CPU bridge PCI\VEN_1022&DEV_1402&SUBSYS_00000000&REV_00 PCI bus 0, device 24, function 2
PCI standard host CPU bridge PCI\VEN_1022&DEV_1403&SUBSYS_00000000&REV_00 PCI bus 0, device 24, function 3
PCI standard host CPU bridge PCI\VEN_1022&DEV_1404&SUBSYS_00000000&REV_00 PCI bus 0, device 24, function 4
PCI standard host CPU bridge PCI\VEN_1022&DEV_1405&SUBSYS_00000000&REV_00 PCI bus 0, device 24, function 5
PCI standard host CPU bridge PCI\VEN_1022&DEV_1410&SUBSYS_14101022&REV_00 PCI bus 0, device 0, function 0
PCI Express standard Root Port PCI\VEN_1022&DEV_1412&SUBSYS_12341022&REV_00 PCI bus 0, device 2, function 0
PCI Express standard Root Port PCI\VEN_1022&DEV_1414&SUBSYS_12341022&REV_00 PCI bus 0, device 4, function 0
PCI Express standard Root Port PCI\VEN_1022&DEV_1417&SUBSYS_12341022&REV_00 PCI bus 0, device 7, function 0
AMD IOMMU Device PCI\VEN_1022&DEV_1419&SUBSYS_14191022&REV_00 PCI bus 0, device 0, function 2
AMD SATA Controller PCI\VEN_1022&DEV_7801&SUBSYS_B0021458&REV_40 PCI bus 0, device 17, function 0
Standard OpenHCD USB Host Controller PCI\VEN_1022&DEV_7807&SUBSYS_50041458&REV_11 PCI bus 0, device 18, function 0
Standard OpenHCD USB Host Controller PCI\VEN_1022&DEV_7807&SUBSYS_50041458&REV_11 PCI bus 0, device 19, function 0
Standard Enhanced PCI to USB Host Controller PCI\VEN_1022&DEV_7808&SUBSYS_50041458&REV_11 PCI bus 0, device 18, function 2
Standard Enhanced PCI to USB Host Controller PCI\VEN_1022&DEV_7808&SUBSYS_50041458&REV_11 PCI bus 0, device 19, function 2
Standard OpenHCD USB Host Controller PCI\VEN_1022&DEV_7809&SUBSYS_50041458&REV_11 PCI bus 0, device 20, function 5
AMD SMBus PCI\VEN_1022&DEV_780B&SUBSYS_780B1022&REV_14 PCI bus 0, device 20, function 0
High Definition Audio Controller PCI\VEN_1022&DEV_780D&SUBSYS_A0021458&REV_01 PCI bus 0, device 20, function 2
PCI standard ISA bridge PCI\VEN_1022&DEV_780E&SUBSYS_780E1022&REV_11 PCI bus 0, device 20, function 3
PCI standard PCI-to-PCI bridge PCI\VEN_1022&DEV_780F&SUBSYS_00000000&REV_40 PCI bus 0, device 20, function 4
AMD USB 3.0 Host Controller PCI\VEN_1022&DEV_7812&SUBSYS_50041458&REV_03 PCI bus 0, device 16, function 0
AMD USB 3.0 Host Controller PCI\VEN_1022&DEV_7812&SUBSYS_50041458&REV_03 PCI bus 0, device 16, function 1
High Definition Audio Controller PCI\VEN_10DE&DEV_0BEE&SUBSYS_35371458&REV_A1 PCI bus 1, device 0, function 1
NVIDIA GeForce GTX 550 Ti PCI\VEN_10DE&DEV_1244&SUBSYS_35371458&REV_A1 PCI bus 1, device 0, function 0
Realtek PCIe GBE Family Controller PCI\VEN_10EC&DEV_8168&SUBSYS_E0001458&REV_06 PCI bus 2, device 0, function 0
MSI [email protected] Plus PCI\VEN_1131&DEV_7133&SUBSYS_62311462&REV_D1 PCI bus 4, device 6, function 0
Etron USB 3.0 Extensible Host Controller PCI\VEN_1B6F&DEV_7023&SUBSYS_50071458&REV_01 PCI bus 3, device 0, function 0
는 그냥 무시하십시오 "PCI"
문자열
여기
//---------------------------------------------------------------------------
//$$---- Form CPP ----
//---------------------------------------------------------------------------
#include <vcl.h>
#include <setupapi.h>
#pragma hdrstop
#include "win_main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMain *Main;
//---------------------------------------------------------------------------
bool USBinfo()
{
int i,n;
AnsiString s,txt="";
DWORD dwSize,dwPropertyRegDataType;
HDEVINFO hDevInfo;
SP_DEVINFO_DATA DeviceInfoData;
TCHAR szDesc[1024];
// hDevInfo = SetupDiGetClassDevs(NULL, NULL, NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES); // List all devices
// hDevInfo = SetupDiGetClassDevs(NULL, TEXT("USB"), NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES); // List all connected USB devices
hDevInfo = SetupDiGetClassDevs(NULL, TEXT("PCI"), NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES); // List all connected PCI devices
if (hDevInfo == INVALID_HANDLE_VALUE) return false;
// Find the ones that are driverless
for (i=0;;i++)
{
DeviceInfoData.cbSize = sizeof(DeviceInfoData);
if (!SetupDiEnumDeviceInfo(hDevInfo, i, &DeviceInfoData)) break;
SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData, SPDRP_DEVICEDESC,&dwPropertyRegDataType, (BYTE*)szDesc,sizeof(szDesc),&dwSize);
s=szDesc; n=48; while (s.Length()<n) s+=" "; if (s.Length()>n) s=s.SubString(1,n); txt+=s+" ";
SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData, SPDRP_HARDWAREID,&dwPropertyRegDataType, (BYTE*)szDesc,sizeof(szDesc),&dwSize);
s=szDesc; n=64; while (s.Length()<n) s+=" "; if (s.Length()>n) s=s.SubString(1,n); txt+=s+" ";
SetupDiGetDeviceRegistryProperty(hDevInfo, &DeviceInfoData, SPDRP_LOCATION_INFORMATION,&dwPropertyRegDataType, (BYTE*)szDesc,sizeof(szDesc),&dwSize);
s=szDesc; n=40; while (s.Length()<n) s+=" "; if (s.Length()>n) s=s.SubString(1,n); txt+=s+" ";
txt+="\r\n";
}
Main->mm_log->Lines->Add(txt);
return true;
}
//-------------------------------------------------------------------------
__fastcall TMain::TMain(TComponent* Owner) : TForm(Owner)
{
USBinfo();
}
//-------------------------------------------------------------------------
샘플 출력 : BDS2006 C++/VCL에서 내가 this을 사용하고 바로 경기 문자열을 변경하여 (나는 몇 시간 전에 체포) VCL 물건. 중요한 것은 USBinfo()
기능입니다 (예, 정보를 얻기 위해 사용합니다). 그것은 장치 관리자에서와 같은 모든 장치를 열거합니다.이 문자열은 사용자가 초기화하는 문자열과 일치합니다 (3 개의 유사한 행 2는 해결됩니다). AnsiString
은 문자열 클래스입니다 (요소는 [0]
대신 에서 액세스 함). DWORD
은 부호없는 32 비트 int입니다. Main->mm_log
은 단지 TMemo
이며 결과를 출력합니다. 당신의 Windows 장치 관리자에있는 모든 정보를 가져올 수 있습니다 인터페이스는 당신이 필요로하는 SPDRP_
속성을 (그들이 여기 setupapi.h
에 나와있는 사용 setupapi.h
포함하는 것을 잊지 마십시오 내 포함 된 내용이다 :
#define SPDRP_DEVICEDESC (0x00000000) // DeviceDesc (R/W)
#define SPDRP_HARDWAREID (0x00000001) // HardwareID (R/W)
#define SPDRP_COMPATIBLEIDS (0x00000002) // CompatibleIDs (R/W)
#define SPDRP_UNUSED0 (0x00000003) // unused
#define SPDRP_SERVICE (0x00000004) // Service (R/W)
#define SPDRP_UNUSED1 (0x00000005) // unused
#define SPDRP_UNUSED2 (0x00000006) // unused
#define SPDRP_CLASS (0x00000007) // Class (R--tied to ClassGUID)
#define SPDRP_CLASSGUID (0x00000008) // ClassGUID (R/W)
#define SPDRP_DRIVER (0x00000009) // Driver (R/W)
#define SPDRP_CONFIGFLAGS (0x0000000A) // ConfigFlags (R/W)
#define SPDRP_MFG (0x0000000B) // Mfg (R/W)
#define SPDRP_FRIENDLYNAME (0x0000000C) // FriendlyName (R/W)
#define SPDRP_LOCATION_INFORMATION (0x0000000D) // LocationInformation (R/W)
#define SPDRP_PHYSICAL_DEVICE_OBJECT_NAME (0x0000000E) // PhysicalDeviceObjectName (R)
#define SPDRP_CAPABILITIES (0x0000000F) // Capabilities (R)
#define SPDRP_UI_NUMBER (0x00000010) // UiNumber (R)
#define SPDRP_UPPERFILTERS (0x00000011) // UpperFilters (R/W)
#define SPDRP_LOWERFILTERS (0x00000012) // LowerFilters (R/W)
#define SPDRP_BUSTYPEGUID (0x00000013) // BusTypeGUID (R)
#define SPDRP_LEGACYBUSTYPE (0x00000014) // LegacyBusType (R)
#define SPDRP_BUSNUMBER (0x00000015) // BusNumber (R)
#define SPDRP_ENUMERATOR_NAME (0x00000016) // Enumerator Name (R)
#define SPDRP_SECURITY (0x00000017) // Security (R/W, binary form)
#define SPDRP_SECURITY_SDS (0x00000018) // Security (W, SDS form)
#define SPDRP_DEVTYPE (0x00000019) // Device Type (R/W)
#define SPDRP_EXCLUSIVE (0x0000001A) // Device is exclusive-access (R/W)
#define SPDRP_CHARACTERISTICS (0x0000001B) // Device Characteristics (R/W)
#define SPDRP_ADDRESS (0x0000001C) // Device Address (R)
#define SPDRP_UI_NUMBER_DESC_FORMAT (0X0000001D) // UiNumberDescFormat (R/W)
#define SPDRP_DEVICE_POWER_DATA (0x0000001E) // Device Power Data (R)
#define SPDRP_REMOVAL_POLICY (0x0000001F) // Removal Policy (R)
#define SPDRP_REMOVAL_POLICY_HW_DEFAULT (0x00000020) // Hardware Removal Policy (R)
#define SPDRP_REMOVAL_POLICY_OVERRIDE (0x00000021) // Removal Policy Override (RW)
#define SPDRP_INSTALL_STATE (0x00000022) // Device Install State (R)
#define SPDRP_LOCATION_PATHS (0x00000023) // Device Location Paths (R)
#define SPDRP_MAXIMUM_PROPERTY (0x00000024) // Upper bound on ordinals
//
// Class registry property codes
// (Codes marked as read-only (R) may only be used for
// SetupDiGetClassRegistryProperty)
//
// These values should cover the same set of registry properties
// as defined by the CM_CRP codes in cfgmgr32.h.
// they should also have a 1:1 correspondence with Device registers, where applicable
// but no overlap otherwise
//
#define SPCRP_SECURITY (0x00000017) // Security (R/W, binary form)
#define SPCRP_SECURITY_SDS (0x00000018) // Security (W, SDS form)
#define SPCRP_DEVTYPE (0x00000019) // Device Type (R/W)
#define SPCRP_EXCLUSIVE (0x0000001A) // Device is exclusive-access (R/W)
#define SPCRP_CHARACTERISTICS (0x0000001B) // Device Characteristics (R/W)
#define SPCRP_MAXIMUM_PROPERTY (0x0000001C) // Upper bound on ordinals
: 당신은 GPU의 정보를 수집으로
그러나 당신은 또한 OpenGL을 접근 방법을 시도 할 수도 있습니다
당신은 suppleted extentions 및 기능의 목록을 수집 할 수 있습니다 또한 파이프 라인의 번호와 같은 특정 GPU 정보, 질감 단위, 일부 무료 메모리에 대한 ...
왜 아래 표를? 그렇습니다. OP에는 현재의 시도에 대한 코드가 포함되어 있지 않지만 이는 여전히 관련 질문이라고 생각합니다. 그리고 낮은 투표자에게 투표를 내려서 변경이나 수리에 대한 의견이 없거나 적어도 잘못된 것은 내 의견으로는 쓸모가 없다. – Spektre