Platform SDK: Windows Networking |
The NETRESOURCE structure contains information about a network resource. The structure is returned during enumeration of network resources. NETRESOURCE is also specified when making or querying a network connection with calls to various Windows Networking functions.
typedef struct _NETRESOURCE { DWORD dwScope; DWORD dwType; DWORD dwDisplayType; DWORD dwUsage; LPTSTR lpLocalName; LPTSTR lpRemoteName; LPTSTR lpComment; LPTSTR lpProvider; } NETRESOURCE;
Value | Meaning |
---|---|
RESOURCE_CONNECTED | Enumerate currently connected resources. The dwUsage member cannot be specified. |
RESOURCE_GLOBALNET | Enumerate all resources on the network. The dwUsage member is specified. |
RESOURCE_REMEMBERED | Enumerate remembered (persistent) connections. The dwUsage member cannot be specified. |
Value | Meaning |
---|---|
RESOURCETYPE_ANY | All resources |
RESOURCETYPE_DISK | Disk resources |
RESOURCETYPE_PRINT | Print resources |
The WNetEnumResource function can also return the value RESOURCETYPE_UNKNOWN if a resource is neither a disk nor a print resource.
Value | Meaning |
---|---|
RESOURCEDISPLAYTYPE_DOMAIN | The object should be displayed as a domain. |
RESOURCEDISPLAYTYPE_SERVER | The object should be displayed as a server. |
RESOURCEDISPLAYTYPE_SHARE | The object should be displayed as a share. |
RESOURCEDISPLAYTYPE_GENERIC | The method used to display the object does not matter. |
Note that this member can be specified only if the dwScope member is equal to RESOURCE_GLOBALNET. This member can be one of the following values.
Value | Meaning |
---|---|
RESOURCEUSAGE_CONNECTABLE | The resource is a connectable resource; the name pointed to by the lpRemoteName member can be passed to the WNetAddConnection function to make a network connection. |
RESOURCEUSAGE_CONTAINER | The resource is a container resource; the name pointed to by the lpRemoteName member can be passed to the WNetOpenEnum function to enumerate the resources in the container. |
If the entry is a current or persistent connection, lpRemoteName points to the network name associated with the name pointed to by the lpLocalName member.
The string can be MAX_PATH characters in length, and it must follow the network provider's naming conventions.
For more information about setting the values of the dwType, lpLocalName, lpRemoteName, and lpProvider members, see MultinetGetConnectionPerformance, WNetAddConnection2, WNetAddConnection3, WNetGetResourceInformation, WNetGetResourceParent, and WNetUseConnection.
Windows NT/2000: Requires Windows NT 3.51 or later.
Header: Declared in Npapi.h.
Windows Networking (WNet) Overview, Windows Networking Structures, MultinetGetConnectionPerformance, WNetAddConnection2, WNetAddConnection3, WNetUseConnection, WNetCloseEnum, WNetEnumResource, WNetGetProviderName, WNetGetResourceInformation, WNetGetResourceParent, WNetOpenEnum