From b170a840b5f702356c15bb59737e7ed106cdc88c Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 28 Jun 2015 13:24:13 -0400 Subject: [PATCH] Windows: remove dead network provider code Remove all #if 0 code blocks. Change-Id: I981d7a178c0ae1be7b3ca9f546a7a1aab8f5a48c Reviewed-on: http://gerrit.openafs.org/11912 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/WINNT/afsrdr/npdll/AFS_Npdll.c | 253 ----------------------------- 1 file changed, 253 deletions(-) diff --git a/src/WINNT/afsrdr/npdll/AFS_Npdll.c b/src/WINNT/afsrdr/npdll/AFS_Npdll.c index 648792820..ede424d34 100644 --- a/src/WINNT/afsrdr/npdll/AFS_Npdll.c +++ b/src/WINNT/afsrdr/npdll/AFS_Npdll.c @@ -2239,13 +2239,6 @@ NPOpenEnum( DWORD dwScope, dwUsage = RESOURCEUSAGE_ALL; } -#if 0 - if ( dwType == 0 || dwType == RESOURCEUSAGE_ATTACHED) - { - dwType |= RESOURCETYPE_DISK | RESOURCETYPE_PRINT; - } -#endif - hControlDevice = OpenRedirector(); if( hControlDevice == NULL) @@ -2441,222 +2434,6 @@ NPEnumResource( HANDLE hEnum, try_return( dwStatus = WN_NO_MORE_ENTRIES); } - // - // Handle the special cases here - // 0. Provider Network Root - // 1. Server Root - // - -#if 0 - if ( pEnumCB->Scope == RESOURCE_GLOBALNET) - { - - ReadServerNameString(); - - if ( pEnumCB->CurrentIndex == 0 && - pEnumCB->RemoteName == NULL) - { - - // Determine the space needed for this entry... - - SpaceNeeded = 2 * ( cbProviderNameLength + sizeof( WCHAR)); - - uniRemoteName.Length = (USHORT)cbProviderNameLength; - uniRemoteName.MaximumLength = uniRemoteName.Length; - uniRemoteName.Buffer = wszProviderName; - - if( SpaceNeeded + sizeof( NETRESOURCE) > SpaceAvailable) - { - - *lpBufferSize = SpaceNeeded + sizeof( NETRESOURCE); - -#ifdef AFS_DEBUG_TRACE - AFSDbgPrint( L"NPEnumResource Request MORE_DATA for entry %s Len %d\n", - &uniRemoteName, - *lpBufferSize); -#endif - try_return( dwStatus = WN_MORE_DATA); - } - -#ifdef AFS_DEBUG_TRACE - AFSDbgPrint( L"NPEnumResource Processing Entry %wZ\n", - &uniRemoteName); -#endif - - SpaceAvailable -= (SpaceNeeded + sizeof( NETRESOURCE)); - - pNetResource->dwScope = RESOURCE_GLOBALNET; - pNetResource->dwType = RESOURCETYPE_ANY; - pNetResource->dwDisplayType = RESOURCEDISPLAYTYPE_NETWORK; - pNetResource->dwUsage = RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_RESERVED; - - // setup string area at opposite end of buffer - StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded); - - pNetResource->lpLocalName = NULL; - - // copy remote name - pNetResource->lpRemoteName = StringZone; - - StringCbCopy( StringZone, - cbProviderNameLength + sizeof( WCHAR), - wszProviderName); - - StringZone += cbProviderNameLength / sizeof(WCHAR) + 1; - - pNetResource->lpComment = NULL; - - // copy provider name - pNetResource->lpProvider = StringZone; - StringCbCopy( StringZone, - cbProviderNameLength + sizeof( WCHAR), - wszProviderName); - - StringZone += cbProviderNameLength / sizeof( WCHAR) + 1; - -#ifdef AFS_DEBUG_TRACE - AFSDbgPrint( L"NPEnumResource Entry (0x%p) Scope %s Type %s Display %s Usage %s Local %s Remote \"%s\" Comment \"%s\"\n", - pNetResource, - GetScopeString(pNetResource->dwScope), - GetTypeString(pNetResource->dwType), - GetDisplayString(pNetResource->dwDisplayType), - GetUsageString(pNetResource->dwUsage), - pNetResource->lpLocalName, - pNetResource->lpRemoteName, - pNetResource->lpComment); -#endif - - // setup the new end of buffer - StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded); - - EntriesCopied++; - - pNetResource++; - - // do not change the index since we did not query the redirector - pEnumCB->CurrentIndex = 0; - - // remember that we returned the provider name - pEnumCB->RemoteName = (WCHAR *)HeapAlloc( GetProcessHeap( ), HEAP_ZERO_MEMORY, 0x1000); - - if( pEnumCB->RemoteName == NULL) - { - - try_return( dwStatus = WN_OUT_OF_MEMORY); - } - else - { - - StringCbCopy( pEnumCB->RemoteName, - 0x1000, - wszProviderName); - } - } - - if ( pEnumCB->CurrentIndex == 0 && - lstrlen( pEnumCB->RemoteName) == cbProviderNameLength / sizeof( WCHAR) && - _wcsnicmp( pEnumCB->RemoteName, wszProviderName, cbProviderNameLength / sizeof( WCHAR)) == 0 && - EntriesCopied < EntriesRequested) - { - - // - // After the network provider entry comes the server entry - // - - // Determine the space needed for this entry... - - SpaceNeeded = cbProviderNameLength + cbServerNameUNCLength + cbServerCommentLength + 3 * sizeof( WCHAR); - - uniRemoteName.Length = (USHORT)cbServerNameUNCLength; - uniRemoteName.MaximumLength = uniRemoteName.Length; - uniRemoteName.Buffer = wszServerNameUNC; - - if( SpaceNeeded + sizeof( NETRESOURCE) > SpaceAvailable) - { - - *lpBufferSize = SpaceNeeded + sizeof( NETRESOURCE); - -#ifdef AFS_DEBUG_TRACE - AFSDbgPrint( L"NPEnumResource Request MORE_DATA for entry %s Len %d\n", - &uniRemoteName, - *lpBufferSize); -#endif - try_return( dwStatus = WN_MORE_DATA); - } - -#ifdef AFS_DEBUG_TRACE - AFSDbgPrint( L"NPEnumResource Processing Entry %wZ\n", - &uniRemoteName); -#endif - - SpaceAvailable -= (SpaceNeeded + sizeof( NETRESOURCE)); - - pNetResource->dwScope = 0; - pNetResource->dwType = RESOURCETYPE_ANY; - pNetResource->dwDisplayType = RESOURCEDISPLAYTYPE_SERVER; - pNetResource->dwUsage = RESOURCEUSAGE_CONTAINER; - - // setup string area at opposite end of buffer - StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded); - - pNetResource->lpLocalName = NULL; - - // copy remote name - pNetResource->lpRemoteName = StringZone; - - StringCbCopy( StringZone, - cbServerNameUNCLength + sizeof( WCHAR), - wszServerNameUNC); - - StringZone += cbServerNameUNCLength / sizeof(WCHAR) + 1; - - // copy comment - pNetResource->lpComment = StringZone; - - StringCbCopy( StringZone, - cbServerCommentLength + sizeof( WCHAR), - wszServerComment); - - StringZone += cbServerCommentLength / sizeof( WCHAR) + 1; - - // copy provider name - pNetResource->lpProvider = StringZone; - StringCbCopy( StringZone, - cbProviderNameLength + sizeof( WCHAR), - wszProviderName); - - StringZone += cbProviderNameLength / sizeof( WCHAR) + 1; - -#ifdef AFS_DEBUG_TRACE - AFSDbgPrint( L"NPEnumResource Entry (0x%p) Scope %s Type %s Display %s Usage %s Local %s Remote \"%s\" Comment \"%s\"\n", - pNetResource, - GetScopeString(pNetResource->dwScope), - GetTypeString(pNetResource->dwType), - GetDisplayString(pNetResource->dwDisplayType), - GetUsageString(pNetResource->dwUsage), - pNetResource->lpLocalName, - pNetResource->lpRemoteName, - pNetResource->lpComment); -#endif - - // setup the new end of buffer - StringZone = (PWCHAR)( (PBYTE) StringZone - SpaceNeeded); - - EntriesCopied++; - - pNetResource++; - - // do not update the index because we did not query the redirector - pEnumCB->CurrentIndex = 0; - - // remember that we returned the server - StringCbCopy( pEnumCB->RemoteName, - 0x1000, - wszServerNameUNC); - } - } -#endif - // // Setup what we are going to ask for // @@ -4137,36 +3914,6 @@ OpenRedirector() GetLastError()); #endif } -#if 0 - // - // only do this if you want network shares to fail to mount - // when the file system is not yet ready - // - else { - - AFSDriverStatusRespCB respCB; - DWORD dwBytes; - - memset( &respCB, '\0', sizeof( AFSDriverStatusRespCB)); - - if ( !DeviceIoControl( hControlDevice, - IOCTL_AFS_STATUS_REQUEST, - NULL, - 0, - (void *)&respCB, - sizeof( AFSDriverStatusRespCB), - &dwBytes, - NULL) || - dwBytes != sizeof(AFSDriverStatusRespCB) || - respCB.Status != AFS_DRIVER_STATUS_READY ) - { - - CloseHandle( hControlDevice); - - hControlDevice = NULL; - } - } -#endif return hControlDevice; } -- 2.39.5