Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

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:

See Microsoft SDK

The Sprezzatura Group

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?

The Sprezzatura Group

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 Log
	void=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 error
	void=msg("Unable to create windows event log handle||Possible causes are security/permissions")
end
return

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

The Sprezzatura Group

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.

The Sprezzatura Group

World leaders in all things RevSoft


At 17 OCT 2005 06:05PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

  • third_party_content/community/commentary/forums_nonworks/9d354e1a2016da1e85257099002f3301.txt
  • Last modified: 2023/12/28 07:39
  • by 127.0.0.1