Re: [PATCHES] Open Items - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: [PATCHES] Open Items
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE476092@algol.sollentuna.se
Whole thread Raw
List pgsql-hackers
> > Just one question about the actual implementation of the
> patch - why
> > are you setting the OS version *before* you call GetVersionEx()?
>
> The Microsoft Example did a memset on the structure before
> calling void GetVersionEx().

The docs only say you have tos et the dwOSVersionInfoSize member before
you call it, no need to memset.

> Setting it to a version that needs the Global\ is only a
> safeguard against a failing call. I guess the call cannot
> fail, and thus setting it before is not really needed.

The call will return FALSE when it fails, and this should probably be
checked - missed that. It is *not* a void function, it is a BOOL
function.
It can fail. For example, if you pass it a size that is not supported by
the OS you are on (say a OSVERSIONINFOEX structure on a pre-sp6 NT4). I
don't think it can fail for other reasons than that, but I'm not sure.
It should probably be checked..

(See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo
/base/getversionex.asp)


//Magnus

pgsql-hackers by date:

Previous
From: "Zeugswetter Andreas DAZ SD"
Date:
Subject: Re: [PATCHES] Open Items
Next
From: Bruce Momjian
Date:
Subject: Re: tablespaces for temporary files