[ros-dev] [ros-diffs] [cgutman] 48522: [MSAFD] - Update lpcbBytesReturned when FIONREAD is called - Fix the value inside lpErrno when XxxSocketInformation() fails - Pass the unrecognized IOCTLs to the winsock helper (no behavior change for this yet because wsh

Gabriel ilardi gabrielilardi at hotmail.it
Sat Aug 14 11:15:06 UTC 2010


Was this meant for trunk instead of a branch ?
After this commit DNS resolution doesn't work.
Thanks.

Gabriel.

> Date: Thu, 12 Aug 2010 13:13:21 +0000
> To: ros-diffs at reactos.org
> From: cgutman at svn.reactos.org
> Subject: [ros-diffs] [cgutman] 48522: [MSAFD] - Update lpcbBytesReturned when FIONREAD is called - Fix the value inside lpErrno when XxxSocketInformation() fails - Pass the unrecognized IOCTLs to the winsock helper (no behavior change for this yet because wshtcpip's WSHIoctl is unimplemented)
> 
> Author: cgutman
> Date: Thu Aug 12 13:13:19 2010
> New Revision: 48522
> 
> URL: http://svn.reactos.org/svn/reactos?rev=48522&view=rev
> Log:
> [MSAFD]
> - Update lpcbBytesReturned when FIONREAD is called
> - Fix the value inside lpErrno when XxxSocketInformation() fails
> - Pass the unrecognized IOCTLs to the winsock helper (no behavior change for this yet because wshtcpip's WSHIoctl is unimplemented)
> 
> 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/dllmain.c?rev=48522&r1=48521&r2=48522&view=diff
> ==============================================================================
> --- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
> +++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Thu Aug 12 13:13:19 2010
> @@ -1910,6 +1910,7 @@
>           OUT LPINT lpErrno)
>  {
>      PSOCKET_INFORMATION Socket = NULL;
> +	BOOLEAN NeedsCompletion;
>  
>      /* Get the Socket Structure associate to this Socket*/
>      Socket = GetSocketStructure(Handle);
> @@ -1918,6 +1919,8 @@
>         *lpErrno = WSAENOTSOCK;
>         return SOCKET_ERROR;
>      }
> +	
> +	*lpcbBytesReturned = 0;
>  
>      switch( dwIoControlCode )
>      {
> @@ -1928,17 +1931,44 @@
>                  return SOCKET_ERROR;
>              }
>              Socket->SharedData.NonBlocking = *((PULONG)lpvInBuffer) ? 1 : 0;
> -            return SetSocketInformation(Socket, AFD_INFO_BLOCKING_MODE, (PULONG)lpvInBuffer, NULL);
> +            *lpErrno = SetSocketInformation(Socket, AFD_INFO_BLOCKING_MODE, (PULONG)lpvInBuffer, NULL);
> +			if (*lpErrno != NO_ERROR)
> +				return SOCKET_ERROR;
> +			else
> +				return NO_ERROR;
>          case FIONREAD:
>              if( cbOutBuffer < sizeof(INT) || IS_INTRESOURCE(lpvOutBuffer) )
>              {
>                  *lpErrno = WSAEFAULT;
>                  return SOCKET_ERROR;
>              }
> -            return GetSocketInformation(Socket, AFD_INFO_RECEIVE_CONTENT_SIZE, (PULONG)lpvOutBuffer, NULL);
> +            *lpErrno = GetSocketInformation(Socket, AFD_INFO_RECEIVE_CONTENT_SIZE, (PULONG)lpvOutBuffer, NULL);
> +			if (*lpErrno != NO_ERROR)
> +			{
> +				*lpcbBytesReturned = sizeof(ULONG);
> +				return SOCKET_ERROR;
> +			}
> +			else
> +				return NO_ERROR;
>          default:
> -            *lpErrno = WSAEINVAL;
> -            return SOCKET_ERROR;
> +			*lpErrno = Socket->HelperData->WSHIoctl(Socket->HelperContext,
> +													Handle,
> +													Socket->TdiAddressHandle,
> +													Socket->TdiConnectionHandle,
> +													dwIoControlCode,
> +													lpvInBuffer,
> +													cbInBuffer,
> +													lpvOutBuffer,
> +													cbOutBuffer,
> +													lpcbBytesReturned,
> +													lpOverlapped,
> +													lpCompletionRoutine,
> +													(LPBOOL)&NeedsCompletion);
> +			
> +			if (*lpErrno != NO_ERROR)
> +				return SOCKET_ERROR;
> +			else
> +				return NO_ERROR;
>      }
>  }
>  
> 
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20100814/0cfa76cf/attachment.htm>


More information about the Ros-dev mailing list