NWRegisterNCPExtensionByID

Registers a service to be provided as an NCP Extension and assigns the NCP Extension a specific ID

Local Servers:blocking
Remote Servers:N/A
NetWare Server:3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM
Service:NCP Extension

Syntax

  #include <nlm\nwncpx.h>  
   
  int NWRegisterNCPExtensionByID  (  
     LONG          NCPExtensionID,   
     const char  *NCPExtensionName,   
     BYTE       (*NCPExtensionHandler)(  
        NCPExtensionClient   *NCPExtensionClient,   
        void                * requestData,   
        LONG                 requestDataLen,   
        void                * replyData,   
        LONG                *replyDataLen),  
     void       (*ConnectionEventHandler)(  
        LONG   connection,   
        LONG   eventType)  
     void        (*ReplyBufferManager)(  
        NCPExtensionClient   *NCPExtensionClient,   
        void                * replyBuffer),  
     BYTE        majorVersion,   
     BYTE        minorVersion,   
     BYTE        revision,   
     void      **queryData);
  

Parameters

NCPExtensionID
(IN) Specifies the unique ID to be associated with your service for the NCP Extension (assigned by Developer Support).
NCPExtensionName
(IN) Points to the name to identify the NCP Extension.
NCPExtensionHandler
(IN) Points to the function to be called when the NCP Extension calls the NWSendNCPExtensionRequest or NWSendNCPExtensionFraggedRequest function (optional).
ConnectionEventHandler
(IN) Points to the function to be called and steps to follow when a connection is freed, killed, logged out, or restarted (optional).
ReplyBufferManager
(IN) Points to a buffer manager function used to reply to NCP Extension requests (optional).
majorVersion
(IN) Specifies the major version number of the service provider.
minorVersion
(IN) Specifies the minor version number of the service provider.
revision
(IN) Specifies the revision number of the service provider.
queryData
(OUT) Points to a 32-byte area that NetWare has allocated.

Return Values

The following table lists return values and descriptions.

Value

Hex

Name and description

0

0x00

SUCCESSFUL The extension was found, and the non-null output parameters were filled.

5

0x05

ENOMEM Not enough memory was available on the server to register the service.

166

0xA6

ERR_ALREADY_IN_USE The NCP Extension name is already registered. Your service is not registered.

251

0xFB

ERR_UNKNOWN_REQUEST The server version does not support this request.

255

0xFF

ERR_BAD_PARAMETER The NCPExtensionName parameter is longer than the 32-byte limit.

Remarks

NWRegisterNCPExtensionByID is called by the service-providing NLM applications in conjunction with NWDeRegisterNCPExtension and NWRegisterNCPExtension.

NCP extension names are case sensitive and must be unique. They have a maximum length of 32 bytes plus a NULL terminator.

For an explanation of the NCPExtensionHandler, ConnectionEventHandler, and ReplyBufferManager parameters, see the Remarks section for NWRegisterNCPExtension.

The queryData parameter can be used by the service provider to return up to 32 bytes of information to the client and is aligned on a DWORD (32-bit) boundary. This information can then be retrieved by calling NWGetNCPExtensionInfo (NLM), NWGetNCPExtensionInfoByID, or NWScanNCPExtensions (NLM). The queryData parameter is also used by the registering NLM as the NCP extension handle when NWDeRegisterNCPExtension is called.

NOTE:The NCPExtensionHandler, ConnectionEventHandler, and ReplyBufferManager parameters are function callbacks that run as OS threads. They need to have CLIB context if they are going to make calls into CLIB that need context.

See Also

GetThreadContextSpecifier (NDK: NLM Threads Management), NWDeRegisterNCPExtension, NWRegisterNCPExtension, SetThreadContextSpecifier (NDK: NLM Threads Management)