ReactOS  0.4.14-dev-614-gbfd8a84
debug_ros.c
Go to the documentation of this file.
1 /* The use of these four functions was creating unwanted imports
2  * from msvcrt.dll in kernel32.dll. */
3 
4 #define malloc libwine_malloc
5 #define free libwine_free
6 #define realloc libwine_realloc
7 #define _strdup libwine__strdup
8 
9 #include "debug.c"
10 
12 void * __cdecl malloc(size_t size)
13 {
14  return LocalAlloc(0, size);
15 }
16 
17 void __cdecl free(void *ptr)
18 {
19  LocalFree(ptr);
20 }
21 
22 void * __cdecl realloc(void *ptr, size_t size)
23 {
24  if (ptr == NULL) return malloc(size);
26 }
27 
29 char * __cdecl _strdup(const char *str)
30 {
31  char *newstr = malloc(strlen(str) + 1);
32  if (newstr) strcpy(newstr, str);
33  return newstr;
34 }
#define realloc
Definition: debug_ros.c:6
#define __cdecl
Definition: accygwin.h:79
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define free
Definition: debug_ros.c:5
#define __MINGW_ATTRIB_MALLOC
Definition: _mingw.h:106
#define _strdup
Definition: debug_ros.c:7
static PVOID ptr
Definition: dispmode.c:27
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define LMEM_MOVEABLE
Definition: winbase.h:350
HLOCAL NTAPI LocalReAlloc(HLOCAL hMem, SIZE_T dwBytes, UINT uFlags)
Definition: heapmem.c:1608
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define malloc
Definition: debug_ros.c:4
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373