This is follow-up question on my recent post. It was about the cycle of request that was occurring continuously even if the request completed continuously.So I investigated the request and response using File Test and File Spy. And Matched the response with NTFS partition. The output seems ok but still the it is being requested again and again.
Tony pointed out that the length of the buffer is too much but I want to clarify that the buffer size that is shown in the filespy is equal to the size of output buffer provided by the caller program.So the size of the buffer is not the problem.
I want help from the OSR community to understand this behaviour. Because there is no clue while would explorer make such kind of request when file system giving proper response.
POINT OF INTEREST IS THIS THAT IT IS HAPPENING WITH ROOT DIRECTORY ONLY.
FileNameInformation -> FsVolumeInformation -> FsAttributeInformation
Here is the code that showing How I am handling Request
FILENAME INFORMATION
ULONG Length = FIELD_OFFSET(FILE_NAME_INFORMATION, FileName);
Length += (PtrFCB->AbsoluteFileName.Length);
if (BufferSize >= Length)
{
PFILE_NAME_INFORMATION PtrInfo = (PFILE_NAME_INFORMATION)Irp->AssociatedIrp.SystemBuffer;
PtrInfo->FileNameLength = PtrFCB->AbsoluteFileName.Length;
RtlCopyMemory(PtrInfo->FileName, PtrFCB->AbsoluteFileName.Buffer, PtrFCB->AbsoluteFileName.Length);
Information = Length;
Status = STATUS_SUCCESS;
}
else
{
Information = 0;
Status = STATUS_BUFFER_OVERFLOW;
}
FsVoumeInformation
if (PtrIoStackLocation->Parameters.QueryVolume.Length < ((ULONG)FIELD_OFFSET(FILE_FS_VOLUME_INFORMATION, VolumeLabel[0]) + PtrVolume->VolumeName.Length))
{
Status = STATUS_BUFFER_OVERFLOW;
Information = FIELD_OFFSET(FILE_FS_VOLUME_INFORMATION, VolumeLabel[0]) + PtrVolume->VolumeName.Length;
break;
}
else
{
PFILE_FS_VOLUME_INFORMATION PtrVolumeInformation = Irp->AssociatedIrp.SystemBuffer;
PtrVolumeInformation->VolumeSerialNumber = 0X29051991;
PtrVolumeInformation->VolumeLabelLength = PtrVolume->VolumeName.Length;
PtrVolumeInformation->SupportsObjects = FALSE;
DEBUG_WUFS(“WUFS: VolName %wZ\n”,&PtrVolume->VolumeName);
RtlCopyMemory(PtrVolumeInformation->VolumeLabel, PtrVolume->VolumeName.Buffer, PtrVolume->VolumeName.Length);
PtrVolumeInformation->VolumeCreationTime.QuadPart = PtrVolume->CreationTime.QuadPart;
Status = STATUS_SUCCESS;
Information = (FIELD_OFFSET(FILE_FS_VOLUME_INFORMATION, VolumeLabel[0]) + PtrVolume->VolumeName.Length);
break;
}
FsAttributeInformation
if (PtrIoStackLocation->Parameters.QueryVolume.Length < sizeof(FILE_FS_ATTRIBUTE_INFORMATION))
{
Status = STATUS_BUFFER_OVERFLOW;
Information = (sizeof(FILE_FS_ATTRIBUTE_INFORMATION)+PtrVolume->VolumeName.Length);
break;
}
else
{
PFILE_FS_ATTRIBUTE_INFORMATION PtrFSAttribInformation = Irp->AssociatedIrp.SystemBuffer;
PtrFSAttribInformation->FileSystemAttributes = FILE_CASE_SENSITIVE_SEARCH |FILE_CASE_PRESERVED_NAMES | FILE_UNICODE_ON_DISK;
PtrFSAttribInformation->MaximumComponentNameLength = 255;
PtrFSAttribInformation->FileSystemNameLength = PtrVolume->VolumeName.Length;
DEBUG_WUFS(“WUFS: VolName %wZ\n”, &PtrVolume->VolumeName);
RtlCopyMemory(PtrFSAttribInformation->FileSystemName, PtrVolume->VolumeName.Buffer, PtrVolume->VolumeName.Length);
Status = STATUS_SUCCESS;
Information = (FIELD_OFFSET(FILE_FS_ATTRIBUTE_INFORMATION, FileSystemName[0]) + PtrVolume->VolumeName.Length);
break;
}