mirror of
https://github.com/reactos/wine.git
synced 2025-02-27 00:08:18 +00:00
msvcrt: Add _findfirst32() implementation.
This commit is contained in:
parent
78dc7af9ce
commit
cd7f096210
@ -617,7 +617,7 @@
|
|||||||
@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64
|
@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64
|
||||||
@ cdecl _fileno(ptr) msvcrt._fileno
|
@ cdecl _fileno(ptr) msvcrt._fileno
|
||||||
@ cdecl _findclose(long) msvcrt._findclose
|
@ cdecl _findclose(long) msvcrt._findclose
|
||||||
@ stub _findfirst32
|
@ cdecl _findfirst32(str ptr) msvcrt._findfirst32
|
||||||
@ stub _findfirst32i64
|
@ stub _findfirst32i64
|
||||||
@ cdecl _findfirst64(str ptr) msvcrt._findfirst64
|
@ cdecl _findfirst64(str ptr) msvcrt._findfirst64
|
||||||
@ cdecl _findfirst64i32(str ptr) msvcrt._findfirst64i32
|
@ cdecl _findfirst64i32(str ptr) msvcrt._findfirst64i32
|
||||||
|
@ -458,7 +458,7 @@
|
|||||||
@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64
|
@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64
|
||||||
@ cdecl _fileno(ptr) msvcrt._fileno
|
@ cdecl _fileno(ptr) msvcrt._fileno
|
||||||
@ cdecl _findclose(long) msvcrt._findclose
|
@ cdecl _findclose(long) msvcrt._findclose
|
||||||
@ stub _findfirst32
|
@ cdecl _findfirst32(str ptr) msvcrt._findfirst32
|
||||||
@ stub _findfirst32i64
|
@ stub _findfirst32i64
|
||||||
@ cdecl _findfirst64(str ptr) msvcrt._findfirst64
|
@ cdecl _findfirst64(str ptr) msvcrt._findfirst64
|
||||||
@ cdecl _findfirst64i32(str ptr) msvcrt._findfirst64i32
|
@ cdecl _findfirst64i32(str ptr) msvcrt._findfirst64i32
|
||||||
|
@ -450,7 +450,7 @@
|
|||||||
@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64
|
@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64
|
||||||
@ cdecl _fileno(ptr) msvcrt._fileno
|
@ cdecl _fileno(ptr) msvcrt._fileno
|
||||||
@ cdecl _findclose(long) msvcrt._findclose
|
@ cdecl _findclose(long) msvcrt._findclose
|
||||||
@ stub _findfirst32
|
@ cdecl _findfirst32(str ptr) msvcrt._findfirst32
|
||||||
@ stub _findfirst32i64
|
@ stub _findfirst32i64
|
||||||
@ cdecl _findfirst64(str ptr) msvcrt._findfirst64
|
@ cdecl _findfirst64(str ptr) msvcrt._findfirst64
|
||||||
@ cdecl _findfirst64i32(str ptr) msvcrt._findfirst64i32
|
@ cdecl _findfirst64i32(str ptr) msvcrt._findfirst64i32
|
||||||
|
@ -56,6 +56,26 @@ static void msvcrt_fttofd( const WIN32_FIND_DATAA *fd, struct MSVCRT__finddata_t
|
|||||||
strcpy(ft->name, fd->cFileName);
|
strcpy(ft->name, fd->cFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* INTERNAL: Translate WIN32_FIND_DATAA to finddata32_t */
|
||||||
|
static void msvcrt_fttofd32( const WIN32_FIND_DATAA *fd, struct MSVCRT__finddata32_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;
|
||||||
|
strcpy(ft->name, fd->cFileName);
|
||||||
|
}
|
||||||
|
|
||||||
/* INTERNAL: Translate WIN32_FIND_DATAW to wfinddata_t */
|
/* INTERNAL: Translate WIN32_FIND_DATAW to wfinddata_t */
|
||||||
static void msvcrt_wfttofd( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfinddata_t* ft)
|
static void msvcrt_wfttofd( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfinddata_t* ft)
|
||||||
{
|
{
|
||||||
@ -325,6 +345,25 @@ MSVCRT_intptr_t CDECL MSVCRT__findfirst(const char * fspec, struct MSVCRT__findd
|
|||||||
return (MSVCRT_intptr_t)hfind;
|
return (MSVCRT_intptr_t)hfind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _findfirst32 (MSVCRT.@)
|
||||||
|
*/
|
||||||
|
MSVCRT_intptr_t CDECL MSVCRT__findfirst32(const char * fspec, struct MSVCRT__finddata32_t* ft)
|
||||||
|
{
|
||||||
|
WIN32_FIND_DATAA find_data;
|
||||||
|
HANDLE hfind;
|
||||||
|
|
||||||
|
hfind = FindFirstFileA(fspec, &find_data);
|
||||||
|
if (hfind == INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
|
msvcrt_set_errno(GetLastError());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
msvcrt_fttofd32(&find_data, ft);
|
||||||
|
TRACE(":got handle %p\n", hfind);
|
||||||
|
return (MSVCRT_intptr_t)hfind;
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _wfindfirst (MSVCRT.@)
|
* _wfindfirst (MSVCRT.@)
|
||||||
*
|
*
|
||||||
|
@ -411,6 +411,7 @@
|
|||||||
@ cdecl _fileno(ptr) MSVCRT__fileno
|
@ cdecl _fileno(ptr) MSVCRT__fileno
|
||||||
@ cdecl _findclose(long) MSVCRT__findclose
|
@ cdecl _findclose(long) MSVCRT__findclose
|
||||||
@ cdecl _findfirst(str ptr) MSVCRT__findfirst
|
@ cdecl _findfirst(str ptr) MSVCRT__findfirst
|
||||||
|
@ cdecl _findfirst32(str ptr) MSVCRT__findfirst32
|
||||||
@ cdecl _findfirst64(str ptr) MSVCRT__findfirst64
|
@ cdecl _findfirst64(str ptr) MSVCRT__findfirst64
|
||||||
@ cdecl _findfirst64i32(str ptr) MSVCRT__findfirst64i32
|
@ cdecl _findfirst64i32(str ptr) MSVCRT__findfirst64i32
|
||||||
@ cdecl _findfirsti64(str ptr) MSVCRT__findfirsti64
|
@ cdecl _findfirsti64(str ptr) MSVCRT__findfirsti64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user