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

Side by Side Diff: sandbox/src/target_process.cc

Issue 378030: 64-bit compatibility changes for the sandbox code (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « sandbox/src/sidestep/mini_disassembler.cpp ('k') | 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-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/src/target_process.h" 5 #include "sandbox/src/target_process.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/pe_image.h" 8 #include "base/pe_image.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "sandbox/src/crosscall_server.h" 10 #include "sandbox/src/crosscall_server.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 if (NULL == child_var) 213 if (NULL == child_var)
214 return SBOX_ERROR_GENERIC; 214 return SBOX_ERROR_GENERIC;
215 215
216 size_t offset = reinterpret_cast<char*>(child_var) - 216 size_t offset = reinterpret_cast<char*>(child_var) -
217 reinterpret_cast<char*>(module); 217 reinterpret_cast<char*>(module);
218 child_var = reinterpret_cast<char*>(MainModule()) + offset; 218 child_var = reinterpret_cast<char*>(MainModule()) + offset;
219 #else 219 #else
220 UNREFERENCED_PARAMETER(name); 220 UNREFERENCED_PARAMETER(name);
221 #endif 221 #endif
222 222
223 DWORD written; 223 SIZE_T written;
224 if (!::WriteProcessMemory(sandbox_process_, child_var, address, size, 224 if (!::WriteProcessMemory(sandbox_process_, child_var, address, size,
225 &written)) 225 &written))
226 return SBOX_ERROR_GENERIC; 226 return SBOX_ERROR_GENERIC;
227 227
228 if (written != size) 228 if (written != size)
229 return SBOX_ERROR_GENERIC; 229 return SBOX_ERROR_GENERIC;
230 230
231 return SBOX_ALL_OK; 231 return SBOX_ALL_OK;
232 } 232 }
233 233
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 318
319 TargetProcess* MakeTestTargetProcess(HANDLE process, HMODULE base_address) { 319 TargetProcess* MakeTestTargetProcess(HANDLE process, HMODULE base_address) {
320 TargetProcess* target = new TargetProcess(NULL, NULL, NULL, NULL); 320 TargetProcess* target = new TargetProcess(NULL, NULL, NULL, NULL);
321 target->sandbox_process_ = process; 321 target->sandbox_process_ = process;
322 target->base_address_ = base_address; 322 target->base_address_ = base_address;
323 return target; 323 return target;
324 } 324 }
325 325
326 } // namespace sandbox 326 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/src/sidestep/mini_disassembler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698