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

#define K_VALIDATE_BUFFER ( buf,
cb   ) 

Value:

do { \
        if (!K_VALID_PTR(buf)) \
            return KERR_INVALID_POINTER; \
        if ((cb) != 0) \
        { \
            KU8             __b; \
            KU8 volatile   *__pb = (KU8 volatile *)(buf); \
            KSIZE           __cbPage1 = 0x1000 - ((KUPTR)(__pb) & 0xfff); /* ASSUMES page size! */ \
            __b = *__pb; *__pb = 0xff; *__pb = __b; \
            if ((cb) > __cbPage1) \
            { \
                KSIZE __cb = (cb) - __cbPage1; \
                __pb -= __cbPage1; \
                for (;;) \
                { \
                    __b = *__pb; *__pb = 0xff; *__pb = __b; \
                    if (__cb < 0x1000) \
                        break; \
                    __pb += 0x1000; \
                    __cb -= 0x1000; \
                } \
            } \
        } \
        else \
            return KERR_INVALID_PARAMETER; \
    } while (0)
Return/Crash validation of an output buffer.

Definition at line 428 of file kDefs.h.

Referenced by kLdrDyldGetFilename(), and kLdrDyldGetName().


Generated by  Doxygen 1.6.0   Back to index