Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 601540 Details for
Bug 842837
USBClerk: Winusb driver is not completely uninstalled when a USB device is disconnected from guest.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
usbclerk: uninstall inf file on driver removal
0002-usbclerk-uninstall-inf-file-on-driver-removal.patch (text/plain), 3.41 KB, created by
Arnon Gilboa
on 2012-07-31 14:59:51 UTC
(
hide
)
Description:
usbclerk: uninstall inf file on driver removal
Filename:
MIME Type:
Creator:
Arnon Gilboa
Created:
2012-07-31 14:59:51 UTC
Size:
3.41 KB
patch
obsolete
>From 9c25bb47502745dcc192738b682890aec4e387f8 Mon Sep 17 00:00:00 2001 >From: Arnon Gilboa <agilboa@redhat.com> >Date: Tue, 31 Jul 2012 17:56:50 +0300 >Subject: [PATCH v2 2/2] usbclerk: uninstall inf file on driver removal > >otherwise, in win7, winusb driver is reinstalled on the next devices rescan >rhbz#842837 >--- > usbclerk.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 45 insertions(+), 1 deletions(-) > >diff --git a/usbclerk.cpp b/usbclerk.cpp >index c2819bd..ae85468 100644 >--- a/usbclerk.cpp >+++ b/usbclerk.cpp >@@ -40,6 +40,7 @@ private: > bool dispatch_message(CHAR *buffer, DWORD bytes, USBClerkReply *reply); > bool install_winusb_driver(int vid, int pid); > bool remove_winusb_driver(int vid, int pid); >+ bool uninstall_inf(HDEVINFO devs, PSP_DEVINFO_DATA dev_info); > bool remove_dev(HDEVINFO devs, PSP_DEVINFO_DATA dev_info); > bool rescan(); > bool get_dev_info(HDEVINFO devs, int vid, int pid, SP_DEVINFO_DATA *dev_info, bool *has_winusb); >@@ -479,7 +480,9 @@ bool USBClerk::remove_winusb_driver(int vid, int pid) > if (get_dev_info(devs, vid, pid, &dev_info, &installed)) { > if (installed) { > vd_printf("Removing %04x:%04x", vid, pid); >- ret = remove_dev(devs, &dev_info); >+ if (uninstall_inf(devs, &dev_info)) { >+ ret = remove_dev(devs, &dev_info); >+ } > } else { > vd_printf("WinUSB driver is not installed"); > } >@@ -489,6 +492,47 @@ bool USBClerk::remove_winusb_driver(int vid, int pid) > return ret; > } > >+bool USBClerk::uninstall_inf(HDEVINFO devs, PSP_DEVINFO_DATA dev_info) >+{ >+ SP_DRVINFO_DATA drv_info; >+ SP_DRVINFO_DETAIL_DATA drv_info_detail; >+ SP_DEVINSTALL_PARAMS install_params = {0}; >+ TCHAR *inf_filename; >+ >+ install_params.cbSize = sizeof(SP_DEVINSTALL_PARAMS); >+ if (!SetupDiGetDeviceInstallParams(devs, dev_info, &install_params)) { >+ vd_printf("Failed to get device install params: %u", GetLastError()); >+ return false; >+ } >+ install_params.FlagsEx |= DI_FLAGSEX_INSTALLEDDRIVER; >+ if (!SetupDiSetDeviceInstallParams(devs, dev_info, &install_params)) { >+ vd_printf("Failed to set device install params: %u", GetLastError()); >+ return false; >+ } >+ if (!SetupDiBuildDriverInfoList(devs, dev_info, SPDIT_CLASSDRIVER)) { >+ vd_printf("Cannot build driver info list: %u", GetLastError()); >+ return false; >+ } >+ drv_info.cbSize = sizeof(SP_DRVINFO_DATA); >+ if (!SetupDiEnumDriverInfo(devs, dev_info, SPDIT_CLASSDRIVER, 0, &drv_info)) { >+ vd_printf("Failed to enumerate driver info: %u", GetLastError()); >+ return false; >+ } >+ drv_info_detail.cbSize = sizeof(drv_info_detail); >+ if (!SetupDiGetDriverInfoDetail(devs, dev_info, &drv_info, &drv_info_detail, >+ sizeof(drv_info_detail), NULL) && GetLastError() != ERROR_INSUFFICIENT_BUFFER) { >+ vd_printf("Cannot get driver info detail: %u", GetLastError()); >+ return false; >+ } >+ vd_printf("Uninstalling inf: %S", drv_info_detail.InfFileName); >+ inf_filename = wcsrchr(drv_info_detail.InfFileName, '\\') + 1; >+ if (!SetupUninstallOEMInf(inf_filename, SUOI_FORCEDELETE, NULL)) { >+ vd_printf("Failed to uninstall inf: %u", GetLastError()); >+ return false; >+ } >+ return true; >+} >+ > bool USBClerk::remove_dev(HDEVINFO devs, PSP_DEVINFO_DATA dev_info) > { > SP_REMOVEDEVICE_PARAMS rmd_params; >-- >1.7.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 842837
: 601540