NWRegisterNCPExtensionByID
Registers a service to be provided as an NCP Extension and assigns the NCP Extension a specific ID
#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);
The following table lists return values and descriptions.
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.