+#endif // _M_IX86
+
+BOOLEAN DriveMapIsValidDriveString(PCSTR DriveString)
+{
+ ULONG Index;
+
+ // Now verify that the user has given us appropriate strings
+ if ((strlen(DriveString) < 3) ||
+ ((DriveString[0] != 'f') && (DriveString[0] != 'F') &&
+ (DriveString[0] != 'h') && (DriveString[0] != 'H')) ||
+ ((DriveString[1] != 'd') && (DriveString[1] != 'D')))
+ {
+ return FALSE;
+ }
+
+ // Now verify that the user has given us appropriate numbers
+ // Make sure that only numeric characters were given
+ for (Index = 2; Index < strlen(DriveString); Index++)
+ {
+ if (DriveString[Index] < '0' || DriveString[Index] > '9')
+ {
+ return FALSE;
+ }
+ }
+
+ // Now make sure that they are not outrageous values (i.e. hd90874)
+ if ((atoi(&DriveString[2]) < 0) || (atoi(&DriveString[2]) > 0xff))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+UCHAR DriveMapGetBiosDriveNumber(PCSTR DeviceName)
+{
+ UCHAR BiosDriveNumber = 0;
+
+ TRACE("DriveMapGetBiosDriveNumber(%s)\n", DeviceName);
+
+ // If they passed in a number string then just
+ // convert it to decimal and return it
+ if (DeviceName[0] >= '0' && DeviceName[0] <= '9')
+ {
+ return (UCHAR)strtoul(DeviceName, NULL, 0);
+ }
+
+ // Convert the drive number string into a number
+ // 'hd1' = 1
+ BiosDriveNumber = atoi(&DeviceName[2]);
+
+ // If it's a hard disk then set the high bit
+ if ((DeviceName[0] == 'h' || DeviceName[0] == 'H') &&
+ (DeviceName[1] == 'd' || DeviceName[1] == 'D'))
+ {
+ BiosDriveNumber |= 0x80;
+ }
+
+ return BiosDriveNumber;
+}
+
+#ifdef _M_IX86
+