NWGetNCPExtensionInfoByID

Returns information about an NCP Extension specified by ID

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

Syntax

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

Parameters

NCPExtensionID
(IN) Specifies the ID of the desired NCP Extension.
NCPExtensionName
(OUT) Points to the name of NCP Extension associated with the ID passed in the NCPExtensionID parameter (optional).
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 (optional).

Return Values

The following table lists return values and descriptions.

Value

Hex

Name and description

0

0x00

SUCCESSFUL The extension was found, and the non-null output parameters were filled.

255

0xFF

ERR_NO_ITEMS_FOUND The extension name was not found.

1-16

 

A communications error occurred. (See niterror.h.)

Remarks

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:

  • To see if the NCP Extension is registered.
  • To verify the name of the NCP Extension.
  • To check the version of the NCP Extension handler.
  • To receive 32 bytes of information from the NCP Extension without calling the NWSendNCPExtensionRequest function.

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.

See Also

NWDeRegisterNCPExtension, NWGetNCPExtensionInfo (NLM), NWRegisterNCPExtension, NWScanNCPExtensions (NLM), NWSendNCPExtensionRequest