Bugfix: Changed GetDriveType32A(NULL) to use cwd's root.

This commit is contained in:
Petter Reinholdtsen 1998-10-11 14:26:25 +00:00 committed by Alexandre Julliard
parent b05264fe53
commit 0dce5b7538
1 changed files with 18 additions and 15 deletions

View File

@ -786,29 +786,32 @@ UINT16 WINAPI GetDriveType16(
* DRIVE_RAMDISK virtual disk in ram
*
* DRIVE_DOESNOTEXIST XXX Not valid return value
* DRIVE_CANNOTDETERMINE XXX Not valid return value
*
* BUGS
*
* Currently returns DRIVE_DOESNOTEXIST when it really should return
* DRIVE_UNKNOWN or DRIVE_NO_ROOT_DIR. DRIVE_RAMDISK is unsupported.
* Should determine current directory and use that root if param is
* NULL.
* Currently returns DRIVE_DOESNOTEXIST and DRIVE_CANNOTDETERMINE
* when it really should return DRIVE_NO_ROOT_DIR and DRIVE_UNKNOWN.
* Why where the former defines used?
*
* DRIVE_RAMDISK is unsupported.
*/
UINT32 WINAPI GetDriveType32A(LPCSTR root /* String describing drive */)
{
TRACE(dosfs, "(%s)\n", NULL != root ? root : "NULL");
if (NULL == root)
{
FIXME(dosfs,"(NULL) should use current dir, hardcoded c: instead\n");
root = "C:";
}
int drive;
TRACE(dosfs, "(%s)\n", debugstr_a(root));
if (NULL == root) drive = DRIVE_GetCurrentDrive();
else
{
if ((root[1]) && (root[1] != ':'))
{
WARN(dosfs, "invalid root '%s'\n", NULL != root ? root : "NULL");
WARN(dosfs, "invalid root '%s'\n", debugstr_a(root));
return DRIVE_DOESNOTEXIST;
}
switch(DRIVE_GetType(toupper(root[0]) - 'A'))
drive = toupper(root[0]) - 'A';
}
switch(DRIVE_GetType(drive))
{
case TYPE_FLOPPY: return DRIVE_REMOVABLE;
case TYPE_HD: return DRIVE_FIXED;