[DEVMGR] Add the code to uninstall a device from the property page

This commit is contained in:
Eric Kohl 2019-08-04 11:18:42 +02:00
parent 5bbc2c6308
commit 7550e9efbf
27 changed files with 396 additions and 9 deletions

View file

@ -241,6 +241,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -245,6 +245,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,7 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Entfernen des Geräts bestätigen"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warnung: Sie sind dabei, das Gerät aus der Systemkonfiguration zu deinstalleren.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Abbrechen", IDCANCEL, 166, 100, 50, 14
END
/*
This code relates to the device manager GUI

View file

@ -242,6 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -240,6 +240,18 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*
This code relates to the device manager GUI

View file

@ -249,6 +249,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -247,6 +247,18 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*
This code relates to the device manager GUI

View file

@ -241,6 +241,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,6 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -241,6 +241,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,6 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,7 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -240,6 +240,18 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 9, "MS UI Gothic"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*
This code relates to the device manager GUI

View file

@ -242,7 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -250,7 +250,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,7 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,7 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -245,7 +245,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,6 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -245,6 +245,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -244,6 +244,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,6 +242,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -248,6 +248,17 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 8, "MS Shell Dlg"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*

View file

@ -242,6 +242,18 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 9, "宋体"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*
This code relates to the device manager GUI

View file

@ -242,6 +242,18 @@ BEGIN
LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX
END
IDD_UNINSTALLDRIVER DIALOGEX 0, 0, 224, 121
STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME
CAPTION "Confirm Device Removal"
FONT 9, "新細明體"
BEGIN
ICON "", IDC_DEVICON, 7, 7, 20, 20
LTEXT "", IDC_DEVNAME, 40, 9, 174, 16, SS_NOPREFIX
LTEXT "Warning: You are about to uninstall this device from your system.", -1, 7, 37, 204, 50
DEFPUSHBUTTON "OK", IDOK, 110, 100, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 100, 50, 14
END
/*
This code relates to the device manager GUI

View file

@ -429,6 +429,104 @@ DriverDetailsDlgProc(IN HWND hwndDlg,
}
static
INT_PTR
CALLBACK
UninstallDriverDlgProc(IN HWND hwndDlg,
IN UINT uMsg,
IN WPARAM wParam,
IN LPARAM lParam)
{
PDEVADVPROP_INFO dap;
INT_PTR Ret = FALSE;
dap = (PDEVADVPROP_INFO)GetWindowLongPtr(hwndDlg, DWLP_USER);
if (dap != NULL || uMsg == WM_INITDIALOG)
{
switch (uMsg)
{
case WM_INITDIALOG:
dap = (PDEVADVPROP_INFO)lParam;
if (dap != NULL)
{
SetWindowLongPtr(hwndDlg, DWLP_USER, (DWORD_PTR)dap);
/* Set the device image */
SendDlgItemMessage(hwndDlg,
IDC_DEVICON,
STM_SETICON,
(WPARAM)dap->hDevIcon,
0);
/* Set the device name */
SetDlgItemText(hwndDlg,
IDC_DEVNAME,
dap->szDevName);
}
Ret = TRUE;
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
EndDialog(hwndDlg, IDOK);
break;
case IDCANCEL:
EndDialog(hwndDlg, IDCANCEL);
break;
}
break;
case WM_CLOSE:
EndDialog(hwndDlg, IDCANCEL);
break;
}
}
return Ret;
}
static
VOID
UninstallDriver(
_In_ HWND hwndDlg,
_In_ PDEVADVPROP_INFO dap)
{
SP_REMOVEDEVICE_PARAMS RemoveDevParams;
if (DialogBoxParam(hDllInstance,
MAKEINTRESOURCE(IDD_UNINSTALLDRIVER),
hwndDlg,
UninstallDriverDlgProc,
(ULONG_PTR)dap) == IDCANCEL)
return;
RemoveDevParams.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
RemoveDevParams.ClassInstallHeader.InstallFunction = DIF_REMOVE;
RemoveDevParams.Scope = DI_REMOVEDEVICE_GLOBAL;
RemoveDevParams.HwProfile = 0;
SetupDiSetClassInstallParamsW(dap->DeviceInfoSet,
&dap->DeviceInfoData,
&RemoveDevParams.ClassInstallHeader,
sizeof(SP_REMOVEDEVICE_PARAMS));
SetupDiCallClassInstaller(DIF_REMOVE,
dap->DeviceInfoSet,
&dap->DeviceInfoData);
SetupDiSetClassInstallParamsW(dap->DeviceInfoSet,
&dap->DeviceInfoData,
NULL,
0);
}
static
VOID
UpdateDriver(
@ -500,6 +598,9 @@ UpdateDriverDlg(IN HWND hwndDlg,
{
HDEVINFO DeviceInfoSet;
PSP_DEVINFO_DATA DeviceInfoData;
DWORD dwStatus = 0;
DWORD dwProblem = 0;
CONFIGRET cr;
if (dap->CurrentDeviceInfoSet != INVALID_HANDLE_VALUE)
{
@ -556,6 +657,19 @@ UpdateDriverDlg(IN HWND hwndDlg,
IDC_DRVVERSION,
dap->szTemp);
}
/* Disable the Uninstall button if the driver cannot be removed */
cr = CM_Get_DevNode_Status_Ex(&dwStatus,
&dwProblem,
dap->DeviceInfoData.DevInst,
0,
dap->hMachine);
if (cr == CR_SUCCESS)
{
if ((dwStatus & DN_ROOT_ENUMERATED) != 0 &&
(dwStatus & DN_DISABLEABLE) == 0)
EnableWindow(GetDlgItem(hwndDlg, IDC_UNINSTALLDRIVER), FALSE);
}
}
@ -596,7 +710,7 @@ AdvProcDriverDlgProc(IN HWND hwndDlg,
break;
case IDC_UNINSTALLDRIVER:
// FIXME
UninstallDriver(hwndDlg, dap);
break;
}
break;
@ -624,7 +738,6 @@ AdvProcDriverDlgProc(IN HWND hwndDlg,
dap);
}
EnableWindow(GetDlgItem(hwndDlg, IDC_ROLLBACKDRIVER), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_UNINSTALLDRIVER), FALSE);
Ret = TRUE;
break;
}

View file

@ -217,6 +217,7 @@
#define IDD_DRIVERDETAILS 0x404
#define IDD_DEVICEDETAILS 0x405
#define IDD_DEVICEPOWER 0x406
#define IDD_UNINSTALLDRIVER 0x407
#define IDC_DEVICON 0x57B
#define IDC_DEVNAME 0x57C