Public Device Installation ...


Windows Driver Kit: Device Installation
SetupDiCreateDeviceInfoListEx

The SetupDiCreateDeviceInfoList function creates an empty device information set on a remote or a local computer and optionally associates the set with a device setup class .

HDEVINFO
  SetupDiCreateDeviceInfoListEx(
    IN LPGUID  ClassGuid..OPTIONAL,
    IN HWND  hwndParent..OPTIONAL,
    IN PCTSTR  MachineName..OPTIONAL,
    IN PVOID  Reserved
    );

Parameters

ClassGuid
A pointer to the GUID of the device setup class to associate with the newly created device information set. If this parameter is specified, only devices of this class can be included in this device information set. If this parameter is set to NULL, the device information set is not associated with a specific device setup class.
hwndParent
A handle to the top-level window to use for any user interface that is related to non-device-specific actions (such as a select-device dialog box that uses the global class driver list). This handle is optional and can be NULL. If a specific top-level window is not required, set hwndParent to NULL.

MachineName
A pointer to a NULL-terminated string that contains the name of a computer on a network. If a name is specified, only devices on that computer can be created and opened in this device information set. If this parameter is set to NULL, the device information set is for devices on the local computer.
Reserved
Must be NULL.

Return Value

The function returns a handle to an empty device information set if it is successful. Otherwise, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Comments

The caller of this function must delete the returned device information set when it is no longer needed by calling SetupDiDestroyDeviceInfoList.

If the device information set is for devices on a remote computer (MachineName is not NULL), all subsequent operations on this set or any of its elements must use routines that support device information sets with remote elements. The SetupDiXxx routines that do not provide this support, such as SetupDiCallClassInstaller, have a statement to that effect in their reference page.

Requirements

Versions: The SetupDiCreateDeviceInfoListEx function is available in Microsoft Windows 2000 and later versions of Windows.

Headers: Declared in Setupapi.h. Include Setupapi.h.

Library: Contained in Setupapi.lib. Link to Setupapi.lib.

See Also

SetupDiCreateDeviceInfoList, SetupDiDestroyDeviceInfoList, SetupDiGetDeviceInfoListDetail


Send feedback on this topic
Built on November 19, 2009
Page view tracker