-use ExAllocatePoolWithTag/ExFreePoolWithTag

-set FileObject to readonly
-register the filesystem as low priority

svn path=/trunk/; revision=39579
This commit is contained in:
Christoph von Wittich
2009-02-13 11:48:06 +00:00
parent fb513b8a3c
commit b3c01e9864
5 changed files with 12 additions and 4 deletions
+2
View File
@@ -104,6 +104,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
CdfsGlobalData->CacheMgrCallbacks.AcquireForReadAhead = CdfsAcquireForLazyWrite;
CdfsGlobalData->CacheMgrCallbacks.ReleaseFromReadAhead = CdfsReleaseFromLazyWrite;
DeviceObject->Flags |= DO_LOW_PRIORITY_FILESYSTEM;
IoRegisterFileSystem(DeviceObject);
DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+2 -2
View File
@@ -68,9 +68,9 @@ CdfsCloseFile(PDEVICE_EXTENSION DeviceExt,
if (Ccb->DirectorySearchPattern.Buffer)
{
ExFreePool(Ccb->DirectorySearchPattern.Buffer);
ExFreePoolWithTag(Ccb->DirectorySearchPattern.Buffer, TAG_CCB);
}
ExFreePool(Ccb);
ExFreePoolWithTag(Ccb, TAG_CCB);
return(STATUS_SUCCESS);
}
+2 -2
View File
@@ -590,7 +590,7 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject,
{
First = TRUE;
Ccb->DirectorySearchPattern.Buffer =
ExAllocatePool(NonPagedPool, SearchPattern->Length + sizeof(WCHAR));
ExAllocatePoolWithTag(NonPagedPool, SearchPattern->Length + sizeof(WCHAR), TAG_CCB);
if (Ccb->DirectorySearchPattern.Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
@@ -608,7 +608,7 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject,
else if (Ccb->DirectorySearchPattern.Buffer == NULL)
{
First = TRUE;
Ccb->DirectorySearchPattern.Buffer = ExAllocatePool(NonPagedPool, 2 * sizeof(WCHAR));
Ccb->DirectorySearchPattern.Buffer = ExAllocatePoolWithTag(NonPagedPool, 2 * sizeof(WCHAR), TAG_CCB);
if (Ccb->DirectorySearchPattern.Buffer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
+3
View File
@@ -246,6 +246,9 @@ CdfsFCBInitializeCache(PVCB Vcb,
RtlZeroMemory(newCCB,
sizeof(CCB));
FileObject->ReadAccess = TRUE;
FileObject->WriteAccess = FALSE;
FileObject->DeleteAccess = FALSE;
FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
FileObject->FsContext = Fcb;
FileObject->FsContext2 = newCCB;
+3
View File
@@ -385,6 +385,9 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject,
RtlZeroMemory(Ccb,
sizeof(CCB));
DeviceExt->StreamFileObject->ReadAccess = TRUE;
DeviceExt->StreamFileObject->WriteAccess = FALSE;
DeviceExt->StreamFileObject->DeleteAccess = FALSE;
DeviceExt->StreamFileObject->FsContext = Fcb;
DeviceExt->StreamFileObject->FsContext2 = Ccb;
DeviceExt->StreamFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;