INtime SDK Help
ntxLookupNtxHandle(INtimeDotNet)
INtime SDK v6 > About INtime > Alternate APIs > INtimeDotNet > ntxLookupNtxHandle(INtimeDotNet)

Searches the given process's object directory for a given name and, if found, returns the object handle. The calling thread can wait for the object to be cataloged if not present at the time of the call.

Use ntxLookupNtxHandle to get an object's handle so a thread can access the object. You specify the handle of the process whose object directory you want to search, the name of the object, and the amount of time the thread can wait. If the object is not cataloged, the thread goes to sleep by waiting for the specified time or until the name is cataloged, whichever comes first.

Visual Basic:

Function ntxLookupNtxhandle(
  ByVal hRtProcess As Integer,
  ByVal lpszName As String,
  ByVal dwMilliseconds As Integer)
As Integer

Visual C#:

Int32 ntxLookupNtxhandle (
  Int32 hRtProcess,
  String lpszName,
  Int32 dwMilliseconds);

Parameters

hRtProcess
Handle to the RT process whose directory will be examined.
lpszName
String that contains the name.
dwMilliseconds
The number of milliseconds the calling thread waits:
NTX_NO_WAIT The thread does not wait.
NTX_INFINITE The thread waits for its request to be fully satisfied.
Any positive integer Calling thread goes to sleep for this many milliseconds, after which it awakes.

Note: The kernel converts milliseconds to high-level ticks.

Return Values

The handle associated with the specified name.

INtimeException Status

E_TIME
One of these is true:
  • No object was available during the waiting period specified in dwMilliseconds.
  • The thread was not willing to wait, and the entry indicated by lpszName is not in the specified object directory.
E_LIMIT
The specified object directory is full and the object being looked up is not yet cataloged.
E_CONTEXT
The specified process has an object directory of size 0 (zero).
E_EXIST
At least one of these is true:
  • hRtProcess (if not a null selector) is not a handle for an existing object.
  • The name was found, but the cataloged object has a null handle.
E_TYPE
The process parameter is not a handle for a process.
E_PARAM
lpszName contains a string with a length of 0 (zero) or greater than 12.
E_BAD_ADDR
The pointer to lpszName is invalid.
E_NTX_INTERNAL_ERROR
The DLL could not contact the RT kernel to complete the request.

Requirements

Versions Reference
INtime 3.0 INtimeDotNet

See Also

INtimeDotNet system calls, Object directory system calls