mirror of
https://github.com/reactos/reactos.git
synced 2025-01-06 06:20:13 +00:00
[usb/usbehci]
- DeviceArrivalWorkItem: Check the device object returned from IoGetAttachedDeviceReference. if its the PDO, deref and return. - Pass upper attached device object pointer to the completion routine. - ArrivalNotificationCompletion: Dereference the upper attached device object before returning. svn path=/trunk/; revision=45023
This commit is contained in:
parent
f579412d32
commit
72ed9b6854
1 changed files with 9 additions and 1 deletions
|
@ -98,7 +98,9 @@ NTSTATUS
|
|||
NTAPI
|
||||
ArrivalNotificationCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID PContext)
|
||||
{
|
||||
PDEVICE_OBJECT PortDeviceObject = (PDEVICE_OBJECT) PContext;
|
||||
IoFreeIrp(Irp);
|
||||
ObDereferenceObject(PortDeviceObject);
|
||||
return STATUS_MORE_PROCESSING_REQUIRED;
|
||||
}
|
||||
|
||||
|
@ -120,6 +122,12 @@ DeviceArrivalWorkItem(PDEVICE_OBJECT DeviceObject, PVOID Context)
|
|||
return;
|
||||
}
|
||||
|
||||
if (PortDeviceObject == DeviceObject)
|
||||
{
|
||||
/* Piontless to send query relations to ourself */
|
||||
ObDereferenceObject(PortDeviceObject);
|
||||
}
|
||||
|
||||
Irp = IoAllocateIrp(PortDeviceObject->StackSize, FALSE);
|
||||
|
||||
if (!Irp)
|
||||
|
@ -129,7 +137,7 @@ DeviceArrivalWorkItem(PDEVICE_OBJECT DeviceObject, PVOID Context)
|
|||
|
||||
IoSetCompletionRoutine(Irp,
|
||||
(PIO_COMPLETION_ROUTINE)ArrivalNotificationCompletion,
|
||||
NULL,
|
||||
(PVOID) PortDeviceObject,
|
||||
TRUE,
|
||||
TRUE,
|
||||
TRUE);
|
||||
|
|
Loading…
Reference in a new issue