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

Issue 12295040: Stop delay loading user32.dll from chrome.dll on x86/Windows. (Closed)

Created:
7 years, 10 months ago by Sigurður Ásgeirsson
Modified:
7 years, 8 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Check in a custom-built import library for user32 exports up to Windows XP SP2/SP3, which is used by chrome.dll in preference to the Platform SDK's user32.lib import library. Custom build an import library for Chrome's post-WinXP imports, that binds to a fictional "user32-delay.dll". Implement and test a delay load hook that diverts dynamic loading of any dll "foo-delay.dll" to "foo.dll". R=cpu@chromium.org BUG=176040 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=191173 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=191418

Patch Set 1 #

Total comments: 2

Patch Set 2 : Move hook and tests to chrome/app, call hard error reporting. #

Patch Set 3 : Remove error reporting. #

Patch Set 4 : Build config sketch, mostly works for x86 and x64. Move the hook back to base." #

Total comments: 26

Patch Set 5 : Reduce scope to chrome.dll/x86. Address review comments. #

Total comments: 27

Patch Set 6 : Address M-A's comments. #

Patch Set 7 : Rebase to ToT. #

Patch Set 8 : Remove import library committed separately in http://crrev.com/190721. #

Patch Set 9 : Add a missing include for windows.h, fix permissions on python scripts. #

Patch Set 10 : Rearrange build config to fix unit_tests.exe, which were getting a dependency on the custom import … #

Patch Set 11 : Fix speling mistik [sic]. #

Total comments: 2

Patch Set 12 : Address M-A's nit. #

