NPOpenEnum function (npapi.h)
Opens an enumeration of network resources or existing connections. The NPOpenEnum function must be called to obtain a valid handle for an enumeration.
DWORD NPOpenEnum( DWORD dwScope, DWORD dwType, DWORD dwUsage, LPNETRESOURCEW lpNetResource, LPHANDLE lphEnum );
Determines the scope of the enumeration. This can be one of the following.
Specifies the type of resources of interest. This is a bitmask, which may be any combination of the following flags.
If dwType is 0, or is just RESOURCEUSAGE_ATTACHED, all types of resources are returned. If a provider does not have the capability to distinguish between print and disk resources at the same level, it may return all resources.
Specifies the usage of resources of interested. This is a bitmask, which may be any combination of the following flags.
||All connectable resources|
||All container resources|
The bitmask may be zero to match all of the flags. This parameter may be ignored if dwScope is not set to RESOURCE_GLOBALNET.
Pointer to the container to perform the enumeration. The NETRESOURCE could have been obtained through a previous NPEnumResource call, or constructed by the caller, or it can be NULL. If it is NULL or if the lpRemoteName field of the NETRESOURCE is NULL, the provider should enumerate the top level of its network. Note that this means a provider cannot use an lpRemoteName of NULL to represent any network resource. A caller would normally start off by calling NPOpenEnum with this parameter set to NULL and then use the returned results for further enumeration. If the calling program knows exactly the provider and remote path to enumerate from, it may build its own NETRESOURCE structure to pass in, filling in the lpProvider and lpRemoteName fields. Note that if dwScope is RESOURCE_CONNECTED or RESOURCE_CONTEXT, this parameter will be NULL.
If the function succeeds, it should return WN_SUCCESS. Otherwise, it should return an error code which may include one of the following.
||The provider does not support the type of enumeration being requested, or the specific network resource cannot be browsed.|
||lpNetResource does not point to a container.|
||Invalid dwScope, dwUsage, or dwType or bad combination of parameters is specified.|
||The network is not present.|
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|