Author: janderwald
Date: Sat Dec 8 19:17:35 2012
New Revision: 57825
URL:
http://svn.reactos.org/svn/reactos?rev=57825&view=rev
Log:
[HIDCLASS]
- Handle device initialization errors
CORE-6575
Modified:
trunk/reactos/drivers/hid/hidclass/fdo.c
Modified: trunk/reactos/drivers/hid/hidclass/fdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/fdo.c…
==============================================================================
--- trunk/reactos/drivers/hid/hidclass/fdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidclass/fdo.c [iso-8859-1] Sat Dec 8 19:17:35 2012
@@ -350,7 +350,13 @@
// query capabilities
//
Status = HidClassFDO_QueryCapabilities(DeviceObject,
&FDODeviceExtension->Capabilities);
- ASSERT(Status == STATUS_SUCCESS);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("[HIDCLASS] Failed to retrieve capabilities %x\n", Status);
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
//
// lets start the lower device too
@@ -369,13 +375,25 @@
// lets get the descriptors
//
Status = HidClassFDO_GetDescriptors(DeviceObject);
- ASSERT(Status == STATUS_SUCCESS);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("[HIDCLASS] Failed to retrieve the descriptors %x\n", Status);
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
//
// now get the the collection description
//
Status = HidP_GetCollectionDescription(FDODeviceExtension->ReportDescriptor,
FDODeviceExtension->HidDescriptor.DescriptorList[0].wReportLength, NonPagedPool,
&FDODeviceExtension->Common.DeviceDescription);
- ASSERT(Status == STATUS_SUCCESS);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("[HIDCLASS] Failed to retrieve the collection description
%x\n", Status);
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return Status;
+ }
//
// complete request