DWORD NPGetCaps( DWORD nIndex );
nIndex
Specifies the capability set that the caller is interested in.
Unlike all the other calls, this function does not return an error status. Instead, the nIndex parameter specifies a query, and that defines the type of value returned.
A few of the nIndex values cause a constant to be returned, but in most cases the nIndex parameter specifies which set of services are being queried, and the return value is a bit mask indicating which services in that set are supported. A zero value would indicate that none of the services in that set are supported. If NPGetCaps is called with values that the NP does not recognize, it must return zero. This is so that features can be safely added in future releases.
The symbols for the valid values of nIndex are listed below, together with the constants defining the bits in the returned mask. The values themselves are defined in the file Netspi.h.
WNNC_SPEC_VERSION
The high and low words of the return value contain the major and minor version numbers of the WinNet API specification to which the provider conforms.
For this version it should return the following:
WNNC_SPEC_VERSION51
WNNC_NET_TYPE
Returns a DWORD value: the high word contains the network type, and the low word may contain a subtype. The following Net Type values are assigned:
WNNC_NET_MSNET | |
WNNC_NET_LANMAN | |
WNNC_NET_NETWARE | |
WNNC_NET_VINES | |
WNNC_NET_10NET | |
WNNC_NET_LOCUS | |
WNNC_NET_SUN_PC_NFS | |
WNNC_NET_LANSTEP | |
WNNC_NET_9TILES | |
WNNC_NET_LANTASTIC | |
WNNC_NET_AS400 | |
WNNC_NET_FTP_NFS | |
WNNC_NET_PATHWORKS | |
WNNC_NET_LIFENET | |
WNNC_NET_POWERLAN |
Vendors working on new networks should register their network type values with Microsoft.
WNNC_DRIVER_VERSION
Returns the provider version number.
Note: to assist in common versioning conventions for providers, the following macro is provided:
#define WNNC_DRIVER(major,minor) (major*WNNC_DRIVER_MAJOR1 + minor*WNNC_DRIVER_MINOR1)
WNNC_USER
Returns a mask of: WNNC_USR_GETUSER
WNNC_CONNECTION
Returns a mask of:
WNNC_CON_ADDCONNECTION | |
WNNC_CON_CANCELCONNECTION | |
WNNC_CON_GETCONNECTIONS | |
WNNC_CON_GETPERFORMANCE | |
WNNC_CON_GETUNIVERSALNAME | |
WNNC_CON_FORMATCONNECTION |
WNNC_DIALOG
Returns a mask of:
WNNC_DLG_FORMATNETWORKNAME | |
WNNC_DLG_GETRESOURCEPARENT | |
WNNC_DLG_GETRESOURCEINFORMATION |
WNNC_ENUMERATION
Returns a mask of:
WNNC_ENUM_GLOBAL | |
WNNC_ENUM_LOCAL | |
WNNC_ENUM_CONTEXT |
If one or more of these values is set, then the NP must export and support NPOpenEnum, NPEnumResource, and NPCloseEnum.
WNNC_START
Returns a value to indicate if the provider is likely to start. MPR may call this function during its startup to determine the state of the provider. For example, when MPR is trying to restore persistent connections, and a provider is not responding, it will use this to determine if it should retry and how long. A provider should return WNNC_START_WONT if it knows it will not start (for example, if it is in some unrecoverable failure mode) so MPR will not retry. Otherwise, it should either return the estimated start time in number of milliseconds, or WNNC_START_UNKNOWN to mean it doesn't know. If WNNC_START_UNKNOWN is returned, MPR will use some default time-out. If it turns out the provider has started by the time this call is issued, it can return WNNC_START_DONE. A provider should return WNNC_START_INACTIVE if it cannot access the network at the moment, but may be able to in the future (such as when the PCMCIA net card is removed from the computer, or the computer is undocked, essentially when the client is unable to run a transport).
WNNC_START_WONT | |
WNNC_START_INACTIVE | |
WNNC_START_UNKNOWN | |
WNNC_START_DONE |
WNNC_RESOURCE
Returns a mask of bit values that indicate specific behaviors of the NP and its underlying network. These behaviors are used by the MPR to provide intelligent processing for the NP. For example, if a network does not support deviceless connections, the MPR knows how to select a local when making connections.
WNNC_RES_VALIDLOCALDEVICE
These values have the following meanings:
WNNC_RES_VALIDLOCALDEVICE means that the NP has restrictions upon valid local device names (for example, only supporting "LPT1" to "LPT3" when the Windows 95 printing system supports more printer numbers). The NP must export NPValidLocalDevice if it sets this value.
WNNC_AUTHENTICATION
Returns a mask of:
WNNC_AUTH_LOGON | |
WNNC_AUTH_LOGOFF | |
WNNC_AUTH_GETPOLICYPATH | |
WNNC_AUTH_GETHOMEDIRECTORY |