Set up an asynchronous write
| 593 | |
| 594 | // Set up an asynchronous write |
| 595 | bool Xbox360Peripheral::QueueWrite(const void *bytes,UInt32 length) |
| 596 | { |
| 597 | IOBufferMemoryDescriptor *outBuffer; |
| 598 | IOUSBCompletion complete; |
| 599 | IOReturn err; |
| 600 | |
| 601 | outBuffer=IOBufferMemoryDescriptor::inTaskWithOptions(kernel_task,0,length); |
| 602 | if(outBuffer==NULL) { |
| 603 | IOLog("send - unable to allocate buffer\n"); |
| 604 | return false; |
| 605 | } |
| 606 | outBuffer->writeBytes(0,bytes,length); |
| 607 | complete.target=this; |
| 608 | complete.action=WriteCompleteInternal; |
| 609 | complete.parameter=outBuffer; |
| 610 | err=outPipe->Write(outBuffer,0,0,length,&complete); |
| 611 | if(err==kIOReturnSuccess) return true; |
| 612 | else { |
| 613 | IOLog("send - failed to start (0x%.8x)\n",err); |
| 614 | return false; |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | bool Xbox360Peripheral::willTerminate(IOService *provider, IOOptionBits options) |
| 619 | { |
no outgoing calls
no test coverage detected