This SPI is used to open an enumeration of network resources or existing connections. It must be called to obtain a valid handle for enumeration.
DWORD NPOpenEnum (
DWORD dwScope,
DWORD dwType,
DWORD dwUsage,
LPNETRESOURCE lpNetResource,
LPHANDLE lphEnum
);
RESOURCE_CONNECTED | All currently connected resources. |
RESOURCE_GLOBALNET | All resources on the network. |
RESOURCE_CONTEXT | The resources associated with the user's current and default network context (used for a "My Network" view). |
RESOURCETYPE_DISK | All disk resources. |
RESOURCETYPE_PRINT | All print resources. |
If dwType is RESOURCETYPE_ANY, all types of resources are returned. If an NP does not have the capability to distinguish between print and disk resources at a level, it may return all resources. If RESOURCETYPE_ANY is set, then the MPR also sets RESOURCETYPE_DISK and RESOURCETYPE_PRINT, so that if the NP enumerates only for printers and disks, then it need only test for RESOURCETYPE_DISK, and RESOURCETYPE_PRINT. It need not explicitly test for RESOURCETYPE_ANY. |
RESOURCEUSAGE_CONNECTABLE | All connectable resources. |
RESOURCEUSAGE_CONTAINER | All container resources. |
RESOURCEUSAGE_ALL | All resources. |
WN_NOT_SUPPORTED | The provider does not support the type of enumeration being requested, or the specific network resource cannot be browsed. |
WN_NOT_CONTAINER | lpNetResource does not point to a container. |
WN_BAD_VALUE | Invalid dwScope or dwUsage or dwType, or bad combination of parameters is specified. |
WN_NO_NETWORK | The network is not present. |
WN_NOT_AUTHENTICATED | Authentication needs to occur before the network resource can be enumerated. |
WN_NOT_LOGGED_ON | Logon needs to occur before the network resource can be enumerated. |
WN_ACCESS_DENIED | The user is authenticated to the network where the enumeration is being attempted, but does not have sufficient permissions (access rights). |