[ros-diffs] [cgutman] 47376: [MSAFD] - Zero the entire struct not just the lpNetworkEvents member - Write the error codes returned from AFD to the iErrorCode array - Fixes hundreds of ws2_32_winetest sock failures (only 104 failures now) - Dedicated to Physicus

cgutman at svn.reactos.org cgutman at svn.reactos.org
Fri May 28 04:25:56 CEST 2010


Author: cgutman
Date: Fri May 28 04:25:56 2010
New Revision: 47376

URL: http://svn.reactos.org/svn/reactos?rev=47376&view=rev
Log:
[MSAFD]
- Zero the entire struct not just the lpNetworkEvents member
- Write the error codes returned from AFD to the iErrorCode array
- Fixes hundreds of ws2_32_winetest sock failures (only 104 failures now)
- Dedicated to Physicus

Modified:
    trunk/reactos/dll/win32/msafd/misc/event.c

Modified: trunk/reactos/dll/win32/msafd/misc/event.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/event.c?rev=47376&r1=47375&r2=47376&view=diff
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/event.c [iso-8859-1] Fri May 28 04:25:56 2010
@@ -179,43 +179,51 @@
     AFD_DbgPrint(MID_TRACE,("About to touch struct at %x (%d)\n", 
 			    lpNetworkEvents, sizeof(*lpNetworkEvents)));
 
-    lpNetworkEvents->lNetworkEvents = 0;
+    RtlZeroMemory(lpNetworkEvents, sizeof(*lpNetworkEvents));
 
     AFD_DbgPrint(MID_TRACE,("Zeroed struct\n"));
 
     /* Set Events to wait for */
     if (EnumReq.PollEvents & AFD_EVENT_RECEIVE) {
 	lpNetworkEvents->lNetworkEvents |= FD_READ;
+	lpNetworkEvents->iErrorCode[FD_READ_BIT] = EnumReq.EventStatus[FD_READ_BIT];
     }
 
     if (EnumReq.PollEvents & AFD_EVENT_SEND) {
 	lpNetworkEvents->lNetworkEvents |= FD_WRITE;
+	lpNetworkEvents->iErrorCode[FD_WRITE_BIT] = EnumReq.EventStatus[FD_WRITE_BIT];
     }
 
     if (EnumReq.PollEvents & AFD_EVENT_OOB_RECEIVE) {
         lpNetworkEvents->lNetworkEvents |= FD_OOB;
+	lpNetworkEvents->iErrorCode[FD_OOB_BIT] = EnumReq.EventStatus[FD_OOB_BIT];
     }
 
     if (EnumReq.PollEvents & AFD_EVENT_ACCEPT) {
 	lpNetworkEvents->lNetworkEvents |= FD_ACCEPT;
+	lpNetworkEvents->iErrorCode[FD_ACCEPT_BIT] = EnumReq.EventStatus[FD_ACCEPT_BIT];
     }
 
     if (EnumReq.PollEvents & 
 	(AFD_EVENT_CONNECT | AFD_EVENT_CONNECT_FAIL)) {
         lpNetworkEvents->lNetworkEvents |= FD_CONNECT;
+	lpNetworkEvents->iErrorCode[FD_CONNECT_BIT] = EnumReq.EventStatus[FD_CONNECT_BIT];
     }
 
     if (EnumReq.PollEvents & 
 	(AFD_EVENT_DISCONNECT | AFD_EVENT_ABORT | AFD_EVENT_CLOSE)) {
 	lpNetworkEvents->lNetworkEvents |= FD_CLOSE;
+	lpNetworkEvents->iErrorCode[FD_CLOSE_BIT] = EnumReq.EventStatus[FD_CLOSE_BIT];
     }
 
     if (EnumReq.PollEvents & AFD_EVENT_QOS) {
 	lpNetworkEvents->lNetworkEvents |= FD_QOS;
+	lpNetworkEvents->iErrorCode[FD_QOS_BIT] = EnumReq.EventStatus[FD_QOS_BIT];
     }
 
     if (EnumReq.PollEvents & AFD_EVENT_GROUP_QOS) {
 	lpNetworkEvents->lNetworkEvents |= FD_GROUP_QOS;
+	lpNetworkEvents->iErrorCode[FD_GROUP_QOS_BIT] = EnumReq.EventStatus[FD_GROUP_QOS_BIT];
     }
 
     if( NT_SUCCESS(Status) ) *lpErrno = 0;




More information about the Ros-diffs mailing list