msvcrt: Fix the stat and finddata structures for 64-bit.
This commit is contained in:
parent
4a7b3460ef
commit
ac760a47f3
|
@ -1838,7 +1838,7 @@ int CDECL _setmode(int fd,int mode)
|
|||
/*********************************************************************
|
||||
* _stat64 (MSVCRT.@)
|
||||
*/
|
||||
int CDECL MSVCRT__stat64(const char* path, struct MSVCRT__stat64 * buf)
|
||||
int CDECL MSVCRT_stat64(const char* path, struct MSVCRT__stat64 * buf)
|
||||
{
|
||||
DWORD dw;
|
||||
WIN32_FILE_ATTRIBUTE_DATA hfi;
|
||||
|
@ -1904,12 +1904,12 @@ int CDECL MSVCRT__stat64(const char* path, struct MSVCRT__stat64 * buf)
|
|||
/*********************************************************************
|
||||
* _stati64 (MSVCRT.@)
|
||||
*/
|
||||
int CDECL MSVCRT__stati64(const char* path, struct MSVCRT__stati64 * buf)
|
||||
int CDECL MSVCRT_stati64(const char* path, struct MSVCRT__stati64 * buf)
|
||||
{
|
||||
int ret;
|
||||
struct MSVCRT__stat64 buf64;
|
||||
|
||||
ret = MSVCRT__stat64(path, &buf64);
|
||||
ret = MSVCRT_stat64(path, &buf64);
|
||||
if (!ret)
|
||||
msvcrt_stat64_to_stati64(&buf64, buf);
|
||||
return ret;
|
||||
|
@ -1918,11 +1918,11 @@ int CDECL MSVCRT__stati64(const char* path, struct MSVCRT__stati64 * buf)
|
|||
/*********************************************************************
|
||||
* _stat (MSVCRT.@)
|
||||
*/
|
||||
int CDECL MSVCRT__stat(const char* path, struct MSVCRT__stat * buf)
|
||||
int CDECL MSVCRT_stat(const char* path, struct MSVCRT__stat * buf)
|
||||
{ int ret;
|
||||
struct MSVCRT__stat64 buf64;
|
||||
|
||||
ret = MSVCRT__stat64( path, &buf64);
|
||||
ret = MSVCRT_stat64( path, &buf64);
|
||||
if (!ret)
|
||||
msvcrt_stat64_to_stat(&buf64, buf);
|
||||
return ret;
|
||||
|
|
|
@ -45,22 +45,20 @@ typedef unsigned short MSVCRT_wchar_t;
|
|||
typedef unsigned short MSVCRT_wint_t;
|
||||
typedef unsigned short MSVCRT_wctype_t;
|
||||
typedef unsigned short MSVCRT__ino_t;
|
||||
typedef unsigned long MSVCRT__fsize_t;
|
||||
typedef unsigned int MSVCRT__fsize_t;
|
||||
#ifdef _WIN64
|
||||
typedef unsigned __int64 MSVCRT_size_t;
|
||||
typedef __int64 MSVCRT_intptr_t;
|
||||
typedef unsigned __int64 MSVCRT_uintptr_t;
|
||||
typedef __int64 MSVCRT_time_t;
|
||||
#else
|
||||
typedef unsigned long MSVCRT_size_t;
|
||||
typedef long MSVCRT_intptr_t;
|
||||
typedef unsigned long MSVCRT_uintptr_t;
|
||||
typedef long MSVCRT_time_t;
|
||||
#endif
|
||||
typedef unsigned int MSVCRT__dev_t;
|
||||
typedef int MSVCRT__off_t;
|
||||
typedef long MSVCRT_clock_t;
|
||||
typedef long MSVCRT___time32_t;
|
||||
typedef int MSVCRT___time32_t;
|
||||
typedef __int64 MSVCRT___time64_t;
|
||||
typedef __int64 MSVCRT_fpos_t;
|
||||
|
||||
|
@ -299,38 +297,74 @@ struct MSVCRT__diskfree_t {
|
|||
unsigned int bytes_per_sector;
|
||||
};
|
||||
|
||||
struct MSVCRT__finddata_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
struct MSVCRT__finddata32_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time32_t time_create;
|
||||
MSVCRT___time32_t time_access;
|
||||
MSVCRT___time32_t time_write;
|
||||
MSVCRT__fsize_t size;
|
||||
char name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__finddatai64_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
struct MSVCRT__finddata32i64_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time32_t time_create;
|
||||
MSVCRT___time32_t time_access;
|
||||
MSVCRT___time32_t time_write;
|
||||
__int64 size;
|
||||
char name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__wfinddata_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
struct MSVCRT__finddata64i32_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time64_t time_create;
|
||||
MSVCRT___time64_t time_access;
|
||||
MSVCRT___time64_t time_write;
|
||||
MSVCRT__fsize_t size;
|
||||
char name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__finddata64_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time64_t time_create;
|
||||
MSVCRT___time64_t time_access;
|
||||
MSVCRT___time64_t time_write;
|
||||
__int64 size;
|
||||
char name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__wfinddata32_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time32_t time_create;
|
||||
MSVCRT___time32_t time_access;
|
||||
MSVCRT___time32_t time_write;
|
||||
MSVCRT__fsize_t size;
|
||||
MSVCRT_wchar_t name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__wfinddatai64_t {
|
||||
unsigned attrib;
|
||||
MSVCRT_time_t time_create;
|
||||
MSVCRT_time_t time_access;
|
||||
MSVCRT_time_t time_write;
|
||||
struct MSVCRT__wfinddata32i64_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time32_t time_create;
|
||||
MSVCRT___time32_t time_access;
|
||||
MSVCRT___time32_t time_write;
|
||||
__int64 size;
|
||||
MSVCRT_wchar_t name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__wfinddata64i32_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time64_t time_create;
|
||||
MSVCRT___time64_t time_access;
|
||||
MSVCRT___time64_t time_write;
|
||||
MSVCRT__fsize_t size;
|
||||
MSVCRT_wchar_t name[260];
|
||||
};
|
||||
|
||||
struct MSVCRT__wfinddata64_t {
|
||||
unsigned int attrib;
|
||||
MSVCRT___time64_t time_create;
|
||||
MSVCRT___time64_t time_access;
|
||||
MSVCRT___time64_t time_write;
|
||||
__int64 size;
|
||||
MSVCRT_wchar_t name[260];
|
||||
};
|
||||
|
@ -352,7 +386,7 @@ struct MSVCRT___utimbuf64
|
|||
#undef st_ctime
|
||||
#undef st_mtime
|
||||
|
||||
struct MSVCRT__stat {
|
||||
struct MSVCRT__stat32 {
|
||||
MSVCRT__dev_t st_dev;
|
||||
MSVCRT__ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
|
@ -361,26 +395,12 @@ struct MSVCRT__stat {
|
|||
short st_gid;
|
||||
MSVCRT__dev_t st_rdev;
|
||||
MSVCRT__off_t st_size;
|
||||
MSVCRT_time_t st_atime;
|
||||
MSVCRT_time_t st_mtime;
|
||||
MSVCRT_time_t st_ctime;
|
||||
MSVCRT___time32_t st_atime;
|
||||
MSVCRT___time32_t st_mtime;
|
||||
MSVCRT___time32_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT_stat {
|
||||
MSVCRT__dev_t st_dev;
|
||||
MSVCRT__ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT__dev_t st_rdev;
|
||||
MSVCRT__off_t st_size;
|
||||
MSVCRT_time_t st_atime;
|
||||
MSVCRT_time_t st_mtime;
|
||||
MSVCRT_time_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT__stati64 {
|
||||
struct MSVCRT__stat32i64 {
|
||||
MSVCRT__dev_t st_dev;
|
||||
MSVCRT__ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
|
@ -389,9 +409,23 @@ struct MSVCRT__stati64 {
|
|||
short st_gid;
|
||||
MSVCRT__dev_t st_rdev;
|
||||
__int64 DECLSPEC_ALIGN(8) st_size;
|
||||
MSVCRT_time_t st_atime;
|
||||
MSVCRT_time_t st_mtime;
|
||||
MSVCRT_time_t st_ctime;
|
||||
MSVCRT___time32_t st_atime;
|
||||
MSVCRT___time32_t st_mtime;
|
||||
MSVCRT___time32_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT__stat64i32 {
|
||||
MSVCRT__dev_t st_dev;
|
||||
MSVCRT__ino_t st_ino;
|
||||
unsigned short st_mode;
|
||||
short st_nlink;
|
||||
short st_uid;
|
||||
short st_gid;
|
||||
MSVCRT__dev_t st_rdev;
|
||||
MSVCRT__off_t st_size;
|
||||
MSVCRT___time64_t st_atime;
|
||||
MSVCRT___time64_t st_mtime;
|
||||
MSVCRT___time64_t st_ctime;
|
||||
};
|
||||
|
||||
struct MSVCRT__stat64 {
|
||||
|
@ -408,6 +442,22 @@ struct MSVCRT__stat64 {
|
|||
MSVCRT___time64_t st_ctime;
|
||||
};
|
||||
|
||||
#ifdef _WIN64
|
||||
#define MSVCRT__finddata_t MSVCRT__finddata64i32_t
|
||||
#define MSVCRT__finddatai64_t MSVCRT__finddata64_t
|
||||
#define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t
|
||||
#define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t
|
||||
#define MSVCRT__stat MSVCRT__stat64i32
|
||||
#define MSVCRT__stati64 MSVCRT__stat64
|
||||
#else
|
||||
#define MSVCRT__finddata_t MSVCRT__finddata32_t
|
||||
#define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t
|
||||
#define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t
|
||||
#define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t
|
||||
#define MSVCRT__stat MSVCRT__stat32
|
||||
#define MSVCRT__stati64 MSVCRT__stat32i64
|
||||
#endif
|
||||
|
||||
#define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
|
||||
#define MSVCRT_EOF (-1)
|
||||
#define MSVCRT_TMP_MAX 0x7fff
|
||||
|
@ -675,7 +725,6 @@ MSVCRT_FILE* __cdecl MSVCRT__iob_func(void);
|
|||
MSVCRT_clock_t __cdecl MSVCRT_clock(void);
|
||||
MSVCRT___time32_t __cdecl MSVCRT__time32(MSVCRT___time32_t*);
|
||||
MSVCRT___time64_t __cdecl MSVCRT__time64(MSVCRT___time64_t*);
|
||||
MSVCRT_time_t __cdecl MSVCRT_time(MSVCRT_time_t*);
|
||||
MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *);
|
||||
MSVCRT_FILE* __cdecl MSVCRT__wfdopen(int, const MSVCRT_wchar_t *);
|
||||
int __cdecl MSVCRT_vsnprintf(char *str, unsigned int len, const char *format, __ms_va_list valist);
|
||||
|
|
|
@ -482,9 +482,9 @@
|
|||
@ cdecl _spawnvp(long str ptr)
|
||||
@ cdecl _spawnvpe(long str ptr ptr)
|
||||
@ cdecl _splitpath(str ptr ptr ptr ptr) ntdll._splitpath
|
||||
@ cdecl _stat(str ptr) MSVCRT__stat
|
||||
@ cdecl _stat64(str ptr) MSVCRT__stat64
|
||||
@ cdecl _stati64(str ptr) MSVCRT__stati64
|
||||
@ cdecl _stat(str ptr) MSVCRT_stat
|
||||
@ cdecl _stat64(str ptr) MSVCRT_stat64
|
||||
@ cdecl _stati64(str ptr) MSVCRT_stati64
|
||||
@ cdecl _statusfp()
|
||||
@ cdecl _strcmpi(str str) ntdll._strcmpi
|
||||
@ cdecl _strdate(ptr)
|
||||
|
|
|
@ -87,7 +87,6 @@ static void test_types(void)
|
|||
CHECK_TYPE(_dev_t);
|
||||
CHECK_TYPE(_off_t);
|
||||
CHECK_TYPE(clock_t);
|
||||
CHECK_TYPE(time_t);
|
||||
CHECK_TYPE(__time32_t);
|
||||
CHECK_TYPE(__time64_t);
|
||||
CHECK_TYPE(fpos_t);
|
||||
|
@ -237,62 +236,6 @@ static void test_structs(void)
|
|||
CHECK_FIELD(_stat, st_atime);
|
||||
CHECK_FIELD(_stat, st_mtime);
|
||||
CHECK_FIELD(_stat, st_ctime);
|
||||
CHECK_FIELD(_stat, st_dev);
|
||||
CHECK_FIELD(_stat, st_ino);
|
||||
CHECK_FIELD(_stat, st_mode);
|
||||
CHECK_FIELD(_stat, st_nlink);
|
||||
CHECK_FIELD(_stat, st_uid);
|
||||
CHECK_FIELD(_stat, st_gid);
|
||||
CHECK_FIELD(_stat, st_rdev);
|
||||
CHECK_FIELD(_stat, st_size);
|
||||
CHECK_FIELD(_stat, st_atime);
|
||||
CHECK_FIELD(_stat, st_mtime);
|
||||
CHECK_FIELD(_stat, st_ctime);
|
||||
CHECK_FIELD(_stat, st_dev);
|
||||
CHECK_FIELD(_stat, st_ino);
|
||||
CHECK_FIELD(_stat, st_mode);
|
||||
CHECK_FIELD(_stat, st_nlink);
|
||||
CHECK_FIELD(_stat, st_uid);
|
||||
CHECK_FIELD(_stat, st_gid);
|
||||
CHECK_FIELD(_stat, st_rdev);
|
||||
CHECK_FIELD(_stat, st_size);
|
||||
CHECK_FIELD(_stat, st_atime);
|
||||
CHECK_FIELD(_stat, st_mtime);
|
||||
CHECK_FIELD(_stat, st_ctime);
|
||||
CHECK_STRUCT(stat);
|
||||
CHECK_FIELD(stat, st_dev);
|
||||
CHECK_FIELD(stat, st_ino);
|
||||
CHECK_FIELD(stat, st_mode);
|
||||
CHECK_FIELD(stat, st_nlink);
|
||||
CHECK_FIELD(stat, st_uid);
|
||||
CHECK_FIELD(stat, st_gid);
|
||||
CHECK_FIELD(stat, st_rdev);
|
||||
CHECK_FIELD(stat, st_size);
|
||||
CHECK_FIELD(stat, st_atime);
|
||||
CHECK_FIELD(stat, st_mtime);
|
||||
CHECK_FIELD(stat, st_ctime);
|
||||
CHECK_FIELD(stat, st_dev);
|
||||
CHECK_FIELD(stat, st_ino);
|
||||
CHECK_FIELD(stat, st_mode);
|
||||
CHECK_FIELD(stat, st_nlink);
|
||||
CHECK_FIELD(stat, st_uid);
|
||||
CHECK_FIELD(stat, st_gid);
|
||||
CHECK_FIELD(stat, st_rdev);
|
||||
CHECK_FIELD(stat, st_size);
|
||||
CHECK_FIELD(stat, st_atime);
|
||||
CHECK_FIELD(stat, st_mtime);
|
||||
CHECK_FIELD(stat, st_ctime);
|
||||
CHECK_FIELD(stat, st_dev);
|
||||
CHECK_FIELD(stat, st_ino);
|
||||
CHECK_FIELD(stat, st_mode);
|
||||
CHECK_FIELD(stat, st_nlink);
|
||||
CHECK_FIELD(stat, st_uid);
|
||||
CHECK_FIELD(stat, st_gid);
|
||||
CHECK_FIELD(stat, st_rdev);
|
||||
CHECK_FIELD(stat, st_size);
|
||||
CHECK_FIELD(stat, st_atime);
|
||||
CHECK_FIELD(stat, st_mtime);
|
||||
CHECK_FIELD(stat, st_ctime);
|
||||
CHECK_STRUCT(_stati64);
|
||||
CHECK_FIELD(_stati64, st_dev);
|
||||
CHECK_FIELD(_stati64, st_ino);
|
||||
|
|
Loading…
Reference in New Issue