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

BOOLEAN DissectArcPath ( CHAR ArcPath,
CHAR BootPath,
UCHAR BootDrive,
ULONG BootPartition 
)

Definition at line 24 of file arcname.c.

Referenced by DiskOpen().

{
    char *p;

    //
    // Detect ramdisk path
    //
    if (_strnicmp(ArcPath, "ramdisk(0)", 10) == 0)
    {
        //
        // Magic value for ramdisks
        //
        *BootDrive = 0x49;
        *BootPartition = 1;

        //
        // Get the path
        //
        p = ArcPath + 11;
        strcpy(BootPath, p);
        return TRUE;
    }

    if (_strnicmp(ArcPath, "multi(0)disk(0)", 15) != 0)
        return FALSE;

    p = ArcPath + 15;
    if (_strnicmp(p, "fdisk(", 6) == 0)
    {
        /*
         * floppy disk path:
         *  multi(0)disk(0)fdisk(x)\path
         */
        p = p + 6;
        *BootDrive = atoi(p);
        p = strchr(p, ')');
        if (p == NULL)
            return FALSE;
        p++;
        *BootPartition = 0;
    }
    else if (_strnicmp(p, "cdrom(", 6) == 0)
    {
        /*
         * cdrom path:
         *  multi(0)disk(0)cdrom(x)\path
         */
        p = p + 6;
        *BootDrive = atoi(p) + 0x80;
        p = strchr(p, ')');
        if (p == NULL)
            return FALSE;
        p++;
        *BootPartition = 0xff;
    }
    else if (_strnicmp(p, "rdisk(", 6) == 0)
    {
        /*
         * hard disk path:
         *  multi(0)disk(0)rdisk(x)partition(y)\path
         */
        p = p + 6;
        *BootDrive = atoi(p) + 0x80;
        p = strchr(p, ')');
        if ((p == NULL) || (_strnicmp(p, ")partition(", 11) != 0))
            return FALSE;
        p = p + 11;
        *BootPartition = atoi(p);
        p = strchr(p, ')');
        if (p == NULL)
            return FALSE;
        p++;
    }
    else
    {
        return FALSE;
    }

    strcpy(BootPath, p);

    return TRUE;
}

Generated on Mon May 28 2012 04:48:50 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.