WNetGetConnection

3.1

  UINT WNetGetConnection(lpszLocalName, lpszRemoteName, cbRemoteName)    
  LPSTR lpszLocalName; /* address of local device name */
  LPSTR lpszRemoteName; /* address of remote device name */
  UINT FAR* cbRemoteName; /* max. number of bytes in buffer */

The WNetGetConnection function returns the name of the network resource associated with the specified redirected local device.

Parameters

lpszLocalName

Points to a null-terminated string specifying the name of the redirected local device.

lpszRemoteName

Points to the buffer to receive the null-terminated name of the remote network resource.

cbRemoteName

Points to a variable specifying the maximum number of bytes the buffer pointed to by lpszRemoteName can hold. The function sets this variable to the number of bytes copied to the buffer.

Return Value

The return value is one of the following:

Value Meaning

WN_SUCCESS The function was successful.
WN_NOT_SUPPORTED The function was not supported.
WN_OUT_OF_MEMORY The system was out of memory.
WN_NET_ERROR An error occurred on the network.
WN_BAD_POINTER The pointer was invalid.
WN_BAD_VALUE The szLocalName parameter was not a valid local device.
WN_NOT_CONNECTED The szLocalName parameter was not a redirected local device.
WN_MORE_DATA The buffer was too small.

See Also

WNetAddConnection, WNetCancelConnection