Corrected returned error code

This commit is contained in:
Benjamin Höglinger-Stelzer
2018-09-02 15:02:21 +02:00
parent a0e670dd59
commit d1d6face36

View File

@@ -608,6 +608,12 @@ NTSTATUS Xusb_GetUserIndex(WDFDEVICE Device, PXUSB_GET_USER_INDEX Request)
Request->UserIndex = (ULONG)userIndex;
status = STATUS_SUCCESS;
}
else
{
// If the index is negative at this stage, we've exceeded XUSER_MAX_COUNT
// and need to fail this request with a distinct status.
status = STATUS_INVALID_DEVICE_OBJECT_PARAMETER;
}
TraceEvents(TRACE_LEVEL_VERBOSE, TRACE_XUSB, "%!FUNC! Exit with status %!STATUS!", status);