mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[UMPNPMGR] Implement PNP_SetDeviceProblem
CORE-17527
This commit is contained in:
parent
c0c431b0ee
commit
d5b20cb118
1 changed files with 41 additions and 2 deletions
|
@ -3207,8 +3207,47 @@ PNP_SetDeviceProblem(
|
|||
DWORD ulProblem,
|
||||
DWORD ulFlags)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return CR_CALL_NOT_IMPLEMENTED;
|
||||
ULONG ulOldStatus, ulOldProblem;
|
||||
CONFIGRET ret = CR_SUCCESS;
|
||||
|
||||
UNREFERENCED_PARAMETER(hBinding);
|
||||
|
||||
DPRINT1("PNP_SetDeviceProblem(%p %S %lu 0x%08lx)\n",
|
||||
hBinding, pDeviceID, ulProblem, ulFlags);
|
||||
|
||||
if (ulFlags & ~CM_SET_DEVNODE_PROBLEM_BITS)
|
||||
return CR_INVALID_FLAG;
|
||||
|
||||
if (!IsValidDeviceInstanceID(pDeviceID))
|
||||
return CR_INVALID_DEVINST;
|
||||
|
||||
ret = GetDeviceStatus(pDeviceID,
|
||||
&ulOldStatus,
|
||||
&ulOldProblem);
|
||||
if (ret != CR_SUCCESS)
|
||||
return ret;
|
||||
|
||||
if (((ulFlags & CM_SET_DEVNODE_PROBLEM_OVERRIDE) == 0) &&
|
||||
(ulOldProblem != 0) &&
|
||||
(ulOldProblem != ulProblem))
|
||||
{
|
||||
return CR_FAILURE;
|
||||
}
|
||||
|
||||
if (ulProblem == 0)
|
||||
{
|
||||
ret = ClearDeviceStatus(pDeviceID,
|
||||
DN_HAS_PROBLEM,
|
||||
ulOldProblem);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = SetDeviceStatus(pDeviceID,
|
||||
DN_HAS_PROBLEM,
|
||||
ulProblem);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue