Commit 60faef8e authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

msvcrt: Added _wfindfirst32 implementation.

parent 7de3f1b5
......@@ -1534,7 +1534,7 @@
@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp
@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe
@ cdecl _wfdopen(long wstr) msvcrt._wfdopen
@ stub _wfindfirst32
@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32
@ stub _wfindfirst32i64
@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
@ cdecl _wfindfirst64i32(wstr ptr) msvcrt._wfindfirst64i32
......
......@@ -1897,7 +1897,7 @@
@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp
@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe
@ cdecl _wfdopen(long wstr) msvcrt._wfdopen
@ stub _wfindfirst32
@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32
@ stub _wfindfirst32i64
@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
@ cdecl _wfindfirst64i32(wstr ptr) msvcrt._wfindfirst64i32
......
......@@ -1194,7 +1194,7 @@
@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp
@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe
@ cdecl _wfdopen(long wstr) msvcrt._wfdopen
@ stub _wfindfirst32
@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32
@ stub _wfindfirst32i64
@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
@ cdecl _wfindfirst64i32(wstr ptr) msvcrt._wfindfirst64i32
......
......@@ -1188,7 +1188,7 @@
@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp
@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe
@ cdecl _wfdopen(long wstr) msvcrt._wfdopen
@ stub _wfindfirst32
@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32
@ stub _wfindfirst32i64
@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64
@ cdecl _wfindfirst64i32(wstr ptr) msvcrt._wfindfirst64i32
......
......@@ -95,6 +95,26 @@ static void msvcrt_wfttofd( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfinddata
strcpyW(ft->name, fd->cFileName);
}
/* INTERNAL: Translate WIN32_FIND_DATAW to wfinddata32_t */
static void msvcrt_wfttofd32(const WIN32_FIND_DATAW *fd, struct MSVCRT__wfinddata32_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 = fd->nFileSizeLow;
strcpyW(ft->name, fd->cFileName);
}
/* INTERNAL: Translate WIN32_FIND_DATAA to finddatai64_t */
static void msvcrt_fttofdi64( const WIN32_FIND_DATAA *fd, struct MSVCRT__finddatai64_t* ft)
{
......@@ -385,6 +405,27 @@ MSVCRT_intptr_t CDECL MSVCRT__wfindfirst(const MSVCRT_wchar_t * fspec, struct MS
}
/*********************************************************************
* _wfindfirst32 (MSVCRT.@)
*
* Unicode version of _findfirst32.
*/
MSVCRT_intptr_t CDECL MSVCRT__wfindfirst32(const MSVCRT_wchar_t * fspec, struct MSVCRT__wfinddata32_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_wfttofd32(&find_data, ft);
TRACE(":got handle %p\n", hfind);
return (MSVCRT_intptr_t)hfind;
}
/*********************************************************************
* _findfirsti64 (MSVCRT.@)
*
* 64-bit version of _findfirst.
......
......@@ -1153,6 +1153,7 @@
@ cdecl _wexecvpe(wstr ptr ptr)
@ cdecl _wfdopen(long wstr) MSVCRT__wfdopen
@ cdecl _wfindfirst(wstr ptr) MSVCRT__wfindfirst
@ cdecl _wfindfirst32(wstr ptr) MSVCRT__wfindfirst32
@ cdecl _wfindfirst64(wstr ptr) MSVCRT__wfindfirst64
@ cdecl _wfindfirsti64(wstr ptr) MSVCRT__wfindfirsti64
@ cdecl _wfindfirst64i32(wstr ptr) MSVCRT__wfindfirst64i32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment