[2/2] version: Test for VerQueryValueA

Mark Jansen learn0more+wine at gmail.com
Mon Feb 23 03:37:18 CST 2015

On Mon, Feb 23, 2015 at 9:47 AM, Stefan Dösinger
<stefandoesinger at gmail.com> wrote:
> Hash: SHA1
> Am 2015-02-18 um 22:41 schrieb Mark Jansen:
>> +    char preparedbuffer[] = {
>> +        0x04, 0x01, 0x34, 0x00, 0x00, 0x00, 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, 0xbd, 0x04, 0xef, 0xfe, 0x00, 0x00, 0x01, 0x00,
>> +        0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
>> ...
> Is it possible to put the test data into dlls/version/test/version.rc in plain text instead of using an unreadable blob? If not, please add a comment to explain what is in the blob.
No, this is not possible.
This is simply a version info block (with only one entry in it to keep
it small, but that doesnt influence the test), compiled in the reactos
build environment.
This does create a slightly different resource, but the resource is
accepted by windows resource parser functions, and not by wine. (as
this test shows).

>> +    ret = VerQueryValueA(preparedbuffer, "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");
> Does p point to a 0 byte now? (i.e., ok(!*p, "Expected a terminated string\n"); or something like this.)
No, p points to a data byte, but it can (should) not be read, since
the returned length is 0.
Trying to read it is exactly what is going wrong in the wine implementation,
since it is a non-null byte.

> Version: GnuPG v2
> 5oaF83RA4wjqTAtOQYbIGFqTtM0kT5rANLgh5cMkgNETSttl8ZgJlyECUmz8ArHA
> VQv0kr0VsgdurFmhoxA37Cw9kou4b2hgsyimfr0dvjahJAroZJgIzXSbtUVgMVQ3
> SUoluqPMSuXod/xW78lVwLI5HLm79/cJdizo+PiWLmLrlNiga6k295eKAfd5Tcco
> qHo+bCf56s0FRlaD4eZ+5AWl5nDP0eP7aGpddBtk4a0Y5E/3npD+9KE2L/hIlTdy
> kbSSW+NUfWAIUKzVFgVr9m/ejGjTMCb6ieHfuK/7S9oU6jCJyM/mwg++vsgdUJbI
> ts03c3UXV/JXGuDSEkxqMNLdhVM0Jv9RLCz4GlwdH7LlSiO9UOGjUpMF2steuULm
> FwirfHXCV1FyZBWIZyHfUw9wykoY4613S49Iq3EGZKKPQmzSi0p+Aygm2Mz6+LhM
> ApI/rVpGs7rqTxYZWZEgcaadpCGlwczOrgbQYEEoxdaYMm8GbEWRyDXjsHiC9NF4
> RbWV+n69+wzC7bOIYqHQSkXEWNEuFlLjn4MElHCqBkGlwTsw9HIPofN6wDbORONt
> xKP5s14VduDyJdT21jYLJJUvIxO3R7OSNxoWIoKBOofFlQeT0c6WHvnqSqW9e7ED
> sX3108dzC77WwIVODqFm
> =gsJF

More information about the wine-devel mailing list