Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

static int kldrDyldCopyError ( int  rc,
char *  pszErr,
KSIZE  cchErr 
) [static]

Copies the error string to the user buffer.

Returns:
rc.
Parameters:
rc The status code.
pszErr Where to copy the error string to.
cchErr The size of the destination buffer.

Definition at line 1491 of file kLdrDyld.c.

References g_szkLdrDyldError, and KSIZE.

Referenced by kldrDyldDoLoad().

{
    KSIZE  cchToCopy;

    /* if no error string, format the rc into a string. */
    if (!g_szkLdrDyldError[0] && rc)
        kHlpInt2Ascii(g_szkLdrDyldError, sizeof(g_szkLdrDyldError), rc, 10);

    /* copy it if we got something. */
    if (cchErr && pszErr && g_szkLdrDyldError[0])
    {
        cchToCopy = kHlpStrLen(g_szkLdrDyldError);
        if (cchToCopy >= cchErr)
            cchToCopy = cchErr - 1;
        kHlpMemCopy(pszErr, g_szkLdrDyldError, cchToCopy);
        pszErr[cchToCopy] = '\0';
    }

    return rc;
}


Generated by  Doxygen 1.6.0   Back to index