NWGetNCPExtensionInfo (NLM)
Returns information about an NCP Extension specified by name
#include <nlm\nwncpx.h>
int NWGetNCPExtensionInfo (
const char *NCPExtensionName,
LONG *NCPExtensionID,
BYTE *majorVersion,
BYTE *minorVersion,
BYTE *revision,
void *queryData);
The following table lists return values and descriptions.
NWGetNCPExtensionInfo (NLM), the NWScanNCPExtensions (NLM) function, and the NWSendNCPExtensionRequest function access NCP Extensions. For example, if you know the name of the NCP Extension you want to access, such as "ECHO SERVER," you can call NWGetNCPExtensionInfo (NLM) for the following purposes:
Before a client can access an NCP Extension, NWGetNCPExtensionInfo (NLM) must be called to see if the Extension has been registered followed by calling the NWScanNCPExtensions (NLM) function to receive the Extension ID needed to call the NCP Extension. If the NCP Extension has been registered, NWGetNCPExtensionInfo (NLM) returns SUCCESSFUL; otherwise, it returns ERR_NO_ITEMS_FOUND. The NWScanNCPExtensions (NLM) function returns the same information but must be called iteratively until the NCP Extension name is found.
The NCPExtensionName parameter can be any character string, up to 32 bytes plus a NULL terminator. The NCP Extension names are case sensitive and must be unique for each NCP Extension. One suggestion is to name the NCP Extension the same as your NLM. To avoid naming conflicts, you should clear your NCP Extension’s name through Developer Support.
You provide the majorVersion, minorVersion, and revision parameters when you call the NWRegisterNCPExtension function. If you have different versions or revisions of the NCP Extension, the client can use these parameters to verify that the extension is the correct version. If you do not want to use any of these parameters, pass NULL.
The server side and the client side of NCP Extensions should be implemented as matched sets so the client side knows what the server side is expecting and what it can return. The client side also needs to know the name of the NCP Extension.
There are some cases where NWGetNCPExtensionInfo (NLM) can return all of the information your client needs, eliminating the need to call the NWSendNCPExtensionRequest function or to have an NCP Extension handler. This information is placed in the client’s queryData buffer, whose address is passed as a parameter to NWGetNCPExtensionInfo (NLM).
Use this method if the service-providing NLM is periodically updating its queryData buffer (with 32 bytes or less of information) and the buffer address was returned to the NLM when it called the NWRegisterNCPExtension function. If the information you want is in the NLM’s queryData buffer, call NWGetNCPExtensionInfo (NLM) to copy the contents of the queryData buffer for the service-providing NLM into the queryData buffer for the client. This method is useful only if a one-way server-to-client message is sufficient.
If you are using the queryData buffer, pass NULL to the queryData parameter.
NOTE:If an NLM is unloaded, all NCP Extensions associated with it are deregistered. If the NLM is reloaded, its NCP Extensions do not have the same NCP Extension IDs, even though they have the same names.
If any of the client (NLM or workstation) NCP Extension functions return ERR_NO_ITEMS_FOUND (or ERR_NCPEXT_NO_HANDLER after previously working properly), call the NCPGetExtensionInfo function again. The NCPGetExtensionInfo function will return the new NCPExtensionID parameter if the NCP Extension has been deregistered and then reregistered.