From 3ef7143dbea4cf49c5629030d76c0766276562fd Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 19 Jun 2012 18:26:55 +0200 Subject: [PATCH] supports_delete_on_close: Initialise OSVIERSIONINFO struct per documentation The microsoft documentation says that dwOSVersionInfoSize must be initialised with the size of the struct. This was not being done, so the call to GetVersionEx was failing. --- gl/clean-temp.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gl/clean-temp.c b/gl/clean-temp.c index b05550a..362acff 100644 --- a/gl/clean-temp.c +++ b/gl/clean-temp.c @@ -583,6 +583,10 @@ supports_delete_on_close () { OSVERSIONINFO v; + /* according to http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451%28v=vs.85%29.aspx + this structure must be initialised as follows: */ + v.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + if (GetVersionEx (&v)) known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1); else -- 1.7.2.5