VirtualBox

Changeset 8694 in vbox


Ignore:
Timestamp:
May 8, 2008 7:29:59 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30631
Message:

Linux Additions: handle IOCTL_VBOXGUEST_HGCM_DISCONNECT

File:
1 edited

Legend:

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

    r8155 r8694  
    343343
    344344/**
     345 * IOCTL handler.  Disconnect a specific HGCM connection.
     346 *
     347 * @returns 0 on success, or a Linux kernel errno value
     348 * @param  filp           the file structure with which the application opened the driver
     349 * @param  userspace_info userspace pointer to the hgcm connection information
     350 *                        (VBoxGuestHGCMConnectInfo structure)
     351 * @retval userspace_info userspace pointer to the hgcm connection information
     352 */
     353static int vboxadd_hgcm_disconnect(struct file *filp, unsigned long userspace_info)
     354{
     355        VBoxGuestHGCMDisconnectInfo info;
     356        if (0 != copy_from_user ((void *)&info, (void *)userspace_info, sizeof (info))) {
     357                LogRelFunc (("IOCTL_VBOXGUEST_HGCM_DISCONNECT: can not get info\n"));
     358                return -EFAULT;
     359        }
     360        LogRelFunc(("client ID %u\n", info.u32ClientID));
     361        vboxadd_cmc_call(vboxDev, IOCTL_VBOXGUEST_HGCM_DISCONNECT, &info);
     362        if (copy_to_user ((void *)userspace_info, (void *)&info, sizeof(info))) {
     363                LogRelFunc (("IOCTL_VBOXGUEST_HGCM_DISCONNECT: failed to return the connection structure\n"));
     364                return -EFAULT;
     365        }
     366        return 0;
     367}
     368
     369/**
    345370 * IOCtl handler.  Control the interrupt filter mask to specify which VMMDev interrupts
    346371 * we know how to handle.
     
    532557                    IOCTL_EXIT("IOCTL_VBOXGUEST_HGCM_CONNECT", arg);
    533558                    break;
     559            case IOCTL_VBOXGUEST_HGCM_DISCONNECT:
     560                    IOCTL_ENTRY("IOCTL_VBOXGUEST_HGCM_DISCONNECT", arg);
     561                    vboxadd_hgcm_disconnect(filp, arg);
     562                    IOCTL_EXIT("IOCTL_VBOXGUEST_HGCM_DISCONNECT", arg);
     563                    break;
    534564            case VBOXGUEST_IOCTL_CTL_FILTER_MASK:
    535565            {
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