[MSAFD]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 10 Mar 2011 14:07:55 +0000 (14:07 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 10 Mar 2011 14:07:55 +0000 (14:07 +0000)
- Fix bug introduced in 51007

svn path=/trunk/; revision=51010

reactos/dll/win32/msafd/misc/dllmain.c

index ca12941..3fb76c8 100644 (file)
@@ -907,7 +907,7 @@ WSPSelect(IN int nfds,
     }
 
     PollInfo->HandleCount = j;
     }
 
     PollInfo->HandleCount = j;
-       PollBufferSize = sizeof(AFD_POLL_INFO) + (PollInfo->HandleCount > 1 ? sizeof(HANDLE) * ( PollInfo->HandleCount - 1) : 0);
+    PollBufferSize = FIELD_OFFSET(AFD_POLL_INFO, Handles) + PollInfo->HandleCount * sizeof(AFD_HANDLE);
 
     /* Send IOCTL */
     Status = NtDeviceIoControlFile((HANDLE)PollInfo->Handles[0].Handle,
 
     /* Send IOCTL */
     Status = NtDeviceIoControlFile((HANDLE)PollInfo->Handles[0].Handle,