Index: trunk/src/kernel32/HandleManager.cpp
===================================================================
--- trunk/src/kernel32/HandleManager.cpp	(revision 530)
+++ trunk/src/kernel32/HandleManager.cpp	(revision 532)
@@ -1,3 +1,3 @@
-/* $Id: HandleManager.cpp,v 1.9 1999-08-17 16:35:08 phaller Exp $ */
+/* $Id: HandleManager.cpp,v 1.10 1999-08-17 17:04:50 sandervl Exp $ */
 
 /*
Index: trunk/src/kernel32/KERNEL32.CPP
===================================================================
--- trunk/src/kernel32/KERNEL32.CPP	(revision 530)
+++ trunk/src/kernel32/KERNEL32.CPP	(revision 532)
@@ -1,9 +1,4 @@
-/* $Id: KERNEL32.CPP,v 1.13 1999-08-17 16:35:09 phaller Exp $ */
-
-/*
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
+/* $Id: KERNEL32.CPP,v 1.14 1999-08-17 17:04:51 sandervl Exp $ */
+
 /*
  * Win32 compatibility file functions for OS/2
@@ -15,4 +10,7 @@
  *
  * @(#) KERNEL32.CPP            1.0.1   1998/06/12 PH added HandleManager support
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
  */
 
@@ -26,5 +24,4 @@
 #include <stdlib.h>
 #include <string.h>
-//#include <odincrt.h>
 
 #include "misc.h"
Index: trunk/src/kernel32/heap.cpp
===================================================================
--- trunk/src/kernel32/heap.cpp	(revision 530)
+++ trunk/src/kernel32/heap.cpp	(revision 532)
@@ -1,3 +1,3 @@
-/* $Id: heap.cpp,v 1.12 1999-08-17 16:35:09 phaller Exp $ */
+/* $Id: heap.cpp,v 1.13 1999-08-17 17:04:51 sandervl Exp $ */
 
 /*
@@ -70,5 +70,5 @@
   if(curheap == NULL)
   {
-      O32_HeapDestroy(hHeap);
+      	O32_HeapDestroy(hHeap);
         return(NULL);
   }
@@ -92,5 +92,5 @@
 
   O32_HeapDestroy(curheap->getHeapHandle());
-  delete curheap;
+  delete(curheap);
   return(TRUE);
 }
@@ -157,6 +157,6 @@
 
       if(OS2ProcessHeap == NULL) {
-         O32_HeapDestroy(hHeap);
-               return(NULL);
+         	O32_HeapDestroy(hHeap);
+               	return(NULL);
       }
       processheap = hHeap;
Index: trunk/src/kernel32/os2heap.cpp
===================================================================
--- trunk/src/kernel32/os2heap.cpp	(revision 530)
+++ trunk/src/kernel32/os2heap.cpp	(revision 532)
@@ -1,3 +1,3 @@
-/* $Id: os2heap.cpp,v 1.7 1999-08-17 16:35:09 phaller Exp $ */
+/* $Id: os2heap.cpp,v 1.8 1999-08-17 17:04:51 sandervl Exp $ */
 
 /*
@@ -91,5 +91,5 @@
   {
     hmutex->leave();
-    delete hmutex;
+    delete(hmutex);
   }
 
Index: trunk/src/kernel32/thread.cpp
===================================================================
--- trunk/src/kernel32/thread.cpp	(revision 530)
+++ trunk/src/kernel32/thread.cpp	(revision 532)
@@ -1,3 +1,3 @@
-/* $Id: thread.cpp,v 1.9 1999-08-17 16:35:10 phaller Exp $ */
+/* $Id: thread.cpp,v 1.10 1999-08-17 17:04:52 sandervl Exp $ */
 
 /*
@@ -12,5 +12,4 @@
 #include <os2win.h>
 #include <stdarg.h>
-//#include <odincrt.h>
 #include "thread.h"
 #include "except.h"
@@ -160,6 +159,5 @@
  DWORD            rc;
 
- delete(me);    //only called once
-
+  delete(me);    //only called once
   dprintf(("Win32ThreadProc %d\n", GetCurrentThreadId()));
 
Index: trunk/src/kernel32/winimage.cpp
===================================================================
--- trunk/src/kernel32/winimage.cpp	(revision 530)
+++ trunk/src/kernel32/winimage.cpp	(revision 532)
@@ -1,3 +1,3 @@
-/* $Id: winimage.cpp,v 1.8 1999-08-17 16:35:10 phaller Exp $ */
+/* $Id: winimage.cpp,v 1.9 1999-08-17 17:04:52 sandervl Exp $ */
 
 /*
@@ -144,5 +144,5 @@
   {
     res    = winres->next;
-    delete winres;
+    delete(winres);
     winres = res;
   }
@@ -985,5 +985,5 @@
         if(WinDll == NULL) {
             fout << "WinDll: Error allocating memory" << endl;
-                WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szMemErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);
+            WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, szMemErrorMsg, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);
             errorState = ERROR_INTERNAL;
             return(FALSE);
Index: trunk/src/kernel32/winimgres.cpp
===================================================================
--- trunk/src/kernel32/winimgres.cpp	(revision 530)
+++ trunk/src/kernel32/winimgres.cpp	(revision 532)
@@ -1,13 +1,11 @@
-/* $Id: winimgres.cpp,v 1.6 1999-08-17 16:35:11 phaller Exp $ */
-
-/*
- *
- * Project Odin Software License can be found in LICENSE.TXT
- *
- */
+/* $Id: winimgres.cpp,v 1.7 1999-08-17 17:04:52 sandervl Exp $ */
+
 /*
  * Win32 PE Image class (resource methods)
  *
  * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
+ *
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
  *
  */
