mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 13:33:32 +08:00
[UMPNPMGR] Implement PNP_SetDeviceProblem
CORE-17527
This commit is contained in:
parent
c0c431b0ee
commit
d5b20cb118
@ -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 New Issue
Block a user