typedef struct _NETRESOURCE { /* nr */
DWORD dwScope; /* enumeration scope */
DWORD dwType; /* resource type */
DWORD dwUsage; /* resource usage */
LPTSTR lpLocalName; /* local resource name */
LPTSTR lpRemoteName; /* remote resource name */
LPTSTR lpComment; /* provider-supplied comment */
LPTSTR lpProvider; /* name of the provider */
} NETRESOURCE, *LPNETRESOURCE;
The NETRESOURCE structure is returned during enumeration of resources on the network and during enumeration of currently connected resources.
dwScope
Specifies the scope of the enumeration. Currently, this member may have one of the following values:
Value | Meaning |
RESOURCE_CONNECTED | currently connected resources (dwUsage is undefined) |
RESOURCE_GLOBALNET | resources on the network |
RESOURCE_REMEMBERED | remembered connections (dwUsage is undefined) |
dwType
Specifies a bitmask that gives the resource type. Currently, this member may have one of the following values:
Value | Meaning |
RESOURCETYPE_ANY | all resources |
RESOURCETYPE_DISK | disk resources |
RESOURCETYPE_PRINT | print resources |
dwUsage
Specifies a bitmask that gives the resource usage. This member is defined only if dwScope is RESOURCE_GLOBALNET. Currently, this member may have one of the following values:
Value | Meaning |
RESOURCEUSAGE_CONNECTABLE | This is a connectable resource; lpRemoteName may be passed to the WNetAddConnection function to make a network connection. |
RESOURCEUSAGE_CONTAINER | This is a container resource; lpRemoteName may be passed to the WNetOpenEnum function to enumerate the resources in the container. |
lpLocalName
Points to the name of a local device if dwScope is RESOURCE_CONNECTED or RESOURCE_REMEMBERED. This member is NULL if the connection does not use a device. Otherwise, it is undefined.
lpRemoteName
Points to a remote network name if the entry is a network resource.
If the entry is a current or remembered connection, lpRemoteName points to the network name associated with lpLocalName.
lpComment
Points to a provider-supplied comment.
lpProvider
Points to the name of the provider owning this resource. This member can be NULL if the provider name is unknown.
WNetEnumResource, WNetCloseEnum, WNetOpenEnum