Closed Bug 705454 Opened 13 years ago Closed 13 years ago

Loading of module PMMERGE to compute screen size is wrong

Categories

(Core Graveyard :: Widget: OS/2, defect)

x86
OS/2
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla11

People

(Reporter: lars.erdmann, Assigned: dave.r.yeo)

References

Details

(Whiteboard: OS/2 only file)

Attachments

(1 file, 1 obsolete file)

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 )
...
OS: Windows 7 → OS/2
Assignee: nobody → mozilla
Component: General → Widget: OS/2
Product: Firefox → Core
QA Contact: general → os2
Version: 8 Branch → Trunk
Assignee: mozilla → nobody
Attached patch Patch based on Lars comment (obsolete) — Splinter Review
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
Attachment #577147 - Attachment is obsolete: true
Yes, your suggested fix is OK.
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)
Blocks: 303328
Blocks: 67913
No longer blocks: 303328
Attachment #577161 - Flags: review?(wuno) → review+
Keywords: checkin-needed
Whiteboard: OS/2 only file
https://hg.mozilla.org/mozilla-central/rev/dbe04a04bc41
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.