SetupDiAskForOEMDisk function

The SetupDiAskForOEMDisk function displays a dialog that asks the user for the path of an OEM installation disk.


  HDEVINFO         DeviceInfoSet,



A handle to a device information set for the local computer. This set contains a device information element that represents the device that is being installed.


A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet. This parameter is optional and can be NULL. If this parameter is specified, SetupDiAskForOEMDisk associates the driver with the device that is being installed. If this parameter is NULL, SetupDiAskForOEMDisk associates the driver with the global class driver list for DeviceInfoSet.

Return Value

The function returns TRUE if it is successful and the DriverPath field of the SP_DEVINSTALLPARAMS structure is updated to reflect the new path. If the user cancels the dialog, the function returns FALSE and a call to GetLastError returns ERROR_CANCELLED.


SetupDiAskForOEMDisk allows the user to browse local and network drives for OEM installation files. However, SetupDiAskForOEMDisk is primarily designed to obtain the path of an OEM driver on a local computer before selecting and installing the driver for a device on that computer.

Although this function will not fail if the device information set if for a remote computer, the result is of limited use because the device information set cannot subsequently be used with DIF_Xxx installation requests or SetupDiXxx functions that do not support operations on a remote computer.

In particular, the device information set cannot be used as input with a DIF_SELECTDEVICE installation request to select a driver for a device, followed by a DIF_INSTALLDEVICE installation request to install a device on a remote computer.


Windows version Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Desktop
Header setupapi.h (include Setupapi.h)
Library Setupapi.lib
DLL Setupapi.dll

See Also