Closed Bug 1460003 Opened 6 years ago Closed 6 years ago

nsWindow::UpdateGetWindowInfoCaptionStatus: AddHook on GetWindowInfo should only be invoked once

Categories

(Core :: Widget: Win32, enhancement, P1)

Unspecified
Windows
enhancement

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: bugzilla, Assigned: jimm)

References

Details

(Whiteboard: inj+)

Attachments

(1 file, 2 obsolete files)

Otherwise we repeatedly try the hook over and over.
Priority: -- → P3
Whiteboard: inj+
Assignee: nobody → jmathies
Priority: P3 → P1
Attached patch patch (obsolete) — Splinter Review
Attachment #8976211 - Flags: review?(aklotz)
Since mHookedGetWindowInfo is a member of nsWindow the code will retry AddHook for each window object. Not sure if that's desired behavior.. do we anticipate that one AddHook failure implies all other attempts will also fail?
(In reply to Jim Mathies [:jimm] from comment #3)
> Since mHookedGetWindowInfo is a member of nsWindow the code will retry
> AddHook for each window object. Not sure if that's desired behavior.. do we
> anticipate that one AddHook failure implies all other attempts will also
> fail?

Typically, yes. If AddHook fails, it is usually because some instructions in the binary are encountered that the interceptor does not understand. That situation is unlikely to improve with subsequent invocations.
Comment on attachment 8976211 [details] [diff] [review]
patch

LGTM
Attachment #8976211 - Flags: review?(aklotz) → review+
But yeah, I guess it makes less sense for mHookedGetWindowInfo to be per-nsWindow. There really should only ever be one.
Comment on attachment 8976211 [details] [diff] [review]
patch

Review of attachment 8976211 [details] [diff] [review]:
-----------------------------------------------------------------

Changing my review here to reflect my earlier comments.

::: widget/windows/nsWindow.h
@@ +679,5 @@
>    // Pointer events processing and management
>    WinPointerEvents mPointerEvents;
> +
> +  // AddHook success checks
> +  mozilla::Maybe<bool> mHookedGetWindowInfo;

Yeah I think this should be static (or equivalent)
Attachment #8976211 - Flags: review+
Attached patch patch v.2 (obsolete) — Splinter Review
Attachment #8976211 - Attachment is obsolete: true
Comment on attachment 8976233 [details] [diff] [review]
patch v.2

updated
Attachment #8976233 - Flags: review?(aklotz)
Comment on attachment 8976233 [details] [diff] [review]
patch v.2

Review of attachment 8976233 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/windows/nsWindow.cpp
@@ +351,5 @@
>  // General purpose user32.dll hook object
>  static WindowsDllInterceptor sUser32Intercept;
>  
> +// AddHook success checks
> +mozilla::Maybe<bool> sHookedGetWindowInfo;

Missing static
Attachment #8976233 - Flags: review?(aklotz) → review+
Attached patch patch v.3Splinter Review
Attachment #8976233 - Attachment is obsolete: true
Attachment #8976247 - Flags: review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8d8c17bc3145
Only call nsWindow's AddHook for GetWindowInfo once. r=aklotz
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8d8c17bc3145
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: