Unlock console on alternate return paths. Fixes bug 734.
authorGé van Geldorp <ge@gse.nl>
Thu, 8 Sep 2005 15:51:44 +0000 (15:51 +0000)
committerGé van Geldorp <ge@gse.nl>
Thu, 8 Sep 2005 15:51:44 +0000 (15:51 +0000)
svn path=/trunk/; revision=17742

reactos/subsys/csrss/win32csr/conio.c

index 51084e1..ff1f042 100644 (file)
@@ -1500,6 +1500,10 @@ CSR_API(CsrSetCursor)
       NewCursorY < 0 || NewCursorY >= Buff->MaxY)
     {
       ConioUnlockScreenBuffer(Buff);
+      if (NULL != Console)
+        {
+          ConioUnlockConsole(Console);
+        }
       return Request->Status = STATUS_INVALID_PARAMETER;
     }
   ConioPhysicalToLogical(Buff, Buff->CurrentX, Buff->CurrentY, &OldCursorX, &OldCursorY);
@@ -1510,6 +1514,10 @@ CSR_API(CsrSetCursor)
       if (! ConioSetScreenInfo(Console, Buff, OldCursorX, OldCursorY))
         {
           ConioUnlockScreenBuffer(Buff);
+          if (NULL != Console)
+            {
+              ConioUnlockConsole(Console);
+            }
           return Request->Status = STATUS_UNSUCCESSFUL;
         }
     }