Windows: Correct exceptions in AFSRDFSProvider
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 24 Jul 2012 17:53:49 +0000 (13:53 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 25 Jul 2012 04:09:42 +0000 (21:09 -0700)
Correct two errors in the generation of debug strings that
were triggering invalid memory access exceptions.

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

src/WINNT/afsrdr/npdll/AFS_Npdll.c

index 6de7d53..d1a4886 100644 (file)
@@ -3893,8 +3893,8 @@ NPFormatNetworkName( LPTSTR  lpRemoteName,
 #ifdef AFS_DEBUG_TRACE
     AFSDbgPrint( L"NPFormatNetworkName Remote %s Flags %s (0x%x) CharsPerLine %u\n",
                  lpRemoteName,
-                 dwFlags,
                  GetFormatFlags( dwFlags),
+                 dwFlags,
                  dwAveCharPerLine);
 #endif
 
@@ -4292,7 +4292,7 @@ AFSDbgPrint(
 #endif
                            GetCurrentThreadId());
 
-        rc = StringCbVPrintfW( &wszbuffer[ 14], sizeof(wszbuffer) - 14, Format, marker);
+        rc = StringCbVPrintfW( &wszbuffer[ 14], sizeof(wszbuffer) - 14 * sizeof(WCHAR), Format, marker);
 
         if (SUCCEEDED(rc)) {
             if (debug & 1)