Re: Postmaster service code - Mailing list pgsql-hackers-win32

From Laurent Ballester
Subject Re: Postmaster service code
Date
Msg-id 00e001c435b3$492f9610$1cf0fdc1@fleche
Whole thread Raw
In response to Postmaster service code  ("Dave Page" <dpage@vale-housing.co.uk>)
List 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

pgsql-hackers-win32 by date:

Previous
From: "Darko Prenosil"
Date:
Subject: Re: Postmaster service code
Next
From: "Magnus Hagander"
Date:
Subject: Re: Postmaster service code