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

Side by Side Diff: base/win/iat_patch_function.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « base/version.cc ('k') | base/win/scoped_comptr.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/win/iat_patch_function.h" 5 #include "base/win/iat_patch_function.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/win/pe_image.h" 8 #include "base/win/pe_image.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 &old_page_protection); 212 &old_page_protection);
213 } else { 213 } else {
214 error = GetLastError(); 214 error = GetLastError();
215 } 215 }
216 216
217 return error; 217 return error;
218 } 218 }
219 219
220 IATPatchFunction::IATPatchFunction() 220 IATPatchFunction::IATPatchFunction()
221 : module_handle_(NULL), 221 : module_handle_(NULL),
222 intercept_function_(NULL),
222 original_function_(NULL), 223 original_function_(NULL),
223 iat_thunk_(NULL), 224 iat_thunk_(NULL) {}
224 intercept_function_(NULL) {
225 }
226 225
227 IATPatchFunction::~IATPatchFunction() { 226 IATPatchFunction::~IATPatchFunction() {
228 if (NULL != intercept_function_) { 227 if (NULL != intercept_function_) {
229 DWORD error = Unpatch(); 228 DWORD error = Unpatch();
230 DCHECK_EQ(static_cast<DWORD>(NO_ERROR), error); 229 DCHECK_EQ(static_cast<DWORD>(NO_ERROR), error);
231 } 230 }
232 } 231 }
233 232
234 DWORD IATPatchFunction::Patch(const wchar_t* module, 233 DWORD IATPatchFunction::Patch(const wchar_t* module,
235 const char* imported_from_module, 234 const char* imported_from_module,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return error; 297 return error;
299 } 298 }
300 299
301 void* IATPatchFunction::original_function() const { 300 void* IATPatchFunction::original_function() const {
302 DCHECK(is_patched()); 301 DCHECK(is_patched());
303 return original_function_; 302 return original_function_;
304 } 303 }
305 304
306 } // namespace win 305 } // namespace win
307 } // namespace base 306 } // namespace base
OLDNEW
« no previous file with comments | « base/version.cc ('k') | base/win/scoped_comptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698