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

static FF_T_SINT8 FF_PartitionCount ( FF_T_UINT8 pBuffer) [static]

Definition at line 50 of file ff_format.c.

Referenced by FF_FormatPartition().

{
    FF_T_SINT8 count = 0;
    FF_T_SINT8 part;
    // Check PBR or MBR signature
    if (FF_getChar(pBuffer, FF_FAT_MBR_SIGNATURE) != 0x55 &&
        FF_getChar(pBuffer, FF_FAT_MBR_SIGNATURE) != 0xAA ) {
        // No MBR, but is it a PBR ?
        if (FF_getChar(pBuffer, 0) == 0xEB &&          // PBR Byte 0
            FF_getChar(pBuffer, 2) == 0x90 &&          // PBR Byte 2
            (FF_getChar(pBuffer, 21) & 0xF0) == 0xF0) {// PBR Byte 21 : Media byte
            return 1;   // No MBR but PBR exist then only one partition
        }
        return 0;   // No MBR and no PBR then no partition found
    }
    for (part = 0; part < 4; part++)  {
        FF_T_UINT8 active = FF_getChar(pBuffer, FF_FAT_PTBL + FF_FAT_PTBL_ACTIVE + (16 * part));
        FF_T_UINT8 part_id = FF_getChar(pBuffer, FF_FAT_PTBL + FF_FAT_PTBL_ID + (16 * part));
        // The first sector must be a MBR, then check the partition entry in the MBR
        if (active != 0x80 && (active != 0 || part_id == 0)) {
            break;
        }
        count++;
    }
    return count;
}

Generated on Sat May 26 2012 06:00:04 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.