don't tell the user the device is working properly when the drivers aren't even installed
authorThomas Bluemel <thomas@reactsoft.com>
Thu, 1 Dec 2005 21:17:25 +0000 (21:17 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Thu, 1 Dec 2005 21:17:25 +0000 (21:17 +0000)
svn path=/trunk/; revision=19807

reactos/lib/devmgr/En.rc
reactos/lib/devmgr/advprop.c
reactos/lib/devmgr/misc.c
reactos/lib/devmgr/resource.h

index f17bd77..cc6c7af 100644 (file)
@@ -15,6 +15,7 @@ BEGIN
     IDS_ENABLEDEVICE "Use this device (enable)"
     IDS_DISABLEDEVICE "Do not use this device (disable)"
     IDS_UNKNOWNDEVICE "Unknown device"
+    IDS_NODRIVERLOADED "No drivers are installed for this device."
 END
 
 STRINGTABLE
index 0ccd63e..76c8c25 100644 (file)
@@ -30,8 +30,6 @@
 #define NDEBUG
 #include <debug.h>
 
-#define DPN_DEVICEUPDATE    (WM_USER + 0x1000)
-
 typedef INT_PTR (WINAPI *PPROPERTYSHEETW)(LPCPROPSHEETHEADERW);
 typedef HPROPSHEETPAGE (WINAPI *PCREATEPROPERTYSHEETPAGEW)(LPCPROPSHEETPAGEW);
 typedef BOOL (WINAPI *PDESTROYPROPERTYSHEETPAGE)(HPROPSHEETPAGE);
@@ -437,21 +435,18 @@ UpdateDevInfo(IN HWND hwndDlg,
     dap->CanDisable = FALSE;
     dap->DeviceEnabled = FALSE;
 
-    if (dap->DeviceInfoSet != INVALID_HANDLE_VALUE)
+    if (CanDisableDevice(dap->DeviceInfoData.DevInst,
+                         dap->hMachine,
+                         &bFlag))
     {
-        if (CanDisableDevice(dap->DeviceInfoData.DevInst,
-                             dap->hMachine,
-                             &bFlag))
-        {
-            dap->CanDisable = bFlag;
-        }
+        dap->CanDisable = bFlag;
+    }
 
-        if (IsDeviceEnabled(dap->DeviceInfoData.DevInst,
-                            dap->hMachine,
-                            &bFlag))
-        {
-            dap->DeviceEnabled = bFlag;
-        }
+    if (IsDeviceEnabled(dap->DeviceInfoData.DevInst,
+                        dap->hMachine,
+                        &bFlag))
+    {
+        dap->DeviceEnabled = bFlag;
     }
 
     /* enable/disable the device usage controls */
index af80aeb..2492ff9 100644 (file)
@@ -452,6 +452,11 @@ GetDeviceStatusString(IN DEVINST DevInst,
         szBuffer[0] = L'\0';
         if (ProblemNumber == 0)
         {
+            if (!(Status & DN_DRIVER_LOADED))
+            {
+                MessageId = IDS_NODRIVERLOADED;
+            }
+
             goto UnknownProblem;
         }
         else
index 7af977f..1fe15a4 100644 (file)
@@ -36,6 +36,7 @@
 #define IDS_ENABLEDEVICE       0x108
 #define IDS_DISABLEDEVICE      0x109
 #define IDS_UNKNOWNDEVICE      0x10A
+#define IDS_NODRIVERLOADED     0x10B
 
 #define IDS_DEV_NO_PROBLEM                     0x200
 #define IDS_DEV_NOT_CONFIGURED                 0x201