Commit a3150b95 authored by Iván Matellanes's avatar Iván Matellanes Committed by Alexandre Julliard

msvcirt: Add implementation of streambuf::gbump/pbump.

parent 70b447d0
......@@ -317,6 +317,24 @@ CRITICAL_SECTION* __thiscall streambuf_lockptr(streambuf *this)
return &this->lock;
}
/* ?gbump@streambuf@@IAEXH@Z */
/* ?gbump@streambuf@@IEAAXH@Z */
DEFINE_THISCALL_WRAPPER(streambuf_gbump, 8)
void __thiscall streambuf_gbump(streambuf *this, int count)
{
TRACE("(%p %d)\n", this, count);
this->gptr += count;
}
/* ?pbump@streambuf@@IAEXH@Z */
/* ?pbump@streambuf@@IEAAXH@Z */
DEFINE_THISCALL_WRAPPER(streambuf_pbump, 8)
void __thiscall streambuf_pbump(streambuf *this, int count)
{
TRACE("(%p %d)\n", this, count);
this->pptr += count;
}
/* Unexported */
DEFINE_THISCALL_WRAPPER(streambuf_overflow, 8)
int __thiscall streambuf_overflow(streambuf *this, int c)
......
......@@ -491,8 +491,8 @@
@ stub -arch=win64 ?flush@ostream@@QEAAAEAV1@XZ
@ stub -arch=win32 ?freeze@strstreambuf@@QAEXH@Z # void __thiscall strstreambuf::freeze(int)
@ stub -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z
@ stub -arch=win32 ?gbump@streambuf@@IAEXH@Z # void __thiscall streambuf::gbump(int)
@ stub -arch=win64 ?gbump@streambuf@@IEAAXH@Z
@ thiscall -arch=win32 ?gbump@streambuf@@IAEXH@Z(ptr long) streambuf_gbump
@ cdecl -arch=win64 ?gbump@streambuf@@IEAAXH@Z(ptr long) streambuf_gbump
@ stub -arch=win32 ?gcount@istream@@QBEHXZ # int __thiscall istream::gcount(void)const
@ stub -arch=win64 ?gcount@istream@@QEBAHXZ
@ stub -arch=win32 ?get@istream@@IAEAAV1@PADHH@Z # class istream & __thiscall istream::get(char *,int,int)
......@@ -589,8 +589,8 @@
@ cdecl -arch=win64 ?pbackfail@streambuf@@UEAAHH@Z(ptr long) streambuf_pbackfail
@ thiscall -arch=win32 ?pbase@streambuf@@IBEPADXZ(ptr) streambuf_pbase
@ cdecl -arch=win64 ?pbase@streambuf@@IEBAPEADXZ(ptr) streambuf_pbase
@ stub -arch=win32 ?pbump@streambuf@@IAEXH@Z # void __thiscall streambuf::pbump(int)
@ stub -arch=win64 ?pbump@streambuf@@IEAAXH@Z
@ thiscall -arch=win32 ?pbump@streambuf@@IAEXH@Z(ptr long) streambuf_pbump
@ cdecl -arch=win64 ?pbump@streambuf@@IEAAXH@Z(ptr long) streambuf_pbump
@ stub -arch=win32 ?pcount@ostrstream@@QBEHXZ # int __thiscall ostrstream::pcount(void)const
@ stub -arch=win64 ?pcount@ostrstream@@QEBAHXZ
@ stub -arch=win32 ?pcount@strstream@@QBEHXZ # int __thiscall strstream::pcount(void)const
......
......@@ -55,7 +55,9 @@ static void (*__thiscall p_streambuf_dtor)(streambuf*);
static int (*__thiscall p_streambuf_allocate)(streambuf*);
static void (*__thiscall p_streambuf_clrclock)(streambuf*);
static int (*__thiscall p_streambuf_doallocate)(streambuf*);
static void (*__thiscall p_streambuf_gbump)(streambuf*, int);
static void (*__thiscall p_streambuf_lock)(streambuf*);
static void (*__thiscall p_streambuf_pbump)(streambuf*, int);
static void (*__thiscall p_streambuf_setb)(streambuf*, char*, char*, int);
static void (*__thiscall p_streambuf_setlock)(streambuf*);
static streambuf* (*__thiscall p_streambuf_setbuf)(streambuf*, char*, int);
......@@ -136,7 +138,9 @@ static BOOL init(void)
SET(p_streambuf_allocate, "?allocate@streambuf@@IEAAHXZ");
SET(p_streambuf_clrclock, "?clrlock@streambuf@@QEAAXXZ");
SET(p_streambuf_doallocate, "?doallocate@streambuf@@MEAAHXZ");
SET(p_streambuf_gbump, "?gbump@streambuf@@IEAAXH@Z");
SET(p_streambuf_lock, "?lock@streambuf@@QEAAXXZ");
SET(p_streambuf_pbump, "?pbump@streambuf@@IEAAXH@Z");
SET(p_streambuf_setb, "?setb@streambuf@@IEAAXPEAD0H@Z");
SET(p_streambuf_setbuf, "?setbuf@streambuf@@UEAAPEAV1@PEADH@Z");
SET(p_streambuf_setlock, "?setlock@streambuf@@QEAAXXZ");
......@@ -148,7 +152,9 @@ static BOOL init(void)
SET(p_streambuf_allocate, "?allocate@streambuf@@IAEHXZ");
SET(p_streambuf_clrclock, "?clrlock@streambuf@@QAEXXZ");
SET(p_streambuf_doallocate, "?doallocate@streambuf@@MAEHXZ");
SET(p_streambuf_gbump, "?gbump@streambuf@@IAEXH@Z");
SET(p_streambuf_lock, "?lock@streambuf@@QAEXXZ");
SET(p_streambuf_pbump, "?pbump@streambuf@@IAEXH@Z");
SET(p_streambuf_setb, "?setb@streambuf@@IAEXPAD0H@Z");
SET(p_streambuf_setbuf, "?setbuf@streambuf@@UAEPAV1@PADH@Z");
SET(p_streambuf_setlock, "?setlock@streambuf@@QAEXXZ");
......@@ -318,6 +324,23 @@ static void test_streambuf(void)
ok(sb2.allocated == 1, "wrong allocate value, expected 1 got %d\n", sb2.allocated);
ok(sb2.ebuf - sb2.base == 512 , "wrong reserve area size, expected 512 got %p-%p\n", sb2.ebuf, sb2.base);
/* gbump */
sb.eback = sb.base + 100;
sb.gptr = sb.base + 104;
sb.egptr = sb.base + 110;
call_func2(p_streambuf_gbump, &sb, 10);
ok(sb.gptr == sb.eback + 14, "advance get pointer failed, expected %p got %p\n", sb.eback + 14, sb.gptr);
call_func2(p_streambuf_gbump, &sb, -15);
ok(sb.gptr == sb.eback - 1, "advance get pointer failed, expected %p got %p\n", sb.eback - 1, sb.gptr);
/* pbump */
sb.pbase = sb.pptr = sb.base + 200;
sb.epptr = sb.base + 210;
call_func2(p_streambuf_pbump, &sb, -2);
ok(sb.pptr == sb.pbase - 2, "advance put pointer failed, expected %p got %p\n", sb.pbase - 2, sb.pptr);
call_func2(p_streambuf_pbump, &sb, 20);
ok(sb.pptr == sb.pbase + 18, "advance put pointer failed, expected %p got %p\n", sb.pbase + 18, sb.pptr);
SetEvent(lock_arg.test[3]);
WaitForSingleObject(thread, INFINITE);
......
......@@ -479,8 +479,8 @@
@ stub -arch=win64 ?flush@ostream@@QEAAAEAV1@XZ
@ stub -arch=win32 ?freeze@strstreambuf@@QAEXH@Z
@ stub -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z
@ stub -arch=win32 ?gbump@streambuf@@IAEXH@Z
@ stub -arch=win64 ?gbump@streambuf@@IEAAXH@Z
@ thiscall -arch=win32 ?gbump@streambuf@@IAEXH@Z(ptr long) msvcirt.?gbump@streambuf@@IAEXH@Z
@ cdecl -arch=win64 ?gbump@streambuf@@IEAAXH@Z(ptr long) msvcirt.?gbump@streambuf@@IEAAXH@Z
@ stub -arch=win32 ?gcount@istream@@QBEHXZ
@ stub -arch=win64 ?gcount@istream@@QEBAHXZ
@ stub -arch=win32 ?get@istream@@QAEAAV1@AAC@Z
......@@ -575,8 +575,8 @@
@ cdecl -arch=win64 ?pbackfail@streambuf@@UEAAHH@Z(ptr long) msvcirt.?pbackfail@streambuf@@UEAAHH@Z
@ thiscall -arch=win32 ?pbase@streambuf@@IBEPADXZ(ptr) msvcirt.?pbase@streambuf@@IBEPADXZ
@ cdecl -arch=win64 ?pbase@streambuf@@IEBAPEADXZ(ptr) msvcirt.?pbase@streambuf@@IEBAPEADXZ
@ stub -arch=win32 ?pbump@streambuf@@IAEXH@Z
@ stub -arch=win64 ?pbump@streambuf@@IEAAXH@Z
@ thiscall -arch=win32 ?pbump@streambuf@@IAEXH@Z(ptr long) msvcirt.?pbump@streambuf@@IAEXH@Z
@ cdecl -arch=win64 ?pbump@streambuf@@IEAAXH@Z(ptr long) msvcirt.?pbump@streambuf@@IEAAXH@Z
@ stub -arch=win32 ?pcount@ostrstream@@QBEHXZ
@ stub -arch=win64 ?pcount@ostrstream@@QEBAHXZ
@ stub -arch=win32 ?pcount@strstream@@QBEHXZ
......
......@@ -544,8 +544,8 @@
@ stub -arch=win64 ?flush@ostream@@QEAAAEAV1@XZ
@ stub -arch=win32 ?freeze@strstreambuf@@QAEXH@Z
@ stub -arch=win64 ?freeze@strstreambuf@@QEAAXH@Z
@ stub -arch=win32 ?gbump@streambuf@@IAEXH@Z
@ stub -arch=win64 ?gbump@streambuf@@IEAAXH@Z
@ thiscall -arch=win32 ?gbump@streambuf@@IAEXH@Z(ptr long) msvcirt.?gbump@streambuf@@IAEXH@Z
@ cdecl -arch=win64 ?gbump@streambuf@@IEAAXH@Z(ptr long) msvcirt.?gbump@streambuf@@IEAAXH@Z
@ stub -arch=win32 ?gcount@istream@@QBEHXZ
@ stub -arch=win64 ?gcount@istream@@QEBAHXZ
@ stub -arch=win32 ?get@istream@@IAEAAV1@PADHH@Z
......@@ -644,8 +644,8 @@
@ cdecl -arch=win64 ?pbackfail@streambuf@@UEAAHH@Z(ptr long) msvcirt.?pbackfail@streambuf@@UEAAHH@Z
@ thiscall -arch=win32 ?pbase@streambuf@@IBEPADXZ(ptr) msvcirt.?pbase@streambuf@@IBEPADXZ
@ cdecl -arch=win64 ?pbase@streambuf@@IEBAPEADXZ(ptr) msvcirt.?pbase@streambuf@@IEBAPEADXZ
@ stub -arch=win32 ?pbump@streambuf@@IAEXH@Z
@ stub -arch=win64 ?pbump@streambuf@@IEAAXH@Z
@ thiscall -arch=win32 ?pbump@streambuf@@IAEXH@Z(ptr long) msvcirt.?pbump@streambuf@@IAEXH@Z
@ cdecl -arch=win64 ?pbump@streambuf@@IEAAXH@Z(ptr long) msvcirt.?pbump@streambuf@@IEAAXH@Z
@ stub -arch=win32 ?pcount@ostrstream@@QBEHXZ
@ stub -arch=win64 ?pcount@ostrstream@@QEBAHXZ
@ stub -arch=win32 ?pcount@strstream@@QBEHXZ
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment