msvcrt: Add __swprintf_l.
[wine.git] / dlls / msvcirt / msvcirt.c
blobe73f93e818470801b38bd78bf51dea3855feff8f
1 /*
2 * Copyright (C) 2007 Alexandre Julliard
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
19 #include "config.h"
21 #include <stdarg.h>
23 #include "msvcirt.h"
24 #include "windef.h"
25 #include "winbase.h"
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(msvcirt);
30 typedef struct {
31 LPVOID VTable;
32 } class_ios;
34 typedef struct {
35 LPVOID VTable;
36 } class_ostream;
38 typedef struct {
39 LPVOID VTable;
40 } class_strstreambuf;
42 /******************************************************************
43 * ??1ios@@UAE@XZ (MSVCRTI.@)
44 * class ios & __thiscall ios::-ios<<(void)
46 DEFINE_THISCALL_WRAPPER(MSVCIRT_ios_sl_void,4)
47 void * __thiscall MSVCIRT_ios_sl_void(class_ios * _this)
49 FIXME("(%p) stub\n", _this);
50 return _this;
53 /******************************************************************
54 * ??0ostrstream@@QAE@XZ (MSVCRTI.@)
55 * class ostream & __thiscall ostrstream::ostrstream<<(void)
57 DEFINE_THISCALL_WRAPPER(MSVCIRT_ostrstream_sl_void,4)
58 void * __thiscall MSVCIRT_ostrstream_sl_void(class_ostream * _this)
60 FIXME("(%p) stub\n", _this);
61 return _this;
64 /******************************************************************
65 * ??6ostream@@QAEAAV0@E@Z (MSVCRTI.@)
66 * class ostream & __thiscall ostream::operator<<(unsigned char)
68 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_uchar,8)
69 void * __thiscall MSVCIRT_operator_sl_uchar(class_ostream * _this, unsigned char ch)
71 FIXME("(%p)->(%c) stub\n", _this, ch);
72 return _this;
75 /******************************************************************
76 * ??6ostream@@QAEAAV0@H@Z (MSVCRTI.@)
77 * class ostream & __thiscall ostream::operator<<(int)
79 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_int,8)
80 void * __thiscall MSVCIRT_operator_sl_int(class_ostream * _this, int integer)
82 FIXME("(%p)->(%d) stub\n", _this, integer);
83 return _this;
86 /******************************************************************
87 * ??6ostream@@QAEAAV0@PBD@Z (MSVCRTI.@)
88 * class ostream & __thiscall ostream::operator<<(char const *)
90 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_pchar,8)
91 void * __thiscall MSVCIRT_operator_sl_pchar(class_ostream * _this, const char * string)
93 FIXME("(%p)->(%s) stub\n", _this, debugstr_a(string));
94 return _this;
97 /******************************************************************
98 * ??6ostream@@QAEAAV0@P6AAAV0@AAV0@@Z@Z (MSVCRTI.@)
99 * class ostream & __thiscall ostream::operator<<(class ostream & (__cdecl*)(class ostream &))
101 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_callback,8)
102 void * __thiscall MSVCIRT_operator_sl_callback(class_ostream * _this, class_ostream * (__cdecl*func)(class_ostream*))
104 TRACE("%p, %p\n", _this, func);
105 return func(_this);
108 /******************************************************************
109 * ?endl@@YAAAVostream@@AAV1@@Z (MSVCRTI.@)
110 * class ostream & __cdecl endl(class ostream &)
112 void * CDECL MSVCIRT_endl(class_ostream * _this)
114 FIXME("(%p)->() stub\n", _this);
115 return _this;
118 /******************************************************************
119 * ?ends@@YAAAVostream@@AAV1@@Z (MSVCRTI.@)
120 * class ostream & __cdecl ends(class ostream &)
122 void * CDECL MSVCIRT_ends(class_ostream * _this)
124 FIXME("(%p)->() stub\n", _this);
125 return _this;
128 /******************************************************************
129 * ?str@strstreambuf@@QAEPADXZ (MSVCRTI.@)
130 * class strstreambuf & __thiscall strstreambuf::str(class strstreambuf &)
132 DEFINE_THISCALL_WRAPPER(MSVCIRT_str_sl_void,4)
133 char * __thiscall MSVCIRT_str_sl_void(class_strstreambuf * _this)
135 FIXME("(%p)->() stub\n", _this);
136 return 0;
139 void (__cdecl *MSVCRT_operator_delete)(void*);
141 static void init_cxx_funcs(void)
143 HMODULE hmod = GetModuleHandleA("msvcrt.dll");
145 if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
147 MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z");
149 else
151 MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z");
155 BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
157 switch (reason)
159 case DLL_WINE_PREATTACH:
160 return FALSE; /* prefer native version */
161 case DLL_PROCESS_ATTACH:
162 init_cxx_funcs();
163 init_exception(inst);
164 DisableThreadLibraryCalls( inst );
165 break;
167 return TRUE;