INtime SDK Help
ntxImportRtHandle
INtime SDK v7 > About INtime > INtime Kernel > Object Directories > ntxImportRtHandle

Obtains an NTXHANDLE that corresponds to an RTHANDLE. See Handle conversion.

NTXHANDLE ntxImportRtHandle(
    RTHANDLE IncomingObject,
    NTXHANDLE hObjectSource
);

Parameters

IncomingObject
RTHANDLE in question.
hObjectSource
NTXHANDLE of the object from which IncomingObject was obtained. For example, if the RTHANDLE was stored in an address space, then pass that address space's NTXHANDLE in hObjectSource.

Return Values

A new NTXHANDLE referring to the same RT object as the RTHANDLE.
Success.
NTX_BAD_NTXHANDLE
Failure. To determine the status, call ntxGetLastRtError.

Status

E_EXIST 0x0006
IncomingObject or hObjectSource does not contain a valid handle.
E_LOCATION
The location of hObjectSource cannot be determined or is invalid.

Example

// Receive the RTHANDLE via a mail box operation
int cnt = ntxReceiveRtData(hMailBoxA,pMessage,dwWait);

// Convert the received RTHANDLE into an NTXHANDLE
NTXHANDLE retMbx = ntxImportRtHandle(pMessage, hMailBoxA);
if( NTX_TYPE_MAILBOX != ntxGetType(retMbx)) PrintError;
ntxSendRtData(retMbx,&ret,sizeof(ret));

Note

Object directories and object mailboxes are converted automatically. This call is provided to convert an RTHANDLE passed as data into an NTXHANDLE. See ntxReceiveRtHandle using an Object Mailbox as an alternative.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/nt/include/ntx.h ntx.h ntx.lib
INtime 4.01 (for 64-bit Windows) intime/nt/include/ntx.h ntx.h ntx64.lib
   
See Also