This function is used to determine the name of the network resource associated with a local device.
DWORD WNetGetConnection(
LPTSTR lpLocalName,
LPTSTR lpRemoteName,
LPDWORD lpBufferSize
);
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 persistent connection. |
WN_FUNCTION_BUSY | The MPR or NP is busy (possibly initializing). The caller should retry. |
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. |