VirtualBox

Changeset 10638 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 15, 2008 10:01:32 AM (16 years ago)
Author:
vboxsync
Message:

Generalize the VbglR3WriteLog input checks and specialize the windows buffering.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp

    r10626 r10638  
    5555VBGLR3DECL(int) VbglR3WriteLog(const char *pch, size_t cb)
    5656{
    57 #if defined(RT_OS_WINDOWS) /** @todo more OSes could take this route (solaris and freebsd for instance). */
    5857    /*
    59      * Handle the entire request in one go.
     58     * Quietly skip NULL strings.
     59     * (Happens in the RTLogBackdoorPrintf case.)
    6060     */
    61     if (!pch || !cb)
     61    if (!cb)
    6262        return VINF_SUCCESS;
     63    if (!VALID_PTR(pch))
     64        return VERR_INVALID_POINTER;
    6365
     66#ifdef RT_OS_WINDOWS
     67    /*
     68     * Duplicate the string as it may be read only (a C string).
     69     */
    6470    void *pvTmp = RTMemDup(pch, cb);
    6571    if (!pvTmp)
     
    6874    RTMemFree(pvTmp);
    6975    return rc;
     76
     77#elif 0 /** @todo Several OSes could take this route (solaris and freebsd for instance). */
     78    /*
     79     * Handle the entire request in one go.
     80     */
     81    return vbglR3DoIOCtl(VBOXGUEST_IOCTL_LOG(cb), pvTmp, cb);
    7082
    7183#else
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