Patch Set 13 : Make sure both MSVS and ninja builds link correctly. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1313 lines, -0 lines) Patch
A build/win/importlibs/create_import_lib.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +55 lines, -0 lines 0 comments Download
A build/win/importlibs/create_importlib_win.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +218 lines, -0 lines 0 comments Download
A build/win/importlibs/filter_export_list.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +85 lines, -0 lines 0 comments Download
A build/win/importlibs/x86/user32.winxp.imports View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +670 lines, -0 lines 0 comments Download
A chrome/app/delay_load_hook_unittest_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +90 lines, -0 lines 0 comments Download
A chrome/app/delay_load_hook_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +18 lines, -0 lines 0 comments Download
A chrome/app/delay_load_hook_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +85 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +21 lines, -0 lines 0 comments Download
A chrome/chrome.user32.delay.imports View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
M chrome/chrome_dll.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +39 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 35 (0 generated)
Sigurður Ásgeirsson
Please take a look - I think this legitimately belongs in base, but I'm very ...
7 years, 10 months ago (2013-02-19 21:47:35 UTC) #1
cpu_(ooo_6.6-7.5)
could this code be in chrome/app ? https://codereview.chromium.org/12295040/diff/1/base/win/delay_load_hook.cc File base/win/delay_load_hook.cc (right): https://codereview.chromium.org/12295040/diff/1/base/win/delay_load_hook.cc#newcode57 base/win/delay_load_hook.cc:57: } not ...
7 years, 10 months ago (2013-02-20 21:52:54 UTC) #2
cpu_(ooo_6.6-7.5)
I also see https://codereview.chromium.org/12210017/ had this in chrome/app
7 years, 10 months ago (2013-02-20 21:57:22 UTC) #3
Sigurður Ásgeirsson
PTAL - I baked this into chrome/app. However it's not clear to me that chrome/app ...
7 years, 10 months ago (2013-02-26 18:56:19 UTC) #4
cpu_(ooo_6.6-7.5)
hmm I see both our exe and our dll have their own delayload machinery and ...
7 years, 10 months ago (2013-02-26 20:51:11 UTC) #5
cpu_(ooo_6.6-7.5)
looks good, there is the other comment (of line 57) left to address.
7 years, 10 months ago (2013-02-26 20:53:28 UTC) #6
cpu_(ooo_6.6-7.5)
also along the same lines of comment of line 57 it seems dangerous to use ...
7 years, 10 months ago (2013-02-26 20:55:48 UTC) #7
Sigurður Ásgeirsson
On Tue, Feb 26, 2013 at 3:55 PM, <cpu@chromium.org> wrote: > also along the same ...
7 years, 10 months ago (2013-02-26 21:19:40 UTC) #8
cpu_(ooo_6.6-7.5)
sure, ping me when the change is ready.
7 years, 10 months ago (2013-02-27 00:41:59 UTC) #9
M-A Ruel
Please commit user32.winxp.lib manually first. https://codereview.chromium.org/12295040/diff/18001/build/common.gypi File build/common.gypi (right): https://codereview.chromium.org/12295040/diff/18001/build/common.gypi#newcode4045 build/common.gypi:4045: # link against the ...
7 years, 9 months ago (2013-03-03 01:48:02 UTC) #10
cpu_(ooo_6.6-7.5)
Besides the following items I think the code looks good. I still will like to ...
7 years, 9 months ago (2013-03-04 02:18:53 UTC) #11
cpu_(ooo_6.6-7.5)
also note that I don't read python, so I go with whatever maruel and siggi ...
7 years, 9 months ago (2013-03-04 02:21:04 UTC) #12
Sigurður Ásgeirsson
Please take another look guys. I've reduced the scope of the patch to only affect ...
7 years, 9 months ago (2013-03-25 20:43:29 UTC) #13
M-A Ruel
https://codereview.chromium.org/12295040/diff/27017/build/win/importlibs/create_import_lib.gypi File build/win/importlibs/create_import_lib.gypi (right): https://codereview.chromium.org/12295040/diff/27017/build/win/importlibs/create_import_lib.gypi#newcode47 build/win/importlibs/create_import_lib.gypi:47: '--output-file', '<(lib_dir)/<(RULE_INPUT_ROOT).lib', Or <@(_outputs), as you prefer. https://codereview.chromium.org/12295040/diff/27017/build/win/importlibs/create_importlib_win.py File ...
7 years, 9 months ago (2013-03-26 12:59:14 UTC) #14
Sigurður Ásgeirsson
Thanks! Please take another look. https://codereview.chromium.org/12295040/diff/27017/build/win/importlibs/create_import_lib.gypi File build/win/importlibs/create_import_lib.gypi (right): https://codereview.chromium.org/12295040/diff/27017/build/win/importlibs/create_import_lib.gypi#newcode47 build/win/importlibs/create_import_lib.gypi:47: '--output-file', '<(lib_dir)/<(RULE_INPUT_ROOT).lib', On 2013/03/26 ...
7 years, 9 months ago (2013-03-26 15:35:35 UTC) #15
M-A Ruel
lgtm on my side. https://codereview.chromium.org/12295040/diff/27017/build/win/importlibs/create_importlib_win.py File build/win/importlibs/create_importlib_win.py (right): https://codereview.chromium.org/12295040/diff/27017/build/win/importlibs/create_importlib_win.py#newcode136 build/win/importlibs/create_importlib_win.py:136: print "Obj file", obj_file # ...
7 years, 9 months ago (2013-03-26 15:44:37 UTC) #16
cpu_(ooo_6.6-7.5)
lgtm The notreached also makes me a bit antsy. How about a __debugbreak() ? Also ...
7 years, 9 months ago (2013-03-26 18:20:58 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/12295040/51002
7 years, 9 months ago (2013-03-26 18:46:46 UTC) #18
commit-bot: I haz the power
Presubmit check for 12295040-51002 failed and returned exit status 1. INFO:root:Found 11 file(s). /b/commit-queue/workdir/chromium/build/win/importlibs/create_importlib_win.py: Has ...
7 years, 9 months ago (2013-03-26 18:46:59 UTC) #19
Sigurður Ásgeirsson
Brett - I need owner's approval for this change, and you seem to qualify...
7 years, 9 months ago (2013-03-26 18:52:05 UTC) #20
brettw
LGTM rubberstamp, I hope you guys know what you are doing.
7 years, 9 months ago (2013-03-26 20:25:33 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/12295040/51002
7 years, 9 months ago (2013-03-26 22:28:56 UTC) #22
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=127876
7 years, 9 months ago (2013-03-27 02:30:30 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/12295040/74001
7 years, 9 months ago (2013-03-27 13:50:53 UTC) #24
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=24288
7 years, 9 months ago (2013-03-27 16:37:34 UTC) #25
Sigurður Ásgeirsson
M-A, can I ask you to look at the last patch - I had to ...
7 years, 9 months ago (2013-03-28 00:16:43 UTC) #26
Sigurður Ásgeirsson
Ugh, belay that. Looks like I need to shift some more config to get it ...
7 years, 9 months ago (2013-03-28 12:31:31 UTC) #27
M-A Ruel
found small nit, still lgtm https://codereview.chromium.org/12295040/diff/100001/build/win/importlibs/filter_export_list.py File build/win/importlibs/filter_export_list.py (right): https://codereview.chromium.org/12295040/diff/100001/build/win/importlibs/filter_export_list.py#newcode64 build/win/importlibs/filter_export_list.py:64: return 1 Please remove, ...
7 years, 9 months ago (2013-03-28 12:53:28 UTC) #28
Sigurður Ásgeirsson
Thanks, committing. https://codereview.chromium.org/12295040/diff/100001/build/win/importlibs/filter_export_list.py File build/win/importlibs/filter_export_list.py (right): https://codereview.chromium.org/12295040/diff/100001/build/win/importlibs/filter_export_list.py#newcode64 build/win/importlibs/filter_export_list.py:64: return 1 On 2013/03/28 12:53:28, Marc-Antoine Ruel ...
7 years, 9 months ago (2013-03-28 14:25:08 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/12295040/109001
7 years, 9 months ago (2013-03-28 14:25:32 UTC) #30
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=112185
7 years, 9 months ago (2013-03-28 16:38:57 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/12295040/109001
7 years, 9 months ago (2013-03-28 17:00:13 UTC) #32
commit-bot: I haz the power
Change committed as 191173
7 years, 9 months ago (2013-03-28 17:51:10 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siggi@chromium.org/12295040/140001
7 years, 8 months ago (2013-03-29 16:30:55 UTC) #34
commit-bot: I haz the power
7 years, 8 months ago (2013-03-29 19:17:59 UTC) #35
Message was sent while issue was closed.
Change committed as 191418

Powered by Google App Engine
This is Rietveld 408576698