mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
[UMPNPMGR] Add checks to PNP_GetRelatedDeviceInstance
PNP_GetRelatedDeviceInstance must fail if we try to retrieve the parent or a sibling of the root device.
This commit is contained in:
parent
1744b01ad9
commit
7cc5163bfa
|
@ -781,6 +781,14 @@ PNP_GetRelatedDeviceInstance(
|
|||
if (!IsValidDeviceInstanceID(pDeviceID))
|
||||
return CR_INVALID_DEVINST;
|
||||
|
||||
/* The root device does not have a parent device or sibling devices */
|
||||
if ((ulRelationship == PNP_GET_PARENT_DEVICE_INSTANCE) ||
|
||||
(ulRelationship == PNP_GET_SIBLING_DEVICE_INSTANCE))
|
||||
{
|
||||
if (IsRootDeviceInstanceID(pDeviceID))
|
||||
return CR_NO_SUCH_DEVINST;
|
||||
}
|
||||
|
||||
RtlInitUnicodeString(&PlugPlayData.TargetDeviceInstance,
|
||||
pDeviceID);
|
||||
|
||||
|
|
Loading…
Reference in a new issue