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

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: Remove redundant close handle call 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
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.
117 void* GetProcessBaseAddress(HANDLE process);
118
115 } // namespace sandbox 119 } // namespace sandbox
116 120
117 // Resolves a function name in NTDLL to a function pointer. The second parameter 121 // Resolves a function name in NTDLL to a function pointer. The second parameter
118 // is a pointer to the function pointer. 122 // is a pointer to the function pointer.
119 void ResolveNTFunctionPtr(const char* name, void* ptr); 123 void ResolveNTFunctionPtr(const char* name, void* ptr);
120 124
121 #endif // SANDBOX_SRC_WIN_UTILS_H_ 125 #endif // SANDBOX_SRC_WIN_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698