NWDSMapNameToID

Returns the object ID for an eDirectory object on a specified server.

Local Servers:blocking
Remote Servers:blocking
NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98, Windows 2000, Windows XP
Library:Cross-Platform NDS (NET*.*)
Service:NDS

Syntax

C

  #include <nwnet.h> 
  or 
  #include <nwdsdsa.h> 
   
  N_EXTERN_LIBRARY (NWDSCCODE)  NWDSMapNameToID  ( 
     NWDSContextHandle   context,  
     NWCONN_HANDLE       connHandle,  
     pnstr8              object,  
     pnuint32            objectID); 
  

Pascal

  uses netwin32 
   
  Function NWDSMapNameToID 
    (context : NWDSContextHandle; 
     connHandle : NWCONN_HANDLE; 
     objectName : pnstr8; 
     objectID : pnuint32 
  ) : NWDSCCODE;
  

Parameters

context

(IN) Specifies the NDS context for the request.

connHandle

(IN) Specifies the connection handle for the target server.

object

(IN) Points to the eDirectory object name.

objectID

(OUT) Points to the object ID for the specified object.

Return Values

0x0000 0000

SUCCESSFUL

nonzero value

Nonzero values indicate errors. See NDS Return Values (–001 to –799).

Remarks

The returned ID can be used as input to older routines which require an objectID (for example, NWAddTrustee).

Since object IDs are unique only in relation to a particular server, the use of object IDs is restricted to the server from which they originate. An object ID returned by one server is meaningless to another server. Furthermore, a returned object ID may be valid only for a short period of time.

For these reasons, applications should not store object IDs locally. Rather, they should store the full name of an eDirectory object. (If an application needs a short-hand representation of an object, it should manage its own local name-to-ID mapping.)

The context parameter specifies a location within the eDirectory tree. The NWDSMapNameToID function is designed for local name conversion when the context parameter uses default values (see Section 5.7, Default Context Key Values). If the context has been set to nondefault values (such as not dereferencing aliases) with the NWDSSetContext function, the NWDSMapNameToID function should not be used. Instead, use the NWDSReadObjectDSIInfo and NWDSGetDSIInfo functions.

The connHandle parameter contains a server connection handle. It identifies the server from which the object ID is to be obtained.

The object parameter points to the name of the eDirectory object for which the ID is to be returned.

It is not necessary for the object to be defined in a partition replica stored on the target server. If the object is not stored on the server, the server generates a temporary reference to the object and returns the ID for reference to the client.

The objectID parameter points to the object ID of the specified name on the server identified by conn.

NCP Calls

See Also

NWDSMapIDToName