[NTOSKRNL]

Fix a bug in FsRtlNotifyCleanup: only remove notification from list when we're about to complete it.

svn path=/trunk/; revision=55932
This commit is contained in:
Pierre Schweitzer 2012-02-29 19:43:35 +00:00
parent 4c30c5549a
commit 9624a85234

View file

@ -182,12 +182,13 @@ FsRtlNotifyCleanup(IN PNOTIFY_SYNC NotifySync,
{
FsRtlNotifyCompleteIrpList(NotifyChange, STATUS_NOTIFY_CLEANUP);
}
/* Remove from the list */
RemoveEntryList(&NotifyChange->NotifyList);
/* Downcrease reference number and if 0 is reached, it's time to do complete cleanup */
/* Decrease reference number and if 0 is reached, it's time to do complete cleanup */
if (!InterlockedDecrement((PLONG)&(NotifyChange->ReferenceCount)))
{
/* Remove it from the notifications list */
RemoveEntryList(&NotifyChange->NotifyList);
/* In case there was an allocated buffer, free it */
if (NotifyChange->AllocatedBuffer)
{