msvcr90: Implement _stat32, _fstat32, _wstat32.

This commit is contained in:
Detlef Riekenberg 2011-01-23 17:46:30 +01:00 committed by Alexandre Julliard
parent 1b767a5948
commit 6e610f1e1a
6 changed files with 101 additions and 9 deletions

View File

@ -651,7 +651,7 @@
@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64
@ stub _fseeki64_nolock
@ cdecl _fsopen(str str long) msvcrt._fsopen
@ stub _fstat32
@ cdecl _fstat32(long ptr) msvcr90._fstat32
@ stub _fstat32i64
@ cdecl _fstat64(long ptr) msvcrt._fstat64
@ cdecl _fstat64i32(long ptr) msvcr90._fstat64i32
@ -1123,7 +1123,7 @@
@ stub _sprintf_s_l
@ varargs _sscanf_l(str str ptr) msvcrt._sscanf_l
@ varargs _sscanf_s_l(str str ptr) msvcrt._sscanf_s_l
@ stub _stat32
@ cdecl _stat32(str ptr) msvcr90._stat32
@ stub _stat32i64
@ cdecl _stat64(str ptr) msvcrt._stat64
@ cdecl _stat64i32(str ptr) msvcr90._stat64i32
@ -1393,7 +1393,7 @@
@ cdecl _wspawnvpe(long wstr ptr ptr) msvcrt._wspawnvpe
@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) msvcrt._wsplitpath
@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) msvcrt._wsplitpath_s
@ stub _wstat32
@ cdecl _wstat32(wstr ptr) msvcr90._wstat32
@ stub _wstat32i64
@ cdecl _wstat64(wstr ptr) msvcrt._wstat64
@ cdecl _wstat64i32(wstr ptr) msvcr90._wstat64i32

View File

@ -492,7 +492,7 @@
@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64
@ stub _fseeki64_nolock
@ cdecl _fsopen(str str long) msvcrt._fsopen
@ stub _fstat32
@ cdecl _fstat32(long ptr) msvcr90._fstat32
@ stub _fstat32i64
@ cdecl _fstat64(long ptr) msvcrt._fstat64
@ cdecl _fstat64i32(long ptr) msvcr90._fstat64i32
@ -977,7 +977,7 @@
@ stub _sprintf_s_l
@ varargs _sscanf_l(str str ptr) msvcrt._sscanf_l
@ varargs _sscanf_s_l(str str ptr) msvcrt._sscanf_s_l
@ stub _stat32
@ cdecl _stat32(str ptr) msvcr90._stat32
@ stub _stat32i64
@ cdecl _stat64(str ptr) msvcrt._stat64
@ cdecl _stat64i32(str ptr) msvcr90._stat64i32
@ -1249,7 +1249,7 @@
@ cdecl _wspawnvpe(long wstr ptr ptr) msvcrt._wspawnvpe
@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) msvcrt._wsplitpath
@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) msvcrt._wsplitpath_s
@ stub _wstat32
@ cdecl _wstat32(wstr ptr) msvcr90._wstat32
@ stub _wstat32i64
@ cdecl _wstat64(wstr ptr) msvcrt._wstat64
@ cdecl _wstat64i32(wstr ptr) msvcr90._wstat64i32

View File

@ -30,6 +30,24 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcr90);
/*********************************************************************
* msvcr90_stat64_to_stat32 [internal]
*/
static void msvcr90_stat64_to_stat32(const struct _stat64 *buf64, struct _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;
}
/*********************************************************************
* DllMain (MSVCR90.@)
*/
@ -135,6 +153,48 @@ void* CDECL _recalloc(void* mem, size_t num, size_t size)
return ret;
}
/*********************************************************************
* _fstat32 (MSVCR90.@)
*/
int CDECL _fstat32(int fd, struct _stat32* buf)
{
int ret;
struct _stat64 buf64;
ret = _fstat64(fd, &buf64);
if (!ret)
msvcr90_stat64_to_stat32(&buf64, buf);
return ret;
}
/*********************************************************************
* _stat32 (MSVCR90.@)
*/
int CDECL _stat32(const char *path, struct _stat32* buf)
{
int ret;
struct _stat64 buf64;
ret = _stat64(path, &buf64);
if (!ret)
msvcr90_stat64_to_stat32(&buf64, buf);
return ret;
}
/*********************************************************************
* _wstat32 (MSVCR90.@)
*/
int CDECL _wstat32(const wchar_t *path, struct _stat32* buf)
{
int ret;
struct _stat64 buf64;
ret = _wstat64(path, &buf64);
if (!ret)
msvcr90_stat64_to_stat32(&buf64, buf);
return ret;
}
/*********************************************************************
* _fstat64i32 (MSVCRT.@)
*/

