// *** SETUP FOR COMPLETION CALL ***
// -----------------------------------------------------------
// static array of original completion routine struct contents
sSavedStorageCompletion[mStorageCompletionIndex] = completion;
// save off IOMemoryDescriptor* from original read-call args
sIOMDBuffers[mStorageCompletionIndex] = buffer;
// substitute local completion address into struct
completion.action = MyStorageCompletion; // call here when done
completion.target = (void*) this; // pass in ptr to this obj
completion.parameter = (void*)(mStorageCompletionIndex); // index to
saved data
mStorageCompletionIndex++; // maintain index for use with next
call
if( mStorageCompletionIndex >= kIOStorageCompletionMax)
mStorageCompletionIndex = 0;
If you don't do this part under a lock, you aren't thread-safe...
-- Chris
------------------
6 Infinite Loop
M/S 306-2MS
Cupertino CA 95014
phone: (408) 974-4033
fax: (408) 862-7577
email: email@hidden