+
+
+static BOOL
+DissectArcPath(char *ArcPath, char *BootPath, unsigned int *BootDrive, unsigned int *BootPartition)
+{
+ char *p;
+
+ 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, "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) || (*BootPartition == 0))
+ return FALSE;
+ p++;
+ }
+ else
+ {
+ return FALSE;
+ }
+
+ strcpy(BootPath, p);
+
+ return TRUE;
+}