-
-
[求助]文件微过滤的问题,在S_PostCreate无法获得文件大小?
-
发表于:
2016-10-21 11:36
4129
-
[求助]文件微过滤的问题,在S_PostCreate无法获得文件大小?
您好,请多指点,谢谢
S_PostCreate中:
//获取文件的大小(此大小包括了文件正文及头部)
status = File_GetFileStandardInfo(Data, FltObjects, NULL, &FileSize, &bDirectory) ;
——————————————————————
NTSTATUS
File_GetFileStandardInfo(
__in PFLT_CALLBACK_DATA Data,
__in PFLT_RELATED_OBJECTS FltObjects,
__in PLARGE_INTEGER FileAllocationSize,
__in PLARGE_INTEGER FileSize,
__in PBOOLEAN bDirectory
)
{
NTSTATUS status = STATUS_SUCCESS ;
FILE_STANDARD_INFORMATION sFileStandardInfo ;
//修改为向下层Call
status = FltQueryInformationFile(FltObjects->Instance,
FltObjects->FileObject,
&sFileStandardInfo,
sizeof(FILE_STANDARD_INFORMATION),
FileStandardInformation,
NULL
) ;
if (NT_SUCCESS(status))
{
if (NULL != FileSize)
*FileSize = sFileStandardInfo.EndOfFile ;
if (NULL != FileAllocationSize)
*FileAllocationSize = sFileStandardInfo.AllocationSize ;
if (NULL != bDirectory)
*bDirectory = sFileStandardInfo.Directory ;
}
return status ;
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!