msvcirt: Set error when file can't be opened in fstream_open_ctor.

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-09-17 12:44:15 +02:00 committed by Alexandre Julliard
parent da4dc79db9
commit 19342f43bb
1 changed files with 2 additions and 1 deletions

View File

@ -4627,13 +4627,14 @@ iostream* __thiscall fstream_open_ctor(iostream *this, const char *name, ios_ope
}
filebuf_ctor(fb);
filebuf_open(fb, name, mode, protection);
iostream_internal_sb_ctor(this, &fb->base, &MSVCP_fstream_vtable, virt_init);
base = istream_get_ios(&this->base1);
base->delbuf = 1;
if (!filebuf_open(fb, name, mode, protection))
base->state |= IOSTATE_failbit;
return this;
}