[4/4] msvcirt: Implement filebuf::setbuf

Iván Matellanes matellanesivan at gmail.com
Thu Aug 6 11:10:14 CDT 2015


Hi,

On 06/08/15 11:20, Piotr Caban wrote:
> On 08/05/15 20:32, Iván Matellanes wrote:
>> @@ -1000,8 +1000,14 @@ streampos __thiscall filebuf_seekoff(filebuf *this, streamoff offset, ios_seek_d
>>   DEFINE_THISCALL_WRAPPER(filebuf_setbuf, 12)
>>   streambuf* __thiscall filebuf_setbuf(filebuf *this, char *buffer, int length)
>>   {
>> -    FIXME("(%p %p %d) stub\n", this, buffer, length);
>> -    return NULL;
>> +    streambuf *ret;
>> +
>> +    TRACE("(%p %p %d)\n", this, buffer, length);
>> +
>> +    streambuf_lock(&this->base);
>> +    ret = streambuf_setbuf(&this->base, buffer, length);
>> +    streambuf_unlock(&this->base);
>> +    return ret;
>>   }
> It doesn't look correct if buffer was already set. Probably the function needs to sync previous buffer or return error in this case.
According to my testing, there isn't any call to sync involved. I'll try to write a simple test case for the next try.

Thanks,
Iván



More information about the wine-devel mailing list