Synchronize with trunk r58457.
[reactos.git] / ntoskrnl / fsrtl / filelock.c
index 848e746..6fe7bfd 100644 (file)
@@ -858,7 +858,10 @@ FsRtlFastUnlockSingle(IN PFILE_LOCK FileLock,
     Find.Exclusive.FileLock.StartingByte = *FileOffset;
     Find.Exclusive.FileLock.EndingByte.QuadPart = 
         FileOffset->QuadPart + Length->QuadPart;
-    ASSERT(InternalInfo);
+    if (!InternalInfo) {
+        DPRINT("File not previously locked (ever)\n");
+        return STATUS_RANGE_NOT_LOCKED;
+    }
     Entry = RtlLookupElementGenericTable(&InternalInfo->RangeTable, &Find);
     if (!Entry) {
         DPRINT("Range not locked %wZ\n", &FileObject->FileName);