From ad7fa2396e1903040bbb5be166d09604018ad924 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Fri, 4 Sep 2020 12:42:40 +0300 Subject: [PATCH] msvcirt: Implement ifstream::setbuf(). Signed-off-by: Arkadiusz Hiler Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcirt/msvcirt.c | 18 +++++ dlls/msvcirt/msvcirt.spec | 4 +- dlls/msvcirt/tests/msvcirt.c | 130 +++++++++++++++++++++++++++++++++++ dlls/msvcrt20/msvcrt20.spec | 4 +- dlls/msvcrt40/msvcrt40.spec | 4 +- 5 files changed, 154 insertions(+), 6 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 744d8bc943a..1d7fb838f63 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -4276,6 +4276,24 @@ void __thiscall ifstream_open(istream *this, const char *name, ios_open_mode mod ios_clear(base, base->state | IOSTATE_failbit); } +/* ?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z */ +/* ?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z */ +DEFINE_THISCALL_WRAPPER(ifstream_setbuf, 12) +streambuf* __thiscall ifstream_setbuf(istream *this, char *buffer, int length) +{ + ios *base = istream_get_ios(this); + filebuf* fb = ifstream_rdbuf(this); + + TRACE("(%p %p %d)\n", this, buffer, length); + + if (filebuf_is_open(fb)) { + ios_clear(base, base->state | IOSTATE_failbit); + return NULL; + } + + return filebuf_setbuf(fb, buffer, length); +} + /* ?setmode@ifstream@@QAEHH@Z */ /* ?setmode@ifstream@@QEAAHH@Z */ DEFINE_THISCALL_WRAPPER(ifstream_setmode, 8) diff --git a/dlls/msvcirt/msvcirt.spec b/dlls/msvcirt/msvcirt.spec index 75ae312b486..c2b4b9d30eb 100644 --- a/dlls/msvcirt/msvcirt.spec +++ b/dlls/msvcirt/msvcirt.spec @@ -663,8 +663,8 @@ @ cdecl -arch=win64 ?setbuf@filebuf@@UEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) filebuf_setbuf @ stub -arch=win32 ?setbuf@fstream@@QAEPAVstreambuf@@PADH@Z # class streambuf * __thiscall fstream::setbuf(char *,int) @ stub -arch=win64 ?setbuf@fstream@@QEAAPEAVstreambuf@@PEADH@Z -@ stub -arch=win32 ?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z # class streambuf * __thiscall ifstream::setbuf(char *,int) -@ stub -arch=win64 ?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z +@ thiscall -arch=win32 ?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z(ptr ptr long) ifstream_setbuf +@ cdecl -arch=win64 ?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) ifstream_setbuf @ stub -arch=win32 ?setbuf@ofstream@@QAEPAVstreambuf@@PADH@Z # class streambuf * __thiscall ofstream::setbuf(char *,int) @ stub -arch=win64 ?setbuf@ofstream@@QEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setbuf@streambuf@@UAEPAV1@PADH@Z(ptr ptr long) streambuf_setbuf diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index 48f1514483b..e1a62967835 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -418,6 +418,7 @@ static filedesc (*__thiscall p_ifstream_fd)(istream*); static int (*__thiscall p_ifstream_is_open)(const istream*); static void (*__thiscall p_ifstream_open)(istream*, const char*, ios_open_mode, int); static filebuf* (*__thiscall p_ifstream_rdbuf)(const istream*); +static streambuf* (*__thiscall p_ifstream_setbuf)(istream*, char*, int); static int (*__thiscall p_ifstream_setmode)(istream*, int); /* strstream */ @@ -733,6 +734,7 @@ static BOOL init(void) SET(p_ifstream_is_open, "?is_open@ifstream@@QEBAHXZ"); SET(p_ifstream_open, "?open@ifstream@@QEAAXPEBDHH@Z"); SET(p_ifstream_rdbuf, "?rdbuf@ifstream@@QEBAPEAVfilebuf@@XZ"); + SET(p_ifstream_setbuf, "?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z"); SET(p_ifstream_setmode, "?setmode@ifstream@@QEAAHH@Z"); SET(p_strstream_copy_ctor, "??0strstream@@QEAA@AEBV0@@Z"); @@ -962,6 +964,7 @@ static BOOL init(void) SET(p_ifstream_is_open, "?is_open@ifstream@@QBEHXZ"); SET(p_ifstream_open, "?open@ifstream@@QAEXPBDHH@Z"); SET(p_ifstream_rdbuf, "?rdbuf@ifstream@@QBEPAVfilebuf@@XZ"); + SET(p_ifstream_setbuf, "?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z"); SET(p_ifstream_setmode, "?setmode@ifstream@@QAEHH@Z"); SET(p_strstream_copy_ctor, "??0strstream@@QAE@ABV0@@Z"); @@ -6831,6 +6834,7 @@ static void test_ifstream(void) { const char *filename = "ifstream_test"; istream ifs, ifs_copy, *pifs; + streambuf *psb; filebuf *pfb; char buffer[64]; char st[8]; @@ -6926,6 +6930,132 @@ static void test_ifstream(void) call_func1(p_ifstream_vbase_dtor, &ifs); ok(_close(fd) == -1, "expected ifstream to close opened file\n"); + /* setbuf */ + call_func5(p_ifstream_buffer_ctor, &ifs, -1, NULL, 0, TRUE); + ok(ifs.base_ios.sb->base == NULL, "wrong base value, expected NULL got %p\n", ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == NULL, "wrong ebuf value, expected NULL got %p\n", ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", pfb->base.unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + + psb = call_func3(p_ifstream_setbuf, &ifs, buffer, ARRAY_SIZE(buffer)); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer, "wrong buffer, expected %p got %p\n", buffer, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + + psb = call_func3(p_ifstream_setbuf, &ifs, NULL, 0); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer, "wrong buffer, expected %p got %p\n", buffer, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + call_func1(p_ifstream_vbase_dtor, &ifs); + + call_func2(p_ifstream_ctor, &ifs, TRUE); + ok(ifs.base_ios.sb->base == NULL, "wrong base value, expected NULL got %p\n", ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == NULL, "wrong ebuf value, expected NULL got %p\n", ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + + psb = call_func3(p_ifstream_setbuf, &ifs, buffer, ARRAY_SIZE(buffer)); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer, "wrong buffer, expected %p got %p\n", buffer, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + + psb = call_func3(p_ifstream_setbuf, &ifs, NULL, 0); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer, "wrong buffer, expected %p got %p\n", buffer, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + + psb = call_func3(p_ifstream_setbuf, &ifs, buffer + 8, ARRAY_SIZE(buffer) - 8); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer + 8, "wrong buffer, expected %p got %p\n", buffer + 8, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + + psb = call_func3(p_ifstream_setbuf, &ifs, buffer + 8, 0); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer + 8, "wrong buffer, expected %p got %p\n", buffer + 8, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + + psb = call_func3(p_ifstream_setbuf, &ifs, buffer + 4, ARRAY_SIZE(buffer) - 4); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer + 4, "wrong buffer, expected %p got %p\n", buffer + 4, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + + psb = call_func3(p_ifstream_setbuf, &ifs, NULL, 5); + ok(psb == ifs.base_ios.sb, "wrong return, expected %p got %p\n", ifs.base_ios.sb, psb); + ok(ifs.base_ios.sb->base == buffer + 4, "wrong buffer, expected %p got %p\n", buffer + 4, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == buffer + ARRAY_SIZE(buffer), "wrong ebuf, expected %p got %p\n", buffer + ARRAY_SIZE(buffer), ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == IOSTATE_goodbit, "expected %d got %d\n", IOSTATE_goodbit, ifs.base_ios.state); + call_func1(p_ifstream_vbase_dtor, &ifs); + + /* setbuf - seems to be a nop and always return NULL in those other cases */ + pifs = call_func5(p_ifstream_buffer_ctor, &ifs, 42, NULL, 0, TRUE); + ok(ifs.base_ios.sb->base == NULL, "wrong base value, expected NULL got %p\n", ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == NULL, "wrong ebuf value, expected NULL got %p\n", ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + + ifs.base_ios.state = IOSTATE_eofbit; + psb = call_func3(p_ifstream_setbuf, &ifs, buffer, ARRAY_SIZE(buffer)); + ok(psb == NULL, "wrong return, expected NULL got %p\n", psb); + ok(ifs.base_ios.sb->base == NULL, "wrong base value, expected NULL got %p\n", ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == NULL, "wrong ebuf value, expected NULL got %p\n", ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == (IOSTATE_eofbit | IOSTATE_failbit), "attaching on already setup stream did not set failbit\n"); + + ifs.base_ios.state = IOSTATE_eofbit; + psb = call_func3(p_ifstream_setbuf, &ifs, NULL, 0); + ok(psb == NULL, "wrong return, expected NULL got %p\n", psb); + ok(ifs.base_ios.sb->base == NULL, "wrong base value, expected NULL got %p\n", ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf == NULL, "wrong ebuf value, expected NULL got %p\n", ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 1, "wrong unbuffered value, expected 1 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 0, "wrong allocated value, expected 0 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == (IOSTATE_eofbit | IOSTATE_failbit), "attaching on already setup stream did not set failbit\n"); + call_func1(p_ifstream_vbase_dtor, &ifs); + + pifs = call_func5(p_ifstream_open_ctor, &ifs, filename, OPENMODE_in, filebuf_openprot, TRUE); + ifs.base_ios.state = IOSTATE_eofbit; + psb = call_func3(p_ifstream_setbuf, &ifs, NULL, 0); + ok(psb == NULL, "wrong return, expected NULL got %p\n", psb); + ok(ifs.base_ios.sb->base != NULL, "wrong base value, expected NULL got %p\n", ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->ebuf != NULL, "wrong ebuf value, expected NULL got %p\n", ifs.base_ios.sb->ebuf); + ok(ifs.base_ios.sb->unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 1, "wrong allocated value, expected 1 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == (IOSTATE_eofbit | IOSTATE_failbit), "attaching on already setup stream did not set failbit\n"); + + ifs.base_ios.state = IOSTATE_eofbit; + psb = call_func3(p_ifstream_setbuf, &ifs, buffer, ARRAY_SIZE(buffer)); + ok(psb == NULL, "wrong return, expected NULL got %p\n", psb); + ok(ifs.base_ios.sb->base != NULL, "wrong base value, expected NULL got %p\n", ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->base != buffer, "wrong base value, expected not %p got %p\n", buffer, ifs.base_ios.sb->base); + ok(ifs.base_ios.sb->unbuffered == 0, "wrong unbuffered value, expected 0 got %d\n", ifs.base_ios.sb->unbuffered); + ok(ifs.base_ios.sb->allocated == 1, "wrong allocated value, expected 1 got %d\n", ifs.base_ios.sb->allocated); + ok(ifs.base_ios.state == (IOSTATE_eofbit | IOSTATE_failbit), "attaching on already setup stream did not set failbit\n"); + call_func1(p_ifstream_vbase_dtor, &ifs); + /* attach */ pifs = call_func2(p_ifstream_ctor, &ifs, TRUE); pfb = (filebuf*) ifs.base_ios.sb; diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec index 96c6c681478..2ce72c6b13c 100644 --- a/dlls/msvcrt20/msvcrt20.spec +++ b/dlls/msvcrt20/msvcrt20.spec @@ -651,8 +651,8 @@ @ cdecl -arch=win64 ?setbuf@filebuf@@UEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) msvcirt.?setbuf@filebuf@@UEAAPEAVstreambuf@@PEADH@Z @ stub -arch=win32 ?setbuf@fstream@@QAEPAVstreambuf@@PADH@Z @ stub -arch=win64 ?setbuf@fstream@@QEAAPEAVstreambuf@@PEADH@Z -@ stub -arch=win32 ?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z -@ stub -arch=win64 ?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z +@ thiscall -arch=win32 ?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z(ptr ptr long) msvcirt.?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z +@ cdecl -arch=win64 ?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) msvcirt.?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z @ stub -arch=win32 ?setbuf@ofstream@@QAEPAVstreambuf@@PADH@Z @ stub -arch=win64 ?setbuf@ofstream@@QEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setbuf@streambuf@@UAEPAV1@PADH@Z(ptr ptr long) msvcirt.?setbuf@streambuf@@UAEPAV1@PADH@Z diff --git a/dlls/msvcrt40/msvcrt40.spec b/dlls/msvcrt40/msvcrt40.spec index 6a2c9a7e52e..efa3e3251d6 100644 --- a/dlls/msvcrt40/msvcrt40.spec +++ b/dlls/msvcrt40/msvcrt40.spec @@ -723,8 +723,8 @@ @ cdecl -arch=win64 ?setbuf@filebuf@@UEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) msvcirt.?setbuf@filebuf@@UEAAPEAVstreambuf@@PEADH@Z @ stub -arch=win32 ?setbuf@fstream@@QAEPAVstreambuf@@PADH@Z @ stub -arch=win64 ?setbuf@fstream@@QEAAPEAVstreambuf@@PEADH@Z -@ stub -arch=win32 ?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z -@ stub -arch=win64 ?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z +@ thiscall -arch=win32 ?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z(ptr ptr long) msvcirt.?setbuf@ifstream@@QAEPAVstreambuf@@PADH@Z +@ cdecl -arch=win64 ?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z(ptr ptr long) msvcirt.?setbuf@ifstream@@QEAAPEAVstreambuf@@PEADH@Z @ stub -arch=win32 ?setbuf@ofstream@@QAEPAVstreambuf@@PADH@Z @ stub -arch=win64 ?setbuf@ofstream@@QEAAPEAVstreambuf@@PEADH@Z @ thiscall -arch=win32 ?setbuf@streambuf@@UAEPAV1@PADH@Z(ptr ptr long) msvcirt.?setbuf@streambuf@@UAEPAV1@PADH@Z