Re: Postmaster service code

From: "Laurent Ballester" <postgresql(dot)ballester(at)wanadoo(dot)fr>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>, <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: Postmaster service code
Date: 2004-05-09 22:21:13
Message-ID: 002c01c43613$f0b46810$82d6fdc1@fleche
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32


>Yes, this is exactly what I had in mind whien I did the eventlogging
>code. Except can't you keep using msgid 0? Or is it prohibited? (I
>thought I had used 0 in a previous project, but my memory may be a bit
>off)
>If we can go with 0 I think we should - it seems more appropriate,
>especialy in case we evern want to map error codes to eventids.

Yes we can of course. I modify the mc file.

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

Question: Doesn't MC also generate a .bin-file? IIRC, the .RC file is
just a reference to the .BIN?

Correct, the file was missing in my post !

If not, then it's an easy go - I suggest we put both the .RC and the .MC
file in, so things will still build fully from mingw. If not, I don't
know what the deal is about binary files - could we stuff a
pre-generated .BIN file in CVS? [I know cvs can, but is that acceptable
in postgresql?]

>To finish, we have to register the DLL in
>HKEY_LOCAL_MACHINE\system\CurrentControlSet\Services\EventLog\A
>pplication
>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.

write_eventlog() cannot do this, since the postmaster will run as a
non-administrator, and thus not have permissions under that key.
The installation program should normally do this.

I would suggest implementing the DllRegisterServer() and
DllUnRegisterServer() entrypoint in a small C file that is compiled into
the DLL. That way, a user can just run "regsvr32 pgevent.dll" (or
whatever it's called).
See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/htm
/cmf_d2l_3cmq.asp

If everybody is OK, I will make this extension during the week.

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

> I would suggest creating "bin/pgevent". Comments?

It's ok for me

Regards, Laurent

Attachment Content-Type Size
MSG00001.bin application/octet-stream 28 bytes
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 Bruce Momjian 2004-05-10 04:19:03 Re: JDBC problem/question
Previous Message Thomas Kellerer 2004-05-09 18:00:22 JDBC problem/question