Function Name: Clone Fields

Definition

Duplicates the data in an SE_FIELDS structure by allocating memory for any internal pointers, then populating it with data from the input SE_FIELDS structure. This function avoids the problem associated with doing a member-wise copy of the structure as documented in the comments for the SE_GetFields() function.

IMPORTANT NOTE: The caller is responsible for calling SE_FreeFields() to free the internal pointers allocated within fields_out_ptr.

Returns

SE_DRM_SUCCESS - if valid parameters were passed in. In this case, memory is allocated for *fields_out_ptr (as well as for any dynamically allocated data within the structure), and it is populated with data copied from *fields_in_ptr.

SE_DRM_NULL_REQUIRED_PARAMETER - and *fields_out_ptr is left unaltered, if fields_out_ptr or fields_in_ptr was NULL.

SE_DRM_FAILURE - and *fields_out_ptr's tag is set to SE_NULL_TOKEN, if the API could not allocate the memory for the dynamically allocated memory it should refer to.

Prototype


extern SE_DRM_STATUS_CODE_ENUM
SE_CloneFields
(
SE_FIELDS_PTR fields_in_ptr, (notes)
SE_FIELDS *fields_out_ptr (notes)
);

Parameters Notes

fields_in_ptr

 the fields that are to be duplicated.

fields_out_ptr

 a pointer to an SE_FIELDS structure within memory managed by the
 caller.  Non-dynamically allocated fields in this structure will
 be directly populated with data from the input fields.  Dynamically
 allocated data will be allocated by this function, then copied from
 the input structure.

Prev: Clear Token Set. Next: Clone Property Data Value. Up:Index.