Re: Can a windows DLL have more than one process attached?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can a windows DLL have more than one process attached?
Дата
Msg-id 176.1006908011@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Can a windows DLL have more than one process attached?  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Список pgsql-interfaces
Actually, the more I look at this, the more broken it looks.

(1) netmsgModule and winsock_strerror_buf are declared as static
variables in libpq/win32.h.  Unless Windows has some truly creative new
interpretation of static variables, this means that there'll be a
separate instance of these vars in each .c file that #includes win32.h.
Wasting half a K of space per .c file is the least of the consequences.

(2) Since libpqdll.c and fe-misc.c don't share the same instance of
netmsgModule, winsock_strerror will always see it as NULL regardless
of what DllMain has done or not done.

(3) Even if winsock_strerror saw netmsgModule, it doesn't pass it to
FormatMessage, which means (if I'm reading the documentation I found on
the net correctly) that the wrong message table would be searched.
I think that the "0" parameter should be netmsgModule instead.

Have we got any people who actually know the Windows platform and
can confirm or deny these points?

I'd be happy to change the code to something that looks reasonable to
me, but I'm in no position to test it.
        regards, tom lane


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

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: ODBC driver with dynamic cursor support ??
Следующее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Can a windows DLL have more than one process attached?