From: short <> Date: Sat, 1 Feb 2003 00:07:01 +0000 (+0000) Subject: +general captive shutdown X-Git-Tag: captive-0_2~76 X-Git-Url: https://git.jankratochvil.net/?a=commitdiff_plain;h=fc9befd570b3a56094989d0d90ae8d39670acb7c;p=reactos.git +general captive shutdown - +IoShutdownRegisteredFileSystems() IoShutdownRegisteredFileSystems(): Fixed 'FileSystemListHead' walk corruption +IoUnregisterFileSystem() --- diff --git a/ntoskrnl/io/fs.c b/ntoskrnl/io/fs.c index 26947a8..b96750b 100644 --- a/ntoskrnl/io/fs.c +++ b/ntoskrnl/io/fs.c @@ -174,7 +174,6 @@ IoInitFileSystemImplementation(VOID) #endif /* LIBCAPTIVE */ } -#ifndef LIBCAPTIVE VOID IoShutdownRegisteredFileSystems(VOID) @@ -189,11 +188,15 @@ IoShutdownRegisteredFileSystems(VOID) DPRINT("IoShutdownRegisteredFileSystems()\n"); +#ifndef LIBCAPTIVE + /* filesystems cannot be called at DISPATCH_LEVEL */ KeAcquireSpinLock(&FileSystemListLock,&oldlvl); +#endif /* LIBCAPTIVE */ KeInitializeEvent(&Event,NotificationEvent,FALSE); - current_entry = FileSystemListHead.Flink; - while (current_entry!=(&FileSystemListHead)) + /* 'current' will get IoDeleteDevice()ed by IRP_MJ_SHUTDOWN! */ + /* FIXME: deadlock loop detection */ + while ((current_entry = FileSystemListHead.Flink)!=(&FileSystemListHead)) { current = CONTAINING_RECORD(current_entry,FILE_SYSTEM_OBJECT,Entry); @@ -211,14 +214,14 @@ IoShutdownRegisteredFileSystems(VOID) { KeWaitForSingleObject(&Event,Executive,KernelMode,FALSE,NULL); } - - current_entry = current_entry->Flink; } +#ifndef LIBCAPTIVE + /* filesystems cannot be called at DISPATCH_LEVEL */ KeReleaseSpinLock(&FileSystemListLock,oldlvl); +#endif /* LIBCAPTIVE */ } -#endif /* LIBCAPTIVE */ static NTSTATUS IopMountFileSystem(PDEVICE_OBJECT DeviceObject, @@ -587,7 +590,6 @@ IoRegisterFileSystem(IN PDEVICE_OBJECT DeviceObject) #endif /* LIBCAPTIVE */ } -#ifndef LIBCAPTIVE VOID STDCALL IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject) @@ -608,7 +610,9 @@ IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject) RemoveEntryList(current_entry); ExFreePool(current); KeReleaseSpinLock(&FileSystemListLock,oldlvl); +#ifndef LIBCAPTIVE IopNotifyFileSystemChange(DeviceObject, FALSE); +#endif /* LIBCAPTIVE */ return; } current_entry = current_entry->Flink; @@ -617,6 +621,8 @@ IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject) } +#ifndef LIBCAPTIVE + /********************************************************************** * NAME EXPORTED * IoGetBaseFileSystemDeviceObject@4