Does anyone know how to write to the windows event log from OI ? (OpenInsight 32-bit Specific)
At 13 OCT 2005 04:35:32AM Dale Jessop wrote:
Hi guys,
I want to write to the windows event log when OI goes into DEBUG, I'm running on OI 7.1.1 & have configured OI to intercept the debug, return a user-friendly message and then shutdown. However, it would also be nice if I could write to the windows event log as well. Infact, I think this should be part of the standard DEBUGGER_REPLACEMENT program… anyways…
Can anyone help? has anyone already done this?
Any help would be appreciated!
At 13 OCT 2005 07:56AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
World leaders in all things RevSoft
At 13 OCT 2005 08:12AM Dale Jessop wrote:
I have done and have implemented the following in the KERNEL32_DLL
LONG STDCALL ReportEventA(LONG,LONG,LONG,LONG,LONG,LONG,LONG,LPSTR,VOID) as ReportEvent
LONG STDCALL RegisterEventSourceA(LPSTR,LPSTR) as RegisterEventSource
but i get and ENG0805 error.
At 13 OCT 2005 08:19AM Dale Jessop wrote:
Think I've been a bit thick and looked at the wrong DLL doh! KERNEL32 instead of ADVAPI32
At 13 OCT 2005 08:31AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Off the top of our heads - are you sure it isn't exported out of advapi32.dll?
World leaders in all things RevSoft
At 13 OCT 2005 09:26AM Dale Jessop wrote:
I now have the following in DLL_ADVAPI32
INT STDCALL ReportEventA( HANDLE, LPCHAR, LPCHAR, ULONG, LONG, LPCHAR, ULONG, LPCHAR, LPVOID ) AS ReportEvent
HANDLE STDCALL RegisterEventSourceA( LPCHAR, LPCHAR ) As RegisterEventSource
I get a handle back but I don't get a event being created… I'm using the following code:
EQU EVENTLOG_SUCCESS TO 0x0000 ; * Success event
EQU EVENTLOG_ERROR_TYPE TO 0x0001 ; * Error event
EQU EVENTLOG_WARNING_TYPE TO 0x0002 ; * Warning event
EQU EVENTLOG_INFORMATION_TYPE TO 0x0004 ; * Information event
EQU EVENTLOG_AUDIT_SUCCESS TO 0x0008 ; * Success audit event
EQU EVENTLOG_AUDIT_FAILURE TO 0x0010 ; * Failure audit event
DEBUG
handle=RegisterEventSource('','DialeCT (Application Name)')if (handle) then
Create Event Logvoid=ReportEvent(handle, EVENTLOG_ERROR_TYPE, '111','222', '', 1, 1, 'THIS IS THE ERROR TEXT', '')end else
Error cannot write to windows log file, possible security errorvoid=msg("Unable to create windows event log handle||Possible causes are security/permissions")endreturn
Any help in finishing off this would be appreciated
![]()
At 17 OCT 2005 09:22AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Dale
As this falls into the consultancy arena we will not be replying in full just yet. However because we believe that this technique will be of great use in the real world for people wishing to produce bullet proof software we will shortly release an object code only utility to make this possible.
It will be free.
Regards
World leaders in all things RevSoft
At 17 OCT 2005 11:48AM Dale Jessop wrote:
Cheers Sprezz!
Again, you guys have come up trumps! and not the stink kind
![]()
…will look forward to using the util, again cheers!
At 17 OCT 2005 11:51AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Manual is just being proofed and final release tested internally - should be up on our site within 24 hours. Will post here when complete.
World leaders in all things RevSoft
At 17 OCT 2005 06:05PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
OK available at http://www.sprezzatura.com/s_log.htm
World leaders in all things RevSoft