Last Comment Bug 682759 - NPRemoteWindow.window shouldn't be unsigned long
: NPRemoteWindow.window shouldn't be unsigned long
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: Trunk
: x86_64 Windows Vista
-- normal (vote)
: ---
Assigned To: Josh Aas
: Benjamin Smedberg [:bsmedberg]
Depends on:
  Show dependency treegraph
Reported: 2011-08-28 19:11 PDT by Makoto Kato [:m_kato]
Modified: 2011-11-21 16:55 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

fix v1.0 (5.69 KB, patch)
2011-08-30 08:44 PDT, Josh Aas
m_kato: review+
cjones.bugs: review+
Details | Diff | Splinter Review

Description User image Makoto Kato [:m_kato] 2011-08-28 19:11:59 PDT
NPWindow.window is HWND in Windows.  It is that Win32 is 4 bytes, Win64 is 8bytes.

But NPRemoteWindow.window is defined as unsigned long... Since Win64 model is LLP64, sizeof(unsigned long) is 4, not 8.
Comment 1 User image Josh Aas 2011-08-29 22:34:45 PDT
Correct me if I'm wrong but "unsigned long" is generally 64 bits on 64-bit Unix machines and 32 bits on 64-bit Windows machines. This means casting void* to unsigned long and back would probably work on Unix but not on Windows, which would explain why nobody reported this for Linux but it is an issue on Windows...
Comment 2 User image Josh Aas 2011-08-30 08:44:30 PDT
Created attachment 556858 [details] [diff] [review]
fix v1.0

This is ugly, but maybe less ugly?
Comment 3 User image Josh Aas 2011-09-06 21:58:00 PDT
pushed to mozilla-central
Comment 4 User image Anthony Hughes (:ashughes) [GFX][QA][Mentor] 2011-11-21 16:55:03 PST
Nothing here that QA needs to verify.

Note You need to log in before you can comment on or make changes to this bug.