VirtualBox

Ignore:
Timestamp:
Feb 18, 2008 7:55:14 AM (17 years ago)
Author:
vboxsync
Message:

Additions/Linux: switch the VBOXGUEST_IOCTL_NR ioctl to VBOXGUEST_IOCTL_STRIP_SIZE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/module/vboxmod.c

    r6948 r6978  
    355355
    356356        /* Deal with variable size ioctls first. */
    357         if (VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_LOG(0)) == VBOXGUEST_IOCTL_NUMBER(cmd)) {
     357        if (   VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_LOG(0))
     358            == VBOXGUEST_IOCTL_STRIP_SIZE(cmd)) {
    358359                char *pszMessage = kmalloc(VBOXGUEST_IOCTL_SIZE(cmd), GFP_KERNEL);
    359360                if (NULL == pszMessage) {
     
    376377        }
    377378
    378         if (   VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_VMMREQUEST(0))
    379             == VBOXGUEST_IOCTL_NUMBER(cmd))  {
     379        if (   VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_VMMREQUEST(0))
     380            == VBOXGUEST_IOCTL_STRIP_SIZE(cmd))  {
    380381            VMMDevRequestHeader reqHeader;
    381382            VMMDevRequestHeader *reqFull = NULL;
     
    453454            VbglGRFree(reqFull);
    454455            return rc;
     456        }
     457
     458        if (   VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_HGCM_CALL(0))
     459            == VBOXGUEST_IOCTL_STRIP_SIZE(cmd)) {
     460        /* This IOCTL allows the guest to make an HGCM call from user space.  The
     461           OS-independant part of the Guest Additions already contain code for making an
     462           HGCM call from the guest, but this code assumes that the call is made from the
     463           kernel's address space.  So before calling it, we have to copy all parameters
     464           to the HGCM call from user space to kernel space and reconstruct the structures
     465           passed to the call (which include pointers to other memory) inside the kernel's
     466           address space. */
     467                return vbox_ioctl_hgcm_call(arg, vboxDev);
    455468        }
    456469
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