OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 | 7 |
8 /* | 8 /* |
9 * Nacl inter-module communication primitives. | 9 * Nacl inter-module communication primitives. |
10 * Primitive NaCl socket and shared memory functions which provide a portable | 10 * Primitive NaCl socket and shared memory functions which provide a portable |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 * kInvalidHandle on failure. | 229 * kInvalidHandle on failure. |
230 */ | 230 */ |
231 typedef NaClHandle (*NaClCreateMemoryObjectFunc)(size_t length, int executable); | 231 typedef NaClHandle (*NaClCreateMemoryObjectFunc)(size_t length, int executable); |
232 | 232 |
233 /* | 233 /* |
234 * This allows an alternative implementation of NaClCreateMemoryObject() | 234 * This allows an alternative implementation of NaClCreateMemoryObject() |
235 * to be provided that works in an outer sandbox. | 235 * to be provided that works in an outer sandbox. |
236 */ | 236 */ |
237 void NaClSetCreateMemoryObjectFunc(NaClCreateMemoryObjectFunc func); | 237 void NaClSetCreateMemoryObjectFunc(NaClCreateMemoryObjectFunc func); |
238 | 238 |
| 239 #if NACL_WINDOWS |
| 240 /* |
| 241 * Type of function supplied to NaClSetBrokerDuplicateHandleFunc(). |
| 242 * Such a function copies a Windows handle into the target process |
| 243 * with the given process ID. This is a more restricted version of |
| 244 * Windows' DuplicateHandle() that can send handles but not retrieve |
| 245 * them. |
| 246 */ |
| 247 typedef int (*NaClBrokerDuplicateHandleFunc)(NaClHandle source_handle, |
| 248 uint32_t target_process_id, |
| 249 NaClHandle *target_handle, |
| 250 uint32_t desired_access, |
| 251 uint32_t options); |
| 252 |
| 253 /* |
| 254 * This allows a replacement for Windows' DuplicateHandle() to be |
| 255 * provided that works in an outer sandbox. |
| 256 */ |
| 257 void NaClSetBrokerDuplicateHandleFunc(NaClBrokerDuplicateHandleFunc func); |
| 258 #endif |
| 259 |
239 /* | 260 /* |
240 * Creates a memory object of length bytes. | 261 * Creates a memory object of length bytes. |
241 * | 262 * |
242 * NaClCreateMemoryObject() returns a handle of the newly created | 263 * NaClCreateMemoryObject() returns a handle of the newly created |
243 * memory object on success, and NACL_INVALID_HANDLE on failure. | 264 * memory object on success, and NACL_INVALID_HANDLE on failure. |
244 * length must be a multiple of allocation granularity given by | 265 * length must be a multiple of allocation granularity given by |
245 * NACL_MAP_PAGESIZE in nacl_config.h. | 266 * NACL_MAP_PAGESIZE in nacl_config.h. |
246 * | 267 * |
247 * executable: Whether the memory object needs to be mappable as | 268 * executable: Whether the memory object needs to be mappable as |
248 * executable. (This is significant only on Mac OS X.) | 269 * executable. (This is significant only on Mac OS X.) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 * | 304 * |
284 * NaClUnmap() returns 0 on success, and -1 on failure. | 305 * NaClUnmap() returns 0 on success, and -1 on failure. |
285 */ | 306 */ |
286 int NaClUnmap(void* start, size_t length); | 307 int NaClUnmap(void* start, size_t length); |
287 | 308 |
288 #ifdef __cplusplus | 309 #ifdef __cplusplus |
289 } | 310 } |
290 #endif /* __cplusplus */ | 311 #endif /* __cplusplus */ |
291 | 312 |
292 #endif /* NATIVE_CLIENT_SRC_SHARED_IMC_NACL_IMC_C_H_ */ | 313 #endif /* NATIVE_CLIENT_SRC_SHARED_IMC_NACL_IMC_C_H_ */ |
OLD | NEW |