Fix memory tracking
Modified: trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/malloc.h
Modified: trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/mbuf.h
Modified: trunk/reactos/drivers/lib/oskittcp/include/oskitfreebsd.h
Modified: trunk/reactos/drivers/lib/oskittcp/include/oskittcp.h
Modified: trunk/reactos/drivers/lib/oskittcp/oskittcp/interface.c
Modified: trunk/reactos/drivers/lib/oskittcp/oskittcp.xml

Modified: trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/malloc.h
--- trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/malloc.h	2006-01-01 11:44:55 UTC (rev 20504)
+++ trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/malloc.h	2006-01-01 11:48:11 UTC (rev 20505)
@@ -329,8 +329,8 @@
 extern void *malloc __P((unsigned long size, ...));
 extern void free __P((void *addr, ...));
 #else
-#define malloc fbsd_malloc
-#define free   fbsd_free
+#define malloc(size, flags, id) fbsd_malloc(size, __FILE__, __LINE__)
+#define free(area, flags)   fbsd_free(area, __FILE__, __LINE__)
 #endif
 #endif /* KERNEL */
 #endif /* !_SYS_MALLOC_H_ */

Modified: trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/mbuf.h
--- trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/mbuf.h	2006-01-01 11:44:55 UTC (rev 20504)
+++ trunk/reactos/drivers/lib/oskittcp/include/freebsd/src/sys/sys/mbuf.h	2006-01-01 11:48:11 UTC (rev 20505)
@@ -304,7 +304,7 @@
 #ifdef __REACTOS__
 #define MCLGET(m, how) { \
           OS_DbgPrint(OSK_MID_TRACE,("(MCLGET) m = %x\n", m)); \
-          (m)->m_ext.ext_buf = malloc(MCLBYTES); \
+          (m)->m_ext.ext_buf = malloc(MCLBYTES,__FILE__,__LINE__); \
 	  if ((m)->m_ext.ext_buf != NULL) { \
               (m)->m_data = (m)->m_ext.ext_buf; \
               (m)->m_flags |= M_EXT; \
@@ -313,7 +313,7 @@
         }
 
 #define MCLFREE(p) { \
-          free( (p) ); \
+          free( (p), 0 ); \
         }
 #else
 #define	MCLGET(m, how) \

Modified: trunk/reactos/drivers/lib/oskittcp/include/oskitfreebsd.h
--- trunk/reactos/drivers/lib/oskittcp/include/oskitfreebsd.h	2006-01-01 11:44:55 UTC (rev 20504)
+++ trunk/reactos/drivers/lib/oskittcp/include/oskitfreebsd.h	2006-01-01 11:48:11 UTC (rev 20505)
@@ -30,6 +30,6 @@
 #define panic(...) do { printf(__VA_ARGS__); \
         oskittcp_die(__FILE__,__LINE__); } while(0)
 #endif//_MSC_VER
-#define kmem_malloc(x,y,z) malloc(y)
+#define kmem_malloc(x,y,z) malloc(y,0,0)
 
 #endif//_OSKITFREEBSD_H

Modified: trunk/reactos/drivers/lib/oskittcp/include/oskittcp.h
--- trunk/reactos/drivers/lib/oskittcp/include/oskittcp.h	2006-01-01 11:44:55 UTC (rev 20504)
+++ trunk/reactos/drivers/lib/oskittcp/include/oskittcp.h	2006-01-01 11:48:11 UTC (rev 20505)
@@ -155,8 +155,8 @@
 
 #undef errno
 
-void *fbsd_malloc( unsigned int bytes, ... );
-void fbsd_free( void *data, ... );
+void *fbsd_malloc( unsigned int bytes, char *file, unsigned line, ... );
+void fbsd_free( void *data, char *file, unsigned line, ... );
 #if 0
 #define malloc(x) fbsd_malloc(x,__FILE__,__LINE__)
 #define free(x) fbsd_free(x,__FILE__,__LINE__)

Modified: trunk/reactos/drivers/lib/oskittcp/oskittcp/interface.c
--- trunk/reactos/drivers/lib/oskittcp/oskittcp/interface.c	2006-01-01 11:44:55 UTC (rev 20504)
+++ trunk/reactos/drivers/lib/oskittcp/oskittcp/interface.c	2006-01-01 11:48:11 UTC (rev 20505)
@@ -33,15 +33,15 @@
 int isprint(int c);
 int _snprintf(char * buf, size_t cnt, const char *fmt, ...);
 
-void *fbsd_malloc( unsigned int bytes, ... ) {
+void *fbsd_malloc( unsigned int bytes, char *file, unsigned line, ... ) {
     if( !OtcpEvent.TCPMalloc ) panic("no malloc");
     return OtcpEvent.TCPMalloc
-	( OtcpEvent.ClientData, (OSK_UINT)bytes, "*", 0 );
+	( OtcpEvent.ClientData, (OSK_UINT)bytes, file, line );
 }
 
-void fbsd_free( void *data, ... ) {
+void fbsd_free( void *data, char *file, unsigned line, ... ) {
     if( !OtcpEvent.TCPFree ) panic("no free");
-    OtcpEvent.TCPFree( OtcpEvent.ClientData, data, "*", 0 );
+    OtcpEvent.TCPFree( OtcpEvent.ClientData, data, file, line );
 }
 
 void InitOskitTCP() {

Modified: trunk/reactos/drivers/lib/oskittcp/oskittcp.xml
--- trunk/reactos/drivers/lib/oskittcp/oskittcp.xml	2006-01-01 11:44:55 UTC (rev 20504)
+++ trunk/reactos/drivers/lib/oskittcp/oskittcp.xml	2006-01-01 11:48:11 UTC (rev 20505)
@@ -5,6 +5,7 @@
 	<define name="_DISABLE_TIDENTS"/>
 	<define name="__USE_W32API"/>
 	<define name="__NO_CTYPE_INLINES" />
+	<define name="MEMTRACK" />
 	<include>drivers/lib/oskittcp/include/freebsd</include>
 	<include>drivers/lib/oskittcp/include/freebsd/sys/include</include>
 	<include>drivers/lib/oskittcp/include/freebsd/src/sys</include>