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