mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOSKRNL]
Forgotten comments... svn path=/trunk/; revision=49759
This commit is contained in:
parent
1ab061dba1
commit
92967f5f41
1 changed files with 8 additions and 0 deletions
|
@ -187,31 +187,39 @@ FsRtlInsertPerFileObjectContext(IN PFILE_OBJECT FileObject,
|
|||
return STATUS_INVALID_DEVICE_REQUEST;
|
||||
}
|
||||
|
||||
/* Get filter contexts */
|
||||
FOContext = IoGetFileObjectFilterContext(FileObject);
|
||||
if (!FOContext)
|
||||
{
|
||||
/* If there's none, allocate new structure */
|
||||
FOContext = ExAllocatePoolWithTag(NonPagedPool, sizeof(FILE_OBJECT_FILTER_CONTEXTS), 'FOCX');
|
||||
if (!FOContext)
|
||||
{
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
/* Initialize it */
|
||||
ExInitializeFastMutex(&(FOContext->FilterContextsMutex));
|
||||
InitializeListHead(&(FOContext->FilterContexts));
|
||||
|
||||
/* Set it */
|
||||
if (!IoChangeFileObjectFilterContext(FileObject, FOContext, TRUE))
|
||||
{
|
||||
/* If it fails, it means that someone else has set it in the meanwhile */
|
||||
ExFreePoolWithTag(FOContext, 'FOCX');
|
||||
|
||||
/* So, we can get it */
|
||||
FOContext = IoGetFileObjectFilterContext(FileObject);
|
||||
if (!FOContext)
|
||||
{
|
||||
/* If we fall down here, something went very bad. This shouldn't happen */
|
||||
ASSERT(FALSE);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally, insert */
|
||||
ExAcquireFastMutex(&(FOContext->FilterContextsMutex));
|
||||
InsertHeadList(&(FOContext->FilterContexts), &(Ptr->Links));
|
||||
ExReleaseFastMutex(&(FOContext->FilterContextsMutex));
|
||||
|
|
Loading…
Reference in a new issue