WNetGetConnection

  WORD WNetGetConnection(szLocalName, lpRemoteName, nBufferSize)    
  LPSTR szLocalName;    
  LPSTR lpRemoteName;    
  WORD FAR * nBufferSize;    

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

Parameters

szLocalName

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

lpRemoteName

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

nBufferSize

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

Return Value

The return value is one of the following.

Value Meaning

WN_BAD_POINTER Invalid pointer.
WN_BAD_VALUE The szLocalName parameter is not a valid local device.
WN_MORE_DATA Buffer was too small.
WN_NET_ERROR Network error.
WN_NOT_CONNECTED The szLocalName parameter is not a redirected local device.
WN_NOT_SUPPORTED Function not supported.
WN_OUT_OF_MEMORY Out of memory.
WN_SUCCESS Success.

Comments

The export ordinal for this function is 12.