setupapi: Implement SetupDiInstallDriverFiles().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e5346c5986
commit
1c25cc09b5
|
@ -3674,9 +3674,10 @@ BOOL WINAPI SetupDiCallClassInstaller(DI_FUNCTION function, HDEVINFO devinfo, SP
|
|||
return SetupDiSelectBestCompatDrv(devinfo, device_data);
|
||||
case DIF_REGISTER_COINSTALLERS:
|
||||
return SetupDiRegisterCoDeviceInstallers(devinfo, device_data);
|
||||
case DIF_INSTALLDEVICEFILES:
|
||||
return SetupDiInstallDriverFiles(devinfo, device_data);
|
||||
case DIF_FINISHINSTALL_ACTION:
|
||||
case DIF_INSTALLDEVICE:
|
||||
case DIF_INSTALLDEVICEFILES:
|
||||
case DIF_INSTALLINTERFACES:
|
||||
case DIF_PROPERTYCHANGE:
|
||||
case DIF_SELECTDEVICE:
|
||||
|
@ -4552,3 +4553,43 @@ BOOL WINAPI SetupDiSelectBestCompatDrv(HDEVINFO devinfo, SP_DEVINFO_DATA *device
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SetupDiInstallDriverFiles (SETUPAPI.@)
|
||||
*/
|
||||
BOOL WINAPI SetupDiInstallDriverFiles(HDEVINFO devinfo, SP_DEVINFO_DATA *device_data)
|
||||
{
|
||||
WCHAR section[LINE_LEN], section_ext[LINE_LEN];
|
||||
struct device *device;
|
||||
struct driver *driver;
|
||||
void *callback_ctx;
|
||||
INFCONTEXT ctx;
|
||||
HINF hinf;
|
||||
|
||||
TRACE("devinfo %p, device_data %p.\n", devinfo, device_data);
|
||||
|
||||
if (!(device = get_device(devinfo, device_data)))
|
||||
return FALSE;
|
||||
|
||||
if (!(driver = device->selected_driver))
|
||||
{
|
||||
ERR("No driver selected for device %p.\n", devinfo);
|
||||
SetLastError(ERROR_NO_DRIVER_SELECTED);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((hinf = SetupOpenInfFileW(driver->inf_path, NULL, INF_STYLE_WIN4, NULL)) == INVALID_HANDLE_VALUE)
|
||||
return FALSE;
|
||||
|
||||
SetupFindFirstLineW(hinf, driver->mfg_key, driver->description, &ctx);
|
||||
SetupGetStringFieldW(&ctx, 1, section, ARRAY_SIZE(section), NULL);
|
||||
SetupDiGetActualSectionToInstallW(hinf, section, section_ext, ARRAY_SIZE(section_ext), NULL, NULL);
|
||||
|
||||
callback_ctx = SetupInitDefaultQueueCallback(NULL);
|
||||
SetupInstallFromInfSectionW(NULL, hinf, section_ext, SPINST_FILES, NULL, NULL,
|
||||
SP_COPY_NEWER_ONLY, SetupDefaultQueueCallbackW, callback_ctx, NULL, NULL);
|
||||
SetupTermDefaultQueueCallback(callback_ctx);
|
||||
|
||||
SetupCloseInfFile(hinf);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -368,7 +368,7 @@
|
|||
@ stdcall SetupDiInstallClassW(long wstr long ptr)
|
||||
@ stub SetupDiInstallDevice
|
||||
@ stdcall SetupDiInstallDeviceInterfaces(ptr ptr)
|
||||
@ stub SetupDiInstallDriverFiles
|
||||
@ stdcall SetupDiInstallDriverFiles(ptr ptr)
|
||||
@ stdcall SetupDiLoadClassIcon(ptr ptr ptr)
|
||||
@ stub SetupDiMoveDuplicateDevice
|
||||
@ stdcall SetupDiOpenClassRegKey(ptr long)
|
||||
|
|
Loading…
Reference in New Issue