Author: akhaldi
Date: Wed Jul 22 00:40:49 2015
New Revision: 68539
URL:
http://svn.reactos.org/svn/reactos?rev=68539&view=rev
Log:
[VERSION_WINETEST] Sync with Wine Staging 1.7.47. CORE-9924
Modified:
trunk/rostests/winetests/version/info.c
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] Wed Jul 22 00:40:49 2015
@@ -574,6 +574,132 @@
HeapFree(GetProcessHeap(), 0, ver);
}
+static void test_VerQueryValue_InvalidLength(void)
+{
+ /* this buffer is created with the reactos resource compiler from this resource:
+#include "winver.h"
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION 1,0,0,0
+PRODUCTVERSION 1,0,0,0
+FILEFLAGSMASK 63
+FILEFLAGS 0
+FILEOS VOS_UNKNOWN
+FILETYPE VFT_APP
+FILESUBTYPE VFT2_UNKNOWN
+{
+ BLOCK "StringFileInfo"
+ {
+ }
+}
+*/
+ char preparedbuffer[] = {
+ /* VS_VERSION_INFO_STRUCT32 */
+ 0x80, 0x00, /* wLength */
+ 0x34, 0x00, /* wValueLength */
+ 0x00, 0x00, /* wType */
+ /* L"VS_VERSION_INFO" + DWORD alignment */
+ 0x56, 0x00, 0x53, 0x00, 0x5f, 0x00, 0x56, 0x00, 0x45, 0x00, 0x52, 0x00, 0x53,
0x00, 0x49, 0x00, 0x4f,
+ 0x00, 0x4e, 0x00, 0x5f, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x46, 0x00, 0x4f, 0x00,
0x00, 0x00, 0x00, 0x00,
+
+ /* VS_FIXEDFILEINFO */
+ 0xbd, 0x04, 0xef, 0xfe, /* dwSignature */
+ 0x00, 0x00, 0x01, 0x00, /* dwStrucVersion */
+ 0x00, 0x00, 0x01, 0x00, /* dwFileVersionMS */
+ 0x00, 0x00, 0x00, 0x00, /* dwFileVersionLS */
+ 0x00, 0x00, 0x01, 0x00, /* dwProductVersionMS */
+ 0x00, 0x00, 0x00, 0x00, /* dwProductVersionLS */
+ 0x3f, 0x00, 0x00, 0x00, /* dwFileFlagsMask */
+ 0x00, 0x00, 0x00, 0x00, /* dwFileFlags */
+ 0x00, 0x00, 0x00, 0x00, /* dwFileOS */
+ 0x01, 0x00, 0x00, 0x00, /* dwFileType */
+ 0x00, 0x00, 0x00, 0x00, /* dwFileSubtype */
+ 0x00, 0x00, 0x00, 0x00, /* dwFileDateMS */
+ 0x00, 0x00, 0x00, 0x00, /* dwFileDateLS */
+
+ /* first child: */
+ 0x24, 0x00, /* wLength */
+ 0x00, 0x00, /* wValueLength */
+ 0x01, 0x00, /* wType */
+ /* L"StringFileInfo" + DWORD alignment */
+ 0x53, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x67, 0x00, 0x46,
0x00, 0x69, 0x00,
+ 0x6c, 0x00, 0x65, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x00,
0x00,
+ /* "FE2X" */
+ 0x46, 0x45, 0x32, 0x58,
+
+ /* Extra bytes allocated for W->A conversions. */
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d, 0xf0, 0xad, 0xba, 0x0d,
0xf0, 0xad, 0xba,
+ };
+ char *p;
+ UINT len, ret;
+ WCHAR FileDescriptionW[] = { '\\', '\\', 'S', 't',
'r', 'i', 'n', 'g', 'F', 'i', 'l',
'e', 'I', 'n', 'f', 'o', 0 };
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = VerQueryValueA(preparedbuffer, "StringFileInfo", (LPVOID *)&p,
&len);
+ ok(ret, "VerQueryValueA error %u\n", GetLastError());
+ todo_wine
+ ok(len == 0, "VerQueryValueA returned %u, expected 0\n", len);
+ todo_wine
+ ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer
+ 0x7e);
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = VerQueryValueA(preparedbuffer, "\\StringFileInfo", (LPVOID *)&p,
&len);
+ ok(ret, "VerQueryValueA error %u\n", GetLastError());
+ todo_wine
+ ok(len == 0, "VerQueryValueA returned %u, expected 0\n", len);
+ todo_wine
+ ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer
+ 0x7e);
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = VerQueryValueA(preparedbuffer, "\\\\StringFileInfo", (LPVOID
*)&p, &len);
+ ok(ret, "VerQueryValueA error %u\n", GetLastError());
+ todo_wine
+ ok(len == 0, "VerQueryValueA returned %u, expected 0\n", len);
+ todo_wine
+ ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer
+ 0x7e);
+
+ /* also test the W versions. */
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = VerQueryValueW(preparedbuffer, FileDescriptionW + 2, (LPVOID *)&p,
&len);
+ ok(ret, "VerQueryValueW error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValueW returned %u, expected 0\n", len);
+ todo_wine
+ ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer
+ 0x7e);
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = VerQueryValueW(preparedbuffer, FileDescriptionW + 1, (LPVOID *)&p,
&len);
+ ok(ret, "VerQueryValueW error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValueW returned %u, expected 0\n", len);
+ todo_wine
+ ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer
+ 0x7e);
+
+ p = (char *)0xdeadbeef;
+ len = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = VerQueryValueW(preparedbuffer, FileDescriptionW, (LPVOID *)&p, &len);
+ ok(ret, "VerQueryValueW error %u\n", GetLastError());
+ ok(len == 0, "VerQueryValueW returned %u, expected 0\n", len);
+ todo_wine
+ ok(p == preparedbuffer + 0x7e, "p was %p, expected %p\n", p, preparedbuffer
+ 0x7e);
+}
+
static void test_extra_block(void)
{
WORD extra_block[] = {
@@ -630,5 +756,6 @@
test_info();
test_32bit_win();
test_VerQueryValueA();
+ test_VerQueryValue_InvalidLength();
test_extra_block();
}