Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Issue 21453: Try a new approach to fixing IAT unpatch crashes when the DLL is gone. (Closed)

Created:
11 years, 10 months ago by Dean McNamee
Modified:
9 years, 7 months ago
Reviewers:
amit, ananta
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Try a new approach to fixing IAT unpatch crashes when the DLL is gone. Have the IAT patcher take some "ownership" of the DLL, by taking a library name and then calling LoadLibrary() / FreeLibrary() to manage the reference count. This means as long is there isn't some other reference count balancing bug happening in the process, the DLL will never be unloaded while we are patched. This effectively reverts r9929, the VirtualQuery additional checks are removed. BUG=7701

Patch Set 1 #

Patch Set 2 : Change callers #

Patch Set 3 : Betterz #

Total comments: 3

Patch Set 4 : Feedback. #

Patch Set 5 : DCHECK #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -76 lines) Patch
M base/iat_patch.h View 1 2 2 chunks +9 lines, -2 lines 0 comments Download
M base/iat_patch.cc View 5 chunks +17 lines, -21 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit.h View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_edit.cc View 2 3 4 5 chunks +67 lines, -40 lines 2 comments Download
M webkit/glue/plugins/webplugin_delegate_impl.h View 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl.cc View 2 3 4 chunks +3 lines, -6 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Dean McNamee
I like this approach, and it also simplified both callers, where they were handling the ...
11 years, 10 months ago (2009-02-18 16:24:57 UTC) #1
amit
http://codereview.chromium.org/21453/diff/1010/6 File base/iat_patch.cc (right): http://codereview.chromium.org/21453/diff/1010/6#newcode192 Line 192: HMODULE module_handle = LoadLibraryW(module); Holds a reference on ...
11 years, 10 months ago (2009-02-18 16:50:49 UTC) #2
amit
LGTM. Also, go ahead and BeginPaintIntercept and EndPaintIntercept public :)
11 years, 10 months ago (2009-02-18 17:39:15 UTC) #3
Dean McNamee
Hey Amit, I know you said LG, but I made a few bigger changes so ...
11 years, 10 months ago (2009-02-26 14:02:28 UTC) #4
amit
11 years, 10 months ago (2009-02-26 15:00:32 UTC) #5
Looks good!

Since we now patch/unpatch more frequently, a test case where an autocomplete
view is created/destroyed and we patch unpatch multiple times would be nice.

http://codereview.chromium.org/21453/diff/2009/2012
File chrome/browser/autocomplete/autocomplete_edit.cc (right):

http://codereview.chromium.org/21453/diff/2009/2012#newcode673
Line 673: class PaintPatcher {
maybe derive privately from RefCounted and just call AddRef from RefPatch()?

http://codereview.chromium.org/21453/diff/2009/2012#newcode700
Line 700: private:
DISABLE_COPY_AND_ASSIGN

Powered by Google App Engine
This is Rietveld 408576698