Author: akhaldi
Date: Sat Apr 26 18:16:00 2014
New Revision: 63003
URL:
http://svn.reactos.org/svn/reactos?rev=63003&view=rev
Log:
[VERSION_WINETEST]
* Sync with Wine 1.7.17.
CORE-8080
Modified:
trunk/rostests/winetests/version/CMakeLists.txt
trunk/rostests/winetests/version/info.c
trunk/rostests/winetests/version/install.c
Modified: trunk/rostests/winetests/version/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/CMakeLi…
==============================================================================
--- trunk/rostests/winetests/version/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/winetests/version/CMakeLists.txt [iso-8859-1] Sat Apr 26 18:16:00 2014
@@ -8,5 +8,8 @@
add_executable(version_winetest ${SOURCE} version.rc)
set_module_type(version_winetest win32cui)
-add_importlibs(version_winetest version msvcrt kernel32 ntdll)
+add_importlibs(version_winetest version msvcrt kernel32)
+if(MSVC)
+ add_importlibs(version_winetest ntdll)
+endif()
add_cd_file(TARGET version_winetest DESTINATION reactos/bin FOR all)
Modified: trunk/rostests/winetests/version/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/info.c?…
==============================================================================
--- trunk/rostests/winetests/version/info.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/version/info.c [iso-8859-1] Sat Apr 26 18:16:00 2014
@@ -204,7 +204,7 @@
VS_FIXEDFILEINFO *pFixedVersionInfo;
UINT uiLength;
char VersionString[MAX_PATH];
- static CHAR backslash[] = "\\";
+ static const char backslash[] = "\\";
DWORDLONG dwlVersion;
hdl = 0x55555555;
@@ -457,7 +457,7 @@
HeapFree( GetProcessHeap(), 0, pVersionInfoW);
}
-static void test_VerQueryValue(void)
+static void test_VerQueryValueA(void)
{
static const char * const value_name[] = {
"Product", "CompanyName", "FileDescription",
"Internal",
@@ -468,24 +468,24 @@
UINT len, ret, translation, i;
char buf[MAX_PATH];
- ret = GetModuleFileName(NULL, buf, sizeof(buf));
+ ret = GetModuleFileNameA(NULL, buf, sizeof(buf));
assert(ret);
SetLastError(0xdeadbeef);
- len = GetFileVersionInfoSize(buf, NULL);
- ok(len, "GetFileVersionInfoSize(%s) error %u\n", buf, GetLastError());
+ len = GetFileVersionInfoSizeA(buf, NULL);
+ ok(len, "GetFileVersionInfoSizeA(%s) error %u\n", buf, GetLastError());
ver = HeapAlloc(GetProcessHeap(), 0, len);
assert(ver);
SetLastError(0xdeadbeef);
- ret = GetFileVersionInfo(buf, 0, len, ver);
- ok(ret, "GetFileVersionInfo error %u\n", GetLastError());
-
- p = (char *)0xdeadbeef;
- len = 0xdeadbeef;
- SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, "\\VarFileInfo\\Translation", (LPVOID*)&p,
&len);
+ ret = GetFileVersionInfoA(buf, 0, len, ver);
+ ok(ret, "GetFileVersionInfoA error %u\n", GetLastError());
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = VerQueryValueA(ver, "\\VarFileInfo\\Translation", (LPVOID*)&p,
&len);
ok(ret, "VerQueryValue error %u\n", GetLastError());
ok(len == 4, "VerQueryValue returned %u, expected 4\n", len);
@@ -495,7 +495,7 @@
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, "String", (LPVOID*)&p, &len);
+ ret = VerQueryValueA(ver, "String", (LPVOID*)&p, &len);
ok(!ret, "VerQueryValue should fail\n");
ok(GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND ||
GetLastError() == 0xdeadbeef /* NT4, W2K */,
@@ -506,42 +506,42 @@
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, "StringFileInfo", (LPVOID*)&p, &len);
- ok(ret, "VerQueryValue error %u\n", GetLastError());
-todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
+ ret = VerQueryValueA(ver, "StringFileInfo", (LPVOID*)&p, &len);
+ ok(ret, "VerQueryValue error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n");
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, "\\StringFileInfo", (LPVOID*)&p, &len);
- ok(ret, "VerQueryValue error %u\n", GetLastError());
-todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
+ ret = VerQueryValueA(ver, "\\StringFileInfo", (LPVOID*)&p, &len);
+ ok(ret, "VerQueryValue error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n");
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, "\\\\StringFileInfo", (LPVOID*)&p, &len);
- ok(ret, "VerQueryValue error %u\n", GetLastError());
-todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
+ ret = VerQueryValueA(ver, "\\\\StringFileInfo", (LPVOID*)&p,
&len);
+ ok(ret, "VerQueryValue error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n");
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, "\\StringFileInfo\\\\", (LPVOID*)&p,
&len);
- ok(ret, "VerQueryValue error %u\n", GetLastError());
-todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
+ ret = VerQueryValueA(ver, "\\StringFileInfo\\\\", (LPVOID*)&p,
&len);
+ ok(ret, "VerQueryValue error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n");
sprintf(buf, "\\StringFileInfo\\%08x", translation);
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, buf, (LPVOID*)&p, &len);
- ok(ret, "VerQueryValue error %u\n", GetLastError());
-todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
+ ret = VerQueryValueA(ver, buf, (LPVOID*)&p, &len);
+ ok(ret, "VerQueryValue error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValue returned %u, expected 0\n", len);
ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n");
for (i = 0; i < sizeof(value_name)/sizeof(value_name[0]); i++)
@@ -550,20 +550,20 @@
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, buf, (LPVOID*)&p, &len);
- ok(ret, "VerQueryValue(%s) error %u\n", buf, GetLastError());
+ ret = VerQueryValueA(ver, buf, (LPVOID*)&p, &len);
+ ok(ret, "VerQueryValueA(%s) error %u\n", buf, GetLastError());
ok(len == strlen(value_name[i]) + 1, "VerQueryValue returned %u\n",
len);
ok(!strcmp(value_name[i], p), "expected \"%s\", got
\"%s\"\n",
value_name[i], p);
/* test partial value names */
- len = lstrlen(buf);
+ len = lstrlenA(buf);
buf[len - 2] = 0;
p = (char *)0xdeadbeef;
len = 0xdeadbeef;
SetLastError(0xdeadbeef);
- ret = VerQueryValue(ver, buf, (LPVOID*)&p, &len);
- ok(!ret, "VerQueryValue(%s) succeeded\n", buf);
+ ret = VerQueryValueA(ver, buf, (LPVOID*)&p, &len);
+ ok(!ret, "VerQueryValueA(%s) succeeded\n", buf);
ok(GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND ||
GetLastError() == 0xdeadbeef /* NT4, W2K */,
"VerQueryValue returned %u\n", GetLastError());
@@ -574,10 +574,61 @@
HeapFree(GetProcessHeap(), 0, ver);
}
+static void test_extra_block(void)
+{
+ WORD extra_block[] = {
+ 72, 0, 0, 'W', 'i', 'n', 'e', 'T',
'e', 's', 't', '\0',
+ 24, 4, 0, 'B', 'i', 'n', 'a', 'r',
'y', '\0', 0xbeef, 0xdead,
+ 24, 4, 1, 'T', 'e', 'x', 't', '\0',
'B', '-', ')', '\0',
+ };
+ char buf[MAX_PATH];
+ UINT len, ret;
+ ULONG w;
+ char *ver, *p;
+ WORD *length;
+
+ ret = GetModuleFileNameA(NULL, buf, sizeof(buf));
+ ok(ret, "GetModuleFileNameA failed\n");
+
+ len = GetFileVersionInfoSizeA(buf, NULL);
+ ok(len, "GetFileVersionInfoSizeA(%s) error %u\n", buf, GetLastError());
+
+ ver = HeapAlloc(GetProcessHeap(), 0, len + sizeof(extra_block) * 2);
+ ok(ver != NULL, "Can't allocate memory\n");
+
+ ret = GetFileVersionInfoA(buf, 0, len, ver);
+ ok(ret, "GetFileVersionInfoA error %u\n", GetLastError());
+
+ /* forge the string table, as windres dislike an extra block */
+ length = (WORD *)ver; /* see VS_VERSION_INFO_STRUCT32 for details */
+ memcpy(ver + *length, extra_block, sizeof(extra_block));
+ *length += sizeof(extra_block);
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ w = 0xdeadbeef;
+ ret = VerQueryValueA(ver, "WineTest\\Binary", (LPVOID*)&p, &len);
+ ok(ret, "VerQueryValue error %u\n", GetLastError());
+ ok(len == 4, "VerQueryValue returned %u, expected 4\n", len);
+ ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n");
+ ok(memcmp(p, &w, sizeof(w)) == 0, "got 0x%08x, expected 0x%08x\n",
*(PULONG)p, w);
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ ret = VerQueryValueA(ver, "WineTest\\Text", (LPVOID*)&p, &len);
+ ok(ret, "VerQueryValue error %u\n", GetLastError());
+ ok(len == 4, "VerQueryValue returned %u, expected 4\n", len);
+ ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n");
+ ok(strcmp(p, "B-)") == 0, "got '%s', expected
'%s'\n", p, "B-)");
+
+ HeapFree(GetProcessHeap(), 0, ver);
+}
+
START_TEST(info)
{
test_info_size();
test_info();
test_32bit_win();
- test_VerQueryValue();
-}
+ test_VerQueryValueA();
+ test_extra_block();
+}
Modified: trunk/rostests/winetests/version/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/version/install…
==============================================================================
--- trunk/rostests/winetests/version/install.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/version/install.c [iso-8859-1] Sat Apr 26 18:16:00 2014
@@ -34,9 +34,9 @@
char filename[MAX_PATH];
char outBuf[MAX_PATH];
char windir[MAX_PATH];
- static CHAR empty[] = "",
- regedit[] = "regedit",
- regedit_exe[] = "regedit.exe";
+ static const char empty[] = "",
+ regedit[] = "regedit",
+ regedit_exe[] = "regedit.exe";
memset(appdir, 0, MAX_PATH);
memset(windir, 0, MAX_PATH);