Called to find out enumeration information for a network resource. This is typically used when an object is typed in by a user. Calling this function in conjunction with WNetGetResourceParent determines the placement and nature of the resource in the browse hierarchy. Unlike WNetGetResourceParent, WNetGetResourceInformation always tries to determine the network provider that owns the resource and the type of the resource, although it may not be currently accessible (or even exist if the type of the resource was specified by the caller).
DWORD WNetGetResourceInformation ( LPNETRESOURCE lpNetResource, LPVOID lpBuffer, LPDWORD cbBuffer, LPTSTR *lplpSystem );
lpNetResource
This specifies the network resource for which the information is required. The lpRemoteName field of the NETRESOURCE specifies the remote name of the network resource. This would have typically been typed in by a user. If the calling program knows the values for the lpProvider, and dwType fields, then it should fill them in, because this operation can be expensive, especially without the dwType . Otherwise, it should set them to NULL. All other fields in the NETRESOURCE are ignored and do not have to be filled in.
lpBuffer
A pointer to the buffer to receive the result. The first field in the buffer is a NETRESOURCE structure. The dwScope, lpRemoteName, lpProvider, dwType and dwUsage fields are returned, all other fields being set to NULL. The remote name returned is in the same syntax as that returned from an enumeration, so that the caller can do a case sensitive string compare to determine whether an enumerated resouce is this resource. The provider name is always returned when it is known which network the resource belongs to. If the resource cannot be found on any of the networks, then lpRemoteName is returned as NULL, and lpProvider may not be NULL if a parent for the resource is known to be on one of the networks. dwScope is returned as RESOURCE_CONTEXT if the network resource is part of the user's network context, otherwise it is returned as zero.
cbBuffer
This specifies the size of the buffer passed to the function call. If the buffer is too small to receive even one entry, this variable receives the required size of the buffer.
lplpSystem
Returned pointer to a string in the buffer pointed to by lpBuffer that specifies the part of the resource that is accessed through system resource type specific APIs rather than WNet APIs. For example, if the input remote resource name was "\\server\share\dir", then lpRemoteName is returned pointing to "\\server\share" and lplpSystem points to "\dir", both strings being stored in the buffer pointed to by lpBuffer.
WN_BAD_NETNAME | lpRemoteName is not an existing network resource for any network If the lpProvider field is not NULL, then a parent of the network resource does exist and can be accessed by calls to WNetGetResourceParent. |
WN_MORE_DATA | the buffer is too small for the information |
WN_NO_NETWORK | network is not present. |
WN_EXTENDED_ERROR | a network specific error occurred. WNetGetLastError should be called to obtain a description of the error. |