[PATCH v2] msvcirt: Implement ifstream.

Gijs Vermeulen gijsvrm at gmail.com
Tue Sep 1 11:17:09 CDT 2020


Op di 1 sep. 2020 om 17:54 schreef Piotr Caban <piotr at codeweavers.com>:

> > +/* ??0ifstream@@QAE at HPADH@Z */
> > +/* ??0ifstream@@QEAA at HPEADH@Z */
> > +DEFINE_THISCALL_WRAPPER(ifstream_buffer_ctor, 20)
> > +istream* __thiscall ifstream_buffer_ctor(istream *this, filedesc fd,
> char *buffer, int length, BOOL virt_init)
> > +{
> > +    ios *base;
> > +    filebuf *fb = MSVCRT_operator_new(sizeof(filebuf));
> > +
> > +    TRACE("(%p %d %p %d %d)\n", this, fd, buffer, length, virt_init);
> > +
> > +    if (fb)
> > +    {
> > +        filebuf_fd_reserve_ctor(fb, fd, buffer, length);
> > +        istream_sb_ctor(this, &fb->base, virt_init);
> > +    }
> > +    else
> > +        istream_ctor(this, virt_init);
> The allocation failure handling looks quite strange. It's probably
> better to remove it so the application crashes instead of misbehaving.


It's been a while, but if I remember correctly, I did it this way because
stdiostream and strstream and probably others do the same.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200901/3a864776/attachment.htm>


More information about the wine-devel mailing list