ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

bool NTAPI CheckIfBadBlock ( IN PHW_LU_EXTENSION  LunExt,
IN ULONGLONG  lba,
IN ULONG  count 
)

Definition at line 250 of file id_badblock.cpp.

Referenced by AtaCommand48(), and UniataAhciSetupFIS_H2D().

{
    if (LunExt->nBadBlocks == 0)
        return false;
/*
    // this is checked by caller
    if(!(AtaCommandFlags[command] & ATA_CMD_FLAG_LBAsupp)) {
        return false;
*/
    ULONG nBadBlocks = LunExt->nBadBlocks;
    SBadBlockRange*  arrBadBlocks = LunExt->arrBadBlocks;

    // back transform for possibly CHS'ed LBA
    lba = UniAtaCalculateLBARegsBack(LunExt, lba);

    for (ULONG i = 0; i < nBadBlocks; i++)
    {
        if (lba + count > arrBadBlocks->m_lbaStart  &&  
                    lba < arrBadBlocks->m_lbaEnd) {
            KdPrint(( "listed BB @ %I64x\n", lba));
            return true;
        }
        arrBadBlocks++;
    }

    return false;

} // end CheckIfBadBlock()

Generated on Sat May 26 2012 05:24:45 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.