January 19th 2020
Get an attachment contained to a managed scope, allocating it if necessary
the standard custom layer context pointer
the id of a scope to query
the id of the attachment to query
the expected size for the attachment, used to allocate memory when the attachment did not previously exist, used to check that the attachment is at least as large as expected if it already exists
a pointer to the base of the attachment when the scope exists and no error ocurred in checking the size of the attachment, zero otherwise
Attachments are allocated on a scopes base allocator, and thus are only valid for as long as the scope itself is valid. Whe in doubt, re-query for an attachment and recheck that the pointer returned is non-zero, as often calls between one usage and another can have an effect on the location or existence of an attachment.