/* Verify if the supplied sector contains valid fields of a Partition Boot Sector. Internal function.  */
RtStatus_t VerifyPBS(uint8_t *pSectorData)
/* Verify if the supplied sector contains valid fields of a Partition Boot Sector. Internal function.  */
RtStatus_t VerifyPBS(uint8_t *pSectorData)
{
    uint32_t u8SecValue = 1;
    uint8_t u8SecPerClus = pSectorData[0x0d];
    uint32_t i;
    for (i = 0; i < 8; i++) {
        if (u8SecPerClus == u8SecValue) {
            break;
        }
        u8SecValue <<= 1;
    }
    if ((u8SecValue == 256) || ((pSectorData[0] != 0xEB) && (pSectorData[0] != 0xE9))) {
        return ERROR_OS_FILESYSTEM_FILESYSTEM_NOT_FOUND;
    }
    if (((pSectorData[0x1fe] == 0x55) && (pSectorData[0x1ff] == 0xAA)) ||
        ((pSectorData[0x7fe] == 0x55) && (pSectorData[0x7ff] == 0xAA))) {
        return SUCCESS;
    }
    return ERROR_OS_FILESYSTEM_FILESYSTEM_NOT_FOUND;
}