mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 13:45:56 +00:00
- Removed the using of the media change count to recognize a median change.
svn path=/trunk/; revision=9999
This commit is contained in:
parent
52f4f6acef
commit
fac1d981b1
3 changed files with 24 additions and 51 deletions
|
@ -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: create.c,v 1.69 2004/07/03 17:31:30 hbirr Exp $
|
||||
/* $Id: create.c,v 1.70 2004/07/05 21:39:02 hbirr Exp $
|
||||
*
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/fs/vfat/create.c
|
||||
|
@ -178,7 +178,7 @@ FindFile (PDEVICE_EXTENSION DeviceExt,
|
|||
PVOID Page;
|
||||
PVFATFCB rcFcb;
|
||||
BOOLEAN FoundLong;
|
||||
BOOLEAN FoundShort;
|
||||
BOOLEAN FoundShort = FALSE;
|
||||
UNICODE_STRING PathNameU;
|
||||
BOOLEAN WildCard;
|
||||
PWCHAR curr, last;
|
||||
|
@ -339,8 +339,7 @@ VfatOpenFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
|||
PVFATFCB ParentFcb;
|
||||
PVFATFCB Fcb;
|
||||
NTSTATUS Status;
|
||||
ULONG Size;
|
||||
ULONG MediaChangeCount;
|
||||
|
||||
|
||||
// PDEVICE_OBJECT DeviceObject = DeviceExt->StorageDevice->Vpb->DeviceObject;
|
||||
|
||||
|
@ -373,39 +372,34 @@ VfatOpenFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject,
|
|||
|
||||
if (!DeviceExt->FatInfo.FixedMedia)
|
||||
{
|
||||
Size = sizeof(ULONG);
|
||||
Status = VfatBlockDeviceIoControl (DeviceExt->StorageDevice,
|
||||
IOCTL_DISK_CHECK_VERIFY,
|
||||
NULL,
|
||||
0,
|
||||
&MediaChangeCount,
|
||||
&Size,
|
||||
NULL,
|
||||
0,
|
||||
FALSE);
|
||||
|
||||
if (Status == STATUS_VERIFY_REQUIRED || MediaChangeCount != DeviceExt->MediaChangeCount)
|
||||
if (Status == STATUS_VERIFY_REQUIRED)
|
||||
|
||||
{
|
||||
PDEVICE_OBJECT DeviceToVerify;
|
||||
|
||||
DPRINT ("Media change detected!\n");
|
||||
DPRINT ("Device %p\n", DeviceExt->StorageDevice);
|
||||
|
||||
DeviceToVerify = IoGetDeviceToVerify (PsGetCurrentThread ());
|
||||
IoSetDeviceToVerify (PsGetCurrentThread (),
|
||||
DeviceToVerify = IoGetDeviceToVerify (PsGetCurrentThread ());
|
||||
|
||||
IoSetDeviceToVerify (PsGetCurrentThread (),
|
||||
NULL);
|
||||
|
||||
Status = IoVerifyVolume (DeviceToVerify,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT ("Status %lx\n", Status);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
else if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT ("Status %lx\n", Status);
|
||||
return Status;
|
||||
}
|
||||
Status = IoVerifyVolume (DeviceExt->StorageDevice,
|
||||
FALSE);
|
||||
}
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT ("Status %lx\n", Status);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.32 2004/06/23 20:23:59 hbirr Exp $
|
||||
/* $Id: fsctl.c,v 1.33 2004/07/05 21:39:02 hbirr Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -275,7 +275,6 @@ VfatMountDevice(PDEVICE_EXTENSION DeviceExt,
|
|||
{
|
||||
NTSTATUS Status;
|
||||
BOOLEAN RecognizedFS;
|
||||
ULONG Size;
|
||||
|
||||
DPRINT("Mounting VFAT device...\n");
|
||||
|
||||
|
@ -286,21 +285,6 @@ VfatMountDevice(PDEVICE_EXTENSION DeviceExt,
|
|||
}
|
||||
DPRINT("MountVfatdev %d, PAGE_SIZE = %d\n", DeviceExt->FatInfo.BytesPerCluster, PAGE_SIZE);
|
||||
|
||||
if (!DeviceExt->FatInfo.FixedMedia)
|
||||
{
|
||||
Size = sizeof(ULONG);
|
||||
Status = VfatBlockDeviceIoControl (DeviceToMount,
|
||||
IOCTL_DISK_CHECK_VERIFY,
|
||||
NULL,
|
||||
0,
|
||||
&DeviceExt->MediaChangeCount,
|
||||
&Size,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
@ -498,20 +482,19 @@ VfatVerify (PVFAT_IRP_CONTEXT IrpContext)
|
|||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
FATINFO FatInfo;
|
||||
BOOLEAN RecognizedFS;
|
||||
ULONG Size;
|
||||
PDEVICE_EXTENSION DeviceExt = IrpContext->DeviceExt;
|
||||
|
||||
DPRINT("VfatVerify(IrpContext %x)\n", IrpContext);
|
||||
|
||||
DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
|
||||
Size = sizeof(ULONG);
|
||||
Status = VfatBlockDeviceIoControl(DeviceToVerify,
|
||||
IOCTL_DISK_CHECK_VERIFY,
|
||||
NULL,
|
||||
0,
|
||||
&DeviceExt->MediaChangeCount,
|
||||
&Size,
|
||||
FALSE);
|
||||
NULL,
|
||||
0,
|
||||
TRUE);
|
||||
DeviceToVerify->Flags &= ~DO_VERIFY_VOLUME;
|
||||
if (!NT_SUCCESS(Status) && Status != STATUS_VERIFY_REQUIRED)
|
||||
{
|
||||
DPRINT("VfatBlockDeviceIoControl() failed (Status %lx)\n", Status);
|
||||
|
@ -533,7 +516,6 @@ VfatVerify (PVFAT_IRP_CONTEXT IrpContext)
|
|||
* Each write to the root directory must update this crc sum.
|
||||
*/
|
||||
|
||||
DeviceToVerify->Flags &= ~DO_VERIFY_VOLUME;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: vfat.h,v 1.64 2004/06/23 20:23:59 hbirr Exp $ */
|
||||
/* $Id: vfat.h,v 1.65 2004/07/05 21:39:02 hbirr Exp $ */
|
||||
|
||||
#include <ddk/ntifs.h>
|
||||
|
||||
|
@ -163,9 +163,6 @@ typedef struct
|
|||
struct _VFATFCB * VolumeFcb;
|
||||
|
||||
LIST_ENTRY VolumeListEntry;
|
||||
|
||||
ULONG MediaChangeCount;
|
||||
|
||||
} DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB;
|
||||
|
||||
typedef struct
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue