~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/msvcr90/msvcr90.c

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * msvcr90 specific functions
  3  *
  4  * Copyright 2010 Detlef Riekenberg
  5  *
  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.
 10  *
 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.
 15  *
 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
 19  */
 20 
 21 #include <stdarg.h>
 22 
 23 #include "stdlib.h"
 24 #include "errno.h"
 25 #include "malloc.h"
 26 #include "windef.h"
 27 #include "winbase.h"
 28 #include "wine/debug.h"
 29 #include "sys/stat.h"
 30 
 31 WINE_DEFAULT_DEBUG_CHANNEL(msvcr90);
 32 
 33 typedef int (CDECL *_INITTERM_E_FN)(void);
 34 
 35 /*********************************************************************
 36  *  DllMain (MSVCR90.@)
 37  */
 38 BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved)
 39 {
 40     switch (reason)
 41     {
 42     case DLL_WINE_PREATTACH:
 43         return FALSE;  /* prefer native version */
 44 
 45     case DLL_PROCESS_ATTACH:
 46         DisableThreadLibraryCalls(hdll);
 47     }
 48     return TRUE;
 49 }
 50 
 51 /*********************************************************************
 52  *  _decode_pointer (MSVCR90.@)
 53  *
 54  * cdecl version of DecodePointer
 55  *
 56  */
 57 void * CDECL MSVCR90_decode_pointer(void * ptr)
 58 {
 59     return DecodePointer(ptr);
 60 }
 61 
 62 /*********************************************************************
 63  *  _encode_pointer (MSVCR90.@)
 64  *
 65  * cdecl version of EncodePointer
 66  *
 67  */
 68 void * CDECL MSVCR90_encode_pointer(void * ptr)
 69 {
 70     return EncodePointer(ptr);
 71 }
 72 
 73 /*********************************************************************
 74  *  _encoded_null (MSVCR90.@)
 75  */
 76 void * CDECL _encoded_null(void)
 77 {
 78     TRACE("\n");
 79 
 80     return MSVCR90_encode_pointer(NULL);
 81 }
 82 
 83 /*********************************************************************
 84  *  _initterm_e (MSVCR90.@)
 85  *
 86  * call an array of application initialization functions and report the return value
 87  */
 88 int CDECL _initterm_e(_INITTERM_E_FN *table, _INITTERM_E_FN *end)
 89 {
 90     int res = 0;
 91 
 92     TRACE("(%p, %p)\n", table, end);
 93 
 94     while (!res && table < end) {
 95         if (*table) {
 96             TRACE("calling %p\n", **table);
 97             res = (**table)();
 98             if (res)
 99                 TRACE("function %p failed: 0x%x\n", *table, res);
100 
101         }
102         table++;
103     }
104     return res;
105 }
106 
107 /*********************************************************************
108  * _invalid_parameter_noinfo (MSVCR90.@)
109  */
110 void CDECL _invalid_parameter_noinfo(void)
111 {
112     _invalid_parameter( NULL, NULL, NULL, 0, 0 );
113 }
114 
115 /*********************************************************************
116  * __sys_nerr (MSVCR90.@)
117  */
118 int* CDECL __sys_nerr(void)
119 {
120         return (int*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_nerr");
121 }
122 
123 /*********************************************************************
124  *  __sys_errlist (MSVCR90.@)
125  */
126 char** CDECL __sys_errlist(void)
127 {
128     return (char**)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_errlist");
129 }
130 
131 /*********************************************************************
132  * __clean_type_info_names_internal (MSVCR90.@)
133  */
134 void CDECL __clean_type_info_names_internal(void *p)
135 {
136     FIXME("(%p) stub\n", p);
137 }
138 
139 /*********************************************************************
140  * _recalloc (MSVCR90.@)
141  */
142 void* CDECL _recalloc(void* mem, size_t num, size_t size)
143 {
144     size_t old_size;
145     void *ret;
146 
147     if(!mem)
148         return calloc(num, size);
149 
150     size = num*size;
151     old_size = _msize(mem);
152 
153     ret = realloc(mem, size);
154     if(!ret) {
155         *_errno() = ENOMEM;
156         return NULL;
157     }
158 
159     if(size>old_size)
160         memset((BYTE*)mem+old_size, 0, size-old_size);
161     return ret;
162 }
163 
164 /*********************************************************************
165  *              _fstat64i32 (MSVCRT.@)
166  */
167 
168 static void msvcrt_stat64_to_stat64i32(const struct _stat64 *buf64, struct _stat64i32 *buf)
169 {
170     buf->st_dev   = buf64->st_dev;
171     buf->st_ino   = buf64->st_ino;
172     buf->st_mode  = buf64->st_mode;
173     buf->st_nlink = buf64->st_nlink;
174     buf->st_uid   = buf64->st_uid;
175     buf->st_gid   = buf64->st_gid;
176     buf->st_rdev  = buf64->st_rdev;
177     buf->st_size  = buf64->st_size;
178     buf->st_atime = buf64->st_atime;
179     buf->st_mtime = buf64->st_mtime;
180     buf->st_ctime = buf64->st_ctime;
181 }
182 
183 int CDECL _fstat64i32(int fd, struct _stat64i32* buf)
184 {
185   int ret;
186   struct _stat64 buf64;
187 
188   ret = _fstat64(fd, &buf64);
189   if (!ret)
190       msvcrt_stat64_to_stat64i32(&buf64, buf);
191   return ret;
192 }
193 
194 /*********************************************************************
195  *              _stat64i32 (MSVCRT.@)
196  */
197 int CDECL _stat64i32(const char* path, struct _stat64i32 * buf)
198 {
199   int ret;
200   struct _stat64 buf64;
201 
202   ret = _stat64(path, &buf64);
203   if (!ret)
204     msvcrt_stat64_to_stat64i32(&buf64, buf);
205   return ret;
206 }
207 
208 /*********************************************************************
209  *              _wstat64i32 (MSVCRT.@)
210  */
211 int CDECL _wstat64i32(const wchar_t *path, struct _stat64i32 *buf)
212 {
213     int ret;
214     struct _stat64 buf64;
215 
216     ret = _wstat64(path, &buf64);
217     if (!ret)
218         msvcrt_stat64_to_stat64i32(&buf64, buf);
219     return ret;
220 }
221 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.