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

Side by Side Diff: sandbox/win/src/service_resolver_64.cc

Issue 614813002: Cleanup sandbox/ in advance of re-enabling some MSVC warnings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 6 years, 2 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 | « sandbox/win/src/process_mitigations_test.cc ('k') | sandbox/win/src/target_process.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sandbox/win/src/service_resolver.h" 5 #include "sandbox/win/src/service_resolver.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "sandbox/win/src/sandbox_nt_util.h" 8 #include "sandbox/win/src/sandbox_nt_util.h"
9 #include "sandbox/win/src/win_utils.h" 9 #include "sandbox/win/src/win_utils.h"
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 // Save the verified code. 163 // Save the verified code.
164 memcpy(local_thunk, &function_code, sizeof(function_code)); 164 memcpy(local_thunk, &function_code, sizeof(function_code));
165 165
166 return true; 166 return true;
167 } 167 }
168 168
169 NTSTATUS ServiceResolverThunk::PerformPatch(void* local_thunk, 169 NTSTATUS ServiceResolverThunk::PerformPatch(void* local_thunk,
170 void* remote_thunk) { 170 void* remote_thunk) {
171 ServiceFullThunk* full_local_thunk =
172 reinterpret_cast<ServiceFullThunk*>(local_thunk);
173 ServiceFullThunk* full_remote_thunk =
174 reinterpret_cast<ServiceFullThunk*>(remote_thunk);
175
176 // Patch the original code. 171 // Patch the original code.
177 ServiceEntry local_service; 172 ServiceEntry local_service;
178 DCHECK_NT(GetInternalThunkSize() >= sizeof(local_service)); 173 DCHECK_NT(GetInternalThunkSize() >= sizeof(local_service));
179 if (!SetInternalThunk(&local_service, sizeof(local_service), NULL, 174 if (!SetInternalThunk(&local_service, sizeof(local_service), NULL,
180 interceptor_)) 175 interceptor_))
181 return STATUS_UNSUCCESSFUL; 176 return STATUS_UNSUCCESSFUL;
182 177
183 // Copy the local thunk buffer to the child. 178 // Copy the local thunk buffer to the child.
184 SIZE_T actual; 179 SIZE_T actual;
185 if (!::WriteProcessMemory(process_, remote_thunk, local_thunk, 180 if (!::WriteProcessMemory(process_, remote_thunk, local_thunk,
(...skipping 17 matching lines...) Expand all
203 198
204 return STATUS_SUCCESS; 199 return STATUS_SUCCESS;
205 } 200 }
206 201
207 bool Wow64ResolverThunk::IsFunctionAService(void* local_thunk) const { 202 bool Wow64ResolverThunk::IsFunctionAService(void* local_thunk) const {
208 NOTREACHED_NT(); 203 NOTREACHED_NT();
209 return false; 204 return false;
210 } 205 }
211 206
212 } // namespace sandbox 207 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/process_mitigations_test.cc ('k') | sandbox/win/src/target_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698