mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:42:57 +00:00
display "Unknown" as status when querying the device status failed
svn path=/trunk/; revision=19779
This commit is contained in:
parent
8a98faad53
commit
c38f6ddcdc
1 changed files with 13 additions and 11 deletions
|
@ -426,6 +426,7 @@ GetDeviceStatusString(IN DEVINST DevInst,
|
||||||
{
|
{
|
||||||
CONFIGRET cr;
|
CONFIGRET cr;
|
||||||
ULONG Status, ProblemNumber;
|
ULONG Status, ProblemNumber;
|
||||||
|
UINT MessageId = IDS_UNKNOWN;
|
||||||
BOOL Ret = FALSE;
|
BOOL Ret = FALSE;
|
||||||
|
|
||||||
if (hMachine != NULL)
|
if (hMachine != NULL)
|
||||||
|
@ -446,23 +447,13 @@ GetDeviceStatusString(IN DEVINST DevInst,
|
||||||
|
|
||||||
if (cr == CR_SUCCESS)
|
if (cr == CR_SUCCESS)
|
||||||
{
|
{
|
||||||
UINT MessageId;
|
|
||||||
|
|
||||||
if (ProblemNumber < sizeof(ProblemStringId) / sizeof(ProblemStringId[0]))
|
if (ProblemNumber < sizeof(ProblemStringId) / sizeof(ProblemStringId[0]))
|
||||||
MessageId = ProblemStringId[ProblemNumber];
|
MessageId = ProblemStringId[ProblemNumber];
|
||||||
else
|
|
||||||
MessageId = IDS_UNKNOWN;
|
|
||||||
|
|
||||||
szBuffer[0] = L'\0';
|
szBuffer[0] = L'\0';
|
||||||
if (ProblemNumber == 0)
|
if (ProblemNumber == 0)
|
||||||
{
|
{
|
||||||
if (LoadString(hDllInstance,
|
goto UnknownProblem;
|
||||||
MessageId,
|
|
||||||
szBuffer,
|
|
||||||
BufferSize))
|
|
||||||
{
|
|
||||||
Ret = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -485,6 +476,17 @@ GetDeviceStatusString(IN DEVINST DevInst,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UnknownProblem:
|
||||||
|
if (LoadString(hDllInstance,
|
||||||
|
MessageId,
|
||||||
|
szBuffer,
|
||||||
|
BufferSize))
|
||||||
|
{
|
||||||
|
Ret = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Ret;
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue