NWScanNCPExtensions (NLM)
Iteratively returns information about all registered NCP extensions
#include <nlm\nwncpx.h>
int NWScanNCPExtensions (
LONG *NCPExtensionID,
char *NCPExtensionName,
BYTE *majorVersion,
BYTE *minorVersion,
BYTE *revision,
void *queryData);
The following table lists return values and descriptions.
NWScanNCPExtensions (NLM) can be used iteratively to return the names of all the NCP Extensions registered on the server being queried. To scan the complete list of NCP Extensions, set the NCPExtensionID parameter to BEGIN_SCAN_NCP_EXTENSIONS. When NWScanNCPExtensions (NLM) returns, the NCPExtensionID parameter will be set to the ID of the first NCP Extension in the list and will return SUCCESSFUL. Use the ID in the NCPExtensionID parameter as a seed value to find the next NCP Extension ID. Continue calling NWScanNCPExtensions (NLM), using the new IDs returned in the NCPExtensionID parameter, until you find the information you want or until -1 is returned.
Call NWScanNCPExtensions (NLM) when you want to list the names of the NCP Extensions but are not looking for the name of a specific extension. If you know the name of your NCP Extension, such as "My NCP Extension," you should call NWGetNCPExtensionInfo (NLM) to see if the extension is registered because NWGetNCPExtensionInfo (NLM) needs to be called only once.
Call NWScanNCPExtensions (NLM) to do the following:
The NCPExtensionName parameter should be set to a buffer that is MAX_NCP_EXTENSION_NAME_BYTES (33) bytes long. The returned name is case sensitive and unique for each NCP Extension.
NOTE:The IDs of NCP Extensions are not always consecutive numbers. Therefore, you should not assume that if you increment the value in the NCPExtensionID parameter by one that it is a valid NCP Extension ID.
The majorVersion, minorVersion, and revision parameters are assigned by the registering NLM when it calls NWRegisterNCPExtension. If you have different versions or revisions of the NCP Extension, use these fields to verify that the extension is of the correct version. If you do not want any of this information, pass NULL.
NWScanNCPExtensionInfo can return all of the information you need, eliminating the need to call NWSendNCPExtensionRequest. If all your information can be returned in the queryData parameter, obtain the buffer contents by calling NWGetNCPExtensionInfo (NLM). Receiving information this way does not call the NCP Extension handler and is useful only if a one-way server-to-client message is sufficient. If you do not need the information that is returned in the buffer, pass NULL.