Unlock console on alternate return paths. Fixes bug 734.

svn path=/trunk/; revision=17742
This commit is contained in:
Gé van Geldorp 2005-09-08 15:51:44 +00:00
parent b8d592993d
commit 57b5d08a65

View 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;
}
}