VirtualBox

Changeset 6436 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jan 22, 2008 9:24:56 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27404
Message:

Handle logging ioctl in VBoxGuest.

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
2 edited

Legend:

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

    r6435 r6436  
    798798            cbDataReturned = cbBuf;
    799799        }
    800         rc = ddi_copyout(pvBuf, (void *)(uintptr_t)ReqWrap.pvDataR3, cbDataReturned, Mode);
    801         if (RT_UNLIKELY(rc))
    802         {
    803             Log((DEVICE_NAME ":VBoxAddSolarisIOCtl: ddi_copyout failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg, Cmd, rc));
    804             rc = EFAULT;
     800        if (cbDataReturned > 0)
     801        {
     802            rc = ddi_copyout(pvBuf, (void *)(uintptr_t)ReqWrap.pvDataR3, cbDataReturned, Mode);
     803            if (RT_UNLIKELY(rc))
     804            {
     805                Log((DEVICE_NAME ":VBoxAddSolarisIOCtl: ddi_copyout failed; pvBuf=%p pArg=%p Cmd=%d. rc=%d\n", pvBuf, pArg, Cmd, rc));
     806                rc = EFAULT;
     807            }
    805808        }
    806809    }
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r6426 r6436  
    10911091
    10921092/**
     1093 * Guest backdoor logging.
     1094 *
     1095 * @returns VBox status code.
     1096 *
     1097 * @param   pch                 The log message (need not be NULL terminated).
     1098 * @param   cbData              Size of the buffer.
     1099 * @param   pcbDataReturned     Where to store the amount of returned data. Can be NULL.
     1100 */
     1101static int VBoxGuestCommonIOCtl_Log(char *pch, size_t cbData, size_t *pcbDataReturned)
     1102{
     1103    Log(("%.*s\n", cbData, pch));
     1104    if (pcbDataReturned)
     1105        *pcbDataReturned = 0;
     1106    return VINF_SUCCESS;
     1107}
     1108
     1109
     1110/**
    10931111 * Common IOCtl for user to kernel and kernel to kernel communcation.
    10941112 *
     
    11581176    }
    11591177#endif /* VBOX_HGCM */
     1178    else if (VBOXGUEST_IOCTL_STRIP_SIZE(iFunction) == VBOXGUEST_IOCTL_STRIP_SIZE(VBOXGUEST_IOCTL_LOG(0)))
     1179    {
     1180        CHECKRET_MIN_SIZE("LOG", 1);
     1181        rc = VBoxGuestCommonIOCtl_Log((char *)pvData, cbData, pcbDataReturned);
     1182    }
    11601183    else
    11611184    {
     
    11891212                rc = VBoxGuestCommonIOCtl_HGCMDisconnect(pDevExt, pSession, (VBoxGuestHGCMDisconnectInfo *)pvData, pcbDataReturned);
    11901213                break;
    1191 
    11921214
    11931215            case VBOXGUEST_IOCTL_CLIPBOARD_CONNECT:
Note: See TracChangeset for help on using the changeset viewer.

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