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

33 Commits

Author SHA1 Message Date
Daniel Collins
4cdca80c4b Don't do any cleanup in DllMain() during process termination.
Subtle crashes are fun. I found this to cause a deadlock, but only
after adding lots of extra debug logging to diagnose a DIFFERENT bug
and only when running it on a particular machine.

But once both of those criteria are met? It crashes pretty reliably.
2017-06-18 03:12:13 +01:00
Daniel Collins
0e3713f26f DirectPlay: Increase API_HEADER_SIZE.
We don't need any memory reserved for writing out packet headers, but
DirectPlay seems to corrupt itself internally and do funky things if this goes
below a certain threshold. Value taken from the DX5 service provider.
2015-08-21 22:58:55 +01:00
Daniel Collins
c6b505fee9 DirectPlay: Move initialisation of discovery socket.
Initialise the discovery socket when SP_CreatePlayer() is called with the
CREATEPLAYER_NS flag and do nothing in SP_Open, as per the DX5 implementation.

This will correctly handle the name server moving between nodes in a session.
2015-08-21 22:58:55 +01:00
Daniel Collins
dbfdae63d2 DirectPlay: Move initialisation/destruction of main socket.
Initialise the socket when SP_Open or SP_EnumSessions is called and close it
when SP_CloseEx is called, per the DX5 implementation.
2015-08-21 22:58:55 +01:00
Daniel Collins
8ded8da35a DirectPlay: Refactor worker loop.
Hold the lock while reading to ensure the socket isn't closed during the
recvfrom() call, allow either socket to be closed and close either socket if
the recvfrom() call fails.
2015-08-21 22:58:55 +01:00
Daniel Collins
a89948c2f9 DirectPlay: Remove addr field from sp_data structure.
Resolve the address of the main socket at each use rather than holding a copy
in the sp_data structure, one less thing to become desync'd.
2015-08-21 22:58:51 +01:00
Daniel Collins
95e492f653 DirectPlay: Remove already-initialised check in SPInit()
I have no idea why I implemented this check in the first place, the Microsoft
implementation doesn't do it and I think it might cause problems.
2015-08-21 22:36:13 +01:00
Daniel Collins
a0b4abd53e DirectPlay: Initialise sp_data on stack.
SetSPData() takes a copy of the given data, so there is no need to allocate it
on the heap ourselves.
2015-08-21 22:35:03 +01:00
Daniel Collins
59a9f090d5 DirectPlay: Improve SP_Reply() diagnostics 2015-08-21 22:32:02 +01:00
Daniel Collins
384542defe DirectPlay: Store addresses in shared player data.
When there are more than two players in a session (including the host), the
message that triggers SP_CreatePlayer() may not be from the host that actually
has that player on it, copy the behaviour of the DX5 SP and make each player be
responsible for sharing their own address via the shared data.
2015-08-21 22:32:02 +01:00
Daniel Collins
a108ae80b5 DirectPlay: Remove SP_SendEx() and clean up SP_Send()
Implementing this method isn't mandatory and the Microsoft implementation
doesn't provide it. It doesn't appear to get used either, so ditching it to
reduce the number of things that can go wrong.

WIP: SP_Send cleanup
2015-08-21 22:09:10 +01:00
Daniel Collins
dcd484702e Build with newer toolchain.
Various fixups to build under win-builds.org toolchain rather than MinGW. No
longer builds under MinGW as I have removed headers/definitions that it lacks.
2014-06-26 13:22:10 +01:00
Daniel Collins
fab32bf974 Use get_main_config() to load correct log level from registry in stub DLLs. 2012-12-01 14:34:14 +00:00
Daniel Collins
ebcf1673e2 REFACTOR ALL THE THINGS. 2012-10-21 10:26:52 +00:00
Daniel Collins
e7c6358044 Updated logging API. 2011-11-16 21:32:59 +00:00
Daniel Collins
4266b85cc9 Cleaned up error handling in SPInit and updated changelog. 2011-11-14 02:59:15 +00:00
Daniel Collins
aa36058c1d Updated changelog and added some notes to service provider. 2011-11-08 22:01:32 +00:00
Daniel Collins
7a6c8e95da Cleaned up IPX_Send/IPX_SendEx. 2011-10-08 20:14:16 +00:00
Daniel Collins
4255a77898 Log address location/size in SPInit. 2011-10-02 19:25:01 +00:00
Daniel Collins
49119b4831 Redesigned DirectPlay locking code as deadlocks could occur inside IDirectPlaySP_GetSPData call. Release more resources in IPX_ShutdownEx. 2011-09-28 19:10:08 +00:00
Daniel Collins
322b2fe97d Added tray icon and menu with exit option to ipxrouter. Added filename argument to log_open. 2011-09-18 14:36:24 +00:00
Daniel Collins
646ab3b011 Reduced packet data limit to 8192 bytes, the standard driver included with XP only supports 1467 anyway. 2011-09-17 19:54:53 +00:00
Daniel Collins
3455ee040b Fixed deadlocking bug in DirectPlay provider 2011-09-11 15:31:02 +00:00
Daniel Collins
b888762538 Rewrote DLL loading code to avoid corrupting the system error code. 2011-09-11 13:28:41 +00:00
Daniel Collins
ee30a6200f Some bugfixes in the DirectPlay service provider code. 2011-09-11 12:03:38 +00:00
Daniel Collins
6e94ae1a6b Fixed bugs in thread termination code. 2011-09-08 23:00:52 +00:00
Daniel Collins
f837ac123d Continued DirectPlay code tweaks 2011-09-08 22:23:00 +00:00
Daniel Collins
431d0b8047 Began cleanup/overhaul of DirectPlay service provider. Removed last of the "extended bind" kludge implemented for previous code. 2011-09-08 18:42:27 +00:00
Daniel Collins
eec97eee76 Use service provider GUID defined in dplay.h. 2011-09-07 23:37:57 +00:00
Daniel Collins
bca5c8f978 Only update sp_data.ns_addr in IPX_Reply when idNameServer changes. 2011-08-28 21:39:51 +00:00
Daniel Collins
bbfbcb79cd Lots of code cleanup. 2011-08-28 21:27:06 +00:00
Daniel Collins
4bbf47721c Cleaned up error handling a bit and changed DirectPlay discovery socket number. 2011-08-28 18:49:37 +00:00
Daniel Collins
e5271a3df6 Added (very) experimental DirectPlay support. 2011-08-28 15:56:05 +00:00