X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=ntoskrnl%2Fob%2Fobname.c;h=e4f7e184985dfb95dc2eb2ca4f061ba78a53d42b;hp=c97d4cea5beb345319ddaa3581075f9e15e11031;hb=b726d7355f0aa394852fa8c56e59cfc9bbc4293c;hpb=6bc4e97d08e98b103d59c709c371c73c469c1fad diff --git a/ntoskrnl/ob/obname.c b/ntoskrnl/ob/obname.c index c97d4cea5be..e4f7e184985 100644 --- a/ntoskrnl/ob/obname.c +++ b/ntoskrnl/ob/obname.c @@ -33,6 +33,7 @@ UNICODE_STRING ObpDosDevicesShortName = NTSTATUS NTAPI +INIT_FUNCTION ObpCreateDosDevicesDirectory(VOID) { OBJECT_ATTRIBUTES ObjectAttributes; @@ -112,24 +113,28 @@ VOID NTAPI ObDereferenceDeviceMap(IN PEPROCESS Process) { - //KIRQL OldIrql; - PDEVICE_MAP DeviceMap = Process->DeviceMap; + PDEVICE_MAP DeviceMap; - /* FIXME: We don't use Process Devicemaps yet */ + /* Get the pointer to this process devicemap and reset it + holding devicemap lock */ + KeAcquireGuardedMutex(&ObpDeviceMapLock); + DeviceMap = Process->DeviceMap; + Process->DeviceMap = NULL; + KeReleaseGuardedMutex(&ObpDeviceMapLock); + + /* Continue only if there is a devicemap to dereference */ if (DeviceMap) { - /* FIXME: Acquire the DeviceMap Spinlock */ - // KeAcquireSpinLock(DeviceMap->Lock, &OldIrql); + KeAcquireGuardedMutex(&ObpDeviceMapLock); /* Delete the device map link and dereference it */ - Process->DeviceMap = NULL; if (--DeviceMap->ReferenceCount) { /* Nobody is referencing it anymore, unlink the DOS directory */ DeviceMap->DosDevicesDirectory->DeviceMap = NULL; - /* FIXME: Release the DeviceMap Spinlock */ - // KeReleasepinLock(DeviceMap->Lock, OldIrql); + /* Release the devicemap lock */ + KeReleaseGuardedMutex(&ObpDeviceMapLock); /* Dereference the DOS Devices Directory and free the Device Map */ ObDereferenceObject(DeviceMap->DosDevicesDirectory); @@ -137,8 +142,8 @@ ObDereferenceDeviceMap(IN PEPROCESS Process) } else { - /* FIXME: Release the DeviceMap Spinlock */ - // KeReleasepinLock(DeviceMap->Lock, OldIrql); + /* Release the devicemap lock */ + KeReleaseGuardedMutex(&ObpDeviceMapLock); } } } @@ -1143,15 +1148,12 @@ NTAPI ObQueryDeviceMapInformation(IN PEPROCESS Process, IN PPROCESS_DEVICEMAP_INFORMATION DeviceMapInfo) { - //KIRQL OldIrql ; - /* * FIXME: This is an ugly hack for now, to always return the System Device Map * instead of returning the Process Device Map. Not important yet since we don't use it */ - /* FIXME: Acquire the DeviceMap Spinlock */ - // KeAcquireSpinLock(DeviceMap->Lock, &OldIrql); + KeAcquireGuardedMutex(&ObpDeviceMapLock); /* Make a copy */ DeviceMapInfo->Query.DriveMap = ObSystemDeviceMap->DriveMap; @@ -1159,8 +1161,7 @@ ObQueryDeviceMapInformation(IN PEPROCESS Process, ObSystemDeviceMap->DriveType, sizeof(ObSystemDeviceMap->DriveType)); - /* FIXME: Release the DeviceMap Spinlock */ - // KeReleasepinLock(DeviceMap->Lock, OldIrql); + KeReleaseGuardedMutex(&ObpDeviceMapLock); } /* EOF */