NPGetResourceInformation
DWORD NPGetResourceInformation(
LPNETRESOURCE lpNetResource,
LPVOID lpBuffer,
LPDWORD cbBuffer,
LPTSTR *lplpSystem
);
- lpNetResource
- This specifies the network resource for which the information is required. The lpRemoteName field of NETRESOURCE specifies the remote name of the network resource whose information is required. If the calling program knows the values for the lpProvider and dwType fields, then it should fill them in, otherwise, it should set them to NULL. All other fields in the NETRESOURCE are ignored and are not initialized.
- lpBuffer
- A pointer to the buffer to receive the result, which is returned as a single NETRESOURCE entry representing the parent resource. The lpRemoteName, lpProvider, dwType, and dwUsage fields are returned, all other fields being set to NULL. The remote name returned should be 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 resource is this resource. If the provider owns a parent of the network resource, (in other words is known to be the correct network to respond to this request), then lpProvider should be filled in with a non-null entry. If it is known that a network owns a parent of the resource, but that the resource itself is not valid, then lpProvider is returned as a non-null value together with a return status of WN_BAD_VALUE. 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, in bytes, of the buffer passed to the function call. If the result is WN_MORE_DATA, this will contain the buffer size required (in bytes) to hold the NETRESOURCE information.
- 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_VALUE |
Invalid dwScope or dwUsage or dwType, or bad combination of parameters is specified (for example, lpRemoteName does not correspond to dwType). |
WN_NOT_AUTHENTICATED |
The caller does not have the necessary permissions to obtain the name of the parent. |
WN_ACCESS_DENIED |
The user is authenticated to the network, but does not have sufficient permissions (access rights). |