VirtualBox

Changeset 6345 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 11, 2008 5:28:00 PM (17 years ago)
Author:
vboxsync
Message:

Solaris Guest driver: Fixed ioctl numbering, implemented VBOXGUEST_IOCTL_LOG.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c

    r6301 r6345  
    733733    int rc = 0;
    734734    int requestType = 0;
    735     if (    Cmd >= VBOXGUEST_IOCTL_VMMREQUEST(0)
    736         &&  Cmd <= VBOXGUEST_IOCTL_VMMREQUEST(0xfff))
     735    if (VBOXGUEST_IOCTL_NUMBER(Cmd) == VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_VMMREQUEST(0)))
    737736    {
    738737        cbBuf = sizeof(VMMDevRequestHeader);
    739738        requestType = 1;
    740         LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_VMMREQUEST"));
     739        LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_VMMREQUEST\n"));
    741740    }
    742741#ifdef VBOX_HGCM
    743     else if (   Cmd >= VBOXGUEST_IOCTL_HGCM_CALL(0)
    744              && Cmd <= VBOXGUEST_IOCTL_HGCM_CALL(0xfff))
     742    else if (VBOXGUEST_IOCTL_NUMBER(Cmd) == VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_HGCM_CALL(0)))
    745743    {
    746744        cbBuf = sizeof(VBoxGuestHGCMCallInfo);
    747         LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_HGCM_CALL"));
     745        requestType = 2;
     746        LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_HGCM_CALL", Cmd));
    748747    }
    749748#endif /* VBOX_HGCM */
     749    else if (VBOXGUEST_IOCTL_NUMBER(Cmd) == VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_LOG(0)))
     750    {
     751        /** Untested Code. Will be tested soon. */
     752        cbBuf = VBOXGUEST_IOCTL_SIZE(Cmd);
     753        LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_LOG Cmd=%d cbBuf=%d", Cmd, cbBuf));       
     754        char* pszLogMsg = RTMemTmpAlloc(cbBuf);
     755        if (RT_UNLIKELY(!pszLogMsg))
     756        {
     757            LogRel((DEVICE_NAME ":RTMemAlloc failed to alloc %d bytes\n", cbBuf));
     758            return ENOMEM;
     759        }
     760        rc = ddi_copyin((void *)pArg, pszLogMsg, cbBuf, Mode);
     761        if (rc == 0)
     762            Log(("%.*s", cbBuf, pszLogMsg));
     763        else
     764            LogRel((DEVICE_NAME ":ddi_copyin failed. rc=%d\n", rc));
     765        RTMemTmpFree(pszLogMsg);
     766    }
    750767    else
    751768    {
     
    803820    {
    804821        VMMDevRequestHeader Hdr;
    805         rc = ddi_copyin((void*)pArg, &Hdr, sizeof(Hdr), Mode);
     822        rc = ddi_copyin((void *)pArg, &Hdr, sizeof(Hdr), Mode);
    806823        if (RT_UNLIKELY(rc))
    807824        {
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