Expand Minimize

SetupDiSetDeviceInterfaceDefault function

The SetupDiSetDeviceInterfaceDefault function sets a device interface as the default interface for a device interface class.

Syntax


BOOL SetupDiSetDeviceInterfaceDefault(
  _In_        HDEVINFO DeviceInfoSet,
  _Inout_     PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  _In_        DWORD Flags,
  _Reserved_  PVOID Reserved
);

Parameters

DeviceInfoSet [in]

A handle to the device information set that contains the device interface to set as the default for a device interface class.

DeviceInterfaceData [in, out]

A pointer to an SP_DEVICE_INTERFACE_DATA structure that specifies the device interface in DeviceInfoSet.

Flags [in]

Not used, must be zero.

Reserved

Reserved for future use, must be NULL.

Return value

The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.

Remarks

A caller must have Administrator privileges to set the default interface for a device interface class. However, if the requested default interface is the same as the currently set default interface, the function returns TRUE regardless of whether the caller has Administrator privileges.

If the function successfully sets the specified device interface as the default for the device class, it updates the Flags member of the supplied SP_DEVICE_INTERFACE_DATA structure.

Call SetupDiGetClassDevs to obtain a DevInfoSet handle to a device information set that contains the device interface to set as the default for a device interface class. To obtain the DeviceInterfaceData pointer to the device interface element, call SetupDiEnumDeviceInterfaces to enumerate the interfaces in the device information set. To retrieve information about an enumerated interface, call SetupDiGetDeviceInterfaceDetail.

Requirements

Version

Available in Windows XP and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

See also

SetupDiGetClassDevs
SetupDiEnumDeviceInterfaces
SetupDiGetDeviceInterfaceDetail

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft