The following structure is returned during enumeration of resources on the network, and during enumeration of currently connected resources.
typedef struct _NETRESOURCE {
DWORD dwScope;
DWORD dwType;
DWORD dwDisplayType;
DWORD dwUsage;
LPTSTR lpLocalName;
LPTSTR lpRemoteName;
LPTSTR lpComment;
LPTSTR lpProvider;
} NETRESOURCE, *LPNETRESOURCE;
RESOURCE_CONNECTED | A network resource that is currently connected. |
RESOURCE_GLOBALNET | A network resource (may or may not be connected). |
RESOURCE_CONTEXT | The resources associated with the user's current and default network context. |
RESOURCETYPE_DISK | |
RESOURCETYPE_PRINT | |
RESOURCETYPE_ANY |
The value RESOURCETYPE_ANY is used if the resource matches more than one (such as a container of both print and disk resources), or a resource which is neither print or disk.
RESOURCEDISPLAYTYPE_NETWORK | A network. |
RESOURCEDISPLAYTYPE_DOMAIN | A collection of servers. |
RESOURCEDISPLAYTYPE_SERVER | A server. |
RESOURCEDISPLAYTYPE_SHARE | A share point. |
RESOURCEDISPLAYTYPE_DIRECTORY | A directory. |
RESOURCEDISPLAYTYPE_GENERIC | Unspecified (for providers that don't know or don't care). |
In addition, an NP may register additional types by supporting the NPDisplayLayout function. In this case, the NP can supply additional values here. See the NPDisplayLayout function for more details about assigning display types.
The field is a bit mask which may contain any of the following:
RESOURCEUSAGE_CONNECTABLE | Can connect to resource by a call to NPAddConnection. If dwType is RESOURCETYPE_DISK, then, once the resource is connected to, the file APIs (such as FindFirstFile, FindNextFile) can be used to enumerate any files and directories contained within it. |
RESOURCEUSAGE_CONTAINER | Resource is a container for other resources that can be enumerated using the NPOpenEnum, NPEnumResource, and NPCloseEnum APIs. The resource may not currently contain any resources (for example, the first NPEnumResource call may return WN_NO_MORE_ENTRIES). |
RESOURCEUSAGE_NOLOCALDEVICE | Resource can be connected to without associating a local device (such as D: or LPT1). |
RESOURCEUSAGE_SIBLING | Resource is a sibling of the previous resource returned from the current enumeration (only set if dwScope is RESOURCE_CONTEXT, since resources are always siblings of each other if dwScope is RESOURCE_GLOBALNET). |