[SETUPAPI] CM_Locate_DevNode_ExW: The root device does not need to be validated

This commit is contained in:
Eric Kohl 2022-04-17 22:50:01 +02:00
parent ea3e4bb4cb
commit dde7e6e254

View file

@ -5948,6 +5948,19 @@ CM_Locate_DevNode_ExW(
if (pDeviceID != NULL && lstrlenW(pDeviceID) != 0)
{
lstrcpyW(DeviceIdBuffer, pDeviceID);
RpcTryExcept
{
/* Validate the device ID */
ret = PNP_ValidateDeviceInstance(BindingHandle,
DeviceIdBuffer,
ulFlags);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
ret = RpcStatusToCmStatus(RpcExceptionCode());
}
RpcEndExcept;
}
else
{
@ -5963,25 +5976,10 @@ CM_Locate_DevNode_ExW(
ret = RpcStatusToCmStatus(RpcExceptionCode());
}
RpcEndExcept;
if (ret != CR_SUCCESS)
return CR_FAILURE;
}
TRACE("DeviceIdBuffer: %s\n", debugstr_w(DeviceIdBuffer));
RpcTryExcept
{
/* Validate the device ID */
ret = PNP_ValidateDeviceInstance(BindingHandle,
DeviceIdBuffer,
ulFlags);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{
ret = RpcStatusToCmStatus(RpcExceptionCode());
}
RpcEndExcept;
if (ret == CR_SUCCESS)
{
*pdnDevInst = pSetupStringTableAddString(StringTable, DeviceIdBuffer, 1);