mshtml: Added IHTMLDocument2::put_designMode tests.
[wine] / dlls / msvcirt / msvcirt.c
1 /*
2  * Copyright (C) 2007 Alexandre Julliard
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 #include "wine/port.h"
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "wine/debug.h"
27
28 WINE_DEFAULT_DEBUG_CHANNEL(msvcirt);
29
30 typedef struct {
31     LPVOID VTable;
32 } class_ios;
33
34 typedef struct {
35     LPVOID VTable;
36 } class_ostream;
37
38 typedef struct {
39     LPVOID VTable;
40 } class_strstreambuf;
41
42 #ifdef __i386__  /* thiscall functions are i386-specific */
43
44 #define THISCALL(func) __thiscall_ ## func
45 #define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func)
46 #define __thiscall __stdcall
47 #define DEFINE_THISCALL_WRAPPER(func,args) \
48     extern void THISCALL(func)(void); \
49     __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
50                       "popl %eax\n\t" \
51                       "pushl %ecx\n\t" \
52                       "pushl %eax\n\t" \
53                       "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) )
54 #else /* __i386__ */
55
56 #define THISCALL(func) func
57 #define THISCALL_NAME(func) __ASM_NAME(#func)
58 #define __thiscall __cdecl
59 #define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */
60
61 #endif /* __i386__ */
62
63 /******************************************************************
64  *               ??1ios@@UAE@XZ (MSVCRTI.@)
65  *        class ios & __thiscall ios::-ios<<(void)
66  */
67 DEFINE_THISCALL_WRAPPER(MSVCIRT_ios_sl_void,4)
68 void * __thiscall MSVCIRT_ios_sl_void(class_ios * _this)
69 {
70    FIXME("(%p) stub\n", _this);
71    return _this;
72 }
73
74 /******************************************************************
75  *               ??0ostrstream@@QAE@XZ (MSVCRTI.@)
76  *        class ostream & __thiscall ostrstream::ostrstream<<(void)
77  */
78 DEFINE_THISCALL_WRAPPER(MSVCIRT_ostrstream_sl_void,4)
79 void * __thiscall MSVCIRT_ostrstream_sl_void(class_ostream * _this)
80 {
81    FIXME("(%p) stub\n", _this);
82    return _this;
83 }
84
85 /******************************************************************
86  *              ??6ostream@@QAEAAV0@E@Z (MSVCRTI.@)
87  *    class ostream & __thiscall ostream::operator<<(unsigned char)
88  */
89 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_uchar,8)
90 void * __thiscall MSVCIRT_operator_sl_uchar(class_ostream * _this, unsigned char ch)
91 {
92    FIXME("(%p)->(%c) stub\n", _this, ch);
93    return _this;
94 }
95
96 /******************************************************************
97  *               ??6ostream@@QAEAAV0@H@Z (MSVCRTI.@)
98  *        class ostream & __thiscall ostream::operator<<(int)
99  */
100 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_int,8)
101 void * __thiscall MSVCIRT_operator_sl_int(class_ostream * _this, int integer)
102 {
103    FIXME("(%p)->(%d) stub\n", _this, integer);
104    return _this;
105 }
106
107 /******************************************************************
108  *              ??6ostream@@QAEAAV0@PBD@Z (MSVCRTI.@)
109  *    class ostream & __thiscall ostream::operator<<(char const *)
110  */
111 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_pchar,8)
112 void * __thiscall MSVCIRT_operator_sl_pchar(class_ostream * _this, const char * string)
113 {
114    FIXME("(%p)->(%s) stub\n", _this, debugstr_a(string));
115    return _this;
116 }
117
118 /******************************************************************
119  *              ??6ostream@@QAEAAV0@P6AAAV0@AAV0@@Z@Z (MSVCRTI.@)
120  *    class ostream & __thiscall ostream::operator<<(class ostream & (__cdecl*)(class ostream &))
121  */
122 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_callback,8)
123 void * __thiscall MSVCIRT_operator_sl_callback(class_ostream * _this, class_ostream * (__cdecl*func)(class_ostream*))
124 {
125    TRACE("%p, %p\n", _this, func);
126    return func(_this);
127 }
128
129 /******************************************************************
130  *              ?endl@@YAAAVostream@@AAV1@@Z (MSVCRTI.@)
131  *           class ostream & __cdecl endl(class ostream &)
132  */
133 void * CDECL MSVCIRT_endl(class_ostream * _this)
134 {
135    FIXME("(%p)->() stub\n", _this);
136    return _this;
137 }
138
139 /******************************************************************
140  *              ?ends@@YAAAVostream@@AAV1@@Z (MSVCRTI.@)
141  *           class ostream & __cdecl ends(class ostream &)
142  */
143 void * CDECL MSVCIRT_ends(class_ostream * _this)
144 {
145    FIXME("(%p)->() stub\n", _this);
146    return _this;
147 }
148
149 /******************************************************************
150  *              ?str@strstreambuf@@QAEPADXZ (MSVCRTI.@)
151  *           class strstreambuf & __thiscall strstreambuf::str(class strstreambuf &)
152  */
153 DEFINE_THISCALL_WRAPPER(MSVCIRT_str_sl_void,4)
154 char * __thiscall MSVCIRT_str_sl_void(class_strstreambuf * _this)
155 {
156    FIXME("(%p)->() stub\n", _this);
157    return 0;
158 }
159
160 BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
161 {
162    switch (reason)
163    {
164    case DLL_WINE_PREATTACH:
165        return FALSE;  /* prefer native version */
166    case DLL_PROCESS_ATTACH:
167        DisableThreadLibraryCalls( inst );
168        break;
169    }
170    return TRUE;
171 }