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 /*********************************************************************
36 BOOL WINAPI
DllMain(HINSTANCE hdll
, DWORD reason
, LPVOID reserved
)
40 case DLL_WINE_PREATTACH
:
41 return FALSE
; /* prefer native version */
43 case DLL_PROCESS_ATTACH
:
44 DisableThreadLibraryCalls(hdll
);
49 /*********************************************************************
50 * _decode_pointer (MSVCR90.@)
52 * cdecl version of DecodePointer
55 void * CDECL
MSVCR90_decode_pointer(void * ptr
)
57 return DecodePointer(ptr
);
60 /*********************************************************************
61 * _encode_pointer (MSVCR90.@)
63 * cdecl version of EncodePointer
66 void * CDECL
MSVCR90_encode_pointer(void * ptr
)
68 return EncodePointer(ptr
);
71 /*********************************************************************
72 * _encoded_null (MSVCR90.@)
74 void * CDECL
_encoded_null(void)
78 return MSVCR90_encode_pointer(NULL
);
81 /*********************************************************************
82 * _invalid_parameter_noinfo (MSVCR90.@)
84 void CDECL
_invalid_parameter_noinfo(void)
86 _invalid_parameter( NULL
, NULL
, NULL
, 0, 0 );
89 /*********************************************************************
90 * __sys_nerr (MSVCR90.@)
92 int* CDECL
__sys_nerr(void)
94 return (int*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_nerr");
97 /*********************************************************************
98 * __sys_errlist (MSVCR90.@)
100 char** CDECL
__sys_errlist(void)
102 return (char**)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_errlist");
105 /*********************************************************************
106 * __clean_type_info_names_internal (MSVCR90.@)
108 void CDECL
__clean_type_info_names_internal(void *p
)
110 FIXME("(%p) stub\n", p
);
113 /*********************************************************************
114 * _recalloc (MSVCR90.@)
116 void* CDECL
_recalloc(void* mem
, size_t num
, size_t size
)
122 return calloc(num
, size
);
125 old_size
= _msize(mem
);
127 ret
= realloc(mem
, size
);
134 memset((BYTE
*)mem
+old_size
, 0, size
-old_size
);
138 /*********************************************************************
139 * _fstat64i32 (MSVCRT.@)
142 static void msvcrt_stat64_to_stat64i32(const struct _stat64
*buf64
, struct _stat64i32
*buf
)
144 buf
->st_dev
= buf64
->st_dev
;
145 buf
->st_ino
= buf64
->st_ino
;
146 buf
->st_mode
= buf64
->st_mode
;
147 buf
->st_nlink
= buf64
->st_nlink
;
148 buf
->st_uid
= buf64
->st_uid
;
149 buf
->st_gid
= buf64
->st_gid
;
150 buf
->st_rdev
= buf64
->st_rdev
;
151 buf
->st_size
= buf64
->st_size
;
152 buf
->st_atime
= buf64
->st_atime
;
153 buf
->st_mtime
= buf64
->st_mtime
;
154 buf
->st_ctime
= buf64
->st_ctime
;
157 int CDECL
_fstat64i32(int fd
, struct _stat64i32
* buf
)
160 struct _stat64 buf64
;
162 ret
= _fstat64(fd
, &buf64
);
164 msvcrt_stat64_to_stat64i32(&buf64
, buf
);
168 /*********************************************************************
169 * _stat64i32 (MSVCRT.@)
171 int CDECL
_stat64i32(const char* path
, struct _stat64i32
* buf
)
174 struct _stat64 buf64
;
176 ret
= _stat64(path
, &buf64
);
178 msvcrt_stat64_to_stat64i32(&buf64
, buf
);
182 /*********************************************************************
183 * _wstat64i32 (MSVCRT.@)
185 int CDECL
_wstat64i32(const wchar_t *path
, struct _stat64i32
*buf
)
188 struct _stat64 buf64
;
190 ret
= _wstat64(path
, &buf64
);
192 msvcrt_stat64_to_stat64i32(&buf64
, buf
);