[3/3] Add implementation of streambuf::sgetn/sputn

Iván Matellanes matellanesivan at gmail.com
Sat Jun 20 09:40:21 CDT 2015


---
 dlls/msvcirt/msvcirt.c      | 18 ++++++++++++++++++
 dlls/msvcirt/msvcirt.spec   |  8 ++++----
 dlls/msvcrt20/msvcrt20.spec |  8 ++++----
 dlls/msvcrt40/msvcrt40.spec |  8 ++++----
 4 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index e8faa54..35777e3 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -502,6 +502,7 @@ void __thiscall streambuf_unlock(streambuf *this)
 /* ?xsgetn at streambuf@@UAEHPADH at Z */
 /* ?xsgetn at streambuf@@UEAAHPEADH at Z */
 DEFINE_THISCALL_WRAPPER(streambuf_xsgetn, 12)
+#define call_streambuf_xsgetn(this, buffer, count) CALL_VTBL_FUNC(this, 24, int, (streambuf*, char*, int), (this, buffer, count))
 int __thiscall streambuf_xsgetn(streambuf *this, char *buffer, int count)
 {
     int copied = 0, chunk;
@@ -533,6 +534,7 @@ int __thiscall streambuf_xsgetn(streambuf *this, char *buffer, int count)
 /* ?xsputn at streambuf@@UAEHPBDH at Z */
 /* ?xsputn at streambuf@@UEAAHPEBDH at Z */
 DEFINE_THISCALL_WRAPPER(streambuf_xsputn, 12)
+#define call_streambuf_xsputn(this, data, length) CALL_VTBL_FUNC(this, 20, int, (streambuf*, const char*, int), (this, data, length))
 int __thiscall streambuf_xsputn(streambuf *this, const char *data, int length)
 {
     int copied = 0, chunk;
@@ -579,6 +581,22 @@ int __thiscall streambuf_sputc(streambuf *this, int ch)
     return (this->pptr < this->epptr) ? *this->pptr++ = ch : call_streambuf_overflow(this, ch);
 }
 
+/* ?sgetn at streambuf@@QAEHPADH at Z */
+/* ?sgetn at streambuf@@QEAAHPEADH at Z */
+DEFINE_THISCALL_WRAPPER(streambuf_sgetn, 12)
+int __thiscall streambuf_sgetn(streambuf *this, char *buffer, int count)
+{
+    return call_streambuf_xsgetn(this, buffer, count);
+}
+
+/* ?sputn at streambuf@@QAEHPBDH at Z */
+/* ?sputn at streambuf@@QEAAHPEBDH at Z */
+DEFINE_THISCALL_WRAPPER(streambuf_sputn, 12)
+int __thiscall streambuf_sputn(streambuf *this, const char *data, int length)
+{
+    return call_streambuf_xsputn(this, data, length);
+}
+
 /******************************************************************
  *		 ??1ios@@UAE at XZ (MSVCRTI.@)
  *        class ios & __thiscall ios::-ios<<(void)
diff --git a/dlls/msvcirt/msvcirt.spec b/dlls/msvcirt/msvcirt.spec
index 7d6df5f..2a65e2f 100644
--- a/dlls/msvcirt/msvcirt.spec
+++ b/dlls/msvcirt/msvcirt.spec
@@ -695,8 +695,8 @@
 @ stub -arch=win64 ?setrwbuf at stdiobuf@@QEAAHHH at Z
 @ thiscall -arch=win32 ?sgetc at streambuf@@QAEHXZ(ptr) streambuf_sgetc
 @ cdecl -arch=win64 ?sgetc at streambuf@@QEAAHXZ(ptr) streambuf_sgetc
-@ stub -arch=win32 ?sgetn at streambuf@@QAEHPADH at Z  # int __thiscall streambuf::sgetn(char *,int)
-@ stub -arch=win64 ?sgetn at streambuf@@QEAAHPEADH at Z
+@ thiscall -arch=win32 ?sgetn at streambuf@@QAEHPADH at Z(ptr ptr long) streambuf_sgetn
+@ cdecl -arch=win64 ?sgetn at streambuf@@QEAAHPEADH at Z(ptr ptr long) streambuf_sgetn
 # @ extern ?sh_none at filebuf@@2HB  # static int const filebuf::sh_none
 # @ extern ?sh_read at filebuf@@2HB  # static int const filebuf::sh_read
 # @ extern ?sh_write at filebuf@@2HB  # static int const filebuf::sh_write
@@ -706,8 +706,8 @@
 @ stub -arch=win64 ?sputbackc at streambuf@@QEAAHD at Z
 @ thiscall -arch=win32 ?sputc at streambuf@@QAEHH at Z(ptr long) streambuf_sputc
 @ cdecl -arch=win64 ?sputc at streambuf@@QEAAHH at Z(ptr long) streambuf_sputc
-@ stub -arch=win32 ?sputn at streambuf@@QAEHPBDH at Z  # int __thiscall streambuf::sputn(char const *,int)
-@ stub -arch=win64 ?sputn at streambuf@@QEAAHPEBDH at Z
+@ thiscall -arch=win32 ?sputn at streambuf@@QAEHPBDH at Z(ptr str long) streambuf_sputn
+@ cdecl -arch=win64 ?sputn at streambuf@@QEAAHPEBDH at Z(ptr str long) streambuf_sputn
 @ stub -arch=win32 ?stdiofile at stdiobuf@@QAEPAU_iobuf@@XZ  # struct _iobuf * __thiscall stdiobuf::stdiofile(void)
 @ stub -arch=win64 ?stdiofile at stdiobuf@@QEAAPEAU_iobuf@@XZ
 @ stub -arch=win32 ?stossc at streambuf@@QAEXXZ  # void __thiscall streambuf::stossc(void)
diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec
index 79f5902..1be499b 100644
--- a/dlls/msvcrt20/msvcrt20.spec
+++ b/dlls/msvcrt20/msvcrt20.spec
@@ -683,8 +683,8 @@
 @ stub -arch=win64 ?setrwbuf at stdiobuf@@QEAAHHH at Z
 @ thiscall -arch=win32 ?sgetc at streambuf@@QAEHXZ(ptr) msvcirt.?sgetc at streambuf@@QAEHXZ
 @ cdecl -arch=win64 ?sgetc at streambuf@@QEAAHXZ(ptr) msvcirt.?sgetc at streambuf@@QEAAHXZ
-@ stub -arch=win32 ?sgetn at streambuf@@QAEHPADH at Z
-@ stub -arch=win64 ?sgetn at streambuf@@QEAAHPEADH at Z
+@ thiscall -arch=win32 ?sgetn at streambuf@@QAEHPADH at Z(ptr ptr long) msvcirt.?sgetn at streambuf@@QAEHPADH at Z
+@ cdecl -arch=win64 ?sgetn at streambuf@@QEAAHPEADH at Z(ptr ptr long) msvcirt.?sgetn at streambuf@@QEAAHPEADH at Z
 # @ extern ?sh_none at filebuf@@2HB
 # @ extern ?sh_read at filebuf@@2HB
 # @ extern ?sh_write at filebuf@@2HB
@@ -694,8 +694,8 @@
 @ stub -arch=win64 ?sputbackc at streambuf@@QEAAHD at Z
 @ thiscall -arch=win32 ?sputc at streambuf@@QAEHH at Z(ptr long) msvcirt.?sputc at streambuf@@QAEHH at Z
 @ cdecl -arch=win64 ?sputc at streambuf@@QEAAHH at Z(ptr long) msvcirt.?sputc at streambuf@@QEAAHH at Z
-@ stub -arch=win32 ?sputn at streambuf@@QAEHPBDH at Z
-@ stub -arch=win64 ?sputn at streambuf@@QEAAHPEBDH at Z
+@ thiscall -arch=win32 ?sputn at streambuf@@QAEHPBDH at Z(ptr str long) msvcirt.?sputn at streambuf@@QAEHPBDH at Z
+@ cdecl -arch=win64 ?sputn at streambuf@@QEAAHPEBDH at Z(ptr str long) msvcirt.?sputn at streambuf@@QEAAHPEBDH at Z
 @ stub -arch=win32 ?stdiofile at stdiobuf@@QAEPAU_iobuf@@XZ
 @ stub -arch=win64 ?stdiofile at stdiobuf@@QEAAPEAU_iobuf@@XZ
 @ stub -arch=win32 ?stossc at streambuf@@QAEXXZ
diff --git a/dlls/msvcrt40/msvcrt40.spec b/dlls/msvcrt40/msvcrt40.spec
index 86d3985..94d9035 100644
--- a/dlls/msvcrt40/msvcrt40.spec
+++ b/dlls/msvcrt40/msvcrt40.spec
@@ -755,8 +755,8 @@
 @ stub -arch=win64 ?setrwbuf at stdiobuf@@QEAAHHH at Z
 @ thiscall -arch=win32 ?sgetc at streambuf@@QAEHXZ(ptr) msvcirt.?sgetc at streambuf@@QAEHXZ
 @ cdecl -arch=win64 ?sgetc at streambuf@@QEAAHXZ(ptr) msvcirt.?sgetc at streambuf@@QEAAHXZ
-@ stub -arch=win32 ?sgetn at streambuf@@QAEHPADH at Z
-@ stub -arch=win64 ?sgetn at streambuf@@QEAAHPEADH at Z
+@ thiscall -arch=win32 ?sgetn at streambuf@@QAEHPADH at Z(ptr ptr long) msvcirt.?sgetn at streambuf@@QAEHPADH at Z
+@ cdecl -arch=win64 ?sgetn at streambuf@@QEAAHPEADH at Z(ptr ptr long) msvcirt.?sgetn at streambuf@@QEAAHPEADH at Z
 # @ extern ?sh_none at filebuf@@2HB
 # @ extern ?sh_read at filebuf@@2HB
 # @ extern ?sh_write at filebuf@@2HB
@@ -766,8 +766,8 @@
 @ stub -arch=win64 ?sputbackc at streambuf@@QEAAHD at Z
 @ thiscall -arch=win32 ?sputc at streambuf@@QAEHH at Z(ptr long) msvcirt.?sputc at streambuf@@QAEHH at Z
 @ cdecl -arch=win64 ?sputc at streambuf@@QEAAHH at Z(ptr long) msvcirt.?sputc at streambuf@@QEAAHH at Z
-@ stub -arch=win32 ?sputn at streambuf@@QAEHPBDH at Z
-@ stub -arch=win64 ?sputn at streambuf@@QEAAHPEBDH at Z
+@ thiscall -arch=win32 ?sputn at streambuf@@QAEHPBDH at Z(ptr str long) msvcirt.?sputn at streambuf@@QAEHPBDH at Z
+@ cdecl -arch=win64 ?sputn at streambuf@@QEAAHPEBDH at Z(ptr str long) msvcirt.?sputn at streambuf@@QEAAHPEBDH at Z
 @ stub -arch=win32 ?stdiofile at stdiobuf@@QAEPAU_iobuf@@XZ
 @ stub -arch=win64 ?stdiofile at stdiobuf@@QEAAPEAU_iobuf@@XZ
 @ stub -arch=win32 ?stossc at streambuf@@QAEXXZ
-- 
2.1.4




More information about the wine-patches mailing list