some fixes

svn path=/trunk/; revision=6464
This commit is contained in:
Gunnar Dalsnes 2003-10-30 13:33:43 +00:00
parent 454e9ef133
commit 3186456e36
2 changed files with 61 additions and 48 deletions

View file

@ -198,15 +198,30 @@ WSPSocket(
SocketType = lpProtocolInfo->iSocketType; SocketType = lpProtocolInfo->iSocketType;
Protocol = lpProtocolInfo->iProtocol; Protocol = lpProtocolInfo->iProtocol;
Status = HelperDLL->EntryTable.lpWSHOpenSocket2( /* The OPTIONAL export WSHOpenSocket2 supersedes WSHOpenSocket */
&AddressFamily, if (HelperDLL->EntryTable.lpWSHOpenSocket2)
&SocketType, {
&Protocol, Status = HelperDLL->EntryTable.lpWSHOpenSocket2(
0, &AddressFamily,
0, &SocketType,
&TdiDeviceName, &Protocol,
&HelperContext, 0,
&NotificationEvents); 0,
&TdiDeviceName,
&HelperContext,
&NotificationEvents);
}
else
{
Status = HelperDLL->EntryTable.lpWSHOpenSocket(
&AddressFamily,
&SocketType,
&Protocol,
&TdiDeviceName,
&HelperContext,
&NotificationEvents);
}
if (Status != NO_ERROR) { if (Status != NO_ERROR) {
AFD_DbgPrint(MAX_TRACE, ("WinSock Helper DLL failed (0x%X).\n", Status)); AFD_DbgPrint(MAX_TRACE, ("WinSock Helper DLL failed (0x%X).\n", Status));
*lpErrno = Status; *lpErrno = Status;

View file

@ -104,69 +104,67 @@ INT GetHelperDLLEntries(
PWSHELPER_DLL HelperDLL) PWSHELPER_DLL HelperDLL)
{ {
PVOID e; PVOID e;
e = GetProcAddress(HelperDLL->hModule, "WSHAddressToString"); /* The following functions MUST be supported */
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHAddressToString) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHEnumProtocols"); e = GetProcAddress(HelperDLL->hModule, "WSHEnumProtocols");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHEnumProtocols) = e; ((PVOID) HelperDLL->EntryTable.lpWSHEnumProtocols) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetBroadcastSockaddr"); e = GetProcAddress(HelperDLL->hModule, "WSHGetSockaddrType");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHGetBroadcastSockaddr) = e; ((PVOID) HelperDLL->EntryTable.lpWSHGetSockaddrType) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetProviderGuid");
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHGetProviderGuid) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetSockaddrType");
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHGetSockaddrType) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetSocketInformation"); e = GetProcAddress(HelperDLL->hModule, "WSHGetSocketInformation");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHGetSocketInformation) = e; ((PVOID) HelperDLL->EntryTable.lpWSHGetSocketInformation) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetWildcardSockaddr"); e = GetProcAddress(HelperDLL->hModule, "WSHGetWildcardSockaddr");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHGetWildcardSockaddr) = e; ((PVOID) HelperDLL->EntryTable.lpWSHGetWildcardSockaddr) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetWinsockMapping"); e = GetProcAddress(HelperDLL->hModule, "WSHGetWinsockMapping");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHGetWinsockMapping) = e; ((PVOID) HelperDLL->EntryTable.lpWSHGetWinsockMapping) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetWSAProtocolInfo");
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHGetWSAProtocolInfo) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHIoctl");
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHIoctl) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHJoinLeaf");
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHJoinLeaf) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHNotify"); e = GetProcAddress(HelperDLL->hModule, "WSHNotify");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHNotify) = e; ((PVOID) HelperDLL->EntryTable.lpWSHNotify) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHOpenSocket"); e = GetProcAddress(HelperDLL->hModule, "WSHOpenSocket");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHOpenSocket) = e; ((PVOID) HelperDLL->EntryTable.lpWSHOpenSocket) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHOpenSocket2");
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHOpenSocket2) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHSetSocketInformation"); e = GetProcAddress(HelperDLL->hModule, "WSHSetSocketInformation");
if (!e) return ERROR_BAD_PROVIDER; if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHSetSocketInformation) = e; ((PVOID) HelperDLL->EntryTable.lpWSHSetSocketInformation) = e;
/*
The following functions are OPTIONAL.
Whoever wants to call them, must check that the pointer is not NULL.
*/
e = GetProcAddress(HelperDLL->hModule, "WSHAddressToString");
((PVOID) HelperDLL->EntryTable.lpWSHAddressToString) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetBroadcastSockaddr");
((PVOID) HelperDLL->EntryTable.lpWSHGetBroadcastSockaddr) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetProviderGuid");
((PVOID) HelperDLL->EntryTable.lpWSHGetProviderGuid) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHGetWSAProtocolInfo");
((PVOID) HelperDLL->EntryTable.lpWSHGetWSAProtocolInfo) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHIoctl");
((PVOID) HelperDLL->EntryTable.lpWSHIoctl) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHJoinLeaf");
((PVOID) HelperDLL->EntryTable.lpWSHJoinLeaf) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHOpenSocket2");
((PVOID) HelperDLL->EntryTable.lpWSHOpenSocket2) = e;
e = GetProcAddress(HelperDLL->hModule, "WSHStringToAddress"); e = GetProcAddress(HelperDLL->hModule, "WSHStringToAddress");
if (!e) return ERROR_BAD_PROVIDER;
((PVOID) HelperDLL->EntryTable.lpWSHStringToAddress) = e; ((PVOID) HelperDLL->EntryTable.lpWSHStringToAddress) = e;
return NO_ERROR; return NO_ERROR;