From f968f826e47e47d9a43023e45fd4963481a6b778 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 21 Nov 2003 18:36:01 +0000 Subject: [PATCH] afscreds-drivemap-updates-20031121 #undef REALLOC before importing drivemap.h to prevent the use of the wrong memory allocation routines. Remove extraneous code which computed strings which are no longer used and worse produced misleading debug information Improved consistency of drive mapping when HIGHSECURITY is in use --- src/WINNT/client_config/drivemap.cpp | 70 +++++++++------------------- 1 file changed, 22 insertions(+), 48 deletions(-) diff --git a/src/WINNT/client_config/drivemap.cpp b/src/WINNT/client_config/drivemap.cpp index 83001128d9..9600bfe64f 100644 --- a/src/WINNT/client_config/drivemap.cpp +++ b/src/WINNT/client_config/drivemap.cpp @@ -17,9 +17,11 @@ extern "C" { #include #include #include +#undef REALLOC #include "drivemap.h" #include #include +#define DEBUG_VERBOSE #include /* @@ -632,16 +634,6 @@ BOOL ActivateDriveMap (TCHAR chDrive, LPTSTR pszMapping, LPTSTR pszSubmountReq, TCHAR szRemote[ MAX_PATH ]; wsprintf (szRemote, TEXT("\\\\%s\\%s"), szClient, szSubmount); - NETRESOURCE Resource; - memset (&Resource, 0x00, sizeof(NETRESOURCE)); - Resource.dwScope = RESOURCE_GLOBALNET; - Resource.dwType = RESOURCETYPE_DISK; - Resource.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE; - Resource.dwUsage = RESOURCEUSAGE_CONNECTABLE; - Resource.lpLocalName = szLocal; - Resource.lpRemoteName = szRemote; - - // DWORD rc = WNetAddConnection2 (&Resource, NULL, NULL, ((fPersistent) ? CONNECT_UPDATE_PROFILE : 0)); DWORD rc=MountDOSDrive(chDrive,szSubmount,fPersistent); if (rc == NO_ERROR) return TRUE; @@ -940,10 +932,8 @@ void DoUnMapShare(BOOL drivemap) //disconnect drivemap { if (drivemap) DisMountDOSDrive(*lpnrLocal[i].lpLocalName); - //WNetCancelConnection(lpnrLocal[i].lpLocalName,TRUE); } else DisMountDOSDriveFull(lpnrLocal[i].lpRemoteName); - //WNetCancelConnection(lpnrLocal[i].lpRemoteName,TRUE); DEBUG_EVENT1("AFS DriveUnMap","UnMap-Remote=%x",res); } } @@ -986,13 +976,13 @@ BOOL DoMapShareChange() if (strstr(_strlwr(lpnrLocal[i].lpRemoteName),szPath)==NULL) continue; //only look at real afs mappings CHAR * pSubmount=strrchr(lpnrLocal[i].lpRemoteName,'\\')+1; - if (strcmpi(pSubmount,"all")==0) + if (lstrcmpi(pSubmount,"all")==0) continue; // do not remove 'all' for (DWORD j=0;j