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

Side by Side Diff: base/iat_patch.cc

Issue 48130: Initialize module_handle_ in IATPatch's constructor. (Closed)
Patch Set: Created 11 years, 9 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 | « 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/iat_patch.h" 5 #include "base/iat_patch.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 namespace iat_patch { 8 namespace iat_patch {
9 9
10 struct InterceptFunctionInformation { 10 struct InterceptFunctionInformation {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 &old_page_protection); 162 &old_page_protection);
163 } else { 163 } else {
164 error = GetLastError(); 164 error = GetLastError();
165 NOTREACHED(); 165 NOTREACHED();
166 } 166 }
167 167
168 return error; 168 return error;
169 } 169 }
170 170
171 IATPatchFunction::IATPatchFunction() 171 IATPatchFunction::IATPatchFunction()
172 : original_function_(NULL), 172 : module_handle_(NULL),
173 original_function_(NULL),
173 iat_thunk_(NULL), 174 iat_thunk_(NULL),
174 intercept_function_(NULL) { 175 intercept_function_(NULL) {
175 } 176 }
176 177
177 IATPatchFunction::~IATPatchFunction() { 178 IATPatchFunction::~IATPatchFunction() {
178 if (NULL != intercept_function_) { 179 if (NULL != intercept_function_) {
179 DWORD error = Unpatch(); 180 DWORD error = Unpatch();
180 DCHECK_EQ(NO_ERROR, error); 181 DCHECK_EQ(NO_ERROR, error);
181 } 182 }
182 } 183 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 FreeLibrary(module_handle_); 231 FreeLibrary(module_handle_);
231 module_handle_ = NULL; 232 module_handle_ = NULL;
232 intercept_function_ = NULL; 233 intercept_function_ = NULL;
233 original_function_ = NULL; 234 original_function_ = NULL;
234 iat_thunk_ = NULL; 235 iat_thunk_ = NULL;
235 236
236 return error; 237 return error;
237 } 238 }
238 239
239 } // namespace iat_patch 240 } // namespace iat_patch
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