https://bugs.winehq.org/show_bug.cgi?id=31954
--- Comment #35 from Paul Gofman gofmanp@gmail.com --- Created attachment 63572 --> https://bugs.winehq.org/attachment.cgi?id=63572 Proof of concept hack which lets demo run
The demo gets stuck on reading one of its files. It calls ReadFile() repeatedly requesting all the same read infinitely.
The game uses overlapped IO for reading its data files. Those files are opened with FILE_FLAG_OVERLAPPED, and OVERLAPPED structure is provided for FileRead (with NULL event object). Windows seem to return ERROR_IO_PENDING consistently for it's reads. The demo calls GetOverlappedResult() after each read (even though Wine returns TRUE and no error from ReadFile), and proceeds further. At some point the game seemingly gets sick of it and starts calling ReadFile() repeatedly with all the same parameters endlessly. Giving it FALSE / ERROR_PENDING makes it happy.
I am attaching the hack which effectively sets ERROR_PENDING return unconditionally for overlapped reads. With this patch applied the demo starts and seemingly works.