Author: gedmurphy
Date: Mon Oct 19 08:45:48 2015
New Revision: 69614
URL:
http://svn.reactos.org/svn/reactos?rev=69614&view=rev
Log:
[DEVMGR]
- Implement updating the device from the toolbar
- Add a message before uninstalling a device. Dedicated to Jared Smudde.
Modified:
trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/D…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.cpp [iso-8859-1] Mon Oct 19 08:45:48
2015
@@ -271,7 +271,8 @@
case IDC_UPDATE_DRV:
{
- MessageBox(m_hMainWnd, L"Not yet implemented", L"Update
Driver", MB_OK);
+ bool NeedsReboot;
+ UpdateSelectedDevice(NeedsReboot);
break;
}
@@ -741,11 +742,41 @@
}
bool
-CDeviceView::UninstallSelectedDevice(
+CDeviceView::UpdateSelectedDevice(
+ _Out_ bool &NeedsReboot
)
{
CDeviceNode *Node = dynamic_cast<CDeviceNode *>(GetSelectedNode());
if (Node == nullptr) return false;
+
+ DWORD dwReboot;
+ if (InstallDevInst(m_hMainWnd, Node->GetDeviceId(), TRUE, &dwReboot))
+ {
+ NeedsReboot = false;
+ return true;
+ }
+
+ return false;
+}
+
+bool
+CDeviceView::UninstallSelectedDevice(
+ )
+{
+ CDeviceNode *Node = dynamic_cast<CDeviceNode *>(GetSelectedNode());
+ if (Node == nullptr) return false;
+
+ CAtlStringW str;
+ if (str.LoadStringW(g_hThisInstance, IDS_CONFIRM_UNINSTALL))
+ {
+ if (MessageBoxW(m_hMainWnd,
+ str,
+ Node->GetDisplayName(),
+ MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) != IDYES)
+ {
+ return false;
+ }
+ }
return Node->UninstallDevice();
}
Modified: trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgmt/D…
==============================================================================
--- trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/devmgr/devmgmt/DeviceView.h [iso-8859-1] Mon Oct 19 08:45:48
2015
@@ -115,6 +115,10 @@
_Out_ bool &NeedsReboot
);
+ bool UpdateSelectedDevice(
+ _Out_ bool &NeedsReboot
+ );
+
bool UninstallSelectedDevice(
);