title: Calling WNetAddConnection2 with empty local name
body: <p>I have a small program that simply checks if a specified file is located on a specified network drive that is not mapped on the computer.
  <br>To check this I temporarily map to the network location, check if the file exists and than unmap the drive. I now figured out that I can call WNetAddConnection2 with an empty local name (MSDN: If the string is empty, or if lpLocalName is NULL, the function makes a connection to the network resource without redirecting a local device.).
  <br>Just for showing the code:</p>
  
  <pre><code>NETRESOURCE nr;
  nr.dwType = RESOURCETYPE_DISK;
  nr.lpLocalName = NULL; // explicitly set this to NULL
  nr.lpRemoteName = "\\\\computer\\c$";
  nr.lpProvider = NULL;
  
  DWORD dwResult = WNetAddConnection2(&amp;nr, cstrPassword, cstrUsername, FALSE);
  if (dwResult != 0)
  {
      return false;
  }
  
  CPath cLocation(cstrFileLocation);
  return cLocation.FileExists() != FALSE;
  </code></pre>
  
  <p>So far so good the code works fine. But what I now want to know is if there is any problem with that call of WNetAddConnection2? I cannot call WNetCancelConnection, as I do not have a local name. So do I have some kind of zombies on my computer now?
  <br>How can I see all my network connections on my computer? Best would be a short command for the Command Prompt (something like NET USE).</p>