msvcrt: Implement findfirst64 and findnext64.
This commit is contained in:
parent
5cafb7c917
commit
debd7d36d0
@ -96,6 +96,27 @@ static void msvcrt_fttofdi64( const WIN32_FIND_DATAA *fd, struct MSVCRT__finddat
|
|||||||
strcpy(ft->name, fd->cFileName);
|
strcpy(ft->name, fd->cFileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* INTERNAL: Translate WIN32_FIND_DATAA to finddata64_t */
|
||||||
|
static void msvcrt_fttofd64( const WIN32_FIND_DATAA *fd, struct MSVCRT__finddata64_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;
|
||||||
|
strcpy(ft->name, fd->cFileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* INTERNAL: Translate WIN32_FIND_DATAW to wfinddatai64_t */
|
/* INTERNAL: Translate WIN32_FIND_DATAW to wfinddatai64_t */
|
||||||
static void msvcrt_wfttofdi64( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfinddatai64_t* ft)
|
static void msvcrt_wfttofdi64( const WIN32_FIND_DATAW *fd, struct MSVCRT__wfinddatai64_t* ft)
|
||||||
{
|
{
|
||||||
@ -287,6 +308,27 @@ MSVCRT_intptr_t CDECL MSVCRT__findfirsti64(const char * fspec, struct MSVCRT__fi
|
|||||||
return (MSVCRT_intptr_t)hfind;
|
return (MSVCRT_intptr_t)hfind;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _findfirst64 (MSVCRT.@)
|
||||||
|
*
|
||||||
|
* 64-bit version of _findfirst.
|
||||||
|
*/
|
||||||
|
MSVCRT_intptr_t CDECL MSVCRT__findfirst64(const char * fspec, struct MSVCRT__finddata64_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_fttofd64(&find_data,ft);
|
||||||
|
TRACE(":got handle %p\n",hfind);
|
||||||
|
return (MSVCRT_intptr_t)hfind;
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _wfindfirsti64 (MSVCRT.@)
|
* _wfindfirsti64 (MSVCRT.@)
|
||||||
*
|
*
|
||||||
@ -376,6 +418,25 @@ int CDECL MSVCRT__findnexti64(MSVCRT_intptr_t hand, struct MSVCRT__finddatai64_t
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*********************************************************************
|
||||||
|
* _findnext64 (MSVCRT.@)
|
||||||
|
*
|
||||||
|
* 64-bit version of _findnext.
|
||||||
|
*/
|
||||||
|
int CDECL MSVCRT__findnext64(long hand, struct MSVCRT__finddata64_t * ft)
|
||||||
|
{
|
||||||
|
WIN32_FIND_DATAA find_data;
|
||||||
|
|
||||||
|
if (!FindNextFileA((HANDLE)hand, &find_data))
|
||||||
|
{
|
||||||
|
*MSVCRT__errno() = MSVCRT_ENOENT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
msvcrt_fttofd64(&find_data,ft);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _wfindnexti64 (MSVCRT.@)
|
* _wfindnexti64 (MSVCRT.@)
|
||||||
*
|
*
|
||||||
|
@ -373,10 +373,10 @@
|
|||||||
@ 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
|
||||||
# stub _findfirst64
|
@ cdecl _findfirst64(str ptr) MSVCRT__findfirst64
|
||||||
@ cdecl _findfirsti64(str ptr) MSVCRT__findfirsti64
|
@ cdecl _findfirsti64(str ptr) MSVCRT__findfirsti64
|
||||||
@ cdecl _findnext(long ptr) MSVCRT__findnext
|
@ cdecl _findnext(long ptr) MSVCRT__findnext
|
||||||
# stub _findnext64
|
@ cdecl _findnext64(long ptr) MSVCRT__findnext64
|
||||||
@ cdecl _findnexti64(long ptr) MSVCRT__findnexti64
|
@ cdecl _findnexti64(long ptr) MSVCRT__findnexti64
|
||||||
@ cdecl _finite( double )
|
@ cdecl _finite( double )
|
||||||
@ cdecl _flsbuf(long ptr) MSVCRT__flsbuf
|
@ cdecl _flsbuf(long ptr) MSVCRT__flsbuf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user