NCPX_GetObjectName(3xti_ncp)


NCPX_GetObjectName -- returns the distinguished name of a logged-in object

Synopsis

#include <ncpx_app.h> 

int NCPX_GetObjectName(LONG connectionNumber, char *nameBuf, nt bufLen);

Description

NCPX_GetObjectName returns the name of the object logged-in at the given connection slot. It translates a connection number into the name of the object logged-in on the connection. This provides NCPX handlers with a means of identifying the client for which a request is being processed.

The connectionNumber parameter allows the handler to ``look up'' the distinguished name of the object logged-in on the connection. If the given connectionNumber is invalid, 0xFD is returned. Otherwise, NCPX_GetObjectName fills in the nameBuf and returns zero.

If the connection isn't logged in, the returned name is an empty string.

If there is an error building the name, the returned name is also an empty string.

Parameters

(IN) connectionNumber
The number of the connection slot where the object is logged-in.

(OUT) nameBuf
Passes a pointer to the buffer where the object's name will be stored.

(IN) bufLen
Size (in bytes) of the nameBuf.

Return values

0
SUCCESSFUL

0xFD
UNSUCCESSFUL: bad station number (connection)

Examples

   BYTE 
   NCPCallback(NCPExtensionClient *client, 
           void *requestData, 
           LONG requestDataLength, 
           void *replyData, 
           LONG *replyDataLength) 
   { 
       char buffer[ 256]; 
   

if ( NCPX_GetObjectName( client->connection, buffer, 256) == 0) printf("Object name is '%s'\n", buffer); else printf("Object not LOGGED IN.\n"); return 0; }


30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.