[2/3] msvcirt: Add implementation of streambuf::seekoff/seekpos

Iván Matellanes matellanesivan at gmail.com
Tue Jun 9 12:40:40 CDT 2015


---
 dlls/msvcirt/msvcirt.c | 9 +++++----
 dlls/msvcirt/msvcirt.h | 6 ++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c
index e20fb68..7a31699 100644
--- a/dlls/msvcirt/msvcirt.c
+++ b/dlls/msvcirt/msvcirt.c
@@ -354,9 +354,10 @@ int __thiscall streambuf_pbackfail(streambuf *this, int c)
 /* ?seekoff at streambuf@@UAEJJW4seek_dir at ios@@H at Z */
 /* ?seekoff at streambuf@@UEAAJJW4seek_dir at ios@@H at Z */
 DEFINE_THISCALL_WRAPPER(streambuf_seekoff, 16)
-streampos __thiscall streambuf_seekoff(streambuf *this, streamoff offset, int dir, int mode)
+#define call_streambuf_seekoff(this, off, dir, mode) CALL_VTBL_FUNC(this, 12, streampos, (streambuf*, streamoff, ios_seek_dir, int), (this, off, dir, mode))
+streampos __thiscall streambuf_seekoff(streambuf *this, streamoff offset, ios_seek_dir dir, int mode)
 {
-    FIXME("(%p %d %d %d): stub\n", this, offset, dir, mode);
+    TRACE("(%p %d %d %d)\n", this, offset, dir, mode);
     return EOF;
 }
 
@@ -365,8 +366,8 @@ streampos __thiscall streambuf_seekoff(streambuf *this, streamoff offset, int di
 DEFINE_THISCALL_WRAPPER(streambuf_seekpos, 12)
 streampos __thiscall streambuf_seekpos(streambuf *this, streampos pos, int mode)
 {
-    FIXME("(%p %d %d): stub\n", this, pos, mode);
-    return EOF;
+    TRACE("(%p %d %d)\n", this, pos, mode);
+    return call_streambuf_seekoff(this, pos, SEEKDIR_beg, mode);
 }
 
 /* ?setb at streambuf@@IAEXPAD0H at Z */
diff --git a/dlls/msvcirt/msvcirt.h b/dlls/msvcirt/msvcirt.h
index 5cf15de..4751e8c 100644
--- a/dlls/msvcirt/msvcirt.h
+++ b/dlls/msvcirt/msvcirt.h
@@ -23,6 +23,12 @@
 typedef LONG streamoff;
 typedef LONG streampos;
 
+typedef enum {
+    SEEKDIR_beg = 0,
+    SEEKDIR_cur = 1,
+    SEEKDIR_end = 2
+} ios_seek_dir;
+
 extern void* (__cdecl *MSVCRT_operator_new)(SIZE_T);
 extern void (__cdecl *MSVCRT_operator_delete)(void*);
 
-- 
2.1.4




More information about the wine-patches mailing list