Daniel Lehman : msvcp140: Add _Mtx_init/destroy_in_situ.
Alexandre Julliard
julliard at winehq.org
Mon Aug 8 11:09:28 CDT 2016
Module: wine
Branch: master
Commit: 4b41672f9f48395254eaa91c98594a02b6430340
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4b41672f9f48395254eaa91c98594a02b6430340
Author: Daniel Lehman <dlehman at esri.com>
Date: Thu May 26 20:52:21 2016 -0700
msvcp140: Add _Mtx_init/destroy_in_situ.
Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msvcp140/msvcp140.spec | 4 ++--
dlls/msvcp90/misc.c | 20 +++++++++++++++-----
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec
index 05d62be..fedb05f 100644
--- a/dlls/msvcp140/msvcp140.spec
+++ b/dlls/msvcp140/msvcp140.spec
@@ -3675,10 +3675,10 @@
@ stub _Mtx_clear_owner
@ cdecl _Mtx_current_owns(ptr) msvcp110._Mtx_current_owns
@ cdecl _Mtx_destroy(ptr) _Mtx_destroy
-@ stub _Mtx_destroy_in_situ
+@ cdecl _Mtx_destroy_in_situ(ptr) _Mtx_destroy_in_situ
@ cdecl _Mtx_getconcrtcs(ptr) _Mtx_getconcrtcs
@ cdecl _Mtx_init(ptr long) _Mtx_init
-@ stub _Mtx_init_in_situ
+@ cdecl _Mtx_init_in_situ(ptr long) _Mtx_init_in_situ
@ cdecl _Mtx_lock(ptr) _Mtx_lock
@ stub _Mtx_reset_owner
@ stub _Mtx_timedlock
diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c
index 18b6a19..322e937 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -478,19 +478,29 @@ typedef _Mtx_t *_Mtx_arg_t;
#define MTX_T_TO_ARG(m) (&(m))
#endif
-int __cdecl _Mtx_init(_Mtx_t *mtx, int flags)
+void __cdecl _Mtx_init_in_situ(_Mtx_t mtx, int flags)
{
if(flags & ~MTX_MULTI_LOCK)
FIXME("unknown flags ignored: %x\n", flags);
+ mtx->flags = flags;
+ call_func1(critical_section_ctor, &mtx->cs);
+ mtx->thread_id = -1;
+ mtx->count = 0;
+}
+
+int __cdecl _Mtx_init(_Mtx_t *mtx, int flags)
+{
*mtx = MSVCRT_operator_new(sizeof(**mtx));
- (*mtx)->flags = flags;
- call_func1(critical_section_ctor, &(*mtx)->cs);
- (*mtx)->thread_id = -1;
- (*mtx)->count = 0;
+ _Mtx_init_in_situ(*mtx, flags);
return 0;
}
+void __cdecl _Mtx_destroy_in_situ(_Mtx_t mtx)
+{
+ call_func1(critical_section_dtor, &mtx->cs);
+}
+
void __cdecl _Mtx_destroy(_Mtx_arg_t mtx)
{
call_func1(critical_section_dtor, &MTX_T_FROM_ARG(mtx)->cs);
More information about the wine-cvs
mailing list