Should've done this a long time ago. Just noticed that we're potentially

sending a bunch of 0 handles into AfdSelect.

svn path=/trunk/; revision=35553
This commit is contained in:
Art Yerkes 2008-08-23 09:01:29 +00:00
parent c0e1bccba7
commit 30108cfd31

View file

@ -15,8 +15,8 @@
#include <debug.h>
#ifdef DBG
//DWORD DebugTraceLevel = DEBUG_ULTRA;
DWORD DebugTraceLevel = 0;
DWORD DebugTraceLevel = DEBUG_ULTRA;
//DWORD DebugTraceLevel = 0;
#endif /* DBG */
HANDLE GlobalHeap;
@ -598,7 +598,7 @@ WSPSelect(
IO_STATUS_BLOCK IOSB;
PAFD_POLL_INFO PollInfo;
NTSTATUS Status;
ULONG HandleCount, OutCount = 0;
LONG HandleCount, OutCount = 0;
ULONG PollBufferSize;
PVOID PollBuffer;
ULONG i, j = 0, x;
@ -661,7 +661,6 @@ WSPSelect(
RtlZeroMemory( PollInfo, PollBufferSize );
/* Number of handles for AFD to Check */
PollInfo->HandleCount = HandleCount;
PollInfo->Exclusive = FALSE;
PollInfo->Timeout = Timeout;
@ -689,6 +688,9 @@ WSPSelect(
}
}
PollInfo->HandleCount = j;
PollBufferSize = ((PCHAR)&PollInfo->Handles[j+1]) - ((PCHAR)PollInfo);
/* Send IOCTL */
Status = NtDeviceIoControlFile( (HANDLE)PollInfo->Handles[0].Handle,
SockEvent,