Function Name: Clone Security Info

Definition

Duplicates the data in an SE_SECURITY_INFO structure by allocating memory for its internal pointers (if any are in use), then populating it with data from the input SE_SECURITY_INFO 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_FreeSecurityInfo() 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 the individual string fields are set as for the SE_DRM_FAILURE case of SE_CloneString(), if the API could not allocate the memory for any of the dynamically allocated memory it should refer to.

Prototype


extern SE_DRM_STATUS_CODE_ENUM
SE_CloneSecurityInfo
(
constSE_SECURITY_INFO *src_ptr, (notes)
SE_SECURITY_INFO *dest_ptr (notes)
);

Parameters Notes

src_ptr

 the SE_SECURITY_INFO that is to be duplicated.

dest_ptr

 a pointer to an SE_SECURITY_INFO 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 Property Data Value. Next: Clone String. Up:Index.