Author: arty Date: Sat Aug 23 04:01:29 2008 New Revision: 35553
URL: http://svn.reactos.org/svn/reactos?rev=35553&view=rev Log: Should've done this a long time ago. Just noticed that we're potentially sending a bunch of 0 handles into AfdSelect.
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllmai... ============================================================================== --- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Sat Aug 23 04:01:29 2008 @@ -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 @@ 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 @@ RtlZeroMemory( PollInfo, PollBufferSize );
/* Number of handles for AFD to Check */ - PollInfo->HandleCount = HandleCount; PollInfo->Exclusive = FALSE; PollInfo->Timeout = Timeout;
@@ -689,6 +688,9 @@ } }
+ PollInfo->HandleCount = j; + PollBufferSize = ((PCHAR)&PollInfo->Handles[j+1]) - ((PCHAR)PollInfo); + /* Send IOCTL */ Status = NtDeviceIoControlFile( (HANDLE)PollInfo->Handles[0].Handle, SockEvent,