title: NetUseAdd returns error 67 or 87
body: <p>I'm calling the NetApi32.dll method <code>NetUseAdd</code>.<br>
  This is how:  </p>
  
  <pre><code>USE_INFO_2 useinfo = new USE_INFO_2();
  
  useinfo.ui2_remote = UNCPath;
  useinfo.ui2_username = User;
  useinfo.ui2_domainname = Domain;
  useinfo.ui2_password = Password;
  useinfo.ui2_asg_type = 0;
  useinfo.ui2_usecount = 1;
  uint paramErrorIndex;
  returncode = NetUseAdd(null, 2, ref useinfo, out paramErrorIndex);
  </code></pre>
  
  <p>When calling this with <code>useinfo.ui2_remote = \\servername\dirname</code> it returns code 67 and when calling with <code>useinfo.ui2_remote = \\servername\dirname\</code> it returns code 87.   </p>
  
  <p>When I say it returns code...I mean that either it throws exception and <code>Marshal.GetLastWin32Error()</code> returns this error code, or the actual call to <code>NetUseAdd</code> returns it.   </p>
  
  <p>The weird thing is, that this method succeed when calling this with a path that <strong>doesn't</strong> have dub-folders, and fails when calling with a path that <strong>has</strong> sub-folders.  </p>
  
  <p>The calling machine is Windows server 2008, and the remote is a linux server (I'm not sure what version or distribution).  </p>
  
  <p>Any idea how can I successfully connect\use the remote resource without worry about the subfolder issue?</p>
  
  <p><strong>edit</strong>: </p>
  
  <pre><code>[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
  internal struct USE_INFO_2
  {
       internal LPWSTR ui2_local;
       internal LPWSTR ui2_remote;
       internal LPWSTR ui2_password;
       internal DWORD ui2_status;
       internal DWORD ui2_asg_type;
       internal DWORD ui2_refcount;
       internal DWORD ui2_usecount;
       internal LPWSTR ui2_username;
       internal LPWSTR ui2_domainname;
  }
  
  [DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
  internal static extern NET_API_STATUS NetUseAdd(
       LPWSTR UncServerName,
       DWORD Level,
       ref USE_INFO_2 Buf,
       out DWORD ParmError);
  </code></pre>
  
  <p>More info worth mentioned: the remote path that I'm trying to Add using NetUseAdd is a Huge storage (7 TB). A simple access with Windows explorer takes about 3-4 seconds to reach, but eventually it appears.</p>