2 * Copyright 2010 Piotr Caban for CodeWeavers
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.
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.
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
30 static CRITICAL_SECTION lockit_cs
;
32 void init_lockit(void) {
33 InitializeCriticalSection(&lockit_cs
);
34 lockit_cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": _Lockit critical section");
37 void free_lockit(void) {
38 lockit_cs
.DebugInfo
->Spare
[0] = 0;
39 DeleteCriticalSection(&lockit_cs
);
42 _Lockit
* __thiscall
_Lockit_ctor_locktype(_Lockit
*this, int locktype
)
44 EnterCriticalSection(&lockit_cs
);
48 /* ??0_Lockit@std@@QAE@XZ */
49 /* ??0_Lockit@std@@QEAA@XZ */
50 DEFINE_THISCALL_WRAPPER(_Lockit_ctor
, 4)
51 _Lockit
* __thiscall
_Lockit_ctor(_Lockit
*this)
53 return _Lockit_ctor_locktype(this, 0);
56 /* ??1_Lockit@std@@QAE@XZ */
57 /* ??1_Lockit@std@@QEAA@XZ */
58 DEFINE_THISCALL_WRAPPER(_Lockit_dtor
, 4)
59 void __thiscall
_Lockit_dtor(_Lockit
*this)
61 LeaveCriticalSection(&lockit_cs
);
65 unsigned short __cdecl
wctype(const char *property
)
71 { "alnum", _DIGIT
|_ALPHA
},
73 { "cntrl", _CONTROL
},
75 { "graph", _DIGIT
|_PUNCT
|_ALPHA
},
77 { "print", _DIGIT
|_PUNCT
|_BLANK
|_ALPHA
},
85 for(i
=0; i
<sizeof(properties
)/sizeof(properties
[0]); i
++)
86 if(!strcmp(property
, properties
[i
].name
))
87 return properties
[i
].mask
;