258
258
RTR0DECL(void) RTMemContFree(void *pv, size_t cb) RT_NO_THROW;
261
* Copy memory from an user mode buffer into a kernel buffer.
263
* @retval VINF_SUCCESS on success.
264
* @retval VERR_ACCESS_DENIED on error.
266
* @param pvDst The kernel mode destination address.
267
* @param R3PtrDst The user mode source address.
268
* @param cb The number of bytes to copy.
270
RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb);
273
* Copy memory from a kernel buffer into a user mode one.
275
* @retval VINF_SUCCESS on success.
276
* @retval VERR_ACCESS_DENIED on error.
278
* @param R3PtrDst The user mode destination address.
279
* @param pvSrc The kernel mode source address.
280
* @param cb The number of bytes to copy.
282
RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb);
285
* Tests if the specified address is in the user addressable range.
287
* This function does not check whether the memory at that address is accessible
288
* or anything of that sort, only if the address it self is in the user mode
291
* @returns true if it's in the user addressable range. false if not.
292
* @param R3Ptr The user mode pointer to test.
294
* @remarks Some systems may have overlapping kernel and user address ranges.
295
* One prominent example of this is the x86 version of Mac OS X. Use
296
* RTR0MemAreKrnlAndUsrDifferent() to check.
298
RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr);
301
* Tests if the specified address is in the kernel mode range.
303
* This function does not check whether the memory at that address is accessible
304
* or anything of that sort, only if the address it self is in the kernel mode
307
* @returns true if it's in the kernel range. false if not.
308
* @param pv The alleged kernel mode pointer.
310
* @remarks Some systems may have overlapping kernel and user address ranges.
311
* One prominent example of this is the x86 version of Mac OS X. Use
312
* RTR0MemAreKrnlAndUsrDifferent() to check.
314
RTR0DECL(bool) RTR0MemKernelIsValidAddr(void *pv);
317
* Are user mode and kernel mode address ranges distinctly different.
319
* This determins whether RTR0MemKernelIsValidAddr and RTR0MemUserIsValidAddr
320
* can be used for deciding whether some arbitrary address is a user mode or a
323
* @returns true if they are, false if not.
325
RTR0DECL(bool) RTR0MemAreKrnlAndUsrDifferent(void);
327
#endif /* IN_RING0 */
263
330
/** @name Electrical Fence Version of some APIs.