From ad04c037323fe0712bfaaeeb28b38eb2ed6560a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 26 Dec 2005 15:25:47 +0000 Subject: [PATCH] Fix usage of DI_NOVCP flag svn path=/trunk/; revision=20336 --- reactos/lib/setupapi/devinst.c | 30 +----------------------------- reactos/lib/setupapi/install.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/reactos/lib/setupapi/devinst.c b/reactos/lib/setupapi/devinst.c index f7711abbc03..ea9543427b2 100644 --- a/reactos/lib/setupapi/devinst.c +++ b/reactos/lib/setupapi/devinst.c @@ -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; diff --git a/reactos/lib/setupapi/install.c b/reactos/lib/setupapi/install.c index 933ff976b13..d6404c9d3dd 100644 --- a/reactos/lib/setupapi/install.c +++ b/reactos/lib/setupapi/install.c @@ -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)