mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:56:05 +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;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Get filter contexts */
|
||||||
FOContext = IoGetFileObjectFilterContext(FileObject);
|
FOContext = IoGetFileObjectFilterContext(FileObject);
|
||||||
if (!FOContext)
|
if (!FOContext)
|
||||||
{
|
{
|
||||||
|
/* If there's none, allocate new structure */
|
||||||
FOContext = ExAllocatePoolWithTag(NonPagedPool, sizeof(FILE_OBJECT_FILTER_CONTEXTS), 'FOCX');
|
FOContext = ExAllocatePoolWithTag(NonPagedPool, sizeof(FILE_OBJECT_FILTER_CONTEXTS), 'FOCX');
|
||||||
if (!FOContext)
|
if (!FOContext)
|
||||||
{
|
{
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Initialize it */
|
||||||
ExInitializeFastMutex(&(FOContext->FilterContextsMutex));
|
ExInitializeFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
InitializeListHead(&(FOContext->FilterContexts));
|
InitializeListHead(&(FOContext->FilterContexts));
|
||||||
|
|
||||||
|
/* Set it */
|
||||||
if (!IoChangeFileObjectFilterContext(FileObject, FOContext, TRUE))
|
if (!IoChangeFileObjectFilterContext(FileObject, FOContext, TRUE))
|
||||||
{
|
{
|
||||||
|
/* If it fails, it means that someone else has set it in the meanwhile */
|
||||||
ExFreePoolWithTag(FOContext, 'FOCX');
|
ExFreePoolWithTag(FOContext, 'FOCX');
|
||||||
|
|
||||||
|
/* So, we can get it */
|
||||||
FOContext = IoGetFileObjectFilterContext(FileObject);
|
FOContext = IoGetFileObjectFilterContext(FileObject);
|
||||||
if (!FOContext)
|
if (!FOContext)
|
||||||
{
|
{
|
||||||
|
/* If we fall down here, something went very bad. This shouldn't happen */
|
||||||
ASSERT(FALSE);
|
ASSERT(FALSE);
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Finally, insert */
|
||||||
ExAcquireFastMutex(&(FOContext->FilterContextsMutex));
|
ExAcquireFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
InsertHeadList(&(FOContext->FilterContexts), &(Ptr->Links));
|
InsertHeadList(&(FOContext->FilterContexts), &(Ptr->Links));
|
||||||
ExReleaseFastMutex(&(FOContext->FilterContextsMutex));
|
ExReleaseFastMutex(&(FOContext->FilterContextsMutex));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue