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

Side by Side Diff: chrome_frame/module_utils.cc

Issue 3136009: Fix chrome frame upgrade from old to new beta. During upgrade process, two ve... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome_frame/module_utils.h" 5 #include "chrome_frame/module_utils.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 const wchar_t kBeaconWindowClassName[] = 10 const wchar_t kBeaconWindowClassName[] =
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 HMODULE DllRedirector::GetFirstCFModule() { 44 HMODULE DllRedirector::GetFirstCFModule() {
45 WNDCLASSEX wnd_class = {0}; 45 WNDCLASSEX wnd_class = {0};
46 HMODULE oldest_module = NULL; 46 HMODULE oldest_module = NULL;
47 if (GetClassInfoEx(GetModuleHandle(NULL), kBeaconWindowClassName, 47 if (GetClassInfoEx(GetModuleHandle(NULL), kBeaconWindowClassName,
48 &wnd_class)) { 48 &wnd_class)) {
49 oldest_module = reinterpret_cast<HMODULE>(wnd_class.lpfnWndProc); 49 oldest_module = reinterpret_cast<HMODULE>(wnd_class.lpfnWndProc);
50 // Handle older versions that store module pointer in a class info. 50 // Handle older versions that store module pointer in a class info.
51 // TODO(amit): Remove this in future versions. 51 // TODO(amit): Remove this in future versions.
52 if (reinterpret_cast<HMODULE>(DefWindowProc) == oldest_module) { 52 if (reinterpret_cast<HMODULE>(DefWindowProc) == oldest_module) {
53 WNDCLASSEX wnd_class = {0}; 53 WNDCLASSEX wnd_class = {0};
54 HMODULE oldest_module = NULL;
55 HWND hwnd = CreateWindow(kBeaconWindowClassName, L"temp_window", 54 HWND hwnd = CreateWindow(kBeaconWindowClassName, L"temp_window",
56 WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL); 55 WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
57 DCHECK(IsWindow(hwnd)); 56 DCHECK(IsWindow(hwnd));
58 if (hwnd) { 57 if (hwnd) {
59 oldest_module = reinterpret_cast<HMODULE>(GetClassLongPtr(hwnd, 0)); 58 oldest_module = reinterpret_cast<HMODULE>(GetClassLongPtr(hwnd, 0));
60 DestroyWindow(hwnd); 59 DestroyWindow(hwnd);
61 } 60 }
62 } 61 }
63 } 62 }
64 return oldest_module; 63 return oldest_module;
(...skipping 14 matching lines...) Expand all
79 LOG(ERROR) << "Module Scan: Couldn't get address of " 78 LOG(ERROR) << "Module Scan: Couldn't get address of "
80 << "DllGetClassObject: " 79 << "DllGetClassObject: "
81 << GetLastError(); 80 << GetLastError();
82 } 81 }
83 } else { 82 } else {
84 LOG(ERROR) << "Module Scan: Could not increment module count: " 83 LOG(ERROR) << "Module Scan: Could not increment module count: "
85 << GetLastError(); 84 << GetLastError();
86 } 85 }
87 return proc_ptr; 86 return proc_ptr;
88 } 87 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698