NWScanNCPExtensions (NLM)

Iteratively returns information about all registered NCP extensions

Local Servers:nonblocking
Remote Servers:blocking
NetWare Server:4.x, 5.x, 6.x
Platform:NLM
Service:NCP Extension

Syntax

  #include <nlm\nwncpx.h>  
   
  int NWScanNCPExtensions  (  
     LONG  *NCPExtensionID,   
     char  *NCPExtensionName,   
     BYTE  *majorVersion,   
     BYTE  *minorVersion,   
     BYTE  *revision,   
     void  *queryData);
  

Parameters

NCPExtensionID
(IN/OUT) Points to the ID of the desired NCP Extension.
NCPExtensionName
(OUT) Points to the name of the NCP Extension that was found.
majorVersion
(OUT) Points to the major version number of the NCP Extension provider (optional).
minorVersion
(OUT) Points to the minor version number of the NCP Extension provider (optional).
revision
(OUT) Points to the revision number of the NCP Extension provider (optional).
queryData
(OUT) Points to 32 bytes of information from the NCP Extension service provider and allocated when the NLM calls the NWRegisterNCPExtension function (optional).

Return Values

The following table lists return values and descriptions.

0

SUCCESSFUL: Extension was found and non-NULL output parameters were filled

-1

No more NCP Extensions were found

1-16

An NCP error occurred (see niterror.h)

Remarks

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:

  • See if the NCP Extension is registered.
  • Check the version of the NCP Extension.
  • Get the NCP Extension ID number to call NWSendNCPExtensionRequest.
  • Receive 32 bytes of information from the NCP Extension without calling the NWSendNCPExtensionRequest function.

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.

See Also

NWDeRegisterNCPExtension, NWGetNCPExtensionInfo (NLM), NWRegisterNCPExtension, NWSendNCPExtensionRequest