Windows: AFSRDFSProvider NPOpenEnum vs no redirector
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 26 Nov 2013 01:27:10 +0000 (20:27 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 3 Dec 2013 21:28:09 +0000 (13:28 -0800)
If there is no redirector device present, return WN_NO_NETWORK
to indicate that this network provider is not ready for browsing.

Change-Id: I3e33769bb2d52a59b0ff993aa07e89d959d60800
Reviewed-on: http://gerrit.openafs.org/10523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/npdll/AFS_Npdll.c

index eae4cd4..d0b23c3 100644 (file)
@@ -2246,6 +2246,7 @@ NPOpenEnum( DWORD          dwScope,
 
     DWORD   dwStatus = WN_SUCCESS;
     AFSEnumerationCB *pEnumCB = NULL;
+    HANDLE   hControlDevice = NULL;
 
 #ifdef AFS_DEBUG_TRACE
     if ( lpNetResource == NULL)
@@ -2282,6 +2283,21 @@ NPOpenEnum( DWORD          dwScope,
     }
 #endif
 
+    hControlDevice = OpenRedirector();
+
+    if( hControlDevice == NULL)
+    {
+
+#ifdef AFS_DEBUG_TRACE
+       AFSDbgPrint( L"NPOpenEnum OpenRedirector failure, returning WN_NET_ERROR\n");
+#endif
+
+       return WN_NO_NETWORK;
+    }
+
+    CloseHandle( hControlDevice);
+
+
     *lphEnum = HeapAlloc( GetProcessHeap( ), HEAP_ZERO_MEMORY, sizeof( AFSEnumerationCB));
 
     if( *lphEnum == NULL)