mirror of
https://github.com/reactos/reactos.git
synced 2025-05-18 00:31:27 +00:00
[FASTFAT]
VfatGetAllInformation: Return as much information as possible, but do not fail if the name string does not fit into the buffer. svn path=/trunk/; revision=69891
This commit is contained in:
parent
1ec8189e87
commit
ad4b705148
1 changed files with 14 additions and 8 deletions
|
@ -340,6 +340,7 @@ VfatSetDispositionInformation(
|
||||||
|
|
||||||
if (*FCB->Attributes & FILE_ATTRIBUTE_READONLY)
|
if (*FCB->Attributes & FILE_ATTRIBUTE_READONLY)
|
||||||
{
|
{
|
||||||
|
DPRINT1("\n");
|
||||||
return STATUS_CANNOT_DELETE;
|
return STATUS_CANNOT_DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,16 +348,19 @@ VfatSetDispositionInformation(
|
||||||
(FCB->LongNameU.Length == sizeof(WCHAR) && FCB->LongNameU.Buffer[0] == L'.') ||
|
(FCB->LongNameU.Length == sizeof(WCHAR) && FCB->LongNameU.Buffer[0] == L'.') ||
|
||||||
(FCB->LongNameU.Length == 2 * sizeof(WCHAR) && FCB->LongNameU.Buffer[0] == L'.' && FCB->LongNameU.Buffer[1] == L'.'))
|
(FCB->LongNameU.Length == 2 * sizeof(WCHAR) && FCB->LongNameU.Buffer[0] == L'.' && FCB->LongNameU.Buffer[1] == L'.'))
|
||||||
{
|
{
|
||||||
// we cannot delete a '.', '..' or the root directory
|
/* we cannot delete a '.', '..' or the root directory */
|
||||||
return STATUS_ACCESS_DENIED;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
DPRINT1("\n");
|
||||||
|
return STATUS_CANNOT_DELETE;
|
||||||
|
// return STATUS_ACCESS_DENIED;
|
||||||
|
}
|
||||||
|
|
||||||
if (!MmFlushImageSection (FileObject->SectionObjectPointer, MmFlushForDelete))
|
if (!MmFlushImageSection (FileObject->SectionObjectPointer, MmFlushForDelete))
|
||||||
{
|
{
|
||||||
/* can't delete a file if its mapped into a process */
|
/* can't delete a file if its mapped into a process */
|
||||||
|
|
||||||
DPRINT("MmFlushImageSection returned FALSE\n");
|
DPRINT("MmFlushImageSection returned FALSE\n");
|
||||||
|
DPRINT1("\n");
|
||||||
return STATUS_CANNOT_DELETE;
|
return STATUS_CANNOT_DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,6 +368,7 @@ VfatSetDispositionInformation(
|
||||||
{
|
{
|
||||||
/* can't delete a non-empty directory */
|
/* can't delete a non-empty directory */
|
||||||
|
|
||||||
|
DPRINT1("\n");
|
||||||
return STATUS_DIRECTORY_NOT_EMPTY;
|
return STATUS_DIRECTORY_NOT_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1076,8 +1081,8 @@ VfatGetAllInformation(
|
||||||
ASSERT(Info);
|
ASSERT(Info);
|
||||||
ASSERT(Fcb);
|
ASSERT(Fcb);
|
||||||
|
|
||||||
if (*BufferLength < sizeof(FILE_ALL_INFORMATION) + Fcb->PathNameU.Length + sizeof(WCHAR))
|
if (*BufferLength < sizeof(FILE_ALL_INFORMATION))
|
||||||
return(STATUS_BUFFER_OVERFLOW);
|
return STATUS_BUFFER_OVERFLOW;
|
||||||
|
|
||||||
/* Basic Information */
|
/* Basic Information */
|
||||||
Status = VfatGetBasicInformation(FileObject, Fcb, DeviceObject, &Info->BasicInformation, BufferLength);
|
Status = VfatGetBasicInformation(FileObject, Fcb, DeviceObject, &Info->BasicInformation, BufferLength);
|
||||||
|
@ -1098,11 +1103,12 @@ VfatGetAllInformation(
|
||||||
/* Alignment Information: The IO-Manager adds this information */
|
/* Alignment Information: The IO-Manager adds this information */
|
||||||
/* Name Information */
|
/* Name Information */
|
||||||
Status = VfatGetNameInformation(FileObject, Fcb, DeviceObject, &Info->NameInformation, BufferLength);
|
Status = VfatGetNameInformation(FileObject, Fcb, DeviceObject, &Info->NameInformation, BufferLength);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
|
||||||
|
|
||||||
*BufferLength = InitialBufferLength - (sizeof(FILE_ALL_INFORMATION) + Fcb->PathNameU.Length + sizeof(WCHAR));
|
*BufferLength = InitialBufferLength - sizeof(FILE_ALL_INFORMATION);
|
||||||
|
if (InitialBufferLength > sizeof(FILE_ALL_INFORMATION))
|
||||||
|
*BufferLength -= min(InitialBufferLength - sizeof(FILE_ALL_INFORMATION), Fcb->PathNameU.Length);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
Loading…
Reference in a new issue