From 5e4291354eed450c828de4571bf22fab5106a653 Mon Sep 17 00:00:00 2001 From: Jason Filby Date: Sat, 13 Dec 2003 13:27:46 +0000 Subject: [PATCH] Copied _heapchk(), _heapmin(), _heapset() and _heapwalk() from CRTDLL svn path=/trunk/; revision=6992 --- reactos/lib/msvcrt/msvcrt.def | 12 ++++----- reactos/lib/msvcrt/stdlib/malloc.c | 41 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/reactos/lib/msvcrt/msvcrt.def b/reactos/lib/msvcrt/msvcrt.def index 2722614dcf8..62c2af896c5 100644 --- a/reactos/lib/msvcrt/msvcrt.def +++ b/reactos/lib/msvcrt/msvcrt.def @@ -1,4 +1,4 @@ -; $Id: msvcrt.def,v 1.26 2003/12/07 22:59:13 navaraf Exp $ +; $Id: msvcrt.def,v 1.27 2003/12/13 13:27:46 jfilby Exp $ ; ; ReactOS MSVCRT Compatibility Library ; @@ -316,12 +316,12 @@ _getw ;_getws ;_gmtime64 _global_unwind2 -;_heapadd -;_heapchk -;_heapmin -;_heapset +_heapadd +_heapchk +_heapmin +_heapset ;_heapused -;_heapwalk +_heapwalk _hypot _i64toa _i64tow diff --git a/reactos/lib/msvcrt/stdlib/malloc.c b/reactos/lib/msvcrt/stdlib/malloc.c index 0c8a2e97eed..c780705916f 100644 --- a/reactos/lib/msvcrt/stdlib/malloc.c +++ b/reactos/lib/msvcrt/stdlib/malloc.c @@ -1,5 +1,6 @@ #include #include +#include extern HANDLE hHeap; @@ -95,3 +96,43 @@ int MSVCRT__set_new_mode(int mode) /* FIXME: UNLOCK_HEAP; */ return old_mode; } + +/* + * @implemented + */ +int _heapchk(void) +{ + if (!HeapValidate(GetProcessHeap(), 0, NULL)) + return -1; + return 0; +} + +/* + * @implemented + */ +int _heapmin(void) +{ + if (!HeapCompact(GetProcessHeap(), 0)) + return -1; + return 0; +} + +/* + * @implemented + */ +int _heapset(unsigned int unFill) +{ + if (_heapchk() == -1) + return -1; + return 0; + +} + +/* + * @implemented + */ +int _heapwalk(struct _heapinfo* entry) +{ + return 0; +} +