Only fail with ERROR_INSUFFICIENT_BUFFER if the structure size is

actually too small.
This commit is contained in:
James Juran 2001-05-24 18:38:49 +00:00 committed by Alexandre Julliard
parent 3724de93d7
commit 94cd060d80
1 changed files with 3 additions and 3 deletions

View File

@ -396,7 +396,7 @@ LONG WINAPI GetVersion(void)
BOOL16 WINAPI GetVersionEx16(OSVERSIONINFO16 *v)
{
WINDOWS_VERSION ver = VERSION_GetVersion();
if (v->dwOSVersionInfoSize != sizeof(OSVERSIONINFO16))
if (v->dwOSVersionInfoSize < sizeof(OSVERSIONINFO16))
{
WARN("wrong OSVERSIONINFO size from app\n");
SetLastError(ERROR_INSUFFICIENT_BUFFER);
@ -417,7 +417,7 @@ BOOL16 WINAPI GetVersionEx16(OSVERSIONINFO16 *v)
BOOL WINAPI GetVersionExA(OSVERSIONINFOA *v)
{
WINDOWS_VERSION ver = VERSION_GetVersion();
if (v->dwOSVersionInfoSize != sizeof(OSVERSIONINFOA))
if (v->dwOSVersionInfoSize < sizeof(OSVERSIONINFOA))
{
WARN("wrong OSVERSIONINFO size from app (got: %ld, expected: %d)\n",
v->dwOSVersionInfoSize, sizeof(OSVERSIONINFOA));
@ -440,7 +440,7 @@ BOOL WINAPI GetVersionExW(OSVERSIONINFOW *v)
{
WINDOWS_VERSION ver = VERSION_GetVersion();
if (v->dwOSVersionInfoSize!=sizeof(OSVERSIONINFOW))
if (v->dwOSVersionInfoSize < sizeof(OSVERSIONINFOW))
{
WARN("wrong OSVERSIONINFO size from app (got: %ld, expected: %d)\n",
v->dwOSVersionInfoSize, sizeof(OSVERSIONINFOW));