"Joseph Garvin" k04jg02@kzoo.edu wrote:
- /* Correct if instance is null now, because later we won't
be able to tell the difference between a 16-bit NULL and
a 32-bit NULL */
- if (!instance)
- {
HTASK16 hTask = GetCurrentTask();
TDB *tdb = GlobalLock16(x);
instance = tdb->hInstance;
GlobalUnlock(tdb);
- }
Did you ever test it? GlobalLock16 on x coordinate won't return you anything useful, not mentioning a TDB pointer. Probably you meant GlobalLock(hTask)? And GlobalUnlock(tdb) is not right at all, you want GlobalUnlock16(hTask).
Dmitry Timoshkov wrote:
And GlobalUnlock(tdb) is not right at all, you want GlobalUnlock16(hTask).
I resent it a second later with the 'x' fix. That does look more correct, but strangely the patch as is works. If I make your change the application I'm trying to fix gives this:
err:heap:GlobalUnlock page fault occurred ! Caused by bug ? err:heap:GlobalUnlock page fault occurred ! Caused by bug ?
Mike walked me through the patch, I'm not sure what his reasoning was on unlocking tdb versus hTask.
Joseph Garvin wrote:
Dmitry Timoshkov wrote:
And GlobalUnlock(tdb) is not right at all, you want GlobalUnlock16(hTask).
Mike walked me through the patch, I'm not sure what his reasoning was on unlocking tdb versus hTask.
Typing too fast on IRC, probably ;)
Dmitry is correct, it should be GlobalUnlock16(hTask).
Mike
Mike McCormack wrote:
Typing too fast on IRC, probably ;)
Dmitry is correct, it should be GlobalUnlock16(hTask).
Mike
Hmm, but then there are page faults.
I'll have to take a closer look at task.c to see what's going on...
Doh! The page faults were caused by me using GlobalUnlock instead of GlobalUnlock16. Seems to be working now, sending new version to wine-patches :)