Index: trunk/src/crtdll/crt.cpp
===================================================================
--- trunk/src/crtdll/crt.cpp	(revision 2181)
+++ trunk/src/crtdll/crt.cpp	(revision 2182)
@@ -1,3 +1,3 @@
-/* $Id: crt.cpp,v 1.1 1999-12-21 12:27:11 sandervl Exp $ */
+/* $Id: crt.cpp,v 1.2 1999-12-21 13:46:24 sandervl Exp $ */
 
 /*
@@ -471,7 +471,7 @@
   va_list argptr;                          /* -> variable argument list */
 
-  dprintf(("CRTDLL: sprintf(%08xh,%s)\n",
-           lpstrBuffer,
-           lpstrFormat));
+//  dprintf(("CRTDLL: sprintf(%08xh,%s)\n",
+//           lpstrBuffer,
+//          lpstrFormat));
 
   va_start(argptr,
@@ -569,7 +569,7 @@
                       const LPSTR str2)
 {
-  dprintf(("CRTDLL: _stricmp(%s,%s)\n",
-           str1,
-           str2));
+//  dprintf(("CRTDLL: _stricmp(%s,%s)\n",
+//           str1,
+//           str2));
 
   return (stricmp(str1, str2));
@@ -592,5 +592,5 @@
                        const LPSTR str2)
 {
-  dprintf(("CRTDLL: strcpy\n"));
+//  dprintf(("CRTDLL: strcpy\n"));
 
   return (strcpy(str1, str2));
@@ -613,7 +613,7 @@
                                 LPSTR str2)
 {
-  dprintf(("CRTDLL: strcspn(%s,%s)\n",
-           str1,
-           str2));
+//  dprintf(("CRTDLL: strcspn(%s,%s)\n",
+//           str1,
+//           str2));
 
   return (strcspn(str1, str2));
@@ -635,6 +635,6 @@
 size_t CDECL CRTDLL_strlen(const LPSTR str)
 {
-  dprintf(("CRTDLL: strlen(%s)\n",
-           str));
+//  dprintf(("CRTDLL: strlen(%s)\n",
+//           str));
 
   return (strlen(str));
@@ -658,8 +658,8 @@
                         size_t      i)
 {
-  dprintf(("CRTDLL: strncat(%s,%s,%08xh)\n",
-           str1,
-           str2,
-           i));
+//  dprintf(("CRTDLL: strncat(%s,%s,%08xh)\n",
+//           str1,
+//           str2,
+//           i));
 
   return (strncat(str1, str2, i));
@@ -683,8 +683,8 @@
                        size_t      i)
 {
-  dprintf(("CRTDLL: strncmp(%s,%s,%08xh)\n",
-           str1,
-           str2,
-           i));
+//  dprintf(("CRTDLL: strncmp(%s,%s,%08xh)\n",
+//           str1,
+//           str2,
+//           i));
 
   return (strncmp(str1, str2, i));
@@ -708,8 +708,8 @@
                         size_t      i)
 {
-  dprintf(("CRTDLL: strncpy(%s,%s,%08xh)\n",
-           str1,
-           str2,
-           i));
+//  dprintf(("CRTDLL: strncpy(%s,%s,%08xh)\n",
+//           str1,
+//           str2,
+//           i));
 
   return (strncpy(str1, str2, i));
@@ -801,7 +801,7 @@
                        const LPSTR str2)
 {
-  dprintf(("CRTDLL: strstr(%s,%s)\n",
-           str1,
-           str2));
+//  dprintf(("CRTDLL: strstr(%s,%s)\n",
+//           str1,
+//           str2));
 
   return (strstr(str1, str2));
@@ -829,8 +829,8 @@
   int     rc;
 
-  dprintf(("CRTDLL: swprintf(%s,%d,%s)\n",
-           str,
-           i,
-           format));
+//  dprintf(("CRTDLL: swprintf(%s,%d,%s)\n",
+//           str,
+//           i,
+//           format));
 
   va_start( valist, format );
Index: trunk/src/crtdll/crtdll.cpp
===================================================================
--- trunk/src/crtdll/crtdll.cpp	(revision 2181)
+++ trunk/src/crtdll/crtdll.cpp	(revision 2182)
@@ -1,3 +1,3 @@
-/* $Id: crtdll.cpp,v 1.17 1999-12-21 12:27:11 sandervl Exp $ */
+/* $Id: crtdll.cpp,v 1.18 1999-12-21 13:46:24 sandervl Exp $ */
 
 /*
@@ -53,4 +53,7 @@
 DEFAULT_DEBUG_CHANNEL(crtdll)
 
+//SvL: per process heap for CRTDLL
+HANDLE CRTDLL_hHeap = 0;
+
 
 /*********************************************************************
@@ -63,5 +66,11 @@
 		CRTDLL__fdopen(1,"w");
 		CRTDLL__fdopen(2,"w");
+	     	CRTDLL_hHeap = HeapCreate(0, 0x10000, 0);
 	}
+	else 
+	if (fdwReason == DLL_PROCESS_DETACH) {
+        	HeapDestroy(CRTDLL_hHeap);
+        	CRTDLL_hHeap = 0;
+	}	
 	return TRUE;
 }
@@ -75,5 +84,5 @@
     dprintf(("CRTDLL: ??2@YAPAXI@Z\n"));
     VOID* result;
-    if(!(result = HeapAlloc(GetProcessHeap(),0,size)) && new_handler)
+    if(!(result = Heap_Alloc(size)) && new_handler)
 	(*new_handler)();
     return result;
@@ -87,5 +96,5 @@
 {
     dprintf(("CRTDLL: ??3@YAXPAX@Z\n"));
-    HeapFree(GetProcessHeap(),0,ptr);
+    Heap_Free(ptr);
 }
 
@@ -1047,5 +1056,5 @@
         break;
     default:
-        file = (PCRTDLL_FILE)HeapAlloc( GetProcessHeap(), 0, sizeof(*file) );
+        file = (PCRTDLL_FILE)Heap_Alloc(sizeof(*file) );
         file->handle = handle;
         break;
@@ -3487,5 +3496,14 @@
 int CDECL CRTDLL__setjmp( jmp_buf env )
 {
-  dprintf(("CRTDLL: _setjmp -> setjmp\n"));
+  dprintf(("CRTDLL: _setjmp -> setjmp (NOT IDENTICAL!!!)\n"));
+  return(setjmp( env));
+}
+
+/*********************************************************************
+ *           CRTDLL__setjmp3 	 (CRTDLL.262)
+ */
+int CDECL CRTDLL__setjmp3( jmp_buf env )
+{
+  dprintf(("CRTDLL: _setjmp3 -> setjmp (NOT IDENTICAL!!!)\n"));
   return(setjmp( env));
 }
@@ -4192,6 +4210,6 @@
 void * CDECL CRTDLL_calloc( size_t n, size_t size )
 {
-  dprintf(("CRTDLL: calloc\n"));
-  return (calloc(n, size));
+//  dprintf(("CRTDLL: calloc\n"));
+  return Heap_Alloc(size*n);
 }
 
@@ -4428,5 +4446,5 @@
 size_t CDECL CRTDLL_fread( void *ptr, size_t size, size_t n, FILE *fp )
 {
-  dprintf(("CRTDLL: fread\n"));
+//  dprintf(("CRTDLL: fread\n"));
   return (fread(ptr, size, n, fp));
 }
@@ -4438,6 +4456,6 @@
 VOID CDECL CRTDLL_free(LPVOID ptr)
 {
-    dprintf(("CRTDLL: free\n"));
-    HeapFree(GetProcessHeap(),0,ptr);
+//    dprintf(("CRTDLL: free\n"));
+    Heap_Free(ptr);
 }
 
@@ -4845,6 +4863,6 @@
 VOID* CDECL CRTDLL_malloc(DWORD size)
 {
-      dprintf(("CRTDLL: malloc\n"));
-      return HeapAlloc(GetProcessHeap(),0,size);
+//      dprintf(("CRTDLL: malloc\n"));
+      return Heap_Alloc(size);
 }
 
Index: trunk/src/crtdll/crtdll.def
===================================================================
--- trunk/src/crtdll/crtdll.def	(revision 2181)
+++ trunk/src/crtdll/crtdll.def	(revision 2182)
@@ -1,3 +1,3 @@
-; $Id: crtdll.def,v 1.10 1999-12-21 12:27:12 sandervl Exp $
+; $Id: crtdll.def,v 1.11 1999-12-21 13:46:25 sandervl Exp $
 
 ;Created by BLAST for IBM's compiler
@@ -539,2 +539,3 @@
 
     _itow			= _CRTDLL__itow			@600
+    _setjmp3			= _CRTDLL__setjmp3		@601
Index: trunk/src/crtdll/crtinc.h
===================================================================
--- trunk/src/crtdll/crtinc.h	(revision 2181)
+++ trunk/src/crtdll/crtinc.h	(revision 2182)
@@ -1,3 +1,3 @@
-/* $Id: crtinc.h,v 1.12 1999-12-21 12:27:12 sandervl Exp $ */
+/* $Id: crtinc.h,v 1.13 1999-12-21 13:46:25 sandervl Exp $ */
 
 /* Definitions for the CRTDLL library (CRTDLL.DLL)
@@ -10,4 +10,9 @@
 #define MAX_PATHNAME_LEN 260 
 #endif 
+
+//SvL: Internal heap allocation definitions for NTDLL
+extern HANDLE CRTDLL_hHeap;
+#define Heap_Alloc(a)	HeapAlloc(CRTDLL_hHeap, HEAP_ZERO_MEMORY, a)
+#define Heap_Free(a)	HeapFree(CRTDLL_hHeap, 0, (PVOID)a)
 
 // MBC Defs
