mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:43:04 +00:00
WSPSelect()
- Fix checking of params - Fix allocation size Tested on Firefox, Downloader, Skype Patch by Mikhail Denisenko (denisenkom@gmail.com) with small changes See issue #4526 for more details. svn path=/trunk/; revision=41294
This commit is contained in:
parent
3ee953f7f5
commit
2d592301c9
1 changed files with 8 additions and 3 deletions
|
@ -700,10 +700,15 @@ WSPSelect(int nfds,
|
|||
( writefds ? writefds->fd_count : 0 ) +
|
||||
( exceptfds ? exceptfds->fd_count : 0 );
|
||||
|
||||
if( HandleCount < 0 || nfds != 0 )
|
||||
HandleCount = nfds * 3;
|
||||
if ( HandleCount == 0 )
|
||||
{
|
||||
AFD_DbgPrint(MAX_TRACE,("HandleCount: %d. Return SOCKET_ERROR\n",
|
||||
HandleCount));
|
||||
if (lpErrno) *lpErrno = WSAEINVAL;
|
||||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
PollBufferSize = sizeof(*PollInfo) + (HandleCount * sizeof(AFD_HANDLE));
|
||||
PollBufferSize = sizeof(*PollInfo) + ((HandleCount - 1) * sizeof(AFD_HANDLE));
|
||||
|
||||
AFD_DbgPrint(MID_TRACE,("HandleCount: %d BufferSize: %d\n",
|
||||
HandleCount, PollBufferSize));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue