cwbOBJ_CopyObjHandle

Purpose

Creates a duplicate handle to an object. Use this API to get another handle to the same iSeries™ object. This new handle will be valid until the cwbOBJ_DeleteObjHandle() API has been called to release it.

Syntax

 
unsigned int CWB_ENTRY  cwbOBJ_CopyObjHandle(
                               cwbOBJ_ObjHandle   objectHandle,
                               cwbOBJ_ObjHandle  *newObjectHandle,
                               cwbSV_ErrHandle    errorHandle);

Parameters

cwbOBJ_ObjHandle objectHandle - input
Handle of the object to copy.
cwbOBJ_ObjHandle *newObjectHandle - output
Upon successful competition of this call, this handle will contain the new object handle.
cwbSV_ErrHandle errorHandle - output
Optional, may be 0. Any returned messages will be written to this object. It is created with the cwbSV_CreateErrHandle() API. The messages may be retrieved through the cwbSV_GetErrText() API. If the parameter is set to zero, no messages will be retrievable.

Return Codes

The following list shows common return values.

CWB_NO_ERROR
Successful completion.
CWB_NOT_ENOUGH_MEMORY
Insufficient memory.
CWB_INVALID_HANDLE
Handle is not an allocated object handle.

Usage

If you have a handle to an object in a list and wish to maintain a handle to that object after the list has been close this API allows you to do that. cwbOBJ_DeleteObjHandle() must be called to release resources for this handle.