2008-05-09 17:35:45 +00:00
|
|
|
/*
|
|
|
|
* Unit test suite for version functions
|
|
|
|
*
|
|
|
|
* Copyright 2006 Robert Shearman
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
|
|
|
|
static BOOL (WINAPI * pVerifyVersionInfoA)(LPOSVERSIONINFOEXA, DWORD, DWORDLONG);
|
|
|
|
static ULONGLONG (WINAPI * pVerSetConditionMask)(ULONGLONG, DWORD, BYTE);
|
|
|
|
|
|
|
|
#define KERNEL32_GET_PROC(func) \
|
|
|
|
p##func = (void *)GetProcAddress(hKernel32, #func); \
|
|
|
|
if(!p##func) trace("GetProcAddress(hKernel32, '%s') failed\n", #func);
|
|
|
|
|
|
|
|
static void init_function_pointers(void)
|
|
|
|
{
|
|
|
|
HMODULE hKernel32;
|
|
|
|
|
|
|
|
pVerifyVersionInfoA = NULL;
|
|
|
|
pVerSetConditionMask = NULL;
|
|
|
|
|
|
|
|
hKernel32 = GetModuleHandleA("kernel32.dll");
|
|
|
|
assert(hKernel32);
|
|
|
|
KERNEL32_GET_PROC(VerifyVersionInfoA);
|
|
|
|
KERNEL32_GET_PROC(VerSetConditionMask);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_GetVersionEx(void)
|
|
|
|
{
|
|
|
|
OSVERSIONINFOA infoA;
|
|
|
|
OSVERSIONINFOEXA infoExA;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
if (0)
|
|
|
|
{
|
|
|
|
/* Silently crashes on XP */
|
|
|
|
ret = GetVersionExA(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
memset(&infoA,0,sizeof infoA);
|
|
|
|
ret = GetVersionExA(&infoA);
|
|
|
|
ok(!ret, "Expected GetVersionExA to fail\n");
|
|
|
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
|
|
|
|
GetLastError() == 0xdeadbeef /* Win9x */,
|
|
|
|
"Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n",
|
|
|
|
GetLastError());
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
infoA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA) / 2;
|
|
|
|
ret = GetVersionExA(&infoA);
|
|
|
|
ok(!ret, "Expected GetVersionExA to fail\n");
|
|
|
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
|
|
|
|
GetLastError() == 0xdeadbeef /* Win9x */,
|
|
|
|
"Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n",
|
|
|
|
GetLastError());
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
infoA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA) * 2;
|
|
|
|
ret = GetVersionExA(&infoA);
|
|
|
|
ok(!ret, "Expected GetVersionExA to fail\n");
|
|
|
|
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
|
|
|
|
GetLastError() == 0xdeadbeef /* Win9x */,
|
|
|
|
"Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n",
|
|
|
|
GetLastError());
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
infoA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
|
|
|
|
ret = GetVersionExA(&infoA);
|
|
|
|
ok(ret, "Expected GetVersionExA to succeed\n");
|
|
|
|
ok(GetLastError() == 0xdeadbeef,
|
|
|
|
"Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
|
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
infoExA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
|
|
|
|
ret = GetVersionExA((OSVERSIONINFOA *)&infoExA);
|
2008-12-23 20:02:47 +00:00
|
|
|
ok(ret ||
|
|
|
|
broken(ret == 0), /* win95 */
|
|
|
|
"Expected GetVersionExA to succeed\n");
|
2008-05-09 17:35:45 +00:00
|
|
|
ok(GetLastError() == 0xdeadbeef,
|
|
|
|
"Expected 0xdeadbeef, got %d\n", GetLastError());
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_VerifyVersionInfo(void)
|
|
|
|
{
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
OSVERSIONINFOEX info;
|
2008-05-09 17:35:45 +00:00
|
|
|
BOOL ret;
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
DWORD servicepack, error;
|
2008-05-09 17:35:45 +00:00
|
|
|
|
|
|
|
if(!pVerifyVersionInfoA || !pVerSetConditionMask)
|
|
|
|
{
|
2009-05-17 07:05:22 +00:00
|
|
|
win_skip("Needed functions not available\n");
|
2008-05-09 17:35:45 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Before we start doing some tests we should check what the version of
|
|
|
|
* the ServicePack is. Tests on a box with no ServicePack will fail otherwise.
|
|
|
|
*/
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
|
|
|
GetVersionExA((OSVERSIONINFO *)&info);
|
2008-05-09 17:35:45 +00:00
|
|
|
servicepack = info.wServicePackMajor;
|
|
|
|
memset(&info, 0, sizeof(info));
|
|
|
|
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION,
|
|
|
|
pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL));
|
|
|
|
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
2008-05-09 17:35:45 +00:00
|
|
|
ret = pVerifyVersionInfoA(&info, VER_BUILDNUMBER | VER_MAJORVERSION |
|
|
|
|
VER_MINORVERSION/* | VER_PLATFORMID | VER_SERVICEPACKMAJOR |
|
|
|
|
VER_SERVICEPACKMINOR | VER_SUITENAME | VER_PRODUCT_TYPE */,
|
|
|
|
pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
error = GetLastError();
|
|
|
|
ok(!ret, "VerifyVersionInfoA succeeded\n");
|
|
|
|
ok(error == ERROR_OLD_WIN_VERSION,
|
|
|
|
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
|
2008-05-09 17:35:45 +00:00
|
|
|
|
|
|
|
/* tests special handling of VER_SUITENAME */
|
|
|
|
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_SUITENAME,
|
|
|
|
pVerSetConditionMask(0, VER_SUITENAME, VER_AND));
|
|
|
|
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
|
|
|
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_SUITENAME,
|
|
|
|
pVerSetConditionMask(0, VER_SUITENAME, VER_OR));
|
|
|
|
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
|
|
|
|
|
|
|
/* test handling of version numbers */
|
|
|
|
|
|
|
|
/* v3.10 is always less than v4.x even
|
|
|
|
* if the minor version is tested */
|
|
|
|
info.dwMajorVersion = 3;
|
|
|
|
info.dwMinorVersion = 10;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL),
|
|
|
|
VER_MAJORVERSION, VER_GREATER_EQUAL));
|
|
|
|
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
|
|
|
|
|
|
|
info.dwMinorVersion = 0;
|
|
|
|
info.wServicePackMajor = 10;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL),
|
|
|
|
VER_MAJORVERSION, VER_GREATER_EQUAL));
|
|
|
|
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
|
|
|
|
|
|
|
info.wServicePackMajor = 0;
|
|
|
|
info.wServicePackMinor = 10;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL),
|
|
|
|
VER_MAJORVERSION, VER_GREATER_EQUAL));
|
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.wServicePackMinor++;
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
2008-05-09 17:35:45 +00:00
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
error = GetLastError();
|
|
|
|
ok(!ret, "VerifyVersionInfoA succeeded\n");
|
|
|
|
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some wink2 */,
|
|
|
|
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
|
2008-05-09 17:35:45 +00:00
|
|
|
|
|
|
|
if (servicepack == 0)
|
|
|
|
{
|
|
|
|
skip("There is no ServicePack on this system\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.wServicePackMajor--;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
2008-05-09 17:35:45 +00:00
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.wServicePackMajor--;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
2008-05-09 17:35:45 +00:00
|
|
|
}
|
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.wServicePackMajor++;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
2008-05-09 17:35:45 +00:00
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.wServicePackMajor++;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
2008-05-09 17:35:45 +00:00
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.wServicePackMajor--;
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
2008-05-09 17:35:45 +00:00
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
error = GetLastError();
|
|
|
|
ok(!ret, "VerifyVersionInfoA succeeded\n");
|
|
|
|
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */,
|
|
|
|
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
|
2008-05-09 17:35:45 +00:00
|
|
|
|
|
|
|
/* test the failure hierarchy for the four version fields */
|
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.wServicePackMajor++;
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
2008-05-09 17:35:45 +00:00
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
error = GetLastError();
|
|
|
|
ok(!ret, "VerifyVersionInfoA succeeded\n");
|
|
|
|
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */,
|
|
|
|
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
|
2008-05-09 17:35:45 +00:00
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.dwMinorVersion++;
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
2008-05-09 17:35:45 +00:00
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
error = GetLastError();
|
|
|
|
ok(!ret, "VerifyVersionInfoA succeeded\n");
|
|
|
|
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */,
|
|
|
|
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
|
2008-05-09 17:35:45 +00:00
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.dwMajorVersion++;
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
2008-05-09 17:35:45 +00:00
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
error = GetLastError();
|
|
|
|
ok(!ret, "VerifyVersionInfoA succeeded\n");
|
|
|
|
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */,
|
|
|
|
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
|
2008-05-09 17:35:45 +00:00
|
|
|
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
2008-05-09 17:35:45 +00:00
|
|
|
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.dwBuildNumber++;
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
SetLastError(0xdeadbeef);
|
2008-05-09 17:35:45 +00:00
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
error = GetLastError();
|
|
|
|
ok(!ret, "VerifyVersionInfoA succeeded\n");
|
|
|
|
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */,
|
|
|
|
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
|
2008-05-09 17:35:45 +00:00
|
|
|
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
2008-05-09 17:35:45 +00:00
|
|
|
|
|
|
|
/* test bad dwOSVersionInfoSize */
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
|
2008-05-09 17:35:45 +00:00
|
|
|
GetVersionEx((OSVERSIONINFO *)&info);
|
|
|
|
info.dwOSVersionInfoSize = 0;
|
|
|
|
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
|
|
|
|
pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL));
|
Sync advapi32, comctl32, crypt32, cryptui, cryptnet, fusion, gdi32, gdiplus, hlink, imm32, jscript, kernel32, localspl, msacm32, mscms, msi, mstask, msvcrtd, msxml3, ntdll, ole32, pdh, psapi, quartz, rasapi32, riched20 AND rsaenh Winetests.
TBD mshtml, shell32, oleaut32 which still fail to build here
svn path=/trunk/; revision=47931
2010-07-03 12:45:23 +00:00
|
|
|
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
|
2008-05-09 17:35:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
START_TEST(version)
|
|
|
|
{
|
|
|
|
init_function_pointers();
|
|
|
|
|
|
|
|
test_GetVersionEx();
|
|
|
|
test_VerifyVersionInfo();
|
|
|
|
}
|