Re: Re: [Ethereal-cvs] rev 18183: /trunk/epan/: emem.c

"Lars Roland" <[email protected]>
Newsgroups gmane.network.ethereal.devel
Message-ID <[email protected]>
> --- Ursprüngliche Nachricht ---
> Von: Ulf Lamping <[email protected]>
> An: [email protected]
> Betreff: [Ethereal-dev] Re: [Ethereal-cvs] rev 18183: /trunk/epan/: emem.c
> Datum: Thu, 18 May 2006 10:08:00 +0200
> 
> [email protected] wrote:
> > User: lroland
> > Date: 2006/05/17 07:25 PM
> >
> > Log:
> >  Improve fix for Bug 915 by using GetVersionEx() as it is recommended by
> Microsoft. Tested on Win98 SE.
> >
> >   
> So what's the difference between:
> 
> versinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
> 
> and
> 
> *static* OSVERSIONINFO versinfo;
> 
> versinfo.dwOSVersionInfoSize = sizeof(versinfo);
> 
> ?!?
> 

Microsoft recommends to set versinfo.dwOSVersionInfoSize either to
sizeof(OSVERSIONINFO) or sizeof(OSVERSIONINFOEX) depending on how much
information do you want to retrieve.

I don't know if sizeof(versinfo) is equal to sizeof(OSVERSIONINFO) or equl
to sizeof(OSVERSIONINFOEX) or something completely different. I guess it is
equal to sizeof(OSVERSIONINFOEX), which isn't supported on Win9x and WinNT 4
with SP5 or less. This would explain, why GetVersionInfoEx() failed.

OSVERSIONINFO is supported on Win9x including Win95 and all WinNT versions
except for WinNT 3.5x.

However GetVersionInfoEx() might fail for another reason so the check should
be put back.


> 
> You've removed the handling if GetVersionInfoEx fails, which makes your 
> solution:
> 
> - "Microsoft recommended"
> - fail if the call to GetVersionInfoEx fails
> 
> Just because Microsoft gives examples that way doesn't mean that it's 
> the right solution :-)
> 
> People reported problems that the call the GetVersionInfoEx() failed on 
> their machines (on Win98 First Edition, for whatever reason), so I got 
> the strong feeling your solution is even worse than mine ;-)
> 
> Regards, ULFL

Best Regards,
Lars
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.