Commit 594af0de authored by Morten Eriksen's avatar Morten Eriksen Committed by Alexandre Julliard

Made GetVersionEx() behave in accordance with the specification with

regard to error handling.
parent 6f617600
......@@ -17,6 +17,7 @@
#include "debugtools.h"
#include "neexe.h"
#include "winversion.h"
#include "winerror.h"
DEFAULT_DEBUG_CHANNEL(ver)
......@@ -331,6 +332,7 @@ BOOL16 WINAPI GetVersionEx16(OSVERSIONINFO16 *v)
if (v->dwOSVersionInfoSize != sizeof(OSVERSIONINFO16))
{
WARN("wrong OSVERSIONINFO size from app");
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
v->dwMajorVersion = VersionData[ver].getVersionEx.dwMajorVersion;
......@@ -351,6 +353,7 @@ BOOL WINAPI GetVersionExA(OSVERSIONINFOA *v)
if (v->dwOSVersionInfoSize != sizeof(OSVERSIONINFOA))
{
WARN("wrong OSVERSIONINFO size from app");
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
v->dwMajorVersion = VersionData[ver].getVersionEx.dwMajorVersion;
......@@ -372,6 +375,7 @@ BOOL WINAPI GetVersionExW(OSVERSIONINFOW *v)
if (v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFOW))
{
WARN("wrong OSVERSIONINFO size from app");
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
v->dwMajorVersion = VersionData[ver].getVersionEx.dwMajorVersion;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment