VirtualBox

Changeset 23610 in vbox for trunk/src/VBox/Runtime/r0drv/os2


Ignore:
Timestamp:
Oct 7, 2009 9:22:10 PM (15 years ago)
Author:
vboxsync
Message:

IPRT,VMM,SUPDrv,VBGLR0: Added a parameter to RTR0MemObjLockUser/Kernel that indicates read/write intent so we can correctly lock readonly memory on Windows and OS/2. (Guest property strings, see #4238.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp

    r21497 r23610  
    242242
    243243
    244 int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, RTR0PROCESS R0Process)
     244int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process)
    245245{
    246246    AssertMsgReturn(R0Process == RTR0ProcHandleSelf(), ("%p != %p\n", R0Process, RTR0ProcHandleSelf()), VERR_NOT_SUPPORTED);
     
    254254    /* lock it. */
    255255    ULONG cPagesRet = cPages;
    256     int rc = KernVMLock(VMDHL_LONG | VMDHL_WRITE, (void *)R3Ptr, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
     256    int rc = KernVMLock(VMDHL_LONG | (fAccess & RTMEM_PROT_WRITE ? VMDHL_WRITE : 0),
     257                        (void *)R3Ptr, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
    257258    if (!rc)
    258259    {
     
    269270
    270271
    271 int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb)
     272int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb, uint32_t fAccess)
    272273{
    273274    /* create the object. */
     
    279280    /* lock it. */
    280281    ULONG cPagesRet = cPages;
    281     int rc = KernVMLock(VMDHL_LONG | VMDHL_WRITE, pv, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
     282    int rc = KernVMLock(VMDHL_LONG | (fAccess & RTMEM_PROT_WRITE ? VMDHL_WRITE : 0),
     283                        pv, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
    282284    if (!rc)
    283285    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette