+ 20 pointer to buffer from RamFetch message
+ 24 amount of data written to the buffer
After receiving a RamFetch message, you should write data to the given buffer, using Wimp_TransferBlock, and then send back this message.
Since you cannot guarantee that the buffer offered is large enough for all your data, you should keep a record (across Wimp_Polls) of how much data has been transmitted so far.
If the number of bytes written doesn't fill the buffer, then this will be the last message in the dialogue: You should not expect a reply, sending it as a UserMessage.
If you do fill the buffer, then you should send this message as a UserMessage_Recorded and expect further RamFetch messages.
Possible responses from the data-loading task:
· It sends another RamFetch message (request more data).
· It doesn't reply (error reading data / transfer finished).
If this message returns unanswered as a UserMessage_Acknowledge, then you should abort the data transfer and report an error.
See PRM 3, page 256.
|
|
|