Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 531 of file utils.c.
Referenced by PciGetHotPlugParameters(), and PciIsSlotPresentInParentMethod().
{ PIRP Irp; NTSTATUS Status; KEVENT Event; IO_STATUS_BLOCK IoStatusBlock; PDEVICE_OBJECT AttachedDevice; PAGED_CODE(); /* Initialize the pending IRP event */ KeInitializeEvent(&Event, SynchronizationEvent, FALSE); /* Get a reference to the root PDO (ACPI) */ AttachedDevice = IoGetAttachedDeviceReference(DeviceObject); if (!AttachedDevice) return STATUS_INVALID_PARAMETER; /* Build the requested IOCTL IRP */ Irp = IoBuildDeviceIoControlRequest(IoControlCode, AttachedDevice, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength, 0, &Event, &IoStatusBlock); if (!Irp) return STATUS_INSUFFICIENT_RESOURCES; /* Send the IOCTL to the driver */ Status = IoCallDriver(AttachedDevice, Irp); if (Status == STATUS_PENDING) { /* Wait for a response */ KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); Status = Irp->IoStatus.Status; } /* Take away the reference we took and return the result to the caller */ ObDereferenceObject(AttachedDevice); return Status; }