[ros-diffs] [weiden] 19779: display "Unknown" as status when querying the device status failed

weiden at svn.reactos.com weiden at svn.reactos.com
Wed Nov 30 17:55:05 CET 2005


display "Unknown" as status when querying the device status failed
Modified: trunk/reactos/lib/devmgr/misc.c
  _____  

Modified: trunk/reactos/lib/devmgr/misc.c
--- trunk/reactos/lib/devmgr/misc.c	2005-11-30 16:52:41 UTC (rev
19778)
+++ trunk/reactos/lib/devmgr/misc.c	2005-11-30 16:54:54 UTC (rev
19779)
@@ -426,6 +426,7 @@

 {
     CONFIGRET cr;
     ULONG Status, ProblemNumber;
+    UINT MessageId = IDS_UNKNOWN;
     BOOL Ret = FALSE;
 
     if (hMachine != NULL)
@@ -446,23 +447,13 @@
 
     if (cr == CR_SUCCESS)
     {
-        UINT MessageId;
-
         if (ProblemNumber < sizeof(ProblemStringId) /
sizeof(ProblemStringId[0]))
             MessageId = ProblemStringId[ProblemNumber];
-        else
-            MessageId = IDS_UNKNOWN;
 
         szBuffer[0] = L'\0';
         if (ProblemNumber == 0)
         {
-            if (LoadString(hDllInstance,
-                           MessageId,
-                           szBuffer,
-                           BufferSize))
-            {
-                Ret = TRUE;
-            }
+            goto UnknownProblem;
         }
         else
         {
@@ -485,6 +476,17 @@
             }
         }
     }
+    else
+    {
+UnknownProblem:
+        if (LoadString(hDllInstance,
+                       MessageId,
+                       szBuffer,
+                       BufferSize))
+        {
+            Ret = TRUE;
+        }
+    }
 
     return Ret;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051130/8b9029e8/attachment.html


More information about the Ros-diffs mailing list