All pastes #966693 Raw Edit

CopyPaste

public text v1 · immutable
·published 2008-04-01 22:24 UTC
rendered paste body
#include "windows.h"
#include "setupapi.h"


int main(){

    HDEVINFO        hDevInfo         = 0L;

    SP_DEVINFO_DATA spDevInfoData    = {0};

    short           wIndex           = 0;
    HANDLE          hHandle          = 0;


hDevInfo = SetupDiGetClassDevs(0L, 0L, hHandle, DIGCF_PRESENT |
                               DIGCF_ALLCLASSES | DIGCF_PROFILE);


    while(SetupDiEnumDeviceInfo(hDevInfo, wIndex, &spDevInfoData)){
	printf("Data1: %x Data2: %x Data3: %x", spDevInfoData.ClassGuid.Data1, spDevInfoData.ClassGuid.Data2, spDevInfoData.ClassGuid.Data2);
	wIndex++;
    }





	return 0;
}