André Hentschel : msvcrt: Implement _wfindfirst64.

Alexandre Julliard julliard at winehq.org
Mon Feb 28 11:02:13 CST 2011


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sat Feb 26 19:49:21 2011 +0100

msvcrt: Implement _wfindfirst64.

---

 dlls/msvcr100/msvcr100.spec |    2 +-
 dlls/msvcr70/msvcr70.spec   |    2 +-
 dlls/msvcr71/msvcr71.spec   |    2 +-
 dlls/msvcr80/msvcr80.spec   |    2 +-
 dlls/msvcr90/msvcr90.spec   |    2 +-
 dlls/msvcrt/dir.c           |   41 +++++++++++++++++++++++++++++++++++++++++
 dlls/msvcrt/msvcrt.spec     |    2 +-
 7 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 13f4d19..54a8024 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -1340,7 +1340,7 @@
 @ cdecl _wfdopen(long wstr) msvcrt._wfdopen
 @ stub _wfindfirst32
 @ stub _wfindfirst32i64
-@ stub _wfindfirst64
+@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
 @ cdecl _wfindfirst64i32(wstr ptr) msvcrt._wfindfirst64i32
 @ stub _wfindnext32
 @ stub _wfindnext32i64
diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec
index c03b43d..e378340 100644
--- a/dlls/msvcr70/msvcr70.spec
+++ b/dlls/msvcr70/msvcr70.spec
@@ -622,7 +622,7 @@
 @ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe
 @ cdecl _wfdopen(long wstr) msvcrt._wfdopen
 @ cdecl _wfindfirst(wstr ptr) msvcrt._wfindfirst
-@ stub _wfindfirst64
+@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
 @ cdecl _wfindfirsti64(wstr ptr) msvcrt._wfindfirsti64
 @ cdecl _wfindnext(long ptr) msvcrt._wfindnext
 @ stub _wfindnext64
diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec
index 58597c3..ec8cddd 100644
--- a/dlls/msvcr71/msvcr71.spec
+++ b/dlls/msvcr71/msvcr71.spec
@@ -618,7 +618,7 @@
 @ varargs _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe
 @ cdecl _wfdopen(long wstr) msvcrt._wfdopen
 @ cdecl _wfindfirst(wstr ptr) msvcrt._wfindfirst
-@ stub _wfindfirst64
+@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
 @ cdecl _wfindfirsti64(wstr ptr) msvcrt._wfindfirsti64
 @ cdecl _wfindnext(long ptr) msvcrt._wfindnext
 @ stub _wfindnext64
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index aca11e7..e2b1bec 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -1193,7 +1193,7 @@
 @ cdecl _wfdopen(long wstr) msvcrt._wfdopen
 @ stub _wfindfirst32
 @ stub _wfindfirst32i64
-@ stub _wfindfirst64
+@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
 @ cdecl _wfindfirst64i32(wstr ptr) msvcrt._wfindfirst64i32
 @ stub _wfindnext32
 @ stub _wfindnext32i64
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index b269b87..576149d 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -1180,7 +1180,7 @@
 @ cdecl _wfdopen(long wstr) msvcrt._wfdopen
 @ stub _wfindfirst32
 @ stub _wfindfirst32i64
-@ stub _wfindfirst64
+@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
 @ cdecl _wfindfirst64i32(wstr ptr) msvcrt._wfindfirst64i32
 @ stub _wfindnext32
 @ stub _wfindnext32i64
diff --git a/dlls/msvcrt/dir.c b/dlls/msvcrt/dir.c
index 1e8fd8d..8fcff3d 100644
--- a/dlls/msvcrt/dir.c
+++ b/dlls/msvcrt/dir.c
@@ -116,6 +116,26 @@ static void msvcrt_fttofd64( const WIN32_FIND_DATAA *fd, struct MSVCRT__finddata
   strcpy(ft->name, fd->cFileName);
 }
 
+/* INTERNAL: Translate WIN32_FIND_DATAW to wfinddata64_t  */
+static void msvcrt_wfttofd64( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfinddata64_t* ft)
+{
+  DWORD dw;
+
+  if (fd->dwFileAttributes == FILE_ATTRIBUTE_NORMAL)
+    ft->attrib = 0;
+  else
+    ft->attrib = fd->dwFileAttributes;
+
+  RtlTimeToSecondsSince1970( (const LARGE_INTEGER *)&fd->ftCreationTime, &dw );
+  ft->time_create = dw;
+  RtlTimeToSecondsSince1970( (const LARGE_INTEGER *)&fd->ftLastAccessTime, &dw );
+  ft->time_access = dw;
+  RtlTimeToSecondsSince1970( (const LARGE_INTEGER *)&fd->ftLastWriteTime, &dw );
+  ft->time_write = dw;
+  ft->size = ((__int64)fd->nFileSizeHigh) << 32 | fd->nFileSizeLow;
+  strcpyW(ft->name, fd->cFileName);
+}
+
 /* INTERNAL: Translate WIN32_FIND_DATAA to finddata64i32_t  */
 static void msvcrt_fttofd64i32( const WIN32_FIND_DATAA *fd, struct MSVCRT__finddata64i32_t* ft)
 {
@@ -369,6 +389,27 @@ MSVCRT_intptr_t CDECL MSVCRT__findfirst64(const char * fspec, struct MSVCRT__fin
 }
 
 /*********************************************************************
+ *		_wfindfirst64 (MSVCRT.@)
+ *
+ * Unicode version of _findfirst64.
+ */
+MSVCRT_intptr_t CDECL MSVCRT__wfindfirst64(const MSVCRT_wchar_t * fspec, struct MSVCRT__wfinddata64_t* ft)
+{
+  WIN32_FIND_DATAW find_data;
+  HANDLE hfind;
+
+  hfind  = FindFirstFileW(fspec, &find_data);
+  if (hfind == INVALID_HANDLE_VALUE)
+  {
+    msvcrt_set_errno(GetLastError());
+    return -1;
+  }
+  msvcrt_wfttofd64(&find_data,ft);
+  TRACE(":got handle %p\n",hfind);
+  return (MSVCRT_intptr_t)hfind;
+}
+
+/*********************************************************************
  *		_findfirst64i32 (MSVCRT.@)
  *
  * 64-bit/32-bit version of _findfirst.
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index f1e3259..cc40817 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -1112,7 +1112,7 @@
 @ cdecl _wexecvpe(wstr ptr ptr)
 @ cdecl _wfdopen(long wstr) MSVCRT__wfdopen
 @ cdecl _wfindfirst(wstr ptr) MSVCRT__wfindfirst
-# stub _wfindfirst64
+@ cdecl _wfindfirst64(wstr ptr) MSVCRT__wfindfirst64
 @ cdecl _wfindfirsti64(wstr ptr) MSVCRT__wfindfirsti64
 @ cdecl _wfindfirst64i32(wstr ptr) MSVCRT__wfindfirst64i32
 @ cdecl _wfindnext(long ptr) MSVCRT__wfindnext




More information about the wine-cvs mailing list