From 1e24762a2cf6590798aa9ce483a1374466c7847b Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 25 Nov 2013 20:27:10 -0500 Subject: [PATCH] Windows: AFSRDFSProvider NPOpenEnum vs no redirector 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 Reviewed-by: Jeffrey Altman --- src/WINNT/afsrdr/npdll/AFS_Npdll.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/WINNT/afsrdr/npdll/AFS_Npdll.c b/src/WINNT/afsrdr/npdll/AFS_Npdll.c index eae4cd460d..d0b23c33e7 100644 --- a/src/WINNT/afsrdr/npdll/AFS_Npdll.c +++ b/src/WINNT/afsrdr/npdll/AFS_Npdll.c @@ -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)