diff options
author | Lars Roland <Lars.Roland@gmx.net> | 2006-05-18 00:25:14 +0000 |
---|---|---|
committer | Lars Roland <Lars.Roland@gmx.net> | 2006-05-18 00:25:14 +0000 |
commit | d9b956503232680bb3a5647c4a13f633dca6a7b3 (patch) | |
tree | 02fe96e3fb839b3d2ff72fe61f20b5f46c666afe | |
parent | 86d8177cc1384ff07b91f2e43579785e2188a664 (diff) |
Improve fix for Bug 915 by using GetVersionEx() as it is recommended by Microsoft. Tested on Win98 SE.
svn path=/trunk/; revision=18183
-rw-r--r-- | epan/emem.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/epan/emem.c b/epan/emem.c index c1f4ff294f..391a735fa5 100644 --- a/epan/emem.c +++ b/epan/emem.c @@ -204,19 +204,24 @@ ep_init_chunk(void) GetSystemInfo(&sysinfo); pagesize = sysinfo.dwPageSize; - versinfo.dwOSVersionInfoSize = sizeof(versinfo); - if( !GetVersionEx(&versinfo) ) { - /* the GetVersionEx() call may fail on some older Win95/98 systems */ - /* force the id so we don't care about VirtualProtect() return values */ - versinfo.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS; - } + /* calling GetVersionEx using the OSVERSIONINFO structure. + * OSVERSIONINFOEX requires Win NT4 with SP6 or newer NT Versions. + * OSVERSIONINFOEX will fail on Win9x and older NT Versions. + * See also: + * http://msdn.microsoft.com/library/en-us/sysinfo/base/getversionex.asp + * http://msdn.microsoft.com/library/en-us/sysinfo/base/osversioninfo_str.asp + * http://msdn.microsoft.com/library/en-us/sysinfo/base/osversioninfoex_str.asp + */ + versinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&versinfo); + #elif defined(USE_GUARD_PAGES) pagesize = sysconf(_SC_PAGESIZE); #endif /* _WIN32 / USE_GUARD_PAGES */ #endif /* SE_DEBUG_FREE */ -} +} /* Initialize the capture-lifetime memory allocation pool. * This function should be called only once when Ethereal or Tethereal starts * up. |