Author: janderwald
Date: Thu Mar 10 12:41:50 2011
New Revision: 51007
URL:
http://svn.reactos.org/svn/reactos?rev=51007&view=rev
Log:
[MSAFD]
- Correct calculating PollBufferSize
- Found by DPH
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/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Thu Mar 10 12:41:50 2011
@@ -907,7 +907,7 @@
}
PollInfo->HandleCount = j;
- PollBufferSize = ((PCHAR)&PollInfo->Handles[j+1]) - ((PCHAR)PollInfo);
+ PollBufferSize = sizeof(AFD_POLL_INFO) + (PollInfo->HandleCount > 1 ?
sizeof(HANDLE) * ( PollInfo->HandleCount - 1) : 0);
/* Send IOCTL */
Status = NtDeviceIoControlFile((HANDLE)PollInfo->Handles[0].Handle,