1
0
mirror of https://github.com/solemnwarning/ipxwrapper synced 2024-12-30 16:45:37 +01:00

Updated getsockopt to call get_interfaces for each IPX_ADDRESS/IPX_MAX_ADAPTER_NUM call.

Deleted global interface list.

Set ipxwrapper.dll EnumProtocolsA/EnumProtocolsW stubs to load from wsock32.dll as they don't exist in ws2_32.dll.
This commit is contained in:
Daniel Collins 2011-09-11 17:09:57 +00:00
parent 9ac1da252a
commit a40d3da084
4 changed files with 10 additions and 17 deletions

View File

@ -38,7 +38,6 @@
}
ipx_socket *sockets = NULL;
struct ipx_interface *nics = NULL;
ipx_host *hosts = NULL;
SOCKET send_fd = -1;
struct reg_global global_conf;
@ -79,8 +78,6 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) {
global_conf.filter = 1;
}
nics = get_interfaces(-1);
INIT_CS(&sockets_cs);
INIT_CS(&hosts_cs);
@ -134,8 +131,6 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) {
initialised_cs = 0;
free_interfaces(nics);
reg_close();
unload_dlls();

View File

@ -99,7 +99,6 @@ struct ipx_host {
};
extern ipx_socket *sockets;
extern struct ipx_interface *nics;
extern ipx_host *hosts;
extern SOCKET send_fd;
extern struct reg_global global_conf;

View File

@ -17,8 +17,8 @@ WSAEventSelect:4
WSACloseEvent:4
WSAResetEvent:4
WSASetEvent:4
r_EnumProtocolsA:4
r_EnumProtocolsW:4
r_EnumProtocolsA:1
r_EnumProtocolsW:1
r_WSARecvEx:4
r_bind:4
r_closesocket:4

View File

@ -420,13 +420,7 @@ int WSAAPI getsockopt(SOCKET fd, int level, int optname, char FAR *optval, int F
IPX_ADDRESS_DATA *ipxdata = (IPX_ADDRESS_DATA*)optval;
struct ipx_interface *nic = nics;
int i = 0;
while(nic && i < ipxdata->adapternum) {
nic = nic->next;
i++;
}
struct ipx_interface *nic = get_interfaces(ipxdata->adapternum);
if(!nic) {
WSASetLastError(ERROR_NO_DATA);
@ -442,6 +436,8 @@ int WSAAPI getsockopt(SOCKET fd, int level, int optname, char FAR *optval, int F
ipxdata->maxpkt = MAX_PACKET_SIZE;
ipxdata->linkspeed = 100000; /* 10MBps */
free_interfaces(nic);
RETURN(0);
}
@ -455,12 +451,15 @@ int WSAAPI getsockopt(SOCKET fd, int level, int optname, char FAR *optval, int F
*intval = 0;
struct ipx_interface *nic = nics;
while(nic) {
struct ipx_interface *ifaces = get_interfaces(-1), *nic;
for(nic = ifaces; nic;) {
(*intval)++;
nic = nic->next;
}
free_interfaces(ifaces);
RETURN(0);
}