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 87320 Details for
Bug 205274
EventLogReader utility by default creates Application log
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 for the EventReader.exe
patch_Reader.txt (text/plain), 3.32 KB, created by
Rohit Shetty
on 2008-01-19 06:01:47 EST
(
hide
)
Description:
Patch for the EventReader.exe
Filename:
MIME Type:
Creator:
Rohit Shetty
Created:
2008-01-19 06:01:47 EST
Size:
3.32 KB
patch
obsolete
>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.15 >diff -u -r1.15 Reader.cpp >--- src.native/converters/Reader.cpp 23 May 2007 22:06:59 -0000 1.15 >+++ src.native/converters/Reader.cpp 19 Jan 2008 10:59:29 -0000 >@@ -53,6 +53,7 @@ > const int MAX_MSG_STY = 21; > > FILE *fpOut = NULL; >+TCHAR szKeyName[128]; > > LPSTR GetDescriptionStringFromRegKey(EVENTLOGRECORD *pRecord, LPSTR source); > LPSTR getSourceName(EVENTLOGRECORD *record); >@@ -304,13 +305,12 @@ > void main(int argc , char * argv[] ) > { > const DWORD cBufferSize = 500; >- HANDLE hLog; >+ HANDLE hLog = NULL; > EVENTLOGRECORD *pevlr = NULL; >+ HKEY hKey; > > DWORD dwRead, dwNeeded; > >- >- > if(argc < 2) > { > error("Usage: EventLogReader.exe logName <outputFilename>"); >@@ -338,9 +338,18 @@ > return; > } > >- // Open the Application event log. >- hLog = OpenEventLog( NULL, // use local computer >+ /* search for event source registry key */ >+ lstrcpy( szKeyName, "System\\CurrentControlSet\\Services\\EventLog\\"); >+ lstrcat( szKeyName, argv[1] ); >+ >+ if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_READ, &hKey ) == NOERROR ) >+ { >+ // Open the Application event log. >+ hLog = OpenEventLog( NULL, // use local computer > argv[1]); // source name >+ } >+ >+ RegCloseKey(hKey); > > if (hLog == NULL) > { >@@ -592,31 +601,20 @@ > BOOL bResult = FALSE; > HKEY hKey; > DWORD dwBytesReturned; >- TCHAR szKeyName[128]; >+ TCHAR tmpSzKeyName[128]; > > /* search for event source registry key */ >- lstrcpy( szKeyName, "System\\CurrentControlSet\\Services\\EventLog\\Security\\" ); >- lstrcat( szKeyName, lpszESName ); >- if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_READ, &hKey ) != ERROR_SUCCESS ) >+ lstrcpy( tmpSzKeyName, szKeyName ); >+ lstrcat( tmpSzKeyName, "\\" ); >+ lstrcat( tmpSzKeyName, lpszESName ); >+ if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, tmpSzKeyName, 0, KEY_READ, &hKey ) != ERROR_SUCCESS ) > { >- lstrcpy( szKeyName, "System\\CurrentControlSet\\Services\\EventLog\\System\\" ); >- lstrcat( szKeyName, lpszESName ); >+ /* The registry key of event source is not found, so message cannot be retrieved. >+ Things like this are generally encountered when the application that wrote the event to >+ windows events is uninstalled. >+ */ > RegCloseKey(hKey); >- if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_READ, &hKey ) != ERROR_SUCCESS ) >- { >- lstrcpy( szKeyName, "System\\CurrentControlSet\\Services\\EventLog\\application\\" ); >- lstrcat( szKeyName, lpszESName ); >- RegCloseKey(hKey); >- if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_READ, &hKey ) != ERROR_SUCCESS ) >- { >- /* The registry key of event source is not found, so message cannot be retrieved. >- Things like this are generally encountered when the application that wrote the event to >- windows events is uninstalled. >- */ >- RegCloseKey(hKey); >- return FALSE; >- } >- } >+ return FALSE; > } > > bResult = TRUE; /* Found the registered event source key */
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 205274
: 87320 |
87321