PATCH: Fix LoadCursor() under win9x
u4t5s0yq1001 at sneakemail.com
Fri Oct 12 16:29:58 CDT 2001
On Fri, Oct 12, 2001 at 08:13:20PM +0200, Marcus Meissner wrote:
> On Fri, Oct 12, 2001 at 03:16:04PM +0200, Johan Gill wrote:
> > LoadCursor() should return 0 if we emulate win9x and the second parameter
> > is an invalid pointer.
> > + if (HIWORD(name))
> > + if (GetVersion() & 0x80000000) /* win9x */
> > + if (IsBadReadPtr(name, 4))
> > + return 0;
> This code is unclean:
> It should not check for versions.
> It should not use IsBadReadPtr(), but IsBadStringPtrA().
> It should not use IsBad* functions, but an exception handler.
Oh no, not the version difference discussion again ;-)
Excuse me, but our testing revealed that there *is* a difference between
Win9x and NT 4, namely that Win9x returns 0, whereas NT 4 crashes
(the program, that is) !
Using your exception handler, LoadCursor() *always* returns 0
on invalid parameter, which is WRONG in the NT 4 case
since it continues program execution without crashing.
--> GetVersion() is required, check was (nearly) right IMHO.
Probably the best solution would be to use both an exception handler and
call GetVersion() on exception.
Well, you'll probably now argue that the NT 4 crash case is unneeded,
however I'm not that convinced about it, since it's a real Wine
incompatibility versus NT if we don't check on winver.
Any reasons for doing it this way and *not* (more or less) our way ? ;-)
Andreas Mohr Stauferstr. 6, D-71272 Renningen, Germany
"Point is, nothing here is unfamiliar or unexpected. How long does
it take before there's general recognition that Microsoft software
has no business on the Internet? - Dennis E. Powell re: Code Red
More information about the wine-devel