Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46074
-- v2: msvcr100: Add _ReaderWriterLock constructor implementation.
From: Vijay Kiran Kamuju infyquest@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46074 --- dlls/concrt140/concrt140.spec | 6 +++--- dlls/msvcr100/msvcr100.spec | 4 ++-- dlls/msvcr110/msvcr110.spec | 6 +++--- dlls/msvcr120/msvcr120.spec | 6 +++--- dlls/msvcr120_app/msvcr120_app.spec | 6 +++--- dlls/msvcrt/concurrency.c | 19 +++++++++++++++++++ 6 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/dlls/concrt140/concrt140.spec b/dlls/concrt140/concrt140.spec index f3a39a30599..54b2fb7fc01 100644 --- a/dlls/concrt140/concrt140.spec +++ b/dlls/concrt140/concrt140.spec @@ -33,9 +33,9 @@ @ cdecl -arch=arm ??0_NonReentrantPPLLock@details@Concurrency@@QAA@XZ(ptr) _NonReentrantPPLLock_ctor @ thiscall -arch=i386 ??0_NonReentrantPPLLock@details@Concurrency@@QAE@XZ(ptr) _NonReentrantPPLLock_ctor @ cdecl -arch=win64 ??0_NonReentrantPPLLock@details@Concurrency@@QEAA@XZ(ptr) _NonReentrantPPLLock_ctor -@ stub -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ(ptr) _ReaderWriterLock_ctor +@ thiscall -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ(ptr) _ReaderWriterLock_ctor +@ cdecl -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ(ptr) _ReaderWriterLock_ctor @ cdecl -arch=arm ??0_ReentrantBlockingLock@details@Concurrency@@QAA@XZ(ptr) _ReentrantBlockingLock_ctor @ thiscall -arch=i386 ??0_ReentrantBlockingLock@details@Concurrency@@QAE@XZ(ptr) _ReentrantBlockingLock_ctor @ cdecl -arch=win64 ??0_ReentrantBlockingLock@details@Concurrency@@QEAA@XZ(ptr) _ReentrantBlockingLock_ctor diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 79a201f4c17..532e90b170b 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -14,8 +14,8 @@ @ cdecl -arch=win64 ??0_NonReentrantBlockingLock@details@Concurrency@@QEAA@XZ(ptr) _ReentrantBlockingLock_ctor @ thiscall -arch=win32 ??0_NonReentrantPPLLock@details@Concurrency@@QAE@XZ(ptr) _NonReentrantPPLLock_ctor @ cdecl -arch=win64 ??0_NonReentrantPPLLock@details@Concurrency@@QEAA@XZ(ptr) _NonReentrantPPLLock_ctor -@ stub -arch=win32 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ +@ thiscall -arch=win32 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ(ptr) _ReaderWriterLock_ctor +@ cdecl -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ(ptr) _ReaderWriterLock_ctor @ thiscall -arch=win32 ??0_ReentrantBlockingLock@details@Concurrency@@QAE@XZ(ptr) _ReentrantBlockingLock_ctor @ cdecl -arch=win64 ??0_ReentrantBlockingLock@details@Concurrency@@QEAA@XZ(ptr) _ReentrantBlockingLock_ctor @ stub -arch=win32 ??0_ReentrantLock@details@Concurrency@@QAE@XZ diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 15ceae906c1..a95c32e6d6a 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -38,9 +38,9 @@ @ cdecl -arch=arm ??0_NonReentrantPPLLock@details@Concurrency@@QAA@XZ(ptr) _NonReentrantPPLLock_ctor @ thiscall -arch=i386 ??0_NonReentrantPPLLock@details@Concurrency@@QAE@XZ(ptr) _NonReentrantPPLLock_ctor @ cdecl -arch=win64 ??0_NonReentrantPPLLock@details@Concurrency@@QEAA@XZ(ptr) _NonReentrantPPLLock_ctor -@ stub -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ(ptr) _ReaderWriterLock_ctor +@ thiscall -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ(ptr) _ReaderWriterLock_ctor +@ cdecl -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ(ptr) _ReaderWriterLock_ctor @ cdecl -arch=arm ??0_ReentrantBlockingLock@details@Concurrency@@QAA@XZ(ptr) _ReentrantBlockingLock_ctor @ thiscall -arch=i386 ??0_ReentrantBlockingLock@details@Concurrency@@QAE@XZ(ptr) _ReentrantBlockingLock_ctor @ cdecl -arch=win64 ??0_ReentrantBlockingLock@details@Concurrency@@QEAA@XZ(ptr) _ReentrantBlockingLock_ctor diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 2d6798a0af2..35895d7a9e8 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -35,9 +35,9 @@ @ cdecl -arch=arm ??0_NonReentrantPPLLock@details@Concurrency@@QAA@XZ(ptr) _NonReentrantPPLLock_ctor @ thiscall -arch=i386 ??0_NonReentrantPPLLock@details@Concurrency@@QAE@XZ(ptr) _NonReentrantPPLLock_ctor @ cdecl -arch=win64 ??0_NonReentrantPPLLock@details@Concurrency@@QEAA@XZ(ptr) _NonReentrantPPLLock_ctor -@ stub -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ(ptr) _ReaderWriterLock_ctor +@ thiscall -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ(ptr) _ReaderWriterLock_ctor +@ cdecl -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ(ptr) _ReaderWriterLock_ctor @ cdecl -arch=arm ??0_ReentrantBlockingLock@details@Concurrency@@QAA@XZ(ptr) _ReentrantBlockingLock_ctor @ thiscall -arch=i386 ??0_ReentrantBlockingLock@details@Concurrency@@QAE@XZ(ptr) _ReentrantBlockingLock_ctor @ cdecl -arch=win64 ??0_ReentrantBlockingLock@details@Concurrency@@QEAA@XZ(ptr) _ReentrantBlockingLock_ctor diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 02a28330b54..c987939c381 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -33,9 +33,9 @@ @ cdecl -arch=arm ??0_NonReentrantPPLLock@details@Concurrency@@QAA@XZ(ptr) msvcr120.??0_NonReentrantPPLLock@details@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0_NonReentrantPPLLock@details@Concurrency@@QAE@XZ(ptr) msvcr120.??0_NonReentrantPPLLock@details@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0_NonReentrantPPLLock@details@Concurrency@@QEAA@XZ(ptr) msvcr120.??0_NonReentrantPPLLock@details@Concurrency@@QEAA@XZ -@ stub -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ(ptr) msvcr120.??0_ReaderWriterLock@details@Concurrency@@QAA@XZ +@ thiscall -arch=i386 ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ(ptr) msvcr120.??0_ReaderWriterLock@details@Concurrency@@QAE@XZ +@ cdecl -arch=win64 ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ(ptr) msvcr120.??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ @ cdecl -arch=arm ??0_ReentrantBlockingLock@details@Concurrency@@QAA@XZ(ptr) msvcr120.??0_ReentrantBlockingLock@details@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0_ReentrantBlockingLock@details@Concurrency@@QAE@XZ(ptr) msvcr120.??0_ReentrantBlockingLock@details@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0_ReentrantBlockingLock@details@Concurrency@@QEAA@XZ(ptr) msvcr120.??0_ReentrantBlockingLock@details@Concurrency@@QEAA@XZ diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index 68091c21e60..a9879879301 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -295,6 +295,12 @@ typedef struct } wait; } _ReentrantPPLLock__Scoped_lock;
+typedef struct +{ + LONG state; + LONG count; +} _ReaderWriterLock; + #define EVT_RUNNING (void*)1 #define EVT_WAITING NULL
@@ -3562,6 +3568,19 @@ bool __thiscall _ReentrantBlockingLock__TryAcquire(_ReentrantBlockingLock *this) return TryEnterCriticalSection(&this->cs); }
+/* ??0_ReaderWriterLock@details@Concurrency@@QAA@XZ */ +/* ??0_ReaderWriterLock@details@Concurrency@@QAE@XZ */ +/* ??0_ReaderWriterLock@details@Concurrency@@QEAA@XZ */ +DEFINE_THISCALL_WRAPPER(_ReaderWriterLock_ctor, 4) +_ReaderWriterLock* __thiscall _ReaderWriterLock_ctor(_ReaderWriterLock *this) +{ + TRACE("(%p)\n", this); + + this->state = 0; + this->count = 0; + return this; +} + /* ?wait@Concurrency@@YAXI@Z */ void __cdecl Concurrency_wait(unsigned int time) {
On Mon Jan 22 11:31:37 2024 +0000, Piotr Caban wrote:
The patch looks good for me. Please update the commit message to something like: msvcr100: Add _ReaderWriterLock constructor implementation.
Done. Can you help with implementing _TaskCollection constructor.
This merge request was approved by Piotr Caban.
On Mon Jan 22 11:31:37 2024 +0000, Vijay Kiran Kamuju wrote:
Done. Can you help with implementing _TaskCollection constructor.
I don't know how to implement the class without writing the test and debugging an application that uses it. Taking in account how much time it took to implement StructuredTaskCollection I'm expecting that it's a lot of work.
On Mon Jan 22 11:43:47 2024 +0000, Piotr Caban wrote:
I don't know how to implement the class without writing the test and debugging an application that uses it. Taking in account how much time it took to implement StructuredTaskCollection I'm expecting that it's a lot of work.
It will surely take a lot of time, we use can use the concrt.h as base for creating structure of class. But creating the tests is the toughest part. There are a lot of bugs for implementing this class.
On Mon Jan 22 12:08:54 2024 +0000, Vijay Kiran Kamuju wrote:
It will surely take a lot of time, we use can use the concrt.h as base for creating structure of class. But creating the tests is the toughest part. There are a lot of bugs for implementing this class.
No, you can't look on concrt.h while working on it since it may contain parts of the implementation.