Re: Postmaster service code

Поиск
Список
Период
Сортировка
От Laurent Ballester
Тема Re: Postmaster service code
Дата
Msg-id 002c01c43613$f0b46810$82d6fdc1@fleche
обсуждение исходный текст
Ответ на Re: Postmaster service code  ("Magnus Hagander" <mha@sollentuna.net>)
Список 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

Вложения

В списке pgsql-hackers-win32 по дате отправления:

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: JDBC problem/question
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: JDBC problem/question