Device Trails
by Zvi Gutteman and Avner Rosenan


Example 1:

// Get access to all USB devices on remote machine
HDEVINFO deviceClassInfo =   
    SetupDiGetClassDevsEx(NULL, "USB", 0, 
       DIGCF_ALLCLASSES,0, "192.168.24.81", NULL);                   
SP_DEVINFO_DATA     deviceData; 
char buffer[BUFFER_SIZE];
int index=0;
// Enumerate devices
while (SetupDiEnumDeviceInfo(deviceClassInfo,index,&deviceData))
{
   // Get device's Hardware ID into buffer. An example 
   //   for information that can be gathered
   SetupDiGetDeviceRegistryPropertyW(DeviceClassInfo, DeviceData, 
        SPDRP_HARDWAREID, &regType, buffer, BUFFER_SIZE, &size));
  // Gather more information about the device
  ExtractMoreInfo(DeviceClassInfo, deviceData);
  ++index;
}
1


