--- trunk/reactos/lib/devmgr/misc.c 2005-12-01 23:14:30 UTC (rev 19820)
+++ trunk/reactos/lib/devmgr/misc.c 2005-12-01 23:28:34 UTC (rev 19821)
@@ -439,6 +439,7 @@
UINT MessageId = IDS_UNKNOWN;
BOOL Ret = FALSE;
+ szBuffer[0] = L'\0';
cr = CM_Get_DevNode_Status_Ex(&Status,
&ProblemNumber,
DevInst,
@@ -446,48 +447,58 @@
hMachine);
if (cr == CR_SUCCESS)
{
- if (ProblemNumber < sizeof(ProblemStringId) / sizeof(ProblemStringId[0]))
- MessageId = ProblemStringId[ProblemNumber];
+ if (Status & DN_HAS_PROBLEM)
+ {
+ if (ProblemNumber < sizeof(ProblemStringId) / sizeof(ProblemStringId[0]))
+ MessageId = ProblemStringId[ProblemNumber];
- szBuffer[0] = L'\0';
- if (ProblemNumber == 0)
- {
- if (!(Status & (DN_DRIVER_LOADED | DN_STARTED)))
+ if (ProblemNumber == 0)
{
- MessageId = IDS_NODRIVERLOADED;
+ goto GeneralMessage;
}
+ else
+ {
+ LPWSTR szProblem;
+ UINT StringIDs[] =
+ {
+ MessageId,
+ IDS_DEVCODE,
+ };
- goto GeneralProblem;
+ if (LoadAndFormatStringsCat(hDllInstance,
+ StringIDs,
+ sizeof(StringIDs) / sizeof(StringIDs[0]),
+ &szProblem,
+ ProblemNumber))
+ {
+ wcsncpy(szBuffer,
+ szProblem,
+ BufferSize - 1);
+ szBuffer[BufferSize - 1] = L'\0';
+
+ LocalFree((HLOCAL)szProblem);
+
+ Ret = TRUE;
+ }
+ }
}
else
{
- LPWSTR szProblem;
- UINT StringIDs[] =
+ if (!(Status & (DN_DRIVER_LOADED | DN_STARTED)))
{
- MessageId,
- IDS_DEVCODE,
- };
-
- if (LoadAndFormatStringsCat(hDllInstance,
- StringIDs,
- sizeof(StringIDs) / sizeof(StringIDs[0]),
- &szProblem,
- ProblemNumber))
+ MessageId = IDS_NODRIVERLOADED;
+ }
+ else
{
- wcsncpy(szBuffer,
- szProblem,
- BufferSize - 1);
- szBuffer[BufferSize - 1] = L'\0';
+ MessageId = IDS_DEV_NO_PROBLEM;
+ }
- LocalFree((HLOCAL)szProblem);
-
- Ret = TRUE;
- }
+ goto GeneralMessage;
}
}
else
{
-GeneralProblem:
+GeneralMessage:
if (LoadString(hDllInstance,
MessageId,
szBuffer,