Function Name: Clone Property Data Value

Definition

Duplicates the data in an SE_PROPERTY_DATA_VALUE structure by allocating memory for its internal pointers (if any are in use), then populating it with data from the input SE_PROPERTY_DATA_VALUE 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_FreePropertyDataValue() to free any internal pointers allocated within dest_ptr.

Returns

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

SE_DRM_NULL_REQUIRED_PARAMETER - and *dest_ptr is left unaltered, if dest_ptr or src_ptr was NULL.

SE_DRM_FAILURE - and dest_ptr->u.string_length is set to zero and dest_ptr->u.string_value is set to NULL, 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_ClonePropertyDataValue
(
constSE_PROPERTY_DATA_VALUE *src_ptr, (notes)
SE_PROPERTY_DATA_VALUE *dest_ptr (notes)
);

Parameters Notes

src_ptr

 the SE_PROPERTY_DATA_VALUE that is to be duplicated.

dest_ptr

 a pointer to an SE_PROPERTY_DATA_VALUE 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: Clone Fields. Next: Clone Security Info. Up:Index.