msvcrt: Move _fstat32 and _fstat64i32 functions to msvcrt.

This commit is contained in:
Piotr Caban 2013-04-30 14:29:59 +02:00 committed by Alexandre Julliard
parent ff7388ca3f
commit f99742a539
7 changed files with 66 additions and 38 deletions

View File

@ -78,8 +78,8 @@ typedef void (__cdecl *free_func_t)(void*);
extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int); extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
/********************************************************************* /*********************************************************************
* * stat64_to_stat32 [internal] * stat64_to_stat32 [internal]
* */ */
static void stat64_to_stat32(const struct _stat64 *buf64, struct _stat32 *buf) static void stat64_to_stat32(const struct _stat64 *buf64, struct _stat32 *buf)
{ {
buf->st_dev = buf64->st_dev; buf->st_dev = buf64->st_dev;
@ -209,20 +209,6 @@ void* CDECL _recalloc(void* mem, size_t num, size_t size)
return ret; return ret;
} }
/*********************************************************************
* _fstat32 (MSVCR100.@)
*/
int CDECL _fstat32(int fd, struct _stat32* buf)
{
int ret;
struct _stat64 buf64;
ret = _fstat64(fd, &buf64);
if (!ret)
stat64_to_stat32(&buf64, buf);
return ret;
}
/********************************************************************* /*********************************************************************
* _stat32 (MSVCR100.@) * _stat32 (MSVCR100.@)
*/ */
@ -309,20 +295,6 @@ static void stat64_to_stat64i32(const struct _stat64 *buf64, struct _stat64i32 *
buf->st_ctime = buf64->st_ctime; buf->st_ctime = buf64->st_ctime;
} }
/*********************************************************************
* _fstat64i32 (MSVCR100.@)
*/
int CDECL _fstat64i32(int fd, struct _stat64i32* buf)
{
int ret;
struct _stat64 buf64;
ret = _fstat64(fd, &buf64);
if (!ret)
stat64_to_stat64i32(&buf64, buf);
return ret;
}
/********************************************************************* /*********************************************************************
* _stat64i32 (MSVCR100.@) * _stat64i32 (MSVCR100.@)
*/ */

View File

@ -841,10 +841,10 @@
@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64
@ stub _fseeki64_nolock @ stub _fseeki64_nolock
@ cdecl _fsopen(str str long) msvcrt._fsopen @ cdecl _fsopen(str str long) msvcrt._fsopen
@ cdecl _fstat32(long ptr) @ cdecl _fstat32(long ptr) msvcrt._fstat32
@ stub _fstat32i64 @ stub _fstat32i64
@ cdecl _fstat64(long ptr) msvcrt._fstat64 @ cdecl _fstat64(long ptr) msvcrt._fstat64
@ cdecl _fstat64i32(long ptr) @ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32
@ stub _ftell_nolock @ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64
@ stub _ftelli64_nolock @ stub _ftelli64_nolock

View File

@ -1193,10 +1193,10 @@
@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64
@ stub _fseeki64_nolock @ stub _fseeki64_nolock
@ cdecl _fsopen(str str long) msvcrt._fsopen @ cdecl _fsopen(str str long) msvcrt._fsopen
@ cdecl _fstat32(long ptr) msvcr100._fstat32 @ cdecl _fstat32(long ptr) msvcrt._fstat32
@ stub _fstat32i64 @ stub _fstat32i64
@ cdecl _fstat64(long ptr) msvcrt._fstat64 @ cdecl _fstat64(long ptr) msvcrt._fstat64
@ cdecl _fstat64i32(long ptr) msvcr100._fstat64i32 @ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32
@ stub _ftell_nolock @ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64
@ stub _ftelli64_nolock @ stub _ftelli64_nolock

View File

@ -507,10 +507,10 @@
@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64
@ stub _fseeki64_nolock @ stub _fseeki64_nolock
@ cdecl _fsopen(str str long) msvcrt._fsopen @ cdecl _fsopen(str str long) msvcrt._fsopen
@ cdecl _fstat32(long ptr) msvcr100._fstat32 @ cdecl _fstat32(long ptr) msvcrt._fstat32
@ stub _fstat32i64 @ stub _fstat32i64
@ cdecl _fstat64(long ptr) msvcrt._fstat64 @ cdecl _fstat64(long ptr) msvcrt._fstat64
@ cdecl _fstat64i32(long ptr) msvcr100._fstat64i32 @ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32
@ stub _ftell_nolock @ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64
@ stub _ftelli64_nolock @ stub _ftelli64_nolock

