WNetGetUniversalName

This function is used to get Universal information about a network name which is referred to using a local device name. The following levels of information can be obtained about a network name.


DWORD WNetGetUniversalName (
    LPTSTR lpLocalPath,
    DWORD dwInfoLevel,
    LPVOID lpBuffer,
    LPDWORD lpBufferSize
    );

lpLocalPath

Contains the local path to an object on a network resource. This path is drive based path.

dwInfoLevel

The level of detail of information the caller is interested in as described above.

lpBuffer __

Points to a buffer to receive the info the user has requested. The specific structure returned is one of those described above.

lpBufferSize

This is used to specify the size, in bytes, of the buffer passed in. If the call fails because the buffer is not big enough, this location will be used to return the required buffer size.

WN_BAD_LOCALNAME

lpLocalName is invalid

WN_NOT_CONNECTED

lpLocalName not a redirected device

WN_MORE_DATA

the buffer is too small

WN_CONNECTION_CLOSED

the device is not currently connected, but it is a remembered (persistent) connection.

WN_FUNCTION_BUSY

The router or provider is busy (possibly initializing). The caller should retry.

WN_NO_NETWORK

network is not present.

WN_NOT_SUPPORTED

This function is not supported by any of the providers.

WN_EXTENDED_ERROR

a network specific error occured. WNetGetLastError should be called to obtain a description of the error.