From 23d74b48aea660bafa3e50ab5146e4336f6b1d32 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 3 Apr 2009 03:57:13 +0000 Subject: [PATCH] DEVEL15-windows-afsd-no-more-ods-20090402 LICENSE MIT Any use of OutputDebugString() in production can result in serious delays in the execution of the thread that issues the call. Remove the last of the unprotected calls within afsd_service. (cherry picked from commit f6b4902daeb731eb01de44464476cb0a3edb26b1) --- src/WINNT/afsd/smb.c | 11 +++++------ src/WINNT/afsd/smb3.c | 6 ------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index f23c2d61f..280983987 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -10083,13 +10083,12 @@ void smb_Init(osi_log_t *logp, int useV3, int nThreads, void *aMBfunc) ); if (nts != STATUS_SUCCESS && ntsEx != STATUS_SUCCESS) { - char message[AFSPATHMAX]; - sprintf(message,"MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x", - nts, ntsEx); - OutputDebugString(message); - afsi_log(message); + osi_Log2(smb_logp, "MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x", + nts, ntsEx); + + afsi_log("MsV1_0SetProcessOption failure: nts 0x%x ntsEx 0x%x", nts, ntsEx); } else { - OutputDebugString("MsV1_0SetProcessOption success"); + osi_Log0(smb_logp, "MsV1_0SetProcessOption success"); afsi_log("MsV1_0SetProcessOption success"); } /* END - code from Larry */ diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 955e893a3..39cc6acf6 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -144,8 +144,6 @@ void OutputDebugF(clientchar_t * format, ...) { va_start( args, format ); cm_ClientStrPrintfV(vbuffer, lengthof(vbuffer), format, args); osi_Log1(smb_logp, "%S", osi_LogSaveClientString(smb_logp, vbuffer)); - cm_ClientStrCat(vbuffer, lengthof(vbuffer), _C("\n")); - OutputDebugStringW(vbuffer); } void OutputDebugHexDump(unsigned char * buffer, int len) { @@ -159,8 +157,6 @@ void OutputDebugHexDump(unsigned char * buffer, int len) { if(!(i%16)) { if(i) { osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, buf)); - StringCchCatA(buf, lengthof(buf), "\r\n"); - OutputDebugString(buf); } StringCchPrintfA(buf, lengthof(buf), "%5x", i); memset(buf+5,' ',80); @@ -180,8 +176,6 @@ void OutputDebugHexDump(unsigned char * buffer, int len) { } if(i) { osi_Log1(smb_logp, "%s", osi_LogSaveString(smb_logp, buf)); - StringCchCatA(buf, lengthof(buf), "\r\n"); - OutputDebugString(buf); } } -- 2.39.5