From 9fc35cab4e9a4bf2f49638290ed216adee04da4a Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sun, 20 Jun 2004 09:52:58 +0000 Subject: [PATCH] - Handle correctly "Unknown" media type in VfatHasFileSystem. This gets the floppy disk driver working. svn path=/trunk/; revision=9743 --- reactos/drivers/fs/vfat/fsctl.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/fs/vfat/fsctl.c b/reactos/drivers/fs/vfat/fsctl.c index dee33ff9bde..5bd8bc9dcda 100644 --- a/reactos/drivers/fs/vfat/fsctl.c +++ b/reactos/drivers/fs/vfat/fsctl.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: fsctl.c,v 1.30 2004/05/02 20:16:45 hbirr Exp $ +/* $Id: fsctl.c,v 1.31 2004/06/20 09:52:58 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -31,7 +31,7 @@ #include #include -#define NDEBUG +//#define NDEBUG #include #include "vfat.h" @@ -123,6 +123,16 @@ VfatHasFileSystem(PDEVICE_OBJECT DeviceToMount, *RecognizedFS = TRUE; } } + /* + * Floppy disk driver can return Unknown as media type if it + * doesn't know yet what floppy in the drive really is. This is + * perfectly correct to do under Windows. + */ + if (DiskGeometry.MediaType == Unknown) + { + *RecognizedFS = TRUE; + DiskGeometry.BytesPerSector = 512; + } if (DiskGeometry.MediaType > Unknown && DiskGeometry.MediaType < RemovableMedia ) { *RecognizedFS = TRUE;