Re: win2k, service, pg_ctl, popen, etc

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: win2k, service, pg_ctl, popen, etc
Date: 2004-07-21 12:26:31
Message-ID: 40FE60F7.2050204@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Claudio Natoli wrote:

>>If we don't know why, sign one more down as a bug in mingw (hardly
>>surprising - just the area of pipes and consoles seems to be
>>where it's weak). In that case, why not just recode pg_ctl to execute
>>postmaster.exe from the same directory it found pg_ctl.exe
>>in. This can easily be done using GetModuleFileName(). Is a pipe opened at
>>
>>
>
>
>
>>any other place? Or does other places need to be fixed as well (I haven't
>>
>>
>gone
>
>
>>through the whole code).
>>
>>
>
>Moreover, all the find_*_exec calls could (and IMHO, should) make use of
>GetModuleFileName. Win32 has an API to find the running file name; *nix does
>not and so we have to jump through a few hoops. I just don't see the sense
>in jumping through the same hoops under Win32.
>
>Sure, the functions also make certain that the version is as expected, but
>to my mind this is just a safety check to make sure the hoops we just jumped
>through were all in order. Of course, we'd also lose the ability to protect
>people who mix versions in the same directory, but such people need a lot
>more protection from themselves than we can provide. ;-)
>
>Does there continue to be any resistance to this approach? If not, I'll
>gladly provide a patch.
>
>
>
>

As I understand it, Windows has a standard set of DLL/EXE metadata
(build number, copyright, product name yadda yadda yadda) stored in some
well-known segment of the file. Is there any reason we can't put the
version number somewhere in there and use some standard API to extract
it, rather than running the .exe to make it tell us? (Not that I have
any idea how to do such a thing.)

cheers

andrew

In response to

Responses

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Bruce Momjian 2004-07-21 14:05:37 Re: Borland c++ compile problems...
Previous Message Magnus Hagander 2004-07-21 11:05:19 Re: win2k, service, pg_ctl, popen, etc