Author: tfaber
Date: Sat Nov 7 10:48:38 2015
New Revision: 69828
URL:
http://svn.reactos.org/svn/reactos?rev=69828&view=rev
Log:
[MSAFD]
- Add support for SO_PROTOCOL_INFOW. Patch by Peter Hater.
CORE-10440
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
trunk/reactos/dll/win32/msafd/msafd.h
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] Sat Nov 7 10:48:38 2015
@@ -19,7 +19,6 @@
HANDLE GlobalHeap;
WSPUPCALLTABLE Upcalls;
-DWORD CatalogEntryId; /* CatalogEntryId for upcalls */
LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest;
PSOCKET_INFORMATION SocketListHead = NULL;
CRITICAL_SECTION SocketListLock;
@@ -116,7 +115,6 @@
Socket->SharedData.SizeOfRemoteAddress = HelperData->MaxWSAddressLength;
Socket->SharedData.UseDelayedAcceptance = HelperData->UseDelayedAcceptance;
Socket->SharedData.CreateFlags = dwFlags;
- Socket->SharedData.CatalogEntryId = lpProtocolInfo->dwCatalogEntryId;
Socket->SharedData.ServiceFlags1 = lpProtocolInfo->dwServiceFlags1;
Socket->SharedData.ProviderFlags = lpProtocolInfo->dwProviderFlags;
Socket->SharedData.GroupID = g;
@@ -124,6 +122,7 @@
Socket->SharedData.UseSAN = FALSE;
Socket->SharedData.NonBlocking = FALSE; /* Sockets start blocking */
Socket->SanData = NULL;
+ RtlCopyMemory(&Socket->ProtocolInfo, lpProtocolInfo,
sizeof(Socket->ProtocolInfo));
/* Ask alex about this */
if( Socket->SharedData.SocketType == SOCK_DGRAM ||
@@ -290,7 +289,7 @@
CreateContext(Socket);
/* Notify Winsock */
- Upcalls.lpWPUModifyIFSHandle(CatalogEntryId, (SOCKET)Sock, lpErrno);
+ Upcalls.lpWPUModifyIFSHandle(Socket->ProtocolInfo.dwCatalogEntryId, (SOCKET)Sock,
lpErrno);
/* Return Socket Handle */
TRACE("Success %x\n", Sock);
@@ -1058,7 +1057,6 @@
PSOCKADDR RemoteAddress = NULL;
GROUP GroupID = 0;
ULONG CallBack;
- WSAPROTOCOL_INFOW ProtocolInfo;
SOCKET AcceptSocket;
PSOCKET_INFORMATION AcceptSocketInfo;
UCHAR ReceiveBuffer[0x1A];
@@ -1332,14 +1330,10 @@
}
/* Create a new Socket */
- ProtocolInfo.dwCatalogEntryId = Socket->SharedData.CatalogEntryId;
- ProtocolInfo.dwServiceFlags1 = Socket->SharedData.ServiceFlags1;
- ProtocolInfo.dwProviderFlags = Socket->SharedData.ProviderFlags;
-
AcceptSocket = WSPSocket (Socket->SharedData.AddressFamily,
Socket->SharedData.SocketType,
Socket->SharedData.Protocol,
- &ProtocolInfo,
+ &Socket->ProtocolInfo,
GroupID,
Socket->SharedData.CreateFlags,
lpErrno);
@@ -2182,11 +2176,14 @@
Buffer = &Socket->SharedData.RecvTimeout;
BufferSize = sizeof(DWORD);
break;
+ case SO_PROTOCOL_INFOW:
+ Buffer = &Socket->ProtocolInfo;
+ BufferSize = sizeof(Socket->ProtocolInfo);
+ break;
case SO_GROUP_ID:
case SO_GROUP_PRIORITY:
case SO_MAX_MSG_SIZE:
- case SO_PROTOCOL_INFO:
default:
DbgPrint("MSAFD: Get unknown optname %x\n", OptionName);
@@ -2412,8 +2409,6 @@
lpProcTable->lpWSPStringToAddress = WSPStringToAddress;
lpWSPData->wVersion = MAKEWORD(2, 2);
lpWSPData->wHighVersion = MAKEWORD(2, 2);
- /* Save CatalogEntryId for all upcalls */
- CatalogEntryId = lpProtocolInfo->dwCatalogEntryId;
}
TRACE("Status (%d).\n", Status);
Modified: trunk/reactos/dll/win32/msafd/msafd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/msafd.h?re…
==============================================================================
--- trunk/reactos/dll/win32/msafd/msafd.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/msafd.h [iso-8859-1] Sat Nov 7 10:48:38 2015
@@ -72,7 +72,6 @@
BOOLEAN UseSAN:1;
}; // Flags
DWORD CreateFlags;
- DWORD CatalogEntryId;
DWORD ServiceFlags1;
DWORD ProviderFlags;
GROUP GroupID;
@@ -106,6 +105,7 @@
BOOL TrySAN;
SOCKADDR WSLocalAddress;
SOCKADDR WSRemoteAddress;
+ WSAPROTOCOL_INFOW ProtocolInfo;
struct _SOCKET_INFORMATION *NextSocket;
} SOCKET_INFORMATION, *PSOCKET_INFORMATION;