From: Jeffrey Altman Date: Fri, 3 Apr 2009 03:56:36 +0000 (+0000) Subject: windows-afsd-no-more-ods-20090402 X-Git-Tag: openafs-devel-1_5_61~365 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=f6b4902daeb731eb01de44464476cb0a3edb26b1 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. --- diff --git a/src/WINNT/afsd/smb.c b/src/WINNT/afsd/smb.c index 6264079..44cf35c 100644 --- a/src/WINNT/afsd/smb.c +++ b/src/WINNT/afsd/smb.c @@ -10080,13 +10080,12 @@ void smb_Init(osi_log_t *logp, int useV3, ); 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 955e893..39cc6ac 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); } }