Re: Postmaster service code

From: "Laurent Ballester" <postgresql(dot)ballester(at)wanadoo(dot)fr>
To: "Darko Prenosil" <Darko(dot)Prenosil(at)finteh(dot)hr>, "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>, <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: Postmaster service code
Date: 2004-05-09 10:49:20
Message-ID: 00e001c435b3$492f9610$1cf0fdc1@fleche
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Yes, we need to create and register a tiny DLL to avoid to have error
message joined to our log message such as describe Dave in it's previous
mail.

By studing the works made by Claudio, a simple way to achieve this work it
to create a message wich contains only %1 like the mc file i'am attached
with this post, and to modify a little bit the write_eventlog function he
made (4 parameters of ReportEvent have to change to 0 with 0x00000001L or
PGWIN32_EVENTLOG_MSG in my sample).

To obtain a DLL, we need Microsoft MC Compiler to create a RC file and after
we can finish the compilation with Msys tools.

for Visual Studio users :

mc EventLogMsg.mc # produce one rc file and one .h file
rc -r -fo EventLogMsg.res EventLogMsg.rc
link -dd -noentry -out:EventLogMsg.dll EventLogMsg.res

for Msys :
After obtain a .RC file with MC compiler
windres -o EventLogMsg.o EventLogMsg.rc
dllwrap --dllname=EventLogMsg.dll --driver-name=gcc EventLogMsg.o

To finish, we have to register the DLL in
HKEY_LOCAL_MACHINE\system\CurrentControlSet\Services\EventLog\Application
Create a entry name PostGreSQL, add a key EventMessageFile set it with the
full path of the DLL
two issues : made this job by setup program or by write_eventlog() itself.

Do you know, where will be the right place to put these files and
update/create a Makefile

Regards, Laurent

Attachment Content-Type Size
EventLogMsg.mc application/octet-stream 68 bytes
EventLogMsg.h text/plain 909 bytes
EventLogMsg.rc text/plain 35 bytes

In response to

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Peter Eisentraut 2004-05-09 11:41:38 Re: mingw configure failure detection
Previous Message Darko Prenosil 2004-05-09 10:02:41 Re: Postmaster service code