msvcrt: Added _wfindfirst32 implementation.

This commit is contained in:
Jactry Zeng 2013-04-19 19:18:48 +08:00 committed by Alexandre Julliard
parent 7de3f1b5b5
commit 60faef8e3c
6 changed files with 46 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)
{
@ -384,6 +404,27 @@ MSVCRT_intptr_t CDECL MSVCRT__wfindfirst(const MSVCRT_wchar_t * fspec, struct MS
return (MSVCRT_intptr_t)hfind;
}
/*********************************************************************
* _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.@)
*

View File

@ -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