Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 64796 Details for
Bug 163710
EventLogReader.exe does not expand error messages in the event message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch file
Reader.patch.txt (text/plain), 3.06 KB, created by
Cindy Jin
on 2007-04-24 17:34:23 EDT
(
hide
)
Description:
patch file
Filename:
MIME Type:
Creator:
Cindy Jin
Created:
2007-04-24 17:34:23 EDT
Size:
3.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.logging.parsers >Index: src.native/converters/Reader.cpp >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.logging.parsers/src.native/converters/Reader.cpp,v >retrieving revision 1.9 >diff -u -r1.9 Reader.cpp >--- src.native/converters/Reader.cpp 20 Apr 2007 19:49:29 -0000 1.9 >+++ src.native/converters/Reader.cpp 24 Apr 2007 21:34:05 -0000 >@@ -12,6 +12,7 @@ > > > #include <windows.h> >+#include <stdlib.h> > #include <stdio.h> > #include <string.h> > #include <winerror.h> >@@ -62,8 +63,8 @@ > Language ID of the message > Array of insertion strings */ > LPSTR GetEventMessage(HMODULE hDll, DWORD dwEventIndex, DWORD dwLanguageID, LPTSTR *lpInserts ); >- >- >+bool isDigitNumber(char c); >+LPSTR checkErrorCode(LPSTR lpMsgBuf); > int getEventType(WORD ntEventType) > { > int result = 0; >@@ -589,6 +590,7 @@ > { > DWORD dwReturn; > LPSTR lpMsgBuf = NULL; >+ LPSTR tmpMsg = NULL; > DWORD dwFlags = FORMAT_MESSAGE_FROM_HMODULE |FORMAT_MESSAGE_ALLOCATE_BUFFER; > > if ( lpInserts ) >@@ -598,10 +600,90 @@ > > dwReturn = FormatMessage(dwFlags, hDll, dwEventIndex, dwLanguageID, (LPTSTR) &lpMsgBuf, 0, lpInserts ); > if(dwReturn == 0) // message could not be retrieved >- { >- return NULL; >+ { >+ >+ return NULL; > } > >+ //check if there is system error message >+ >+ do >+ { >+ tmpMsg = lpMsgBuf; >+ lpMsgBuf = checkErrorCode(lpMsgBuf); >+ >+ }while((strcmp(tmpMsg,lpMsgBuf) != 0)); >+ > return( lpMsgBuf ); > } > >+bool isDigitNumber(char c) >+{ >+ if(c -'0' >=0 && '9'-c>=0) >+ { >+ return true; >+ } >+ return false; >+} >+LPSTR checkErrorCode(LPSTR lpMsgBuf) >+{ >+ >+ LPSTR subStr = NULL; >+ LPSTR returnMsg = NULL; >+ for(DWORD i=0; i<strlen(lpMsgBuf); i++) >+ { >+ if(lpMsgBuf[i]=='%' && lpMsgBuf[i++]=='%') >+ { >+ >+ DWORD starIndex = i+1; >+ DWORD tmpIndex = i+1; >+ while(isDigitNumber(lpMsgBuf[tmpIndex])) >+ { >+ tmpIndex++; >+ } >+ >+ >+ if(tmpIndex > starIndex) >+ { >+ LPSTR digitStr = new char[tmpIndex-starIndex+1]; >+ for(DWORD j=starIndex;j<tmpIndex;j++) >+ { >+ >+ digitStr[j-starIndex]=lpMsgBuf[j]; >+ >+ } >+ digitStr[tmpIndex-starIndex] ='\0'; >+ >+ DWORD msgId = atoi(digitStr); >+ >+ LPSTR errorMsg = NULL; >+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, >+ NULL, >+ msgId, >+ 0,// Default language >+ (LPTSTR) &errorMsg, >+ 0, >+ NULL ); >+ if(errorMsg != NULL) >+ { >+ DWORD size = strlen(lpMsgBuf)-(tmpIndex-starIndex)+ strlen(errorMsg); >+ returnMsg = new char[size+1]; >+ strncpy(returnMsg,lpMsgBuf,starIndex-2); >+ returnMsg[starIndex-2] = '\0'; >+ strcat(returnMsg,errorMsg); >+ strcat(returnMsg,lpMsgBuf+tmpIndex); >+ return returnMsg; >+ } >+ >+ } >+ >+ } >+ >+ } >+ if(returnMsg == NULL) >+ return lpMsgBuf; >+ else >+ return returnMsg; >+ >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 163710
:
64796
|
65045
|
65238