mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
Call Fs notifications at PASSIVE_LEVEL by using a guarded mutex
Use ExFreePoolWithTag instead of ExFreePool svn path=/trunk/; revision=15000
This commit is contained in:
parent
da6a50d93f
commit
e5443b9351
1 changed files with 10 additions and 10 deletions
|
@ -35,7 +35,7 @@ typedef struct _FS_CHANGE_NOTIFY_ENTRY
|
||||||
static ERESOURCE FileSystemListLock;
|
static ERESOURCE FileSystemListLock;
|
||||||
static LIST_ENTRY FileSystemListHead;
|
static LIST_ENTRY FileSystemListHead;
|
||||||
|
|
||||||
static FAST_MUTEX FsChangeNotifyListLock;
|
static KGUARDED_MUTEX FsChangeNotifyListLock;
|
||||||
static LIST_ENTRY FsChangeNotifyListHead;
|
static LIST_ENTRY FsChangeNotifyListHead;
|
||||||
|
|
||||||
#define TAG_FILE_SYSTEM TAG('F', 'S', 'Y', 'S')
|
#define TAG_FILE_SYSTEM TAG('F', 'S', 'Y', 'S')
|
||||||
|
@ -178,7 +178,7 @@ IoInitFileSystemImplementation(VOID)
|
||||||
ExInitializeResourceLite(&FileSystemListLock);
|
ExInitializeResourceLite(&FileSystemListLock);
|
||||||
|
|
||||||
InitializeListHead(&FsChangeNotifyListHead);
|
InitializeListHead(&FsChangeNotifyListHead);
|
||||||
ExInitializeFastMutex(&FsChangeNotifyListLock);
|
KeInitializeGuardedMutex(&FsChangeNotifyListLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@ IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
|
||||||
if (current->DeviceObject == DeviceObject)
|
if (current->DeviceObject == DeviceObject)
|
||||||
{
|
{
|
||||||
RemoveEntryList(current_entry);
|
RemoveEntryList(current_entry);
|
||||||
ExFreePool(current);
|
ExFreePoolWithTag(current, TAG_FILE_SYSTEM);
|
||||||
ExReleaseResourceLite(&FileSystemListLock);
|
ExReleaseResourceLite(&FileSystemListLock);
|
||||||
KeLeaveCriticalRegion();
|
KeLeaveCriticalRegion();
|
||||||
IopNotifyFileSystemChange(DeviceObject, FALSE);
|
IopNotifyFileSystemChange(DeviceObject, FALSE);
|
||||||
|
@ -710,7 +710,7 @@ IopNotifyFileSystemChange(PDEVICE_OBJECT DeviceObject,
|
||||||
PFS_CHANGE_NOTIFY_ENTRY ChangeEntry;
|
PFS_CHANGE_NOTIFY_ENTRY ChangeEntry;
|
||||||
PLIST_ENTRY Entry;
|
PLIST_ENTRY Entry;
|
||||||
|
|
||||||
ExAcquireFastMutex(&FsChangeNotifyListLock);
|
KeAcquireGuardedMutex(&FsChangeNotifyListLock);
|
||||||
Entry = FsChangeNotifyListHead.Flink;
|
Entry = FsChangeNotifyListHead.Flink;
|
||||||
while (Entry != &FsChangeNotifyListHead)
|
while (Entry != &FsChangeNotifyListHead)
|
||||||
{
|
{
|
||||||
|
@ -720,7 +720,7 @@ IopNotifyFileSystemChange(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
||||||
Entry = Entry->Flink;
|
Entry = Entry->Flink;
|
||||||
}
|
}
|
||||||
ExReleaseFastMutex(&FsChangeNotifyListLock);
|
KeReleaseGuardedMutex(&FsChangeNotifyListLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -742,10 +742,10 @@ IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject,
|
||||||
Entry->DriverObject = DriverObject;
|
Entry->DriverObject = DriverObject;
|
||||||
Entry->FSDNotificationProc = FSDNotificationProc;
|
Entry->FSDNotificationProc = FSDNotificationProc;
|
||||||
|
|
||||||
ExAcquireFastMutex(&FsChangeNotifyListLock);
|
KeAcquireGuardedMutex(&FsChangeNotifyListLock);
|
||||||
InsertHeadList(&FsChangeNotifyListHead,
|
InsertHeadList(&FsChangeNotifyListHead,
|
||||||
&Entry->FsChangeNotifyList);
|
&Entry->FsChangeNotifyList);
|
||||||
ExReleaseFastMutex(&FsChangeNotifyListLock);
|
KeReleaseGuardedMutex(&FsChangeNotifyListLock);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -768,11 +768,11 @@ IoUnregisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject,
|
||||||
if (ChangeEntry->DriverObject == DriverObject &&
|
if (ChangeEntry->DriverObject == DriverObject &&
|
||||||
ChangeEntry->FSDNotificationProc == FSDNotificationProc)
|
ChangeEntry->FSDNotificationProc == FSDNotificationProc)
|
||||||
{
|
{
|
||||||
ExAcquireFastMutex(&FsChangeNotifyListLock);
|
KeAcquireGuardedMutex(&FsChangeNotifyListLock);
|
||||||
RemoveEntryList(Entry);
|
RemoveEntryList(Entry);
|
||||||
ExReleaseFastMutex(&FsChangeNotifyListLock);
|
KeReleaseGuardedMutex(&FsChangeNotifyListLock);
|
||||||
|
|
||||||
ExFreePool(Entry);
|
ExFreePoolWithTag(Entry, TAG_FS_CHANGE_NOTIFY);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue