Fix usage of DI_NOVCP flag

svn path=/trunk/; revision=20336
This commit is contained in:
Hervé Poussineau 2005-12-26 15:25:47 +00:00
parent 5531d9e68d
commit ad04c03732
2 changed files with 15 additions and 34 deletions

View file

@ -7369,34 +7369,6 @@ InfIsFromOEMLocation(
return TRUE;
}
static UINT WINAPI
NullInstallMsgHandler(
IN PVOID Context,
UINT Notification,
UINT_PTR Param1,
UINT_PTR Param2)
{
switch (Notification)
{
case SPFILENOTIFY_STARTQUEUE: return TRUE;
case SPFILENOTIFY_ENDQUEUE: return 0;
case SPFILENOTIFY_STARTSUBQUEUE: return TRUE;
case SPFILENOTIFY_ENDSUBQUEUE: return 0;
case SPFILENOTIFY_STARTDELETE: return FILEOP_SKIP;
case SPFILENOTIFY_ENDDELETE: return 0;
case SPFILENOTIFY_STARTRENAME: return FILEOP_SKIP;
case SPFILENOTIFY_ENDRENAME: return 0;
case SPFILENOTIFY_STARTCOPY: return FILEOP_SKIP;
case SPFILENOTIFY_ENDCOPY: return 0;
case SPFILENOTIFY_NEEDMEDIA: return FILEOP_SKIP;
default:
FIXME("Notification %u params %p, %p\n", Notification, Param1, Param2 );
break;
}
return 0;
}
/***********************************************************************
* SetupDiInstallDevice (SETUPAPI.@)
*/
@ -7516,7 +7488,7 @@ SetupDiInstallDevice(
Result = SetupInstallFromInfSectionW(InstallParams.hwndParent,
SelectedDriver->InfFileDetails->hInf, SectionName,
DoAction, hKey, NULL, SP_COPY_NEWER,
InstallParams.Flags & (DI_NOFILECOPY | DI_NOVCP) ? NullInstallMsgHandler : SetupDefaultQueueCallback, Context,
SetupDefaultQueueCallback, Context,
DeviceInfoSet, DeviceInfoData);
if (!Result)
goto cleanup;

View file

@ -864,20 +864,29 @@ BOOL WINAPI SetupInstallFromInfSectionW( HWND owner, HINF hinf, PCWSTR section,
if (flags & SPINST_FILES)
{
SP_DEVINSTALL_PARAMS_W install_params;
struct files_callback_info info;
HSPFILEQ queue;
BOOL use_custom_queue;
BOOL ret;
if (!(queue = SetupOpenFileQueue())) return FALSE;
info.queue = queue;
install_params.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
use_custom_queue = SetupDiGetDeviceInstallParamsW(devinfo, devinfo_data, &install_params) && (install_params.Flags & DI_NOVCP);
if (!use_custom_queue && ((queue = SetupOpenFileQueue()) == (HSPFILEQ)INVALID_HANDLE_VALUE ))
return FALSE;
info.queue = use_custom_queue ? install_params.FileQueue : queue;
info.src_root = src_root;
info.copy_flags = copy_flags;
info.layout = hinf;
ret = (iterate_section_fields( hinf, section, CopyFiles, copy_files_callback, &info ) &&
iterate_section_fields( hinf, section, DelFiles, delete_files_callback, &info ) &&
iterate_section_fields( hinf, section, RenFiles, rename_files_callback, &info ) &&
SetupCommitFileQueueW( owner, queue, callback, context ));
SetupCloseFileQueue( queue );
iterate_section_fields( hinf, section, RenFiles, rename_files_callback, &info ));
if (!use_custom_queue)
{
if (ret)
ret = SetupCommitFileQueueW( owner, queue, callback, context );
SetupCloseFileQueue( queue );
}
if (!ret) return FALSE;
}
if (flags & SPINST_INIFILES)