YongHao Hu : msvcp110: Add tr2_sys__Open_dir implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 2 09:47:14 CST 2015


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

Author: YongHao Hu <christopherwuy at gmail.com>
Date:   Sat Oct 31 17:28:46 2015 +0800

msvcp110: Add tr2_sys__Open_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                  | 39 +++++++++++++++++++++++++++++++++++++
 4 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec
index a739dd4..dab4cd2 100644
--- a/dlls/msvcp110/msvcp110.spec
+++ b/dlls/msvcp110/msvcp110.spec
@@ -1641,8 +1641,8 @@
 @ cdecl -arch=win64 ?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at AEBV123@@Z(ptr) locale__Locimp__New_Locimp
 @ cdecl -arch=win32 ?_New_Locimp at _Locimp@locale at std@@CAPAV123 at _N@Z(long) locale__Locimp__New_Locimp_transparent
 @ cdecl -arch=win64 ?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at _N@Z(long) locale__Locimp__New_Locimp_transparent
-@ stub -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXPADPBDAAHAAW4file_type at 123@@Z
-@ stub -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXPEADPEBDAEAHAEAW4file_type at 123@@Z
+@ cdecl -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXPADPBDAAHAAW4file_type at 123@@Z(ptr str long long) tr2_sys__Open_dir
+@ cdecl -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at DPEBDAEAHAEAW4file_type@123@@Z(ptr str long long) tr2_sys__Open_dir
 @ stub -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXPA_WPB_WAAHAAW4file_type at 123@@Z
 @ stub -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXPEA_WPEB_WAEAHAEAW4file_type at 123@@Z
 @ cdecl -arch=arm ?_Orphan_all at _Container_base0@std@@QAAXXZ(ptr) Container_base0_Orphan_all
diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec
index e24268d..4448764 100644
--- a/dlls/msvcp120/msvcp120.spec
+++ b/dlls/msvcp120/msvcp120.spec
@@ -1602,8 +1602,8 @@
 @ cdecl -arch=win64 ?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at AEBV123@@Z(ptr) locale__Locimp__New_Locimp
 @ cdecl -arch=win32 ?_New_Locimp at _Locimp@locale at std@@CAPAV123 at _N@Z(long) locale__Locimp__New_Locimp_transparent
 @ cdecl -arch=win64 ?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at _N@Z(long) locale__Locimp__New_Locimp_transparent
-@ stub -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at DPBDAAHAAW4file_type@123@@Z
-@ stub -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at DPEBDAEAHAEAW4file_type@123@@Z
+@ cdecl -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at DPBDAAHAAW4file_type@123@@Z(ptr str long long) tr2_sys__Open_dir
+@ cdecl -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at DPEBDAEAHAEAW4file_type@123@@Z(ptr str long long) tr2_sys__Open_dir
 @ stub -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at _WPB_WAAHAAW4file_type@123@@Z
 @ stub -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at _WPEB_WAEAHAEAW4file_type@123@@Z
 @ cdecl -arch=arm ?_Orphan_all at _Container_base0@std@@QAAXXZ(ptr) Container_base0_Orphan_all
diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec
index d0debd1..7217a46 100644
--- a/dlls/msvcp120_app/msvcp120_app.spec
+++ b/dlls/msvcp120_app/msvcp120_app.spec
@@ -1602,8 +1602,8 @@
 @ cdecl -arch=win64 ?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at AEBV123@@Z(ptr) msvcp120.?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at AEBV123@@Z
 @ cdecl -arch=win32 ?_New_Locimp at _Locimp@locale at std@@CAPAV123 at _N@Z(long) msvcp120.?_New_Locimp at _Locimp@locale at std@@CAPAV123 at _N@Z
 @ cdecl -arch=win64 ?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at _N@Z(long) msvcp120.?_New_Locimp at _Locimp@locale at std@@CAPEAV123 at _N@Z
-@ stub -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at DPBDAAHAAW4file_type@123@@Z
-@ stub -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at DPEBDAEAHAEAW4file_type@123@@Z
+@ cdecl -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at DPBDAAHAAW4file_type@123@@Z(ptr str long long) msvcp120.?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at DPBDAAHAAW4file_type@123@@Z
+@ cdecl -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at DPEBDAEAHAEAW4file_type@123@@Z(ptr str long long) msvcp120.?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at DPEBDAEAHAEAW4file_type@123@@Z
 @ stub -arch=win32 ?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at _WPB_WAAHAAW4file_type@123@@Z
 @ stub -arch=win64 ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at _WPEB_WAEAHAEAW4file_type@123@@Z
 @ cdecl -arch=arm ?_Orphan_all at _Container_base0@std@@QAAXXZ(ptr) msvcp120.?_Orphan_all at _Container_base0@std@@QAAXXZ
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c
index 4005290..5242b53 100644
--- a/dlls/msvcp90/ios.c
+++ b/dlls/msvcp90/ios.c
@@ -14439,6 +14439,45 @@ void __cdecl tr2_sys__Last_write_time_set(char const* path, __int64 newtime)
     CloseHandle(handle);
 }
 
+/* ?_Open_dir at sys@tr2 at std@@YAPAXAAY0BAE at DPBDAAHAAW4file_type@123@@Z */
+/* ?_Open_dir at sys@tr2 at std@@YAPEAXAEAY0BAE at DPEBDAEAHAEAW4file_type@123@@Z */
+void* __cdecl tr2_sys__Open_dir(char* target, char const* dest, int* err_code, enum file_type* type)
+{
+    HANDLE handle;
+    WIN32_FIND_DATAA data;
+    char temppath[MAX_PATH];
+
+    TRACE("(%p %s %p %p)\n", target, debugstr_a(dest), err_code, type);
+    if(strlen(dest) > MAX_PATH - 3) {
+        *err_code = ERROR_BAD_PATHNAME;
+        return NULL;
+    }
+    strcpy(temppath, dest);
+    strcat(temppath, "\\*");
+
+    handle = FindFirstFileA(temppath, &data);
+    if(handle == INVALID_HANDLE_VALUE) {
+        *err_code = GetLastError();
+        return NULL;
+    }
+    while(!strcmp(data.cFileName, ".") || !strcmp(data.cFileName, "..")) {
+        if(!FindNextFileA(handle, &data)) {
+            *err_code = ERROR_SUCCESS;
+            *type = status_unknown;
+            FindClose(handle);
+            return NULL;
+        }
+    }
+
+    strcpy(target, data.cFileName);
+    *err_code = ERROR_SUCCESS;
+    if(data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+        *type = directory_file;
+    else
+        *type = regular_file;
+    return handle;
+}
+
 /* ??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