Required for Forza Horizon 4 and other games https://bugs.winehq.org/show_bug.cgi?id=54756
-- v3: msvcr120_app: Fix spec file for 0_Cancellation_beacon@details@Concurrency
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/msvcr110/msvcr110.spec | 6 +++--- dlls/msvcr120/msvcr120.spec | 6 +++--- dlls/msvcr120_app/msvcr120_app.spec | 6 +++--- dlls/msvcrt/concurrency.c | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index da4e22960b9..c8b359af4cb 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -17,9 +17,9 @@ @ stub -arch=arm ??0_CancellationTokenState@details@Concurrency@@AAA@XZ @ stub -arch=i386 ??0_CancellationTokenState@details@Concurrency@@AAE@XZ @ stub -arch=win64 ??0_CancellationTokenState@details@Concurrency@@AEAA@XZ -@ stub -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ _Cancellation_beacon_ctor +@ thiscall -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ _Cancellation_beacon_ctor +@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ _Cancellation_beacon_ctor @ cdecl -arch=arm ??0_Condition_variable@details@Concurrency@@QAA@XZ(ptr) _Condition_variable_ctor @ thiscall -arch=i386 ??0_Condition_variable@details@Concurrency@@QAE@XZ(ptr) _Condition_variable_ctor @ cdecl -arch=win64 ??0_Condition_variable@details@Concurrency@@QEAA@XZ(ptr) _Condition_variable_ctor diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 1eff4e82f61..e4d07166ccc 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -14,9 +14,9 @@ @ cdecl -arch=arm ??0SchedulerPolicy@Concurrency@@QAA@XZ(ptr) SchedulerPolicy_ctor @ thiscall -arch=i386 ??0SchedulerPolicy@Concurrency@@QAE@XZ(ptr) SchedulerPolicy_ctor @ cdecl -arch=win64 ??0SchedulerPolicy@Concurrency@@QEAA@XZ(ptr) SchedulerPolicy_ctor -@ stub -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ _Cancellation_beacon_ctor +@ thiscall -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ _Cancellation_beacon_ctor +@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ _Cancellation_beacon_ctor @ cdecl -arch=arm ??0_Condition_variable@details@Concurrency@@QAA@XZ(ptr) _Condition_variable_ctor @ thiscall -arch=i386 ??0_Condition_variable@details@Concurrency@@QAE@XZ(ptr) _Condition_variable_ctor @ cdecl -arch=win64 ??0_Condition_variable@details@Concurrency@@QEAA@XZ(ptr) _Condition_variable_ctor diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index bb1d6914c40..690c7a0962f 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -12,9 +12,9 @@ @ cdecl -arch=arm ??0SchedulerPolicy@Concurrency@@QAA@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0SchedulerPolicy@Concurrency@@QAE@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0SchedulerPolicy@Concurrency@@QEAA@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QEAA@XZ -@ stub -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ _Cancellation_beacon_ctor +@ thiscall -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ _Cancellation_beacon_ctor +@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ _Cancellation_beacon_ctor @ cdecl -arch=arm ??0_Condition_variable@details@Concurrency@@QAA@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0_Condition_variable@details@Concurrency@@QAE@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0_Condition_variable@details@Concurrency@@QEAA@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QEAA@XZ diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index d0f029650ac..58c59616eb4 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -350,6 +350,10 @@ typedef struct { CRITICAL_SECTION cs; } _ReentrantBlockingLock;
+typedef struct { + void *unk; +} _Cancellation_beacon; + #define TICKSPERMSEC 10000 typedef struct { const vtable_ptr *vtable; @@ -3431,6 +3435,16 @@ void __cdecl Concurrency_wait(unsigned int time) }
#if _MSVCR_VER>=110 +/* ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ */ +/* ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ */ +/* ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ */ +DEFINE_THISCALL_WRAPPER(_Cancellation_beacon_ctor, 4) +_Cancellation_beacon* __thiscall _Cancellation_beacon_ctor(_Cancellation_beacon *this) +{ + FIXME("(%p)\n", this); + return this; +} + /* ?_Trace_agents@Concurrency@@YAXW4Agents_EventType@1@_JZZ */ void WINAPIV _Trace_agents(/*enum Concurrency::Agents_EventType*/int type, __int64 id, ...) {
From: Vijay Kiran Kamuju infyquest@gmail.com
--- dlls/msvcr120_app/msvcr120_app.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 690c7a0962f..d4c7318679b 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -12,9 +12,10 @@ @ cdecl -arch=arm ??0SchedulerPolicy@Concurrency@@QAA@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0SchedulerPolicy@Concurrency@@QAE@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0SchedulerPolicy@Concurrency@@QEAA@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QEAA@XZ -@ cdecl -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ _Cancellation_beacon_ctor -@ thiscall -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ _Cancellation_beacon_ctor -@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ _Cancellation_beacon_ctor +@ thiscall -arch=i386 ??0SchedulerPolicy@Concurrency@@QAE@XZ(ptr) msvcr120.??0SchedulerPolicy@Concurrency@@QAE@XZ +@ cdecl -arch=arm ??0_Cancellation_beacon@details@Concurrency@@QAA@XZ msvcr120.??0_Cancellation_beacon@details@Concurrency@@QAA@XZ +@ thiscall -arch=i386 ??0_Cancellation_beacon@details@Concurrency@@QAE@XZ msvcr120.??0_Cancellation_beacon@details@Concurrency@@QAE@XZ +@ cdecl -arch=win64 ??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ msvcr120.??0_Cancellation_beacon@details@Concurrency@@QEAA@XZ @ cdecl -arch=arm ??0_Condition_variable@details@Concurrency@@QAA@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0_Condition_variable@details@Concurrency@@QAE@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0_Condition_variable@details@Concurrency@@QEAA@XZ(ptr) msvcr120.??0_Condition_variable@details@Concurrency@@QEAA@XZ
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=132071
Your paranoid android.
=== debian11 (build log) ===
Task: The win32 Wine build failed
=== debian11b (build log) ===
Task: The wow64 Wine build failed
There was a better stub send as part of !1979 (see 9b2e5d0f and f518f936). I think it's best to wait for @tmatthies to resubmit his patches.
On Thu Apr 20 18:09:53 2023 +0000, Piotr Caban wrote:
There was a better stub send as part of !1979 (see 9b2e5d0f and f518f936). I think it's best to wait for @tmatthies to resubmit his patches.
Ok. I will wait for @tmatthies patchset, hence marked this as a draft.
I found some reference of `_Cancellation_beacon` in the bazel toolchain while searching on GitHub. https://github.com/ci-fuzz/bazel-toolchain/blob/4f42c70f17fd1a64bff2aa53a1a3...
I checked and the code is Apache2 Note: Licenses are only required to use copyrightable work without fair use, so you can use this as reference freely without risking you PR to fall under the Apache2 license as using it as a reference has already been considered fair use by law many times.
Also @piotr the PR you mentioned seems merged but not containing the commit you mentioned, I think this PR is still valid and just need a rebase. I checked the main wine code before saying that: https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/msvcrt/concurrency.c
I checked and the code is Apache2 Note: Licenses are only required to use copyrightable work without fair use, so you can use this as reference freely without risking you PR to fall under the Apache2 license as using it as a reference has already been considered fair use by law many times.
Please don't post misleading information, that code is clearly from the Microsoft SDK, it's not Apache2.