Windows: NPEnumResources no Printer support
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 29 Nov 2011 20:01:00 +0000 (15:01 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 29 Nov 2011 23:36:07 +0000 (15:36 -0800)
The AFS Redirector does not support printer shares.  If the
query is for printers only (or any other query that does not
permit disk shares as a response) return no more entries.

Change-Id: Ide9fc58489bed7f4a9cf50da24a98a9b2477b72d
Reviewed-on: http://gerrit.openafs.org/6141
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/npdll/AFS_Npdll.c

index e412d91..ee31a25 100644 (file)
@@ -2206,6 +2206,15 @@ NPEnumResource( HANDLE  hEnum,
             try_return( dwStatus = WN_NET_ERROR);
         }
 
+        if( pEnumCB->Type != RESOURCETYPE_ANY && pEnumCB->Type != RESOURCETYPE_DISK)
+        {
+
+#ifdef AFS_DEBUG_TRACE
+            AFSDbgPrint( L"NPEnumResource Non-DISK queries are not supported, returning WN_NO_MORE_ENTRIES\n");
+#endif
+            try_return( dwStatus = WN_NO_MORE_ENTRIES);
+        }
+
         //
         // Handle the special cases here
         //   0. Provider Network Root