Author: cgutman
Date: Mon Aug 27 03:43:40 2012
New Revision: 57174
URL:
http://svn.reactos.org/svn/reactos?rev=57174&view=rev
Log:
[AFD]
- Fix some size assumptions that fail on 64-bit
Modified:
trunk/reactos/drivers/network/afd/afd/lock.c
Modified: trunk/reactos/drivers/network/afd/afd/lock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/lock.c [iso-8859-1] Mon Aug 27 03:43:40 2012
@@ -105,15 +105,15 @@
UINT i;
/* Copy the buffer array so we don't lose it */
UINT Lock = LockAddress ? 2 : 0;
- UINT Size = sizeof(AFD_WSABUF) * (Count + Lock);
- PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size * 2 );
+ UINT Size = (sizeof(AFD_WSABUF) + sizeof(AFD_MAPBUF)) * (Count + Lock);
+ PAFD_WSABUF NewBuf = ExAllocatePool( PagedPool, Size );
BOOLEAN LockFailed = FALSE;
PAFD_MAPBUF MapBuf;
AFD_DbgPrint(MID_TRACE,("Called(%08x)\n", NewBuf));
if( NewBuf ) {
- RtlZeroMemory(NewBuf, Size * 2);
+ RtlZeroMemory(NewBuf, Size);
MapBuf = (PAFD_MAPBUF)(NewBuf + Count + Lock);