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

Side by Side Diff: sandbox/win/src/win_utils.h

Issue 2323443003: Implement new method to get process base address in Windows sandbox. (Closed)
Patch Set: Fix typo Created 4 years, 3 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/target_process.cc ('k') | sandbox/win/src/win_utils.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) 2006-2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-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 #ifndef SANDBOX_SRC_WIN_UTILS_H_ 5 #ifndef SANDBOX_SRC_WIN_UTILS_H_
6 #define SANDBOX_SRC_WIN_UTILS_H_ 6 #define SANDBOX_SRC_WIN_UTILS_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <string> 10 #include <string>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // protection attributes. Returns true on success. 105 // protection attributes. Returns true on success.
106 bool WriteProtectedChildMemory(HANDLE child_process, void* address, 106 bool WriteProtectedChildMemory(HANDLE child_process, void* address,
107 const void* buffer, size_t length); 107 const void* buffer, size_t length);
108 108
109 // Returns true if the provided path points to a pipe. 109 // Returns true if the provided path points to a pipe.
110 bool IsPipe(const base::string16& path); 110 bool IsPipe(const base::string16& path);
111 111
112 // Converts a NTSTATUS code to a Win32 error code. 112 // Converts a NTSTATUS code to a Win32 error code.
113 DWORD GetLastErrorFromNtStatus(NTSTATUS status); 113 DWORD GetLastErrorFromNtStatus(NTSTATUS status);
114 114
115 // Returns the address of the main exe module in memory taking in account
116 // address space layout randomization. While it will work on running processes
117 // it's recommended to only call this for a suspended process. Ideally also
118 // a process which has not been started. There's a slim chance that a process
119 // could map its own executables file multiple times, but this is pretty
120 // unlikely to occur in practice.
121 void* GetProcessBaseAddress(HANDLE process);
122
115 } // namespace sandbox 123 } // namespace sandbox
116 124
117 // Resolves a function name in NTDLL to a function pointer. The second parameter 125 // Resolves a function name in NTDLL to a function pointer. The second parameter
118 // is a pointer to the function pointer. 126 // is a pointer to the function pointer.
119 void ResolveNTFunctionPtr(const char* name, void* ptr); 127 void ResolveNTFunctionPtr(const char* name, void* ptr);
120 128
121 #endif // SANDBOX_SRC_WIN_UTILS_H_ 129 #endif // SANDBOX_SRC_WIN_UTILS_H_
OLDNEW
« no previous file with comments | « sandbox/win/src/target_process.cc ('k') | sandbox/win/src/win_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698