2 * Copyright (C) 2007 Alexandre Julliard
3 * Copyright (C) 2015 Iván Matellanes
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/debug.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(msvcirt
);
32 #define RESERVE_SIZE 512
36 const vtable_ptr
*vtable
;
49 CRITICAL_SECTION lock
;
52 void __thiscall
streambuf_setb(streambuf
*, char*, char*, int);
53 streambuf
* __thiscall
streambuf_setbuf(streambuf
*, char*, int);
54 void __thiscall
streambuf_setg(streambuf
*, char*, char*, char*);
55 void __thiscall
streambuf_setp(streambuf
*, char*, char*);
69 /* ??_7streambuf@@6B@ */
70 extern const vtable_ptr MSVCP_streambuf_vtable
;
73 void __asm_dummy_vtables(void) {
75 __ASM_VTABLE(streambuf
,
76 VTABLE_ADD_FUNC(streambuf_vector_dtor
)
77 VTABLE_ADD_FUNC(streambuf_sync
)
78 VTABLE_ADD_FUNC(streambuf_setbuf
)
79 VTABLE_ADD_FUNC(streambuf_seekoff
)
80 VTABLE_ADD_FUNC(streambuf_seekpos
)
81 VTABLE_ADD_FUNC(streambuf_xsputn
)
82 VTABLE_ADD_FUNC(streambuf_xsgetn
)
83 VTABLE_ADD_FUNC(streambuf_overflow
)
84 VTABLE_ADD_FUNC(streambuf_underflow
)
85 VTABLE_ADD_FUNC(streambuf_pbackfail
)
86 VTABLE_ADD_FUNC(streambuf_doallocate
));
91 DEFINE_RTTI_DATA0(streambuf
, 0, ".?AVstreambuf@@")
93 /* ??0streambuf@@IAE@PADH@Z */
94 /* ??0streambuf@@IEAA@PEADH@Z */
95 DEFINE_THISCALL_WRAPPER(streambuf_reserve_ctor
, 12)
96 streambuf
* __thiscall
streambuf_reserve_ctor(streambuf
*this, char *buffer
, int length
)
98 TRACE("(%p %p %d)\n", this, buffer
, length
);
99 this->vtable
= &MSVCP_streambuf_vtable
;
101 this->stored_char
= EOF
;
104 streambuf_setbuf(this, buffer
, length
);
105 streambuf_setg(this, NULL
, NULL
, NULL
);
106 streambuf_setp(this, NULL
, NULL
);
107 InitializeCriticalSection(&this->lock
);
111 /* ??0streambuf@@IAE@XZ */
112 /* ??0streambuf@@IEAA@XZ */
113 DEFINE_THISCALL_WRAPPER(streambuf_ctor
, 4)
114 streambuf
* __thiscall
streambuf_ctor(streambuf
*this)
116 streambuf_reserve_ctor(this, NULL
, 0);
117 this->unbuffered
= 0;
121 /* ??0streambuf@@QAE@ABV0@@Z */
122 /* ??0streambuf@@QEAA@AEBV0@@Z */
123 DEFINE_THISCALL_WRAPPER(streambuf_copy_ctor
, 8)
124 streambuf
* __thiscall
streambuf_copy_ctor(streambuf
*this, const streambuf
*copy
)
126 TRACE("(%p %p)\n", this, copy
);
128 this->vtable
= &MSVCP_streambuf_vtable
;
132 /* ??1streambuf@@UAE@XZ */
133 /* ??1streambuf@@UEAA@XZ */
134 DEFINE_THISCALL_WRAPPER(streambuf_dtor
, 4)
135 void __thiscall
streambuf_dtor(streambuf
*this)
137 TRACE("(%p)\n", this);
139 MSVCRT_operator_delete(this->base
);
140 DeleteCriticalSection(&this->lock
);
143 /* ??4streambuf@@QAEAAV0@ABV0@@Z */
144 /* ??4streambuf@@QEAAAEAV0@AEBV0@@Z */
145 DEFINE_THISCALL_WRAPPER(streambuf_assign
, 8)
146 streambuf
* __thiscall
streambuf_assign(streambuf
*this, const streambuf
*rhs
)
148 streambuf_dtor(this);
149 return streambuf_copy_ctor(this, rhs
);
152 /* ??_Estreambuf@@UAEPAXI@Z */
153 DEFINE_THISCALL_WRAPPER(streambuf_vector_dtor
, 8)
154 streambuf
* __thiscall
streambuf_vector_dtor(streambuf
*this, unsigned int flags
)
156 TRACE("(%p %x)\n", this, flags
);
158 /* we have an array, with the number of elements stored before the first object */
159 INT_PTR i
, *ptr
= (INT_PTR
*)this-1;
161 for (i
= *ptr
-1; i
>= 0; i
--)
162 streambuf_dtor(this+i
);
163 MSVCRT_operator_delete(ptr
);
165 streambuf_dtor(this);
167 MSVCRT_operator_delete(this);
172 /* ??_Gstreambuf@@UAEPAXI@Z */
173 DEFINE_THISCALL_WRAPPER(streambuf_scalar_dtor
, 8)
174 streambuf
* __thiscall
streambuf_scalar_dtor(streambuf
*this, unsigned int flags
)
176 TRACE("(%p %x)\n", this, flags
);
177 streambuf_dtor(this);
178 if (flags
& 1) MSVCRT_operator_delete(this);
182 /* ?doallocate@streambuf@@MAEHXZ */
183 /* ?doallocate@streambuf@@MEAAHXZ */
184 DEFINE_THISCALL_WRAPPER(streambuf_doallocate
, 4)
185 #define call_streambuf_doallocate(this) CALL_VTBL_FUNC(this, 40, int, (streambuf*), (this))
186 int __thiscall
streambuf_doallocate(streambuf
*this)
190 TRACE("(%p)\n", this);
191 reserve
= MSVCRT_operator_new(RESERVE_SIZE
);
195 streambuf_setb(this, reserve
, reserve
+ RESERVE_SIZE
, 1);
199 /* ?allocate@streambuf@@IAEHXZ */
200 /* ?allocate@streambuf@@IEAAHXZ */
201 DEFINE_THISCALL_WRAPPER(streambuf_allocate
, 4)
202 int __thiscall
streambuf_allocate(streambuf
*this)
204 TRACE("(%p)\n", this);
205 if (this->base
!= NULL
|| this->unbuffered
)
207 return call_streambuf_doallocate(this);
210 /* ?base@streambuf@@IBEPADXZ */
211 /* ?base@streambuf@@IEBAPEADXZ */
212 DEFINE_THISCALL_WRAPPER(streambuf_base
, 4)
213 char* __thiscall
streambuf_base(const streambuf
*this)
215 TRACE("(%p)\n", this);
219 /* ?blen@streambuf@@IBEHXZ */
220 /* ?blen@streambuf@@IEBAHXZ */
221 DEFINE_THISCALL_WRAPPER(streambuf_blen
, 4)
222 int __thiscall
streambuf_blen(const streambuf
*this)
224 TRACE("(%p)\n", this);
225 return this->ebuf
- this->base
;
228 /* ?eback@streambuf@@IBEPADXZ */
229 /* ?eback@streambuf@@IEBAPEADXZ */
230 DEFINE_THISCALL_WRAPPER(streambuf_eback
, 4)
231 char* __thiscall
streambuf_eback(const streambuf
*this)
233 TRACE("(%p)\n", this);
237 /* ?ebuf@streambuf@@IBEPADXZ */
238 /* ?ebuf@streambuf@@IEBAPEADXZ */
239 DEFINE_THISCALL_WRAPPER(streambuf_ebuf
, 4)
240 char* __thiscall
streambuf_ebuf(const streambuf
*this)
242 TRACE("(%p)\n", this);
246 /* ?egptr@streambuf@@IBEPADXZ */
247 /* ?egptr@streambuf@@IEBAPEADXZ */
248 DEFINE_THISCALL_WRAPPER(streambuf_egptr
, 4)
249 char* __thiscall
streambuf_egptr(const streambuf
*this)
251 TRACE("(%p)\n", this);
255 /* ?epptr@streambuf@@IBEPADXZ */
256 /* ?epptr@streambuf@@IEBAPEADXZ */
257 DEFINE_THISCALL_WRAPPER(streambuf_epptr
, 4)
258 char* __thiscall
streambuf_epptr(const streambuf
*this)
260 TRACE("(%p)\n", this);
264 /* ?gptr@streambuf@@IBEPADXZ */
265 /* ?gptr@streambuf@@IEBAPEADXZ */
266 DEFINE_THISCALL_WRAPPER(streambuf_gptr
, 4)
267 char* __thiscall
streambuf_gptr(const streambuf
*this)
269 TRACE("(%p)\n", this);
273 /* ?pbase@streambuf@@IBEPADXZ */
274 /* ?pbase@streambuf@@IEBAPEADXZ */
275 DEFINE_THISCALL_WRAPPER(streambuf_pbase
, 4)
276 char* __thiscall
streambuf_pbase(const streambuf
*this)
278 TRACE("(%p)\n", this);
282 /* ?pptr@streambuf@@IBEPADXZ */
283 /* ?pptr@streambuf@@IEBAPEADXZ */
284 DEFINE_THISCALL_WRAPPER(streambuf_pptr
, 4)
285 char* __thiscall
streambuf_pptr(const streambuf
*this)
287 TRACE("(%p)\n", this);
291 /* ?clrlock@streambuf@@QAEXXZ */
292 /* ?clrlock@streambuf@@QEAAXXZ */
293 DEFINE_THISCALL_WRAPPER(streambuf_clrlock
, 4)
294 void __thiscall
streambuf_clrlock(streambuf
*this)
296 TRACE("(%p)\n", this);
297 if (this->do_lock
<= 0)
301 /* ?lock@streambuf@@QAEXXZ */
302 /* ?lock@streambuf@@QEAAXXZ */
303 DEFINE_THISCALL_WRAPPER(streambuf_lock
, 4)
304 void __thiscall
streambuf_lock(streambuf
*this)
306 TRACE("(%p)\n", this);
307 if (this->do_lock
< 0)
308 EnterCriticalSection(&this->lock
);
311 /* ?lockptr@streambuf@@IAEPAU_CRT_CRITICAL_SECTION@@XZ */
312 /* ?lockptr@streambuf@@IEAAPEAU_CRT_CRITICAL_SECTION@@XZ */
313 DEFINE_THISCALL_WRAPPER(streambuf_lockptr
, 4)
314 CRITICAL_SECTION
* __thiscall
streambuf_lockptr(streambuf
*this)
316 TRACE("(%p)\n", this);
320 /* ?gbump@streambuf@@IAEXH@Z */
321 /* ?gbump@streambuf@@IEAAXH@Z */
322 DEFINE_THISCALL_WRAPPER(streambuf_gbump
, 8)
323 void __thiscall
streambuf_gbump(streambuf
*this, int count
)
325 TRACE("(%p %d)\n", this, count
);
329 /* ?pbump@streambuf@@IAEXH@Z */
330 /* ?pbump@streambuf@@IEAAXH@Z */
331 DEFINE_THISCALL_WRAPPER(streambuf_pbump
, 8)
332 void __thiscall
streambuf_pbump(streambuf
*this, int count
)
334 TRACE("(%p %d)\n", this, count
);
338 /* ?in_avail@streambuf@@QBEHXZ */
339 /* ?in_avail@streambuf@@QEBAHXZ */
340 DEFINE_THISCALL_WRAPPER(streambuf_in_avail
, 4)
341 int __thiscall
streambuf_in_avail(const streambuf
*this)
343 TRACE("(%p)\n", this);
344 return this->egptr
- this->gptr
;
347 /* ?out_waiting@streambuf@@QBEHXZ */
348 /* ?out_waiting@streambuf@@QEBAHXZ */
349 DEFINE_THISCALL_WRAPPER(streambuf_out_waiting
, 4)
350 int __thiscall
streambuf_out_waiting(const streambuf
*this)
352 TRACE("(%p)\n", this);
353 return this->pptr
- this->pbase
;
357 DEFINE_THISCALL_WRAPPER(streambuf_overflow
, 8)
358 int __thiscall
streambuf_overflow(streambuf
*this, int c
)
363 /* ?pbackfail@streambuf@@UAEHH@Z */
364 /* ?pbackfail@streambuf@@UEAAHH@Z */
365 DEFINE_THISCALL_WRAPPER(streambuf_pbackfail
, 8)
366 int __thiscall
streambuf_pbackfail(streambuf
*this, int c
)
368 FIXME("(%p %d): stub\n", this, c
);
372 /* ?seekoff@streambuf@@UAEJJW4seek_dir@ios@@H@Z */
373 /* ?seekoff@streambuf@@UEAAJJW4seek_dir@ios@@H@Z */
374 DEFINE_THISCALL_WRAPPER(streambuf_seekoff
, 16)
375 #define call_streambuf_seekoff(this, off, dir, mode) CALL_VTBL_FUNC(this, 12, streampos, (streambuf*, streamoff, ios_seek_dir, int), (this, off, dir, mode))
376 streampos __thiscall
streambuf_seekoff(streambuf
*this, streamoff offset
, ios_seek_dir dir
, int mode
)
378 TRACE("(%p %d %d %d)\n", this, offset
, dir
, mode
);
382 /* ?seekpos@streambuf@@UAEJJH@Z */
383 /* ?seekpos@streambuf@@UEAAJJH@Z */
384 DEFINE_THISCALL_WRAPPER(streambuf_seekpos
, 12)
385 streampos __thiscall
streambuf_seekpos(streambuf
*this, streampos pos
, int mode
)
387 TRACE("(%p %d %d)\n", this, pos
, mode
);
388 return call_streambuf_seekoff(this, pos
, SEEKDIR_beg
, mode
);
391 /* ?setb@streambuf@@IAEXPAD0H@Z */
392 /* ?setb@streambuf@@IEAAXPEAD0H@Z */
393 DEFINE_THISCALL_WRAPPER(streambuf_setb
, 16)
394 void __thiscall
streambuf_setb(streambuf
*this, char *ba
, char *eb
, int delete)
396 TRACE("(%p %p %p %d)\n", this, ba
, eb
, delete);
398 MSVCRT_operator_delete(this->base
);
399 this->allocated
= delete;
404 /* ?setbuf@streambuf@@UAEPAV1@PADH@Z */
405 /* ?setbuf@streambuf@@UEAAPEAV1@PEADH@Z */
406 DEFINE_THISCALL_WRAPPER(streambuf_setbuf
, 12)
407 streambuf
* __thiscall
streambuf_setbuf(streambuf
*this, char *buffer
, int length
)
409 TRACE("(%p %p %d)\n", this, buffer
, length
);
410 if (this->base
!= NULL
)
413 if (buffer
== NULL
|| !length
) {
414 this->unbuffered
= 1;
415 this->base
= this->ebuf
= NULL
;
417 this->unbuffered
= 0;
419 this->ebuf
= buffer
+ length
;
424 /* ?setg@streambuf@@IAEXPAD00@Z */
425 /* ?setg@streambuf@@IEAAXPEAD00@Z */
426 DEFINE_THISCALL_WRAPPER(streambuf_setg
, 16)
427 void __thiscall
streambuf_setg(streambuf
*this, char *ek
, char *gp
, char *eg
)
429 TRACE("(%p %p %p %p)\n", this, ek
, gp
, eg
);
435 /* ?setlock@streambuf@@QAEXXZ */
436 /* ?setlock@streambuf@@QEAAXXZ */
437 DEFINE_THISCALL_WRAPPER(streambuf_setlock
, 4)
438 void __thiscall
streambuf_setlock(streambuf
*this)
440 TRACE("(%p)\n", this);
444 /* ?setp@streambuf@@IAEXPAD0@Z */
445 /* ?setp@streambuf@@IEAAXPEAD0@Z */
446 DEFINE_THISCALL_WRAPPER(streambuf_setp
, 12)
447 void __thiscall
streambuf_setp(streambuf
*this, char *pb
, char *ep
)
449 TRACE("(%p %p %p)\n", this, pb
, ep
);
450 this->pbase
= this->pptr
= pb
;
454 /* ?sync@streambuf@@UAEHXZ */
455 /* ?sync@streambuf@@UEAAHXZ */
456 DEFINE_THISCALL_WRAPPER(streambuf_sync
, 4)
457 int __thiscall
streambuf_sync(streambuf
*this)
459 TRACE("(%p)\n", this);
460 return (this->gptr
>= this->egptr
&& this->pbase
>= this->pptr
) ? 0 : EOF
;
463 /* ?unbuffered@streambuf@@IAEXH@Z */
464 /* ?unbuffered@streambuf@@IEAAXH@Z */
465 DEFINE_THISCALL_WRAPPER(streambuf_unbuffered_set
, 8)
466 void __thiscall
streambuf_unbuffered_set(streambuf
*this, int buf
)
468 TRACE("(%p %d)\n", this, buf
);
469 this->unbuffered
= buf
;
472 /* ?unbuffered@streambuf@@IBEHXZ */
473 /* ?unbuffered@streambuf@@IEBAHXZ */
474 DEFINE_THISCALL_WRAPPER(streambuf_unbuffered_get
, 4)
475 int __thiscall
streambuf_unbuffered_get(const streambuf
*this)
477 TRACE("(%p)\n", this);
478 return this->unbuffered
;
482 DEFINE_THISCALL_WRAPPER(streambuf_underflow
, 4)
483 #define call_streambuf_underflow(this) CALL_VTBL_FUNC(this, 32, int, (streambuf*), (this))
484 int __thiscall
streambuf_underflow(streambuf
*this)
489 /* ?unlock@streambuf@@QAEXXZ */
490 /* ?unlock@streambuf@@QEAAXXZ */
491 DEFINE_THISCALL_WRAPPER(streambuf_unlock
, 4)
492 void __thiscall
streambuf_unlock(streambuf
*this)
494 TRACE("(%p)\n", this);
495 if (this->do_lock
< 0)
496 LeaveCriticalSection(&this->lock
);
499 /* ?xsgetn@streambuf@@UAEHPADH@Z */
500 /* ?xsgetn@streambuf@@UEAAHPEADH@Z */
501 DEFINE_THISCALL_WRAPPER(streambuf_xsgetn
, 12)
502 int __thiscall
streambuf_xsgetn(streambuf
*this, char *buffer
, int count
)
504 FIXME("(%p %p %d): stub\n", this, buffer
, count
);
508 /* ?xsputn@streambuf@@UAEHPBDH@Z */
509 /* ?xsputn@streambuf@@UEAAHPEBDH@Z */
510 DEFINE_THISCALL_WRAPPER(streambuf_xsputn
, 12)
511 int __thiscall
streambuf_xsputn(streambuf
*this, const char *data
, int length
)
513 FIXME("(%p %p %d): stub\n", this, data
, length
);
517 /* ?sgetc@streambuf@@QAEHXZ */
518 /* ?sgetc@streambuf@@QEAAHXZ */
519 DEFINE_THISCALL_WRAPPER(streambuf_sgetc
, 4)
520 int __thiscall
streambuf_sgetc(streambuf
*this)
522 TRACE("(%p)\n", this);
523 if (this->unbuffered
) {
524 if (this->stored_char
== EOF
)
525 this->stored_char
= call_streambuf_underflow(this);
526 return this->stored_char
;
528 return call_streambuf_underflow(this);
531 /******************************************************************
532 * ??1ios@@UAE@XZ (MSVCRTI.@)
533 * class ios & __thiscall ios::-ios<<(void)
535 DEFINE_THISCALL_WRAPPER(MSVCIRT_ios_sl_void
,4)
536 void * __thiscall
MSVCIRT_ios_sl_void(class_ios
* _this
)
538 FIXME("(%p) stub\n", _this
);
542 /******************************************************************
543 * ??0ostrstream@@QAE@XZ (MSVCRTI.@)
544 * class ostream & __thiscall ostrstream::ostrstream<<(void)
546 DEFINE_THISCALL_WRAPPER(MSVCIRT_ostrstream_sl_void
,4)
547 void * __thiscall
MSVCIRT_ostrstream_sl_void(class_ostream
* _this
)
549 FIXME("(%p) stub\n", _this
);
553 /******************************************************************
554 * ??6ostream@@QAEAAV0@E@Z (MSVCRTI.@)
555 * class ostream & __thiscall ostream::operator<<(unsigned char)
557 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_uchar
,8)
558 void * __thiscall
MSVCIRT_operator_sl_uchar(class_ostream
* _this
, unsigned char ch
)
560 FIXME("(%p)->(%c) stub\n", _this
, ch
);
564 /******************************************************************
565 * ??6ostream@@QAEAAV0@H@Z (MSVCRTI.@)
566 * class ostream & __thiscall ostream::operator<<(int)
568 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_int
,8)
569 void * __thiscall
MSVCIRT_operator_sl_int(class_ostream
* _this
, int integer
)
571 FIXME("(%p)->(%d) stub\n", _this
, integer
);
575 /******************************************************************
576 * ??6ostream@@QAEAAV0@PBD@Z (MSVCRTI.@)
577 * class ostream & __thiscall ostream::operator<<(char const *)
579 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_pchar
,8)
580 void * __thiscall
MSVCIRT_operator_sl_pchar(class_ostream
* _this
, const char * string
)
582 FIXME("(%p)->(%s) stub\n", _this
, debugstr_a(string
));
586 /******************************************************************
587 * ??6ostream@@QAEAAV0@P6AAAV0@AAV0@@Z@Z (MSVCRTI.@)
588 * class ostream & __thiscall ostream::operator<<(class ostream & (__cdecl*)(class ostream &))
590 DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_callback
,8)
591 void * __thiscall
MSVCIRT_operator_sl_callback(class_ostream
* _this
, class_ostream
* (__cdecl
*func
)(class_ostream
*))
593 TRACE("%p, %p\n", _this
, func
);
597 /******************************************************************
598 * ?endl@@YAAAVostream@@AAV1@@Z (MSVCRTI.@)
599 * class ostream & __cdecl endl(class ostream &)
601 void * CDECL
MSVCIRT_endl(class_ostream
* _this
)
603 FIXME("(%p)->() stub\n", _this
);
607 /******************************************************************
608 * ?ends@@YAAAVostream@@AAV1@@Z (MSVCRTI.@)
609 * class ostream & __cdecl ends(class ostream &)
611 void * CDECL
MSVCIRT_ends(class_ostream
* _this
)
613 FIXME("(%p)->() stub\n", _this
);
617 /******************************************************************
618 * ?str@strstreambuf@@QAEPADXZ (MSVCRTI.@)
619 * class strstreambuf & __thiscall strstreambuf::str(class strstreambuf &)
621 DEFINE_THISCALL_WRAPPER(MSVCIRT_str_sl_void
,4)
622 char * __thiscall
MSVCIRT_str_sl_void(class_strstreambuf
* _this
)
624 FIXME("(%p)->() stub\n", _this
);
630 #define DEFINE_VTBL_WRAPPER(off) \
631 __ASM_GLOBAL_FUNC(vtbl_wrapper_ ## off, \
635 "movl 0(%ecx), %eax\n\t" \
636 "jmp *" #off "(%eax)\n\t")
638 DEFINE_VTBL_WRAPPER(0);
639 DEFINE_VTBL_WRAPPER(4);
640 DEFINE_VTBL_WRAPPER(8);
641 DEFINE_VTBL_WRAPPER(12);
642 DEFINE_VTBL_WRAPPER(16);
643 DEFINE_VTBL_WRAPPER(20);
644 DEFINE_VTBL_WRAPPER(24);
645 DEFINE_VTBL_WRAPPER(28);
646 DEFINE_VTBL_WRAPPER(32);
647 DEFINE_VTBL_WRAPPER(36);
648 DEFINE_VTBL_WRAPPER(40);
649 DEFINE_VTBL_WRAPPER(44);
650 DEFINE_VTBL_WRAPPER(48);
651 DEFINE_VTBL_WRAPPER(52);
652 DEFINE_VTBL_WRAPPER(56);
656 void* (__cdecl
*MSVCRT_operator_new
)(SIZE_T
);
657 void (__cdecl
*MSVCRT_operator_delete
)(void*);
659 static void init_cxx_funcs(void)
661 HMODULE hmod
= GetModuleHandleA("msvcrt.dll");
663 if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */
665 MSVCRT_operator_new
= (void*)GetProcAddress(hmod
, "??2@YAPEAX_K@Z");
666 MSVCRT_operator_delete
= (void*)GetProcAddress(hmod
, "??3@YAXPEAX@Z");
670 MSVCRT_operator_new
= (void*)GetProcAddress(hmod
, "??2@YAPAXI@Z");
671 MSVCRT_operator_delete
= (void*)GetProcAddress(hmod
, "??3@YAXPAX@Z");
675 static void init_io(void *base
)
678 init_streambuf_rtti(base
);
682 BOOL WINAPI
DllMain( HINSTANCE inst
, DWORD reason
, LPVOID reserved
)
686 case DLL_WINE_PREATTACH
:
687 return FALSE
; /* prefer native version */
688 case DLL_PROCESS_ATTACH
:
690 init_exception(inst
);
692 DisableThreadLibraryCalls( inst
);