Loading of module PMMERGE to compute screen size is wrong

RESOLVED FIXED in mozilla11

Status

Core Graveyard
Widget: OS/2
RESOLVED FIXED
6 years ago
3 years ago

People

(Reporter: Erdmann, Assigned: Dave Yeo)

Tracking

Trunk
mozilla11
x86
OS/2

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: OS/2 only file)

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; .NET4.0C; MALC)




Expected results:

http://dxr.mozilla.org/mozilla/mozilla-central/widget/src/os2/nsScreenOS2.cpp.html: 

routine "nsScreenOS2 :: GetAvailRect": this routine uses DosLoadModule, DosQueryProcAddress, DosFreeModule to get a function pointer to function to query screen size. However the module is freed before function pointer is actually used.
Since PMMERGE module is always loaded (if PM is loaded which is prerequisite for any graphical app) I suggest to replace with:

  if ( !rc && !pfnQueryDesktopWorkArea )
  {
      HMODULE hmod = 0;
      rc = DosQueryModuleHandle("PMMERGE", &hmod );
      if ( !rc )
      {
          rc = DosQueryProcAddr( hmod, 5469, NULL, (PFN*) &pfnQueryDesktopWorkArea ); // WinQueryDesktopWorkArea
      }
  }
if ( pfnQueryDesktopWorkArea && !rc )
...
(Reporter)

Updated

6 years ago
OS: Windows 7 → OS/2
(Assignee)

Updated

6 years ago
Assignee: nobody → mozilla
Component: General → Widget: OS/2
Product: Firefox → Core
QA Contact: general → os2
Version: 8 Branch → Trunk
(Assignee)

Updated

6 years ago
Assignee: mozilla → nobody
(Assignee)

Comment 1

6 years ago
Created attachment 577147 [details] [diff] [review]
Patch based on Lars comment

Lars, does this look correct?
I'll have to do a test build before asking for review.
Assignee: nobody → daveryeo
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(Assignee)

Comment 2

6 years ago
Created attachment 577161 [details] [diff] [review]
Patch based on Lars comment, with missed DosQueryModuleHandle()
Attachment #577147 - Attachment is obsolete: true
(Reporter)

Comment 3

6 years ago
Yes, your suggested fix is OK.
(Assignee)

Comment 4

6 years ago
Comment on attachment 577161 [details] [diff] [review]
Patch based on Lars comment, with missed DosQueryModuleHandle()

I've run this for a week with no adverse affects. SeaMonkey opens where it should without interfering with Warpcentre
Attachment #577161 - Flags: review?(wuno)
(Assignee)

Updated

6 years ago
Blocks: 303328
(Assignee)

Updated

6 years ago
Blocks: 67913
No longer blocks: 303328

Updated

6 years ago
Attachment #577161 - Flags: review?(wuno) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
Whiteboard: OS/2 only file
http://hg.mozilla.org/integration/mozilla-inbound/rev/dbe04a04bc41
Keywords: checkin-needed
Target Milestone: --- → mozilla11
https://hg.mozilla.org/mozilla-central/rev/dbe04a04bc41
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.