View File

@ -489,10 +489,10 @@
@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64
@ stub _fseeki64_nolock @ stub _fseeki64_nolock
@ cdecl _fsopen(str str long) msvcrt._fsopen @ cdecl _fsopen(str str long) msvcrt._fsopen
@ cdecl _fstat32(long ptr) msvcr100._fstat32 @ cdecl _fstat32(long ptr) msvcrt._fstat32
@ stub _fstat32i64 @ stub _fstat32i64
@ cdecl _fstat64(long ptr) msvcrt._fstat64 @ cdecl _fstat64(long ptr) msvcrt._fstat64
@ cdecl _fstat64i32(long ptr) msvcr100._fstat64i32 @ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32
@ stub _ftell_nolock @ stub _ftell_nolock
@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64
@ stub _ftelli64_nolock @ stub _ftelli64_nolock

View File

@ -177,6 +177,36 @@ static void msvcrt_stat64_to_stati64(const struct MSVCRT__stat64 *buf64, struct
buf->st_ctime = buf64->st_ctime; buf->st_ctime = buf64->st_ctime;
} }
static void msvcrt_stat64_to_stat32(const struct MSVCRT__stat64 *buf64, struct MSVCRT__stat32 *buf)
{
buf->st_dev = buf64->st_dev;
buf->st_ino = buf64->st_ino;
buf->st_mode = buf64->st_mode;
buf->st_nlink = buf64->st_nlink;
buf->st_uid = buf64->st_uid;
buf->st_gid = buf64->st_gid;
buf->st_rdev = buf64->st_rdev;
buf->st_size = buf64->st_size;
buf->st_atime = buf64->st_atime;
buf->st_mtime = buf64->st_mtime;
buf->st_ctime = buf64->st_ctime;
}
static void msvcrt_stat64_to_stat64i32(const struct MSVCRT__stat64 *buf64, struct MSVCRT__stat64i32 *buf)
{
buf->st_dev = buf64->st_dev;
buf->st_ino = buf64->st_ino;
buf->st_mode = buf64->st_mode;
buf->st_nlink = buf64->st_nlink;
buf->st_uid = buf64->st_uid;
buf->st_gid = buf64->st_gid;
buf->st_rdev = buf64->st_rdev;
buf->st_size = buf64->st_size;
buf->st_atime = buf64->st_atime;
buf->st_mtime = buf64->st_mtime;
buf->st_ctime = buf64->st_ctime;
}
static void time_to_filetime( MSVCRT___time64_t time, FILETIME *ft ) static void time_to_filetime( MSVCRT___time64_t time, FILETIME *ft )
{ {
/* 1601 to 1970 is 369 years plus 89 leap days */ /* 1601 to 1970 is 369 years plus 89 leap days */
@ -1558,6 +1588,30 @@ int CDECL MSVCRT__fstat(int fd, struct MSVCRT__stat* buf)
return ret; return ret;
} }
/* _fstat32 - not exported in native msvcrt */
int CDECL _fstat32(int fd, struct MSVCRT__stat32* buf)
{
int ret;
struct MSVCRT__stat64 buf64;
ret = MSVCRT__fstat64(fd, &buf64);
if (!ret)
msvcrt_stat64_to_stat32(&buf64, buf);
return ret;
}
/* _fstat64i32 - not exported in native msvcrt */
int CDECL _fstat64i32(int fd, struct MSVCRT__stat64i32* buf)
{
int ret;
struct MSVCRT__stat64 buf64;
ret = MSVCRT__fstat64(fd, &buf64);
if (!ret)
msvcrt_stat64_to_stat64i32(&buf64, buf);
return ret;
}
/********************************************************************* /*********************************************************************
* _futime64 (MSVCRT.@) * _futime64 (MSVCRT.@)
*/ */

View File

@ -1532,3 +1532,5 @@
@ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output @ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output
@ cdecl _getptd() @ cdecl _getptd()
@ cdecl fread_s(ptr long long long ptr) @ cdecl fread_s(ptr long long long ptr)
@ cdecl _fstat32(long ptr)
@ cdecl _fstat64i32(long ptr)