Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thcrap_loader hangs on Wine #251

Open
tactikauan opened this issue Jan 4, 2024 · 1 comment
Open

thcrap_loader hangs on Wine #251

tactikauan opened this issue Jan 4, 2024 · 1 comment

Comments

@tactikauan
Copy link

The thcrap_loader process keeps running after closing the game on Wine. The issue is present since the 2023-08-17 release and affects all versions of Wine/Proton.

From my debugging, this thread seems to get stuck:

HANDLE hWrapperUpdateThread = CreateThread(NULL, 0, update_wrapper_patch, &state, 0, NULL);

Looking at the function, it gets blocked on this call to ReadFile:

for (;;) {
char json_data[1024] = {};
ReadFile(hMail, json_data, sizeof(json_data), nullptr, &overlapped);
DWORD signal = WaitForMultipleObjects(3, handles, FALSE, INFINITE);
json_t* json_data_ = json_loads(json_data, 0, nullptr);

Apparently Wine doesn't support async reads on mailslots.

@32th-System
Copy link
Member

Damn. A developer suggested having one single shared buffer to keep all the data shared between multiple processes, and signaling the update_wrapper_patch using an event, rather than relying on the mailslot system. I guess we'll have to do this after all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants