2 * msvcr90 specific functions
4 * Copyright 2010 Detlef Riekenberg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(msvcr90);
33 /*********************************************************************
34 * msvcr90_stat64_to_stat32 [internal]
36 static void msvcr90_stat64_to_stat32(const struct _stat64 *buf64, struct _stat32 *buf)
38 buf->st_dev = buf64->st_dev;
39 buf->st_ino = buf64->st_ino;
40 buf->st_mode = buf64->st_mode;
41 buf->st_nlink = buf64->st_nlink;
42 buf->st_uid = buf64->st_uid;
43 buf->st_gid = buf64->st_gid;
44 buf->st_rdev = buf64->st_rdev;
45 buf->st_size = buf64->st_size;
46 buf->st_atime = buf64->st_atime;
47 buf->st_mtime = buf64->st_mtime;
48 buf->st_ctime = buf64->st_ctime;
51 /*********************************************************************
54 BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
58 case DLL_WINE_PREATTACH:
59 return FALSE; /* prefer native version */
61 case DLL_PROCESS_ATTACH:
62 DisableThreadLibraryCalls(hdll);
67 /*********************************************************************
68 * _decode_pointer (MSVCR90.@)
70 * cdecl version of DecodePointer
73 void * CDECL MSVCR90_decode_pointer(void * ptr)
75 return DecodePointer(ptr);
78 /*********************************************************************
79 * _encode_pointer (MSVCR90.@)
81 * cdecl version of EncodePointer
84 void * CDECL MSVCR90_encode_pointer(void * ptr)
86 return EncodePointer(ptr);
89 /*********************************************************************
90 * _encoded_null (MSVCR90.@)
92 void * CDECL _encoded_null(void)
96 return MSVCR90_encode_pointer(NULL);
99 /*********************************************************************
100 * _invalid_parameter_noinfo (MSVCR90.@)
102 void CDECL _invalid_parameter_noinfo(void)
104 _invalid_parameter( NULL, NULL, NULL, 0, 0 );
107 /*********************************************************************
108 * __sys_nerr (MSVCR90.@)
110 int* CDECL __sys_nerr(void)
112 return (int*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_nerr");
115 /*********************************************************************
116 * __sys_errlist (MSVCR90.@)
118 char** CDECL __sys_errlist(void)
120 return (char**)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_errlist");
123 /*********************************************************************
124 * __clean_type_info_names_internal (MSVCR90.@)
126 void CDECL __clean_type_info_names_internal(void *p)
128 FIXME("(%p) stub\n", p);
131 /*********************************************************************
132 * _recalloc (MSVCR90.@)
134 void* CDECL _recalloc(void* mem, size_t num, size_t size)
140 return calloc(num, size);
143 old_size = _msize(mem);
145 ret = realloc(mem, size);
152 memset((BYTE*)mem+old_size, 0, size-old_size);
156 /*********************************************************************
157 * _fstat32 (MSVCR90.@)
159 int CDECL _fstat32(int fd, struct _stat32* buf)
162 struct _stat64 buf64;
164 ret = _fstat64(fd, &buf64);
166 msvcr90_stat64_to_stat32(&buf64, buf);
170 /*********************************************************************
171 * _stat32 (MSVCR90.@)
173 int CDECL _stat32(const char *path, struct _stat32* buf)
176 struct _stat64 buf64;
178 ret = _stat64(path, &buf64);
180 msvcr90_stat64_to_stat32(&buf64, buf);
184 /*********************************************************************
185 * _wstat32 (MSVCR90.@)
187 int CDECL _wstat32(const wchar_t *path, struct _stat32* buf)
190 struct _stat64 buf64;
192 ret = _wstat64(path, &buf64);
194 msvcr90_stat64_to_stat32(&buf64, buf);
198 /*********************************************************************
199 * _fstat64i32 (MSVCRT.@)
202 static void msvcrt_stat64_to_stat64i32(const struct _stat64 *buf64, struct _stat64i32 *buf)
204 buf->st_dev = buf64->st_dev;
205 buf->st_ino = buf64->st_ino;
206 buf->st_mode = buf64->st_mode;
207 buf->st_nlink = buf64->st_nlink;
208 buf->st_uid = buf64->st_uid;
209 buf->st_gid = buf64->st_gid;
210 buf->st_rdev = buf64->st_rdev;
211 buf->st_size = buf64->st_size;
212 buf->st_atime = buf64->st_atime;
213 buf->st_mtime = buf64->st_mtime;
214 buf->st_ctime = buf64->st_ctime;
217 int CDECL _fstat64i32(int fd, struct _stat64i32* buf)
220 struct _stat64 buf64;
222 ret = _fstat64(fd, &buf64);
224 msvcrt_stat64_to_stat64i32(&buf64, buf);
228 /*********************************************************************
229 * _stat64i32 (MSVCRT.@)
231 int CDECL _stat64i32(const char* path, struct _stat64i32 * buf)
234 struct _stat64 buf64;
236 ret = _stat64(path, &buf64);
238 msvcrt_stat64_to_stat64i32(&buf64, buf);
242 /*********************************************************************
243 * _wstat64i32 (MSVCRT.@)
245 int CDECL _wstat64i32(const wchar_t *path, struct _stat64i32 *buf)
248 struct _stat64 buf64;
250 ret = _wstat64(path, &buf64);
252 msvcrt_stat64_to_stat64i32(&buf64, buf);
256 /*********************************************************************
257 * _atoflt (MSVCR90.@)
259 int CDECL _atoflt( _CRT_FLOAT *value, char *str )
261 return _atoflt_l( value, str, NULL );