View File

@ -484,7 +484,7 @@
@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64
@ stub _fseeki64_nolock
@ cdecl _fsopen(str str long) msvcrt._fsopen
@ stub _fstat32
@ cdecl _fstat32(long ptr)
@ stub _fstat32i64
@ cdecl _fstat64(long ptr) msvcrt._fstat64
@ cdecl _fstat64i32(long ptr)
@ -963,7 +963,7 @@
@ stub _sprintf_s_l
@ varargs _sscanf_l(str str ptr) msvcrt._sscanf_l
@ varargs _sscanf_s_l(str str ptr) msvcrt._sscanf_s_l
@ stub _stat32
@ cdecl _stat32(str ptr)
@ stub _stat32i64
@ cdecl _stat64(str ptr) msvcrt._stat64
@ cdecl _stat64i32(str ptr)
@ -1233,7 +1233,7 @@
@ cdecl _wspawnvpe(long wstr ptr ptr) msvcrt._wspawnvpe
@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) msvcrt._wsplitpath
@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) msvcrt._wsplitpath_s
@ stub _wstat32
@ cdecl _wstat32(wstr ptr)
@ stub _wstat32i64
@ cdecl _wstat64(wstr ptr) msvcrt._wstat64
@ cdecl _wstat64i32(wstr ptr)

View File

@ -83,6 +83,20 @@ struct stat {
time_t st_ctime;
};
struct _stat32 {
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
_dev_t st_rdev;
_off_t st_size;
__time32_t st_atime;
__time32_t st_mtime;
__time32_t st_ctime;
};
struct _stat32i64 {
_dev_t st_dev;
_ino_t st_ino;
@ -146,6 +160,8 @@ extern "C" {
int __cdecl _fstat(int,struct _stat*);
int __cdecl _stat(const char*,struct _stat*);
int __cdecl _fstat32(int, struct _stat32*);
int __cdecl _stat32(const char*, struct _stat32*);
int __cdecl _fstati64(int,struct _stati64*);
int __cdecl _stati64(const char*,struct _stati64*);
int __cdecl _fstat64(int,struct _stat64*);
@ -155,6 +171,7 @@ int __cdecl _umask(int);
#ifndef _WSTAT_DEFINED
#define _WSTAT_DEFINED
int __cdecl _wstat(const wchar_t*,struct _stat*);
int __cdecl _wstat32(const wchar_t*, struct _stat32*);
int __cdecl _wstati64(const wchar_t*,struct _stati64*);
int __cdecl _wstat64(const wchar_t*,struct _stat64*);
#endif /* _WSTAT_DEFINED */

View File

@ -148,6 +148,20 @@ struct stat {
time_t st_ctime;
};
struct _stat32 {
_dev_t st_dev;
_ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
_dev_t st_rdev;
_off_t st_size;
__time32_t st_atime;
__time32_t st_mtime;
__time32_t st_ctime;
};
struct _stati64 {
_dev_t st_dev;
_ino_t st_ino;
@ -264,6 +278,7 @@ int __cdecl _wsystem(const wchar_t*);
#ifndef _WSTAT_DEFINED
#define _WSTAT_DEFINED
int __cdecl _wstat(const wchar_t*,struct _stat*);
int __cdecl _wstat32(const wchar_t*, struct _stat32*);
int __cdecl _wstati64(const wchar_t*,struct _stati64*);
int __cdecl _wstat64(const wchar_t*,struct _stat64*);
#endif /* _WSTAT_DEFINED */