msvcp60: Remove the msvcp90 debug channel from misc.c as it is unused.
[wine] / dlls / msvcp60 / misc.c
1 /*
2  * Copyright 2010 Piotr Caban for CodeWeavers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #include "config.h"
20
21 #include <stdarg.h>
22 #include <limits.h>
23
24 #include "msvcp.h"
25
26 #include "windef.h"
27 #include "winbase.h"
28
29
30 /* ??0_Mutex@std@@QAE@XZ */
31 /* ??0_Mutex@std@@QEAA@XZ */
32 DEFINE_THISCALL_WRAPPER(mutex_ctor, 4)
33 mutex* __thiscall mutex_ctor(mutex *this)
34 {
35     this->mutex = CreateMutexW(NULL, FALSE, NULL);
36     return this;
37 }
38
39 /* ??1_Mutex@std@@QAE@XZ */
40 /* ??1_Mutex@std@@QEAA@XZ */
41 DEFINE_THISCALL_WRAPPER(mutex_dtor, 4)
42 void __thiscall mutex_dtor(mutex *this)
43 {
44     CloseHandle(this->mutex);
45 }
46
47 /* ?_Lock@_Mutex@std@@QAEXXZ */
48 /* ?_Lock@_Mutex@std@@QEAAXXZ */
49 DEFINE_THISCALL_WRAPPER(mutex_lock, 4)
50 void __thiscall mutex_lock(mutex *this)
51 {
52     WaitForSingleObject(this->mutex, INFINITE);
53 }
54
55 /* ?_Unlock@_Mutex@std@@QAEXXZ */
56 /* ?_Unlock@_Mutex@std@@QEAAXXZ */
57 DEFINE_THISCALL_WRAPPER(mutex_unlock, 4)
58 void __thiscall mutex_unlock(mutex *this)
59 {
60     ReleaseMutex(this->mutex);
61 }
62
63 static CRITICAL_SECTION lockit_cs;
64
65 void init_lockit(void) {
66     InitializeCriticalSection(&lockit_cs);
67     lockit_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": _Lockit critical section");
68 }
69
70 void free_lockit(void) {
71     lockit_cs.DebugInfo->Spare[0] = 0;
72     DeleteCriticalSection(&lockit_cs);
73 }
74
75 static _Lockit* __thiscall _Lockit_ctor_locktype(_Lockit *this, int locktype)
76 {
77     EnterCriticalSection(&lockit_cs);
78     return this;
79 }
80
81 /* ??0_Lockit@std@@QAE@XZ */
82 /* ??0_Lockit@std@@QEAA@XZ */
83 DEFINE_THISCALL_WRAPPER(_Lockit_ctor, 4)
84 _Lockit* __thiscall _Lockit_ctor(_Lockit *this)
85 {
86     return _Lockit_ctor_locktype(this, 0);
87 }
88
89 /* ??1_Lockit@std@@QAE@XZ */
90 /* ??1_Lockit@std@@QEAA@XZ */
91 DEFINE_THISCALL_WRAPPER(_Lockit_dtor, 4)
92 void __thiscall _Lockit_dtor(_Lockit *this)
93 {
94     LeaveCriticalSection(&lockit_cs);
95 }