server: Avoid infinite loop when we're out of timers in set_win_timer server call.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2016-01-25 09:59:46 +01:00 committed by Alexandre Julliard
parent 80eb2fa08e
commit cefdbd59b7
2 changed files with 11 additions and 2 deletions

View File

@ -2581,13 +2581,21 @@ DECL_HANDLER(set_win_timer)
}
else
{
lparam_t end_id = queue->next_timer_id;
/* find a free id for it */
do
while (1)
{
id = queue->next_timer_id;
if (--queue->next_timer_id <= 0x100) queue->next_timer_id = 0x7fff;
if (!find_timer( queue, 0, req->msg, id )) break;
if (queue->next_timer_id == end_id)
{
set_win32_error( ERROR_NO_MORE_USER_HANDLES );
return;
}
}
while (find_timer( queue, 0, req->msg, id ));
}
}

View File

@ -5136,6 +5136,7 @@ static const struct
{ "DIRECTORY_NOT_EMPTY", STATUS_DIRECTORY_NOT_EMPTY },
{ "DISK_FULL", STATUS_DISK_FULL },
{ "DLL_NOT_FOUND", STATUS_DLL_NOT_FOUND },
{ "ERROR_NO_MORE_USER_HANDLES", 0xc0010000 | ERROR_NO_MORE_USER_HANDLES },
{ "ERROR_CLASS_ALREADY_EXISTS", 0xc0010000 | ERROR_CLASS_ALREADY_EXISTS },
{ "ERROR_CLASS_DOES_NOT_EXIST", 0xc0010000 | ERROR_CLASS_DOES_NOT_EXIST },
{ "ERROR_CLASS_HAS_WINDOWS", 0xc0010000 | ERROR_CLASS_HAS_WINDOWS },