Windows: NPAddConnection no local name and connected
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 21 Mar 2013 11:57:34 +0000 (07:57 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 22 Mar 2013 14:33:49 +0000 (07:33 -0700)
The WN_ALREADY_CONNECTED error is only to be returned if a local
device name (aka drive letter) is provided in the request.  Otherwise,
the proper return status is WN_SUCCESS if an unnamed connection is
requested.

Change-Id: I1e1ca47a84e353db66e2830ec11f968a3578c4f6
Reviewed-on: http://gerrit.openafs.org/9642
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/kernel/lib/AFSNetworkProviderSupport.cpp

index c6cd352..9a9588c 100644 (file)
@@ -121,6 +121,8 @@ AFSAddConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
                               &uniRemoteName,
                               ConnectCB->LocalName,
                               ConnectCB->AuthenticationId.QuadPart));
+
+                *ResultStatus = WN_ALREADY_CONNECTED;
             }
             else
             {
@@ -130,13 +132,13 @@ AFSAddConnection( IN AFSNetworkProviderConnectionCB *ConnectCB,
                               "AFSAddConnection ALREADY_CONNECTED remote name %wZ Local (NULL) authentication id %I64X\n",
                               &uniRemoteName,
                               ConnectCB->AuthenticationId.QuadPart));
-            }
 
-            *ResultStatus = WN_ALREADY_CONNECTED;
+                *ResultStatus = WN_SUCCESS;
+            }
 
             *ReturnOutputBufferLength = sizeof( ULONG);
 
-            try_return( ntStatus);
+            try_return( ntStatus = STATUS_SUCCESS);
         }
 
         //