Re: setupapi/tests: Remove an unneeded cast.
On Thursday 08 January 2009 00:05:01 Francois Gouget wrote:
memset(buffer, 0x55, sizeof(buffer)); - retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, (LPDWORD)0); + retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, NULL); ok(retval != ~0u, "failed find 'UILEVEL' in string table\n"); ok(memcmp(buffer, &data, 4), "unexpected data\n");
This test is there to show that the prototype of StringTableLookUpStringEx is broken; the last parameter is treated as an integer instead of a pointer and this notation serves to document that fact. But I can see how this will repeatedly trigger janitorial scripts, so I do not object to this patch going in. -Hans
2009/1/8 Hans Leidekker <hans(a)codeweavers.com>:
On Thursday 08 January 2009 00:05:01 Francois Gouget wrote:
memset(buffer, 0x55, sizeof(buffer)); - retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, (LPDWORD)0); + retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, NULL); ok(retval != ~0u, "failed find 'UILEVEL' in string table\n"); ok(memcmp(buffer, &data, 4), "unexpected data\n");
This test is there to show that the prototype of StringTableLookUpStringEx is broken; the last parameter is treated as an integer instead of a pointer and this notation serves to document that fact. But I can see how this will repeatedly trigger janitorial scripts, so I do not object to this patch going in.
Using 0 instead of NULL should work just as well, if that makes it any clearer.
Hans Leidekker <hans(a)codeweavers.com> writes:
On Thursday 08 January 2009 00:05:01 Francois Gouget wrote:
memset(buffer, 0x55, sizeof(buffer)); - retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, (LPDWORD)0); + retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, NULL); ok(retval != ~0u, "failed find 'UILEVEL' in string table\n"); ok(memcmp(buffer, &data, 4), "unexpected data\n");
This test is there to show that the prototype of StringTableLookUpStringEx is broken; the last parameter is treated as an integer instead of a pointer and this notation serves to document that fact. But I can see how this will repeatedly trigger janitorial scripts, so I do not object to this patch going in.
Where does the prototype come from? AFAICS it's not in the PSDK. Maybe it's just wrong. -- Alexandre Julliard julliard(a)winehq.org
On Thursday 08 January 2009 11:22:59 Alexandre Julliard wrote:
This test is there to show that the prototype of StringTableLookUpStringEx is broken; the last parameter is treated as an integer instead of a pointer and this notation serves to document that fact. But I can see how this will repeatedly trigger janitorial scripts, so I do not object to this patch going in.
Where does the prototype come from? AFAICS it's not in the PSDK. Maybe it's just wrong.
I don't know where the prototype came from, there was a stub there already which entered Wine with commit 8196e2d0d0dbd04325201e14d95f88cad3cfd00f. So we might as well change the prototype, given its demonstrated behavior. -Hans
On Thu, 8 Jan 2009, Hans Leidekker wrote: [...]
I don't know where the prototype came from, there was a stub there already which entered Wine with commit 8196e2d0d0dbd04325201e14d95f88cad3cfd00f.
I did not find it in my SDKs either. And a web search turned no useful result.
So we might as well change the prototype, given its demonstrated behavior.
Works for me. I'm sending a patch... -- Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/ War doesn't determine who's right. War determines who's left.
On Thu, Jan 8, 2009 at 5:22 AM, Alexandre Julliard <julliard(a)winehq.org> wrote:
Where does the prototype come from? AFAICS it's not in the PSDK. Maybe it's just wrong.
When Eric first implemented those functions they were mostly undocumented. I believe I checked the prototypes verses some VB or Pascal code I found on google where someone had reversed the interface but I can't find the exact source I used to check things when writing the first round of tests. According to this link from google search, the prototypes are in MASM include files going back to 2001. You might want to check the others as well. http://www.cecs.csulb.edu/~hill/cecs325/MASM32/INCLUDE/SETUPAPI.INC -- Steven Edwards "There is one thing stronger than all the armies in the world, and that is an idea whose time has come." - Victor Hugo
On Thu, Jan 8, 2009 at 12:29 PM, Steven Edwards <winehacker(a)gmail.com> wrote:
According to this link from google search, the prototypes are in MASM include files going back to 2001. You might want to check the others as well.
http://www.cecs.csulb.edu/~hill/cecs325/MASM32/INCLUDE/SETUPAPI.INC
Heh ignore that part of the spam...I didn't see that the MASM include was not really helpful at all for the prototype... -- Steven Edwards "There is one thing stronger than all the armies in the world, and that is an idea whose time has come." - Victor Hugo
On Thu, Jan 08, 2009 at 10:05:28AM +0100, Hans Leidekker wrote:
On Thursday 08 January 2009 00:05:01 Francois Gouget wrote:
memset(buffer, 0x55, sizeof(buffer)); - retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, (LPDWORD)0); + retval = pStringTableLookUpStringEx(table, uilevel, ST_CASE_SENSITIVE_COMPARE, buffer, NULL); ok(retval != ~0u, "failed find 'UILEVEL' in string table\n"); ok(memcmp(buffer, &data, 4), "unexpected data\n");
This test is there to show that the prototype of StringTableLookUpStringEx is broken; the last parameter is treated as an integer instead of a pointer and this notation serves to document that fact.
Wouldn't that actually be different type sizes under Win64? -- ----------------------------------------------------------- Paul "TBBle" Hampson, B.Sc, LPI, MCSE Very-later-year Asian Studies student, ANU The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361) Paul.Hampson(a)Pobox.com Of course Pacman didn't influence us as kids. If it did, we'd be running around in darkened rooms, popping pills and listening to repetitive music. -- Kristian Wilson, Nintendo, Inc, 1989 License: http://creativecommons.org/licenses/by/2.5/au/ -----------------------------------------------------------
participants (6)
-
Alexandre Julliard -
Francois Gouget -
Hans Leidekker -
Henri Verbeet -
Paul TBBle Hampson -
Steven Edwards