Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 5428 of file cdrom.c.
Referenced by CdRomDeviceControl(), and CdRomDeviceControlDispatch().
{ PDEVICE_EXTENSION deviceExtension = DeviceObject->DeviceExtension; PIRP irp; IO_STATUS_BLOCK ioStatus; KEVENT event; NTSTATUS status; PSUB_Q_CURRENT_POSITION currentBuffer; if (!PLAY_ACTIVE(deviceExtension)) { return(FALSE); } currentBuffer = ExAllocatePool(NonPagedPoolCacheAligned, sizeof(SUB_Q_CURRENT_POSITION)); if (currentBuffer == NULL) { return(FALSE); } ((PCDROM_SUB_Q_DATA_FORMAT) currentBuffer)->Format = IOCTL_CDROM_CURRENT_POSITION; ((PCDROM_SUB_Q_DATA_FORMAT) currentBuffer)->Track = 0; // // Create notification event object to be used to signal the // request completion. // KeInitializeEvent(&event, NotificationEvent, FALSE); // // Build the synchronous request to be sent to the port driver // to perform the request. // irp = IoBuildDeviceIoControlRequest(IOCTL_CDROM_READ_Q_CHANNEL, deviceExtension->DeviceObject, currentBuffer, sizeof(CDROM_SUB_Q_DATA_FORMAT), currentBuffer, sizeof(SUB_Q_CURRENT_POSITION), FALSE, &event, &ioStatus); if (irp == NULL) { ExFreePool(currentBuffer); return FALSE; } // // Pass request to port driver and wait for request to complete. // status = IoCallDriver(deviceExtension->DeviceObject, irp); if (status == STATUS_PENDING) { KeWaitForSingleObject(&event, Suspended, KernelMode, FALSE, NULL); status = ioStatus.Status; } if (!NT_SUCCESS(status)) { ExFreePool(currentBuffer); return FALSE; } ExFreePool(currentBuffer); return(PLAY_ACTIVE(deviceExtension)); }