Platform SDK: Hardware

SetupDiCreateDeviceInfoListEx

The SetupDiCreateDeviceInfoListEx function creates an empty device information set for a local or remote computer. This set can be associated with a class GUID.

HDEVINFO SetupDiCreateDeviceInfoListEx(
  CONST LPGUID ClassGuid, 
  HWND hwndParent, 
  PCTSTR MachineName,
  PVOID Reserved
);

Parameters

ClassGuid
[in] Optionally specifies the GUID of the setup class associated with this device information set. If this parameter is specified, only devices of this class can be included in this device information set.
hwndParent
[in] Optionally specifies a handle to the top-level window to use for any user interface related to actions not specific to a particular device.
MachineName
[in] Optionally specifies the name of the computer on the network. If this parameter is specified, the devices you add to this device information set must reside on the specified computer. If MachineName is NULL, the device information set is for local devices.
Reserved
Reserved; must be NULL.

Return Values

If the function succeeds, the return value is a handle to an empty device information set.

If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Remarks

To destroy the device information set when you have finished, call the SetupDiDestroyDeviceInfoList function.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Setupapi.h.
  Library: Use Setupapi.lib.

See Also

Device Management Overview, Device Management Functions, SetupDiDestroyDeviceInfoList