YongHao Hu : msvcp110: Add tr2_sys__Read_dir implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 21 15:10:32 CST 2015


Module: wine
Branch: master
Commit: 2ed5d0afc1e516c65a2f606ead009e666ffc29ff
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2ed5d0afc1e516c65a2f606ead009e666ffc29ff

Author: YongHao Hu <christopherwuy at gmail.com>
Date:   Mon Dec 21 12:15:34 2015 +0800

msvcp110: Add tr2_sys__Read_dir implementation.

Signed-off-by: YongHao Hu <christopherwuy at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcp110/msvcp110.spec         |  4 ++--
 dlls/msvcp120/msvcp120.spec         |  4 ++--
 dlls/msvcp120_app/msvcp120_app.spec |  4 ++--
 dlls/msvcp90/ios.c                  | 26 ++++++++++++++++++++++++++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec
index a77a5c8..9751854 100644
--- a/dlls/msvcp110/msvcp110.spec
+++ b/dlls/msvcp110/msvcp110.spec
@@ -1711,8 +1711,8 @@
 @ stub -arch=win32 ?_Raise_handler at std@@3P6AXABVexception at stdext@@@ZA
 @ stub -arch=win64 ?_Raise_handler at std@@3P6AXAEBVexception at stdext@@@ZEA
 @ cdecl ?_Random_device at std@@YAIXZ() _Random_device
-@ stub -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPADPADPAXAAW4file_type at 123@@Z
-@ stub -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEADPEADPEAXAEAW4file_type at 123@@Z
+@ cdecl -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPADPADPAXAAW4file_type at 123@@Z(ptr ptr ptr) tr2_sys__Read_dir
+@ cdecl -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEADPEADPEAXAEAW4file_type at 123@@Z(ptr ptr ptr) tr2_sys__Read_dir
 @ stub -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPA_WPA_WPAXAAW4file_type at 123@@Z
 @ stub -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEA_WPEA_WPEAXAEAW4file_type at 123@@Z
 @ stub -arch=arm ?_Release at _Pad@std@@QAAXXZ
diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec
index 4668129..4a136a2 100644
--- a/dlls/msvcp120/msvcp120.spec
+++ b/dlls/msvcp120/msvcp120.spec
@@ -1672,8 +1672,8 @@
 @ stub -arch=win32 ?_Raise_handler at std@@3P6AXABVexception at stdext@@@ZA
 @ stub -arch=win64 ?_Raise_handler at std@@3P6AXAEBVexception at stdext@@@ZEA
 @ cdecl ?_Random_device at std@@YAIXZ() _Random_device
-@ stub -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPADAAY0BAE at DPAXAAW4file_type@123@@Z
-@ stub -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEADAEAY0BAE at DPEAXAEAW4file_type@123@@Z
+@ cdecl -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPADAAY0BAE at DPAXAAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir
+@ cdecl -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEADAEAY0BAE at DPEAXAEAW4file_type@123@@Z(ptr ptr ptr) tr2_sys__Read_dir
 @ stub -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPA_WAAY0BAE at _WPAXAAW4file_type@123@@Z
 @ stub -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEA_WAEAY0BAE at _WPEAXAEAW4file_type@123@@Z
 @ stub -arch=arm ?_Release at _Pad@std@@QAAXXZ
diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec
index 9a1b6da..53f8b0b 100644
--- a/dlls/msvcp120_app/msvcp120_app.spec
+++ b/dlls/msvcp120_app/msvcp120_app.spec
@@ -1672,8 +1672,8 @@
 @ stub -arch=win32 ?_Raise_handler at std@@3P6AXABVexception at stdext@@@ZA
 @ stub -arch=win64 ?_Raise_handler at std@@3P6AXAEBVexception at stdext@@@ZEA
 @ cdecl ?_Random_device at std@@YAIXZ() msvcp120.?_Random_device at std@@YAIXZ
-@ stub -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPADAAY0BAE at DPAXAAW4file_type@123@@Z
-@ stub -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEADAEAY0BAE at DPEAXAEAW4file_type@123@@Z
+@ cdecl -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPADAAY0BAE at DPAXAAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir at sys@tr2 at std@@YAPADAAY0BAE at DPAXAAW4file_type@123@@Z
+@ cdecl -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEADAEAY0BAE at DPEAXAEAW4file_type@123@@Z(ptr ptr ptr) msvcp120.?_Read_dir at sys@tr2 at std@@YAPEADAEAY0BAE at DPEAXAEAW4file_type@123@@Z
 @ stub -arch=win32 ?_Read_dir at sys@tr2 at std@@YAPA_WAAY0BAE at _WPAXAAW4file_type@123@@Z
 @ stub -arch=win64 ?_Read_dir at sys@tr2 at std@@YAPEA_WAEAY0BAE at _WPEAXAEAW4file_type@123@@Z
 @ stub -arch=arm ?_Release at _Pad@std@@QAAXXZ
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 5242b53..f01cf6d 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -14478,6 +14478,32 @@ void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, e
     return handle;
 }
 
+/* ?_Read_dir at sys@tr2 at std@@YAPADAAY0BAE at DPAXAAW4file_type@123@@Z */
+/* ?_Read_dir at sys@tr2 at std@@YAPEADAEAY0BAE at DPEAXAEAW4file_type@123@@Z */
+char* __cdecl tr2_sys__Read_dir(char* target, void* handle, enum file_type* type)
+{
+    WIN32_FIND_DATAA data;
+    TRACE("(%p %p %p)\n", target, handle, type);
+    if(!FindNextFileA(handle, &data)) {
+        *type = status_unknown;
+        *target = '\0';
+        return target;
+    }
+    while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, "..")) {
+        if(!FindNextFileA(handle, &data)) {
+            *type = status_unknown;
+            return NULL;
+        }
+    }
+
+    strcpy(target, data.cFileName);
+    if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+        *type = directory_file;
+    else
+        *type = regular_file;
+    return target;
+}
+
 /* ??0strstream at std@@QAE at PADHH@Z */
 /* ??0strstream at std@@QEAA at PEAD_JH@Z */
 #if STREAMSIZE_BITS == 64




More information about the wine-cvs mailing list