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:
parent
9ac1da252a
commit
a40d3da084
@ -38,7 +38,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
ipx_socket *sockets = NULL;
|
ipx_socket *sockets = NULL;
|
||||||
struct ipx_interface *nics = NULL;
|
|
||||||
ipx_host *hosts = NULL;
|
ipx_host *hosts = NULL;
|
||||||
SOCKET send_fd = -1;
|
SOCKET send_fd = -1;
|
||||||
struct reg_global global_conf;
|
struct reg_global global_conf;
|
||||||
@ -79,8 +78,6 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) {
|
|||||||
global_conf.filter = 1;
|
global_conf.filter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
nics = get_interfaces(-1);
|
|
||||||
|
|
||||||
INIT_CS(&sockets_cs);
|
INIT_CS(&sockets_cs);
|
||||||
INIT_CS(&hosts_cs);
|
INIT_CS(&hosts_cs);
|
||||||
|
|
||||||
@ -134,8 +131,6 @@ BOOL WINAPI DllMain(HINSTANCE me, DWORD why, LPVOID res) {
|
|||||||
|
|
||||||
initialised_cs = 0;
|
initialised_cs = 0;
|
||||||
|
|
||||||
free_interfaces(nics);
|
|
||||||
|
|
||||||
reg_close();
|
reg_close();
|
||||||
|
|
||||||
unload_dlls();
|
unload_dlls();
|
||||||
|
@ -99,7 +99,6 @@ struct ipx_host {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern ipx_socket *sockets;
|
extern ipx_socket *sockets;
|
||||||
extern struct ipx_interface *nics;
|
|
||||||
extern ipx_host *hosts;
|
extern ipx_host *hosts;
|
||||||
extern SOCKET send_fd;
|
extern SOCKET send_fd;
|
||||||
extern struct reg_global global_conf;
|
extern struct reg_global global_conf;
|
||||||
|
@ -17,8 +17,8 @@ WSAEventSelect:4
|
|||||||
WSACloseEvent:4
|
WSACloseEvent:4
|
||||||
WSAResetEvent:4
|
WSAResetEvent:4
|
||||||
WSASetEvent:4
|
WSASetEvent:4
|
||||||
r_EnumProtocolsA:4
|
r_EnumProtocolsA:1
|
||||||
r_EnumProtocolsW:4
|
r_EnumProtocolsW:1
|
||||||
r_WSARecvEx:4
|
r_WSARecvEx:4
|
||||||
r_bind:4
|
r_bind:4
|
||||||
r_closesocket:4
|
r_closesocket:4
|
||||||
|
@ -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;
|
IPX_ADDRESS_DATA *ipxdata = (IPX_ADDRESS_DATA*)optval;
|
||||||
|
|
||||||
struct ipx_interface *nic = nics;
|
struct ipx_interface *nic = get_interfaces(ipxdata->adapternum);
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
while(nic && i < ipxdata->adapternum) {
|
|
||||||
nic = nic->next;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!nic) {
|
if(!nic) {
|
||||||
WSASetLastError(ERROR_NO_DATA);
|
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->maxpkt = MAX_PACKET_SIZE;
|
||||||
ipxdata->linkspeed = 100000; /* 10MBps */
|
ipxdata->linkspeed = 100000; /* 10MBps */
|
||||||
|
|
||||||
|
free_interfaces(nic);
|
||||||
|
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,12 +451,15 @@ int WSAAPI getsockopt(SOCKET fd, int level, int optname, char FAR *optval, int F
|
|||||||
|
|
||||||
*intval = 0;
|
*intval = 0;
|
||||||
|
|
||||||
struct ipx_interface *nic = nics;
|
struct ipx_interface *ifaces = get_interfaces(-1), *nic;
|
||||||
while(nic) {
|
|
||||||
|
for(nic = ifaces; nic;) {
|
||||||
(*intval)++;
|
(*intval)++;
|
||||||
nic = nic->next;
|
nic = nic->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free_interfaces(ifaces);
|
||||||
|
|
||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user