@@ -160,5 +158,4 @@
         unicodestr += *unicodestr;
     }
-
     res = new Win32Resource(this, id, NTRT_STRING, (ULONG)*unicodestr, (char *)unicodestr);
     if(res == NULL) {
@@ -167,6 +164,5 @@
     }
   }
-  else
-    res = new Win32Resource(this, id, type, pData->Size, resdata);
+  else  res = new Win32Resource(this, id, type, pData->Size, resdata);
 
   return res;
Index: trunk/src/kernel32/wprocess.cpp
===================================================================
--- trunk/src/kernel32/wprocess.cpp	(revision 530)
+++ trunk/src/kernel32/wprocess.cpp	(revision 532)
@@ -1,3 +1,3 @@
-/* $Id: wprocess.cpp,v 1.19 1999-08-17 16:35:11 phaller Exp $ */
+/* $Id: wprocess.cpp,v 1.20 1999-08-17 17:04:52 sandervl Exp $ */
 
 /*
@@ -14,5 +14,4 @@
 #include <stdlib.h>
 #include <string.h>
-#include <odinwrap.h>
 
 #include "unicode.h"
@@ -37,5 +36,5 @@
 //Process database
 PDB       ProcessPDB = {0};
-USHORT     ProcessTIBSel = 0;
+USHORT    ProcessTIBSel = 0;
 DWORD    *TIBFlatPtr    = 0;
 
@@ -77,20 +76,20 @@
    TIBFlatPtr = (DWORD *)OS2AllocThreadLocalMemory(1);
    if(TIBFlatPtr == 0) {
-   dprintf(("InitializeTIB: local thread memory alloc failed!!"));
-   DebugInt3();
-   return NULL;
+   	dprintf(("InitializeTIB: local thread memory alloc failed!!"));
+   	DebugInt3();
+   	return NULL;
    }
    if(OS2AllocSel(PAGE_SIZE, &tibsel) == FALSE)
    {
-   dprintf(("InitializeTIB: selector alloc failed!!"));
-   DebugInt3();
-   return NULL;
+   	dprintf(("InitializeTIB: selector alloc failed!!"));
+   	DebugInt3();
+   	return NULL;
    }
    winteb = (TEB *)OS2SelToFlat(tibsel);
    if(winteb == NULL)
    {
-   dprintf(("InitializeTIB: DosSelToFlat failed!!"));
-   DebugInt3();
-   return NULL;
+   	dprintf(("InitializeTIB: DosSelToFlat failed!!"));
+   	DebugInt3();
+   	return NULL;
    }
    memset(winteb, 0, PAGE_SIZE);
@@ -117,14 +116,14 @@
    if(OS2GetPIB(PIB_TASKTYPE) == TASKTYPE_PM)
    {
-   thdb->flags      = 0;  //todo gui
-   }
-   else  thdb->flags      = 0;  //todo textmode
+   	thdb->flags      = 0;  //todo gui
+   }
+   else thdb->flags      = 0;  //todo textmode
 
    if(fMainThread)
    {
-   //todo initialize PDB during process creation
+   	//todo initialize PDB during process creation
         //todo: initialize TLS array if required
         //TLS in executable always TLS index 0?
-   ProcessTIBSel = tibsel;
+   	ProcessTIBSel = tibsel;
    }
    dprintf(("InitializeTIB setup TEB with selector %x", tibsel));
@@ -146,12 +145,12 @@
    winteb = (TEB *)*TIBFlatPtr;
    if(winteb) {
-   thdb = (THDB *)(winteb+1);
-   orgtibsel = thdb->OrgTIBSel;
-
-   //Restore our original FS selector
-      SetFS(orgtibsel);
-
-      //And free our own
-      OS2FreeSel(thdb->teb_sel);
+   	thdb = (THDB *)(winteb+1);
+   	orgtibsel = thdb->OrgTIBSel;
+
+   	//Restore our original FS selector
+      	SetFS(orgtibsel);
+
+      	//And free our own
+      	OS2FreeSel(thdb->teb_sel);
    }
    else dprintf(("Already destroyed TIB"));
@@ -171,9 +170,9 @@
    winteb = (TEB *)*TIBFlatPtr;
    if(winteb) {
-   thdb = (THDB *)(winteb+1);
-   orgtibsel = thdb->OrgTIBSel;
-
-   //Restore our original FS selector
-      SetFS(orgtibsel);
+   	thdb = (THDB *)(winteb+1);
+   	orgtibsel = thdb->OrgTIBSel;
+
+   	//Restore our original FS selector
+      	SetFS(orgtibsel);
    }
 }
@@ -188,9 +187,9 @@
    winteb = (TEB *)*TIBFlatPtr;
    if(winteb) {
-   thdb = (THDB *)(winteb+1);
-   win32tibsel = thdb->teb_sel;
-
-   //Restore our win32 FS selector
-      return SetReturnFS(win32tibsel);
+   	thdb = (THDB *)(winteb+1);
+   	win32tibsel = thdb->teb_sel;
+
+   	//Restore our win32 FS selector
+      	return SetReturnFS(win32tibsel);
    }
    // nested calls are OK, OS2ToWinCallback for instance
@@ -202,12 +201,11 @@
 //******************************************************************************
 void WIN32API RegisterExe(WIN32EXEENTRY EntryPoint, PIMAGE_TLS_CALLBACK *TlsCallbackAddr,
-           LPDWORD TlsIndexAddr, ULONG TlsInitSize,
-           ULONG TlsTotalSize, LPVOID TlsAddress,
-                 LONG Win32TableId, LONG NameTableId, LONG VersionResId,
-                    LONG Pe2lxVersion, HINSTANCE hinstance, ULONG dwReserved)
+           		  LPDWORD TlsIndexAddr, ULONG TlsInitSize,
+           		  ULONG TlsTotalSize, LPVOID TlsAddress,
+                 	  LONG Win32TableId, LONG NameTableId, LONG VersionResId,
+                    	 LONG Pe2lxVersion, HINSTANCE hinstance, ULONG dwReserved)
 {
   if(WinExe != NULL) //should never happen
-    delete WinExe;
-
+    	delete(WinExe);
 
   CheckVersion(Pe2lxVersion, OS2GetDllName(hinstance));
@@ -223,31 +221,31 @@
 
   if(winexe) {
-   dprintf(("RegisterExe Win32TableId = %x", Win32TableId));
-   dprintf(("RegisterExe NameTableId  = %x", NameTableId));
-   dprintf(("RegisterExe VersionResId = %x", VersionResId));
-   dprintf(("RegisterExe Pe2lxVersion = %x", Pe2lxVersion));
-
-      winexe->setVersionId(VersionResId);
-      winexe->setOS2InstanceHandle(hinstance);
-   winexe->setEntryPoint((ULONG)EntryPoint);
-   winexe->setTLSAddress(TlsAddress);
-   winexe->setTLSInitSize(TlsInitSize);
-   winexe->setTLSTotalSize(TlsTotalSize);
-   winexe->setTLSIndexAddr(TlsIndexAddr);
-   winexe->setTLSCallBackAddr(TlsCallbackAddr);
-
-   char *modname = getenv("WIN32MODULE");
-
-   if(modname != NULL)
-   {
-         dprintf(("Set full path for exe to %s", modname));
-         winexe->setFullPath(modname);
-   }
-   winexe->start();
+   	dprintf(("RegisterExe Win32TableId = %x", Win32TableId));
+   	dprintf(("RegisterExe NameTableId  = %x", NameTableId));
+   	dprintf(("RegisterExe VersionResId = %x", VersionResId));
+   	dprintf(("RegisterExe Pe2lxVersion = %x", Pe2lxVersion));
+
+      	winexe->setVersionId(VersionResId);
+      	winexe->setOS2InstanceHandle(hinstance);
+   	winexe->setEntryPoint((ULONG)EntryPoint);
+   	winexe->setTLSAddress(TlsAddress);
+   	winexe->setTLSInitSize(TlsInitSize);
+   	winexe->setTLSTotalSize(TlsTotalSize);
+   	winexe->setTLSIndexAddr(TlsIndexAddr);
+   	winexe->setTLSCallBackAddr(TlsCallbackAddr);
+
+   	char *modname = getenv("WIN32MODULE");
+
+   	if(modname != NULL)
+   	{
+         	dprintf(("Set full path for exe to %s", modname));
+         	winexe->setFullPath(modname);
+   	}
+   	winexe->start();
   }
   else {
-      eprintf(("Win32Exe creation failed!\n"));
-      DebugInt3();
-   return;
+      	eprintf(("Win32Exe creation failed!\n"));
+      	DebugInt3();
+   	return;
   }
 }
@@ -255,8 +253,8 @@
 //******************************************************************************
 ULONG WIN32API RegisterDll(WIN32DLLENTRY pfnDllEntry, PIMAGE_TLS_CALLBACK *TlsCallbackAddr,
-            LPDWORD TlsIndexAddr, ULONG TlsInitSize,
-            ULONG TlsTotalSize, LPVOID TlsAddress,
-                  LONG Win32TableId, LONG NameTableId, LONG VersionResId,
-                     LONG Pe2lxVersion, HINSTANCE hinstance, ULONG dwAttachType)
+            		   LPDWORD TlsIndexAddr, ULONG TlsInitSize,
+            		   ULONG TlsTotalSize, LPVOID TlsAddress,
+                  	   LONG Win32TableId, LONG NameTableId, LONG VersionResId,
+                     	   LONG Pe2lxVersion, HINSTANCE hinstance, ULONG dwAttachType)
 {
  char *name;
@@ -265,50 +263,50 @@
   if(dwAttachType == 0)
   { //Process attach
-   if(getenv("WIN32_IOPL2")) {
-         io_init1();
-   }
-   name = OS2GetDllName(hinstance);
-   CheckVersion(Pe2lxVersion, name);
-
-   dprintf(("RegisterDll %X %s reason %d\n", hinstance, name, dwAttachType));
-   dprintf(("RegisterDll Win32TableId = %x", Win32TableId));
-   dprintf(("RegisterDll NameTableId  = %x", NameTableId));
-   dprintf(("RegisterDll VersionResId = %x", VersionResId));
-   dprintf(("RegisterDll Pe2lxVersion = %x", Pe2lxVersion));
-
-   if(winmod != NULL) {
-         //dll manually loaded by PE loader (Win32Dll::init)
-         winmod->OS2DllInit(hinstance, NameTableId, Win32TableId, pfnDllEntry);
-   }
-   else {
-      //converted win32 dll loaded by OS/2 loader
-      winmod = new Win32Dll(hinstance, NameTableId, Win32TableId, pfnDllEntry);
-      if(winmod == NULL) {
-            eprintf(("Failed to allocate module object!\n"));
-            DebugInt3();
-            return 0;                    //fail dll load
-      }
-   }
-   winmod->setTLSAddress(TlsAddress);
-   winmod->setTLSInitSize(TlsInitSize);
-   winmod->setTLSTotalSize(TlsTotalSize);
-   winmod->setTLSIndexAddr(TlsIndexAddr);
-   winmod->setTLSCallBackAddr(TlsCallbackAddr);
-
-   /* @@@PH 1998/03/17 console devices initialization */
-   iConsoleDevicesRegister();
-
-   //SvL: 19-8-'98
-   winmod->AddRef();
-   winmod->setVersionId(VersionResId);
-
-   winmod->attachProcess();
+   	if(getenv("WIN32_IOPL2")) {
+         	io_init1();
+   	}
+   	name = OS2GetDllName(hinstance);
+   	CheckVersion(Pe2lxVersion, name);
+
+   	dprintf(("RegisterDll %X %s reason %d\n", hinstance, name, dwAttachType));
+   	dprintf(("RegisterDll Win32TableId = %x", Win32TableId));
+   	dprintf(("RegisterDll NameTableId  = %x", NameTableId));
+   	dprintf(("RegisterDll VersionResId = %x", VersionResId));
+   	dprintf(("RegisterDll Pe2lxVersion = %x", Pe2lxVersion));
+
+   	if(winmod != NULL) {
+         	//dll manually loaded by PE loader (Win32Dll::init)
+         	winmod->OS2DllInit(hinstance, NameTableId, Win32TableId, pfnDllEntry);
+   	}
+   	else {
+      		//converted win32 dll loaded by OS/2 loader
+      		winmod = new Win32Dll(hinstance, NameTableId, Win32TableId, pfnDllEntry);
+      		if(winmod == NULL) {
+            		eprintf(("Failed to allocate module object!\n"));
+            		DebugInt3();
+            		return 0;                    //fail dll load
+      		}
+   	}
+   	winmod->setTLSAddress(TlsAddress);
+   	winmod->setTLSInitSize(TlsInitSize);
+   	winmod->setTLSTotalSize(TlsTotalSize);
+   	winmod->setTLSIndexAddr(TlsIndexAddr);
+   	winmod->setTLSCallBackAddr(TlsCallbackAddr);
+
+   	/* @@@PH 1998/03/17 console devices initialization */
+   	iConsoleDevicesRegister();
+
+   	//SvL: 19-8-'98
+   	winmod->AddRef();
+   	winmod->setVersionId(VersionResId);
+
+   	winmod->attachProcess();
    }
    else {//process detach
-   if(winmod != NULL && !fFreeLibrary) {
-      return 0;   //don't unload (OS/2 dll unload bug)
-   }
-//Runtime environment could already be gone, so don't do this
-// dprintf(("KERNEL32: Dll Removed by FreeLibrary or ExitProcess\n"));
+   	if(winmod != NULL && !fFreeLibrary) {
+      		return 0;   //don't unload (OS/2 dll unload bug)
+   	}
+	//Runtime environment could already be gone, so don't do this
+	// dprintf(("KERNEL32: Dll Removed by FreeLibrary or ExitProcess\n"));
    }
    return 1;   //success
@@ -321,5 +319,5 @@
 
   if(WinExe) {
-    delete WinExe;
+    delete(WinExe);
     WinExe = NULL;
   }
@@ -400,10 +398,10 @@
     if(module->getError() != NO_ERROR) {
         dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile));
-        delete module;
+        delete(module);
         return(0);
     }
     if(module->attachProcess() == FALSE) {
         dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile));
-        delete module;
+        delete(module);
         return(0);
     }
@@ -465,4 +463,5 @@
 
     module = new Win32Dll((char *)lpszLibFile);
+
     if(module == NULL)
         return(0);
@@ -471,5 +470,5 @@
     if(module->getError() != NO_ERROR) {
         dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile));
-        delete module;
+        delete(module);
         return(0);
     }
@@ -479,5 +478,5 @@
     if(module->attachProcess() == FALSE) {
         dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile));
-        delete module;
+        delete(module);
         return(0);
     }
