RFC: KUSER_SHARED_DATA update patch to fix bug 29168

Joey Yandle dragon at dancingdragon.be
Tue Mar 20 20:40:37 CDT 2012

Hi everybody,

As originally discovered by Carsten Juttner, Star Wars: The Old Republic
uses the time values in KUSER_SHARED_DATA to trigger network send
buffers.  wine does not currently update these values, so TOR does not
make it past an initial server handshake.

I'm attaching my current patch which fixes this.  It updates the values
every 15600000 nanoseconds as does Windows 7, and presumably all Windows
versions.  The words of the timers are written in the correct order for
applications to detect clock tick.

It uses a separate thread which does nothing else; a previous attempt at
an NtTimer based solution did not work, presumably due to irregularity
in the exact callback times.  Attempts at setting thread priority were
also abandoned after many people were unable to run the code.

The patch does not check the return code of nanosleep; I could add code
to nanosleep again for the remaining time in the case of an interrupt,
but didn't think it was necessary.  I could also change it to use
clock_nanosleep, which would allow for more absolute timing.

Please let me know what you think.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: kuser_shared_data.diff
Type: text/x-patch
Size: 2737 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120320/3ae9bb3c/attachment-0001.bin>

More information about the wine-devel mailing list