NWGetNCPExtensionInfoByID
Returns information about an NCP Extension specified by ID
#include <nlm\nwncpx.h>
int NWGetNCPExtensionInfoByID (
LONG NCPExtensionID,
char *NCPExtensionName,
BYTE *majorVersion,
BYTE *minorVersion,
BYTE *revision,
void *queryData);
The following table lists return values and descriptions.
The NWGetNCPExtensionInfo (NLM), NWGetNCPExtensionInfoByID, NWScanNCPExtensions (NLM), NWSendNCPExtensionFraggedRequest, and NWSendNCPExtensionRequest functions access NCP Extensions.
If you know the ID of the NCP Extension, you can call NWGetNCPExtensionInfoByID for the following purposes:
Before a client can access an NCP Extension, call either the NWGetNCPExtensionInfo (NLM), NWGetNCPExtensionInfoByID, or NWScanNCPExtensions (NLM) function to see if the extension has been registered. If the NCP Extension has been registered, NWGetNCPExtensionInfoByID returns SUCCESSFUL; otherwise, it returns ERR_NO_ITEMS_FOUND. The NWGetNCPExtensionInfo (NLM) and NWScanNCPExtensions (NLM) functions return the same information but they use the name of the NCP Extension, rather than the ID.
The NCPExtensionID parameter can be a dynamic ID returned from the NWGetNCPExtensionInfo (NLM) or NWScanNCPExtensions (NLM) function, or it can be a static ID assigned by Developer Support.
If you are using a static ID, check the name pointed to by the NCPExtensionName parameter (on the first call) to verify that the name returned is the same as the name of your NCP Extension.
The majorVersion, minorVersion, and revision parameters are those you provide when you call the NWRegisterNCPExtension or NWRegisterNCPExtensionByID function. If you have different versions or revisions of the NCP Extension service providers, the client can use these parameters to verify that the service provider is the correct version. If you do not want to use any of these parameters, pass NULL.
There are some cases where NWGetNCPExtensionInfoByID 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 NWGetNCPExtensionInfoByID.
Use this method if the service-providing NLM is periodically updating its queryData buffer (with 32 bytes or less of information) and whose address was returned to the NLM when it called NWRegisterNCPExtension or NWRegisterNCPExtensionByID. If the information you want is in the NLM’s queryData buffer, you can use NWGetNCPExtensionInfoByID 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, and it registers its NCP Extensions by calling NWRegisterNCPExtensionByID, the IDs for the extensions are the same.
If the NLM is reloaded, and it registers its NCP Extensions by name by calling the NWRegisterNCPExtension function, the 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 NWGetNCPExtensionInfo (NLM) function. The NWGetNCPExtensionInfo (NLM) function will return the new NCPExtensionID parameter if the NCP Extension has been deregistered and then reregistered.