VirtualBox

Changeset 4834 in vbox for trunk/src


Ignore:
Timestamp:
Sep 16, 2007 8:46:09 PM (17 years ago)
Author:
vboxsync
Message:

Unbroke solaris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c

    r4824 r4834  
    4040#include <iprt/initterm.h>
    4141#include <iprt/alloc.h>
     42#include <iprt/string.h>
    4243
    4344
     
    170171        ddi_soft_state_fini(&g_pVBoxDrvSolarisState);
    171172
     173    cmn_err(CE_CONT, "VBoxDrvSolaris _init returns %d", e);
    172174    return e;
    173175}
     
    188190{
    189191    cmn_err(CE_CONT, "VBoxDrvSolaris _info");
    190     return mod_info (&g_VBoxDrvSolarisModLinkage, pModInfo);
     192    int e = mod_info (&g_VBoxDrvSolarisModLinkage, pModInfo);
     193    cmn_err(CE_CONT, "VBoxDrvSolaris _info returns %d", e);
     194    return e;
    191195}
    192196
     
    501505#ifndef IOCPARM_LEN
    502506# define IOCPARM_LEN(x)     ( ((x) >> 16) & IOCPARM_MASK )
    503 #endif 
     507#endif
    504508
    505509
     
    525529     * Read the header.
    526530     */
    527     if (RT_UNLIKELY(IOC_PARMLEN(iCmd) != sizeof(Hdr)))
    528     {
    529         OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: iCmd=%#x len %d expected %d\n", iCmd, IOC_PARMLEN(iCmd), sizeof(Hdr)));
     531    if (RT_UNLIKELY(IOCPARM_LEN(iCmd) != sizeof(Hdr)))
     532    {
     533        OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: iCmd=%#x len %d expected %d\n", iCmd, IOCPARM_LEN(iCmd), sizeof(Hdr)));
    530534        return EINVAL;
    531535    }
    532     rc = ddi_copyin(&Hdr, (void *)iArg, sizeof(Hdr), Mode);
     536    rc = ddi_copyin((void *)iArg, &Hdr, sizeof(Hdr), Mode);
    533537    if (RT_UNLIKELY(rc))
    534538    {
     
    544548    if (RT_UNLIKELY(    Hdr.cbIn < sizeof(Hdr)
    545549                    ||  Hdr.cbOut < sizeof(Hdr)
    546                     ||  cbReq > _1M*16))
     550                    ||  cbBuf > _1M*16))
    547551    {
    548552        OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: max(%#x,%#x); iCmd=%#x\n", Hdr.cbIn, Hdr.cbOut, iCmd));
     
    559563        return ENOMEM;
    560564    }
    561     rc = ddi_copyin(pHdr, (void *)iArg, cbBuf, Mode);
     565    rc = ddi_copyin((void *)iArg, pHdr, cbBuf, Mode);
    562566    if (RT_UNLIKELY(rc))
    563567    {
     
    570574     * Process the IOCtl.
    571575     */
    572     rc = supdrvIOCtl(Cmd, &g_DevExt, pSession, pHdr);
     576    rc = supdrvIOCtl(iCmd, &g_DevExt, pSession, pHdr);
    573577
    574578    /*
     
    661665
    662666    va_start(args, pszFormat);
    663     vsnprintf(szMsg, sizeof(szMsg) - 1, pszFormat, args);
     667    RTStrPrintfV(szMsg, sizeof(szMsg) - 1, pszFormat, args);
    664668    va_end(args);
    665669
    666670    szMsg[sizeof(szMsg) - 1] = '\0';
    667     uprintf("%s", szMsg);
     671    uprintf("SUPR0Printf: %s", szMsg);
    668672    return 0;
    669673}
     674
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