From d9746e3ed72bf6d6ea072fd7f1258e909b81360f Mon Sep 17 00:00:00 2001 From: Robert Wilhelm Date: Wed, 26 May 2010 10:34:51 +0200 Subject: [PATCH] msvcrt90: Add fstat64i32. --- dlls/msvcr90/msvcr90.c | 31 +++++++++++++++++++++++++++++++ dlls/msvcr90/msvcr90.spec | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/msvcr90/msvcr90.c b/dlls/msvcr90/msvcr90.c index eaf9d669e09..3372e0b5a84 100644 --- a/dlls/msvcr90/msvcr90.c +++ b/dlls/msvcr90/msvcr90.c @@ -26,6 +26,7 @@ #include "windef.h" #include "winbase.h" #include "wine/debug.h" +#include "sys/stat.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcr90); @@ -158,3 +159,33 @@ void* CDECL _recalloc(void* mem, size_t num, size_t size) memset((BYTE*)mem+old_size, 0, size-old_size); return ret; } + +/********************************************************************* + * _fstat64i32 (MSVCRT.@) + */ + +static void msvcrt_stat64_to_stat64i32(const struct _stat64 *buf64, struct _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; +} + +int CDECL _fstat64i32(int fd, struct _stat64i32* buf) +{ + int ret; + struct _stat64 buf64; + + ret = _fstat64(fd, &buf64); + if (!ret) + msvcrt_stat64_to_stat64i32(&buf64, buf); + return ret; +} diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index be4a6753f46..f350d18e73b 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -433,7 +433,7 @@ @ stub _fstat32 @ stub _fstat32i64 @ cdecl _fstat64(long ptr) msvcrt._fstat64 -@ stub _fstat64i32 +@ cdecl _fstat64i32(long ptr) @ stub _ftell_nolock @ stub _ftelli64 @ stub _ftelli64_nolock