Author: mjmartin
Date: Mon Aug 30 11:51:17 2010
New Revision: 48654
URL:
http://svn.reactos.org/svn/reactos?rev=48654&view=rev
Log:
Patch by Pierre Schweitzer.
[CDFS]
- Several fixes for directory information query.
- Fixed a null access memory under certain circumstances.
- Added support for media ejection.
[FASTFAT]
- Fixed calls to CcMapData(), CcPinRead().
- Fixed an endless loop in FCB management under certain circumstances.
[NTOSKRNL]
- Fixed wrong prototype for IopParseDevice().
Added:
trunk/reactos/drivers/filesystems/cdfs/devctrl.c (with props)
Modified:
trunk/reactos/drivers/filesystems/cdfs/cdfs.c
trunk/reactos/drivers/filesystems/cdfs/cdfs.h
trunk/reactos/drivers/filesystems/cdfs/cdfs.rbuild
trunk/reactos/drivers/filesystems/cdfs/common.c
trunk/reactos/drivers/filesystems/cdfs/dirctl.c
trunk/reactos/drivers/filesystems/cdfs/fcb.c
trunk/reactos/drivers/filesystems/fastfat/create.c
trunk/reactos/drivers/filesystems/fastfat/direntry.c
trunk/reactos/drivers/filesystems/fastfat/dirwr.c
trunk/reactos/drivers/filesystems/fastfat/fcb.c
trunk/reactos/drivers/filesystems/fastfat/volume.c
trunk/reactos/ntoskrnl/include/internal/io.h
trunk/reactos/ntoskrnl/io/iomgr/file.c
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.c [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -95,6 +95,8 @@
CdfsQueryVolumeInformation;
DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] =
CdfsSetVolumeInformation;
+ DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] =
+ CdfsDeviceControl;
DriverObject->DriverUnload = NULL;
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.h [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -277,13 +277,17 @@
IN OUT PULONG pOutputBufferSize,
IN BOOLEAN Override);
-
/* create.c */
NTSTATUS NTAPI
CdfsCreate(PDEVICE_OBJECT DeviceObject,
PIRP Irp);
+/* devctrl.c */
+
+NTSTATUS NTAPI
+CdfsDeviceControl(PDEVICE_OBJECT DeviceObject,
+ PIRP Irp);
/* dirctl.c */
Modified: trunk/reactos/drivers/filesystems/cdfs/cdfs.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/cdfs.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/cdfs.rbuild [iso-8859-1] Mon Aug 30 11:51:17
2010
@@ -10,6 +10,7 @@
<file>close.c</file>
<file>common.c</file>
<file>create.c</file>
+ <file>devctrl.c</file>
<file>dirctl.c</file>
<file>fcb.c</file>
<file>finfo.c</file>
Modified: trunk/reactos/drivers/filesystems/cdfs/common.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/c…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -197,8 +197,11 @@
DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread());
IoSetDeviceToVerify(PsGetCurrentThread(), NULL);
- NewStatus = IoVerifyVolume(DeviceToVerify, FALSE);
- DPRINT1("IoVerifyVolume() returned (Status %lx)\n", NewStatus);
+ if (DeviceToVerify)
+ {
+ NewStatus = IoVerifyVolume(DeviceToVerify, FALSE);
+ DPRINT1("IoVerifyVolume() returned (Status %lx)\n", NewStatus);
+ }
}
DPRINT("Returning Status %x\n", Status);
Added: trunk/reactos/drivers/filesystems/cdfs/devctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/devctrl.c (added)
+++ trunk/reactos/drivers/filesystems/cdfs/devctrl.c [iso-8859-1] Mon Aug 30 11:51:17
2010
@@ -1,0 +1,64 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS kernel
+ * FILE: drivers/filesystems/cdfs/devctrl.c
+ * PURPOSE: CDROM (ISO 9660) filesystem driver
+ * PROGRAMMER: Pierre Schweitzer
+ *
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include "cdfs.h"
+
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS ****************************************************************/
+
+NTSTATUS NTAPI
+CdfsDeviceControl(PDEVICE_OBJECT DeviceObject,
+ PIRP Irp)
+{
+ NTSTATUS Status;
+ PVCB Vcb = NULL;
+ PFILE_OBJECT FileObject;
+ PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
+
+ FileObject = Stack->FileObject;
+ Irp->IoStatus.Information = 0;
+
+ /* FIXME: HACK, it means that CD has changed */
+ if (!FileObject)
+ {
+ DPRINT1("FIXME: CdfsDeviceControl called without FileObject!\n");
+ Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_INVALID_DEVICE_REQUEST;
+ }
+
+ /* Only support such operations on volume */
+ if (!(FileObject->RelatedFileObject == NULL ||
FileObject->RelatedFileObject->FsContext2 != NULL))
+ {
+ Irp->IoStatus.Status = STATUS_INVALID_PARAMETER;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (Stack->Parameters.DeviceIoControl.IoControlCode == IOCTL_CDROM_DISK_TYPE)
+ {
+ /* We should handle this one, but we don't! */
+ Status = STATUS_NOT_IMPLEMENTED;
+ Irp->IoStatus.Status = Status;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ }
+ else
+ {
+ /* Pass it to storage driver */
+ IoSkipCurrentIrpStackLocation(Irp);
+ Vcb = (PVCB)Stack->DeviceObject->DeviceExtension;
+ Status = IoCallDriver(Vcb->StorageDevice, Irp);
+ }
+
+ return Status;
+}
Propchange: trunk/reactos/drivers/filesystems/cdfs/devctrl.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/drivers/filesystems/cdfs/devctrl.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: trunk/reactos/drivers/filesystems/cdfs/dirctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/d…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/dirctl.c [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -376,13 +376,15 @@
DPRINT("CdfsGetNameInformation() called\n");
Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
- if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
+ if ((sizeof(FILE_NAMES_INFORMATION) + Length) > BufferLength)
return(STATUS_BUFFER_OVERFLOW);
Info->FileNameLength = Length;
Info->NextEntryOffset =
- ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
- memcpy(Info->FileName, Fcb->ObjectName, Length);
+ ROUND_UP(sizeof(FILE_NAMES_INFORMATION) + Length, sizeof(ULONG));
+ RtlCopyMemory(Info->FileName, Fcb->ObjectName, Length);
+
+ // Info->FileIndex=;
return(STATUS_SUCCESS);
}
@@ -399,31 +401,27 @@
DPRINT("CdfsGetDirectoryInformation() called\n");
Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
- if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
+ if ((sizeof (FILE_DIRECTORY_INFORMATION) + Length) > BufferLength)
return(STATUS_BUFFER_OVERFLOW);
Info->FileNameLength = Length;
Info->NextEntryOffset =
- ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
- memcpy(Info->FileName, Fcb->ObjectName, Length);
+ ROUND_UP(sizeof(FILE_DIRECTORY_INFORMATION) + Length, sizeof(ULONG));
+ RtlCopyMemory(Info->FileName, Fcb->ObjectName, Length);
/* Convert file times */
CdfsDateTimeToSystemTime(Fcb,
&Info->CreationTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->LastAccessTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->LastWriteTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->ChangeTime);
+ Info->LastWriteTime = Info->CreationTime;
+ Info->ChangeTime = Info->CreationTime;
/* Convert file flags */
CdfsFileFlagsToAttributes(Fcb,
&Info->FileAttributes);
if (CdfsFCBIsDirectory(Fcb))
{
- Info->EndOfFile.QuadPart = 0LL;
- Info->AllocationSize.QuadPart = 0LL;
+ Info->EndOfFile.QuadPart = 0;
+ Info->AllocationSize.QuadPart = 0;
}
else
{
@@ -450,23 +448,19 @@
DPRINT("CdfsGetFullDirectoryInformation() called\n");
Length = wcslen(Fcb->ObjectName) * sizeof(WCHAR);
- if ((sizeof (FILE_BOTH_DIR_INFORMATION) + Length) > BufferLength)
+ if ((sizeof (FILE_FULL_DIR_INFORMATION) + Length) > BufferLength)
return(STATUS_BUFFER_OVERFLOW);
Info->FileNameLength = Length;
Info->NextEntryOffset =
- ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
- memcpy(Info->FileName, Fcb->ObjectName, Length);
+ ROUND_UP(sizeof(FILE_FULL_DIR_INFORMATION) + Length, sizeof(ULONG));
+ RtlCopyMemory(Info->FileName, Fcb->ObjectName, Length);
/* Convert file times */
CdfsDateTimeToSystemTime(Fcb,
&Info->CreationTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->LastAccessTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->LastWriteTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->ChangeTime);
+ Info->LastWriteTime = Info->CreationTime;
+ Info->ChangeTime = Info->CreationTime;
/* Convert file flags */
CdfsFileFlagsToAttributes(Fcb,
@@ -474,8 +468,8 @@
if (CdfsFCBIsDirectory(Fcb))
{
- Info->EndOfFile.QuadPart = 0LL;
- Info->AllocationSize.QuadPart = 0LL;
+ Info->EndOfFile.QuadPart = 0;
+ Info->AllocationSize.QuadPart = 0;
}
else
{
@@ -508,18 +502,14 @@
Info->FileNameLength = Length;
Info->NextEntryOffset =
- ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, 4);
- memcpy(Info->FileName, Fcb->ObjectName, Length);
+ ROUND_UP(sizeof(FILE_BOTH_DIR_INFORMATION) + Length, sizeof(ULONG));
+ RtlCopyMemory(Info->FileName, Fcb->ObjectName, Length);
/* Convert file times */
CdfsDateTimeToSystemTime(Fcb,
&Info->CreationTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->LastAccessTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->LastWriteTime);
- CdfsDateTimeToSystemTime(Fcb,
- &Info->ChangeTime);
+ Info->LastWriteTime = Info->CreationTime;
+ Info->ChangeTime = Info->CreationTime;
/* Convert file flags */
CdfsFileFlagsToAttributes(Fcb,
@@ -527,8 +517,8 @@
if (CdfsFCBIsDirectory(Fcb))
{
- Info->EndOfFile.QuadPart = 0LL;
- Info->AllocationSize.QuadPart = 0LL;
+ Info->EndOfFile.QuadPart = 0;
+ Info->AllocationSize.QuadPart = 0;
}
else
{
@@ -542,8 +532,9 @@
Info->EaSize = 0;
/* Copy short name */
+ ASSERT(Fcb->ShortNameU.Length / sizeof(WCHAR) <= 12);
Info->ShortNameLength = Fcb->ShortNameU.Length;
- memcpy(Info->ShortName, Fcb->ShortNameU.Buffer, Fcb->ShortNameU.Length);
+ RtlCopyMemory(Info->ShortName, Fcb->ShortNameU.Buffer,
Fcb->ShortNameU.Length);
return(STATUS_SUCCESS);
}
@@ -584,6 +575,15 @@
Stack->Parameters.QueryDirectory.FileInformationClass;
FileIndex = Stack->Parameters.QueryDirectory.FileIndex;
+ /* Determine Buffer for result */
+ if (Irp->MdlAddress)
+ {
+ Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
+ }
+ else
+ {
+ Buffer = Irp->UserBuffer;
+ }
if (SearchPattern != NULL)
{
@@ -596,13 +596,8 @@
{
return STATUS_INSUFFICIENT_RESOURCES;
}
-
- Ccb->DirectorySearchPattern.Length = SearchPattern->Length;
Ccb->DirectorySearchPattern.MaximumLength = SearchPattern->Length +
sizeof(WCHAR);
-
- memcpy(Ccb->DirectorySearchPattern.Buffer,
- SearchPattern->Buffer,
- SearchPattern->Length);
+ RtlCopyUnicodeString(&Ccb->DirectorySearchPattern, SearchPattern);
Ccb->DirectorySearchPattern.Buffer[SearchPattern->Length /
sizeof(WCHAR)] = 0;
}
}
@@ -625,23 +620,13 @@
/* Determine directory index */
if (Stack->Flags & SL_INDEX_SPECIFIED)
{
- Ccb->Entry = Ccb->CurrentByteOffset.u.LowPart;
- Ccb->Offset = 0;
+ Ccb->Entry = Stack->Parameters.QueryDirectory.FileIndex;
+ Ccb->Offset = Ccb->CurrentByteOffset.u.LowPart;
}
else if (First || (Stack->Flags & SL_RESTART_SCAN))
{
Ccb->Entry = 0;
Ccb->Offset = 0;
- }
-
- /* Determine Buffer for result */
- if (Irp->MdlAddress)
- {
- Buffer = MmGetSystemAddressForMdl(Irp->MdlAddress);
- }
- else
- {
- Buffer = Irp->UserBuffer;
}
DPRINT("Buffer = %p tofind = %wZ\n", Buffer,
&Ccb->DirectorySearchPattern);
Modified: trunk/reactos/drivers/filesystems/cdfs/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/f…
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/fcb.c [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -233,7 +233,6 @@
PFCB Fcb)
{
PFILE_OBJECT FileObject;
- NTSTATUS Status;
PCCB newCCB;
FileObject = IoCreateStreamFileObject(NULL, Vcb->StorageDevice);
@@ -241,7 +240,7 @@
newCCB = ExAllocatePoolWithTag(NonPagedPool, sizeof(CCB), TAG_CCB);
if (newCCB == NULL)
{
- return(STATUS_INSUFFICIENT_RESOURCES);
+ return STATUS_INSUFFICIENT_RESOURCES;
}
RtlZeroMemory(newCCB,
sizeof(CCB));
@@ -256,7 +255,6 @@
Fcb->FileObject = FileObject;
Fcb->DevExt = Vcb;
- Status = STATUS_SUCCESS;
CcInitializeCacheMap(FileObject,
(PCC_FILE_SIZES)(&Fcb->RFCB.AllocationSize),
FALSE,
@@ -266,7 +264,7 @@
ObDereferenceObject(FileObject);
Fcb->Flags |= FCB_CACHE_INITIALIZED;
- return(Status);
+ return STATUS_SUCCESS;
}
@@ -434,6 +432,9 @@
}
memset(newCCB, 0, sizeof(CCB));
+ FileObject->ReadAccess = TRUE;
+ FileObject->WriteAccess = FALSE;
+ FileObject->DeleteAccess = FALSE;
FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
FileObject->FsContext = Fcb;
FileObject->FsContext2 = newCCB;
Modified: trunk/reactos/drivers/filesystems/fastfat/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/create.c [iso-8859-1] Mon Aug 30 11:51:17
2010
@@ -125,7 +125,7 @@
ExReleaseResourceLite (&DeviceExt->DirResource);
FileOffset.QuadPart = 0;
- if (CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context,
(PVOID*)&Entry))
+ if (CcMapData(pFcb->FileObject, &FileOffset, SizeDirEntry, TRUE, &Context,
(PVOID*)&Entry))
{
while (TRUE)
{
@@ -155,7 +155,7 @@
{
CcUnpinData(Context);
FileOffset.u.LowPart += PAGE_SIZE;
- if (!CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context,
(PVOID*)&Entry))
+ if (!CcMapData(pFcb->FileObject, &FileOffset, SizeDirEntry, TRUE,
&Context, (PVOID*)&Entry))
{
Context = NULL;
break;
Modified: trunk/reactos/drivers/filesystems/fastfat/direntry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/direntry.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/direntry.c [iso-8859-1] Mon Aug 30 11:51:17
2010
@@ -66,7 +66,7 @@
CcUnpinData(Context);
}
- if (!CcMapData(Fcb->FileObject, &FileOffset, PAGE_SIZE, TRUE,
&Context, (PVOID*)&FatDirEntry))
+ if (!CcMapData(Fcb->FileObject, &FileOffset, sizeof(FAT_DIR_ENTRY),
TRUE, &Context, (PVOID*)&FatDirEntry))
{
return TRUE;
}
@@ -120,7 +120,7 @@
CcUnpinData(Context);
}
- if (!CcMapData(Fcb->FileObject, &FileOffset, PAGE_SIZE, TRUE,
&Context, (PVOID*)&FatXDirEntry))
+ if (!CcMapData(Fcb->FileObject, &FileOffset, sizeof(FATX_DIR_ENTRY),
TRUE, &Context, (PVOID*)&FatXDirEntry))
{
return TRUE;
}
Modified: trunk/reactos/drivers/filesystems/fastfat/dirwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/dirwr.c [iso-8859-1] Mon Aug 30 11:51:17
2010
@@ -638,7 +638,7 @@
CcUnpinData(Context);
}
Offset.u.LowPart = (i * sizeof(FAT_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE;
- CcPinRead(pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
+ CcPinRead(pFcb->parentFcb->FileObject, &Offset,
sizeof(FAT_DIR_ENTRY), TRUE,
&Context, (PVOID*)&pDirEntry);
}
pDirEntry[i % (PAGE_SIZE / sizeof(FAT_DIR_ENTRY))].Filename[0] = 0xe5;
@@ -689,7 +689,7 @@
DPRINT("delete entry: %d\n", StartIndex);
Offset.u.HighPart = 0;
Offset.u.LowPart = (StartIndex * sizeof(FATX_DIR_ENTRY) / PAGE_SIZE) * PAGE_SIZE;
- if (!CcPinRead(pFcb->parentFcb->FileObject, &Offset, PAGE_SIZE, TRUE,
+ if (!CcPinRead(pFcb->parentFcb->FileObject, &Offset,
sizeof(FATX_DIR_ENTRY), TRUE,
&Context, (PVOID*)&pDirEntry))
{
DPRINT1("CcPinRead(Offset %x:%x, Length %d) failed\n",
Offset.u.HighPart, Offset.u.LowPart, PAGE_SIZE);
Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -474,7 +474,7 @@
if (vfatFCBIsDirectory(rcFCB))
{
ULONG FirstCluster, CurrentCluster;
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
Size = 0;
FirstCluster = vfatDirEntryGetFirstCluster (vcb, &rcFCB->entry);
if (FirstCluster == 1)
@@ -484,7 +484,7 @@
else if (FirstCluster != 0)
{
CurrentCluster = FirstCluster;
- while (CurrentCluster != 0xffffffff)
+ while (CurrentCluster != 0xffffffff && NT_SUCCESS(Status))
{
Size += vcb->FatInfo.BytesPerCluster;
Status = NextCluster (vcb, FirstCluster, &CurrentCluster, FALSE);
Modified: trunk/reactos/drivers/filesystems/fastfat/volume.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
==============================================================================
--- trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/fastfat/volume.c [iso-8859-1] Mon Aug 30 11:51:17
2010
@@ -229,7 +229,7 @@
/* Search existing volume entry on disk */
FileOffset.QuadPart = 0;
- if (CcPinRead(pRootFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context,
(PVOID*)&Entry))
+ if (CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, TRUE,
&Context, (PVOID*)&Entry))
{
while (TRUE)
{
@@ -250,13 +250,13 @@
Entry = (PDIR_ENTRY)((ULONG_PTR)Entry + SizeDirEntry);
if ((DirIndex % EntriesPerPage) == 0)
{
- CcUnpinData(Context);
- FileOffset.u.LowPart += PAGE_SIZE;
- if (!CcPinRead(pRootFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE,
&Context, (PVOID*)&Entry))
- {
- Context = NULL;
- break;
- }
+ CcUnpinData(Context);
+ FileOffset.u.LowPart += PAGE_SIZE;
+ if (!CcPinRead(pRootFcb->FileObject, &FileOffset, SizeDirEntry, TRUE,
&Context, (PVOID*)&Entry))
+ {
+ Context = NULL;
+ break;
+ }
}
}
if (Context)
Modified: trunk/reactos/ntoskrnl/include/internal/io.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -1073,7 +1073,7 @@
IN ULONG Attributes,
IN OUT PUNICODE_STRING CompleteName,
IN OUT PUNICODE_STRING RemainingName,
- IN OUT PVOID Context OPTIONAL,
+ IN OUT PVOID Context,
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
OUT PVOID *Object
);
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c [iso-8859-1] Mon Aug 30 11:51:17 2010
@@ -171,7 +171,7 @@
IN ULONG Attributes,
IN OUT PUNICODE_STRING CompleteName,
IN OUT PUNICODE_STRING RemainingName,
- IN OUT PVOID Context OPTIONAL,
+ IN OUT PVOID Context,
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
OUT PVOID *Object)
{