diff --git a/dlls/msvcr100/msvcr100.c b/dlls/msvcr100/msvcr100.c index 4449310d5cb..149f132c816 100644 --- a/dlls/msvcr100/msvcr100.c +++ b/dlls/msvcr100/msvcr100.c @@ -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); /********************************************************************* - * * stat64_to_stat32 [internal] - * */ + * stat64_to_stat32 [internal] + */ static void stat64_to_stat32(const struct _stat64 *buf64, struct _stat32 *buf) { buf->st_dev = buf64->st_dev; @@ -209,20 +209,6 @@ void* CDECL _recalloc(void* mem, size_t num, size_t size) 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.@) */ @@ -309,20 +295,6 @@ static void stat64_to_stat64i32(const struct _stat64 *buf64, struct _stat64i32 * 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.@) */ diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index e60e0fb2b96..370feb250bf 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -841,10 +841,10 @@ @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ stub _fseeki64_nolock @ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) +@ cdecl _fstat32(long ptr) msvcrt._fstat32 @ stub _fstat32i64 @ cdecl _fstat64(long ptr) msvcrt._fstat64 -@ cdecl _fstat64i32(long ptr) +@ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32 @ stub _ftell_nolock @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ stub _ftelli64_nolock diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index 9f36dad7be6..12fc808c520 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -1193,10 +1193,10 @@ @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ stub _fseeki64_nolock @ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) msvcr100._fstat32 +@ cdecl _fstat32(long ptr) msvcrt._fstat32 @ stub _fstat32i64 @ cdecl _fstat64(long ptr) msvcrt._fstat64 -@ cdecl _fstat64i32(long ptr) msvcr100._fstat64i32 +@ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32 @ stub _ftell_nolock @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ stub _ftelli64_nolock diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index a8490e166ae..47bf34f7f2a 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -507,10 +507,10 @@ @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ stub _fseeki64_nolock @ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) msvcr100._fstat32 +@ cdecl _fstat32(long ptr) msvcrt._fstat32 @ stub _fstat32i64 @ cdecl _fstat64(long ptr) msvcrt._fstat64 -@ cdecl _fstat64i32(long ptr) msvcr100._fstat64i32 +@ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32 @ stub _ftell_nolock @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ stub _ftelli64_nolock diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 9783c2f5cd8..d76ab736b0c 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -489,10 +489,10 @@ @ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 @ stub _fseeki64_nolock @ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) msvcr100._fstat32 +@ cdecl _fstat32(long ptr) msvcrt._fstat32 @ stub _fstat32i64 @ cdecl _fstat64(long ptr) msvcrt._fstat64 -@ cdecl _fstat64i32(long ptr) msvcr100._fstat64i32 +@ cdecl _fstat64i32(long ptr) msvcrt._fstat64i32 @ stub _ftell_nolock @ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 @ stub _ftelli64_nolock diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index c8863b3ffc7..c0c71248041 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -177,6 +177,36 @@ static void msvcrt_stat64_to_stati64(const struct MSVCRT__stat64 *buf64, struct 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 ) { /* 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; } +/* _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.@) */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 43d3c45cfdf..55ebba994b6 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -1532,3 +1532,5 @@ @ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output @ cdecl _getptd() @ cdecl fread_s(ptr long long long ptr) +@ cdecl _fstat32(long ptr) +@ cdecl _fstat64i32(long ptr)