From 8d9c48171cf1ad83e92ac93d2b6abcbffd683786 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 23 Jan 2018 17:03:00 +0100 Subject: [PATCH] msvcp100: Add _Concurrent_queue_base_v4 constructor implementation. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcp90/misc.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index c7fd04151fc..ac6de38e63b 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -1234,6 +1234,8 @@ typedef struct MSVCP_size_t item_size; } _Concurrent_queue_base_v4; +extern const vtable_ptr MSVCP__Concurrent_queue_base_v4_vtable; + /* ?_Internal_throw_exception@_Concurrent_queue_base_v4@details@Concurrency@@IBEXXZ */ /* ?_Internal_throw_exception@_Concurrent_queue_base_v4@details@Concurrency@@IEBAXXZ */ DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4__Internal_throw_exception, 4) @@ -1250,8 +1252,22 @@ DEFINE_THISCALL_WRAPPER(_Concurrent_queue_base_v4_ctor, 8) _Concurrent_queue_base_v4* __thiscall _Concurrent_queue_base_v4_ctor( _Concurrent_queue_base_v4 *this, MSVCP_size_t size) { - FIXME("(%p %ld) stub\n", this, size); - return NULL; + TRACE("(%p %ld)\n", this, size); + + this->data = MSVCRT_operator_new(sizeof(*this->data)); + memset(this->data, 0, sizeof(*this->data)); + + this->vtable = &MSVCP__Concurrent_queue_base_v4_vtable; + this->item_size = size; + + /* alloc_count needs to be power of 2 */ + this->alloc_count = + size <= 8 ? 32 : + size <= 16 ? 16 : + size <= 32 ? 8 : + size <= 64 ? 4 : + size <= 128 ? 2 : 1; + return this; } /* ??1_Concurrent_queue_base_v4@details@Concurrency@@MAE@XZ */ -- 2.11.4.GIT