- DBGKD_WAIT_STATE_CHANGE64 is used in KD protocol 5, not number 6 that we use. Proto...
[reactos.git] / reactos / lib / 3rdparty / libwine / debug_ros.c
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
11 __MINGW_ATTRIB_MALLOC
12 void *malloc(size_t size)
13 {
14 return LocalAlloc(0, size);
15 }
16
17 void free(void *ptr)
18 {
19 LocalFree(ptr);
20 }
21
22 void *realloc(void *ptr, size_t size)
23 {
24 if (ptr == NULL) return malloc(size);
25 return LocalReAlloc(ptr, size, LMEM_MOVEABLE);
26 }
27
28 __MINGW_ATTRIB_MALLOC
29 char *_strdup(const char *str)
30 {
31 char *newstr = malloc(strlen(str) + 1);
32 if (newstr) strcpy(newstr, str);
33 return newstr;
34 }