summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 15:51:22 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-26 15:51:22 +0000
commitd4c189468cb4f5b5ae44c6da1df02f504c8345fa (patch)
treec37c25361306cc14f3da1fcc482504fc212bf084 /chrome_frame
parent33d0e4c2d01fea34ceb0b5e21b1aea4913f4cf47 (diff)
downloadchromium_src-d4c189468cb4f5b5ae44c6da1df02f504c8345fa.zip
chromium_src-d4c189468cb4f5b5ae44c6da1df02f504c8345fa.tar.gz
chromium_src-d4c189468cb4f5b5ae44c6da1df02f504c8345fa.tar.bz2
Add a call to SetLastError before calling SetClassLongPtr. It turns out that SetClasSLongPtr doesn't reset the error code on success and yet said code must be used to check for failure.
BUG=45041 TEST=none Review URL: http://codereview.chromium.org/2229003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48277 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/module_utils.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome_frame/module_utils.cc b/chrome_frame/module_utils.cc
index df0ea68..fa49b34 100644
--- a/chrome_frame/module_utils.cc
+++ b/chrome_frame/module_utils.cc
@@ -46,6 +46,8 @@ bool DllRedirector::RegisterAsFirstCFModule() {
if (hwnd) {
HMODULE this_module = reinterpret_cast<HMODULE>(&__ImageBase);
LONG_PTR lp = reinterpret_cast<LONG_PTR>(this_module);
+ // SetClassLongPtr doesn't call this on success, so we do it here first.
+ SetLastError(ERROR_SUCCESS);
SetClassLongPtr(hwnd, 0, lp);
// We need to check the GLE value since SetClassLongPtr returns 0 on
// failure as well as on the first call.