Index: trunk/src/kernel32/heapstring.cpp
===================================================================
--- trunk/src/kernel32/heapstring.cpp	(revision 2076)
+++ trunk/src/kernel32/heapstring.cpp	(revision 2077)
@@ -1,3 +1,3 @@
-/* $Id: heapstring.cpp,v 1.22 1999-12-09 00:52:20 sandervl Exp $ */
+/* $Id: heapstring.cpp,v 1.23 1999-12-14 19:14:27 sandervl Exp $ */
 
 /*
@@ -138,5 +138,8 @@
            arg2));
 
-  return O32_lstrcat(arg1, arg2);
+  if(arg2 == NULL)
+    return arg1;
+  strcat(arg1, arg2);
+  return arg1;
 }
 
@@ -159,4 +162,7 @@
            arg1,
            arg2));
+
+  if(arg2 == NULL)
+    return arg1;
 
   UniStrcat( (UniChar*) arg1, (UniChar*) arg2 );
@@ -326,6 +332,5 @@
  *****************************************************************************/
 
-ODINFUNCTION2(LPSTR,lstrcpyA,LPSTR, dest,
-                             LPCSTR,src)
+LPSTR WIN32API lstrcpyA(LPSTR dest, LPCSTR src)
 {
   if ( (src == NULL) || (dest == NULL) ) // stupid parameter checking
@@ -348,6 +353,5 @@
  *****************************************************************************/
 
-ODINFUNCTION2(LPWSTR,lstrcpyW,LPWSTR, dest,
-                              LPCWSTR,src)
+LPWSTR WIN32API lstrcpyW(LPWSTR dest, LPCWSTR src)
 {
   if ( (src == NULL) || (dest == NULL) ) // stupid parameter checking
Index: trunk/src/kernel32/mmap.cpp
===================================================================
--- trunk/src/kernel32/mmap.cpp	(revision 2076)
+++ trunk/src/kernel32/mmap.cpp	(revision 2077)
@@ -1,3 +1,3 @@
-/* $Id: mmap.cpp,v 1.29 1999-12-14 12:50:45 sandervl Exp $ */
+/* $Id: mmap.cpp,v 1.30 1999-12-14 19:14:28 sandervl Exp $ */
 
 /*
@@ -337,5 +337,6 @@
 		goto fail;
   	}
-	if(hMemFile == -1 && !image && (mProtFlags & SEC_COMMIT)) {//commit memory
+	//Windows NT seems to commit memory for memory maps, regardsless of the SEC_COMMIT flag
+	if(hMemFile == -1 && !image) {//commit memory
 		VirtualAlloc(pMapping, mSize, MEM_COMMIT, PAGE_READWRITE);
 	}
Index: trunk/src/kernel32/winexepeldr.cpp
===================================================================
--- trunk/src/kernel32/winexepeldr.cpp	(revision 2076)
+++ trunk/src/kernel32/winexepeldr.cpp	(revision 2077)
@@ -1,3 +1,3 @@
-/* $Id: winexepeldr.cpp,v 1.5 1999-11-24 19:31:23 sandervl Exp $ */
+/* $Id: winexepeldr.cpp,v 1.6 1999-12-14 19:14:28 sandervl Exp $ */
 
 /*
@@ -65,4 +65,5 @@
 
   WinExe->setCommandLine(szCmdLine);
+  dprintf(("Cmd line: %s", szCmdLine));
 
   if(getenv("WIN32_IOPL2")) {
Index: trunk/src/kernel32/wprocess.cpp
===================================================================
--- trunk/src/kernel32/wprocess.cpp	(revision 2076)
+++ trunk/src/kernel32/wprocess.cpp	(revision 2077)
@@ -1,3 +1,3 @@
-/* $Id: wprocess.cpp,v 1.57 1999-12-10 14:06:12 sandervl Exp $ */
+/* $Id: wprocess.cpp,v 1.58 1999-12-14 19:14:28 sandervl Exp $ */
 
 /*
@@ -8,5 +8,5 @@
  *
  * NOTE: Even though Odin32 OS/2 apps don't switch FS selectors,
- *       we still allocate a TEB to store misc information. 
+ *       we still allocate a TEB to store misc information.
  *
  * Project Odin Software License can be found in LICENSE.TXT
@@ -46,6 +46,6 @@
 //******************************************************************************
 BOOL      fFreeLibrary = FALSE;
-BOOL      fIsOS2Image = FALSE;	//TRUE  -> Odin32 OS/2 application (not converted!)
-                         	//FALSE -> otherwise
+BOOL      fIsOS2Image = FALSE;  //TRUE  -> Odin32 OS/2 application (not converted!)
+                            //FALSE -> otherwise
 //Process database
 PDB       ProcessPDB = {0};
@@ -58,5 +58,5 @@
 {
   if(TIBFlatPtr == NULL)
-	return 0;
+    return 0;
 
   return (TEB *)*TIBFlatPtr;
@@ -70,9 +70,9 @@
 
   if(TIBFlatPtr == NULL)
-	return 0;
+    return 0;
 
   winteb = (TEB *)*TIBFlatPtr;
   if(winteb == NULL) {
-   	return NULL;
+    return NULL;
   }
   thdb = (THDB *)(winteb+1);
@@ -92,23 +92,23 @@
    //Allocate one dword to store the flat address of our TEB
    if(fMainThread) {
-   	TIBFlatPtr = (DWORD *)OSLibAllocThreadLocalMemory(1);
-   	if(TIBFlatPtr == 0) {
-   		dprintf(("InitializeTIB: local thread memory alloc failed!!"));
-	   	DebugInt3();
-	   	return NULL;
-	}
+    TIBFlatPtr = (DWORD *)OSLibAllocThreadLocalMemory(1);
+    if(TIBFlatPtr == 0) {
+        dprintf(("InitializeTIB: local thread memory alloc failed!!"));
+        DebugInt3();
+        return NULL;
+    }
    }
    if(OSLibAllocSel(PAGE_SIZE, &tibsel) == FALSE)
    {
-   	dprintf(("InitializeTIB: selector alloc failed!!"));
-   	DebugInt3();
-   	return NULL;
+    dprintf(("InitializeTIB: selector alloc failed!!"));
+    DebugInt3();
+    return NULL;
    }
    winteb = (TEB *)OSLibSelToFlat(tibsel);
    if(winteb == NULL)
    {
-   	dprintf(("InitializeTIB: DosSelToFlat failed!!"));
-   	DebugInt3();
-   	return NULL;
+    dprintf(("InitializeTIB: DosSelToFlat failed!!"));
+    DebugInt3();
+    return NULL;
    }
    memset(winteb, 0, PAGE_SIZE);
@@ -136,5 +136,5 @@
    if(OSLibGetPIB(PIB_TASKTYPE) == TASKTYPE_PM)
    {
-   	thdb->flags      = 0;  //todo gui
+    thdb->flags      = 0;  //todo gui
    }
    else thdb->flags      = 0;  //todo textmode
@@ -142,22 +142,22 @@
    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;
-    	ProcessPDB.exit_code       = 0x103; /* STILL_ACTIVE */
-    	ProcessPDB.threads         = 1;
-    	ProcessPDB.running_threads = 1;
-    	ProcessPDB.ring0_threads   = 1;
-    	ProcessPDB.system_heap     = GetProcessHeap();
-    	ProcessPDB.parent          = 0;
-    	ProcessPDB.group           = &ProcessPDB;
-    	ProcessPDB.priority        = 8;  /* Normal */
-    	ProcessPDB.heap            = ProcessPDB.system_heap;  /* will be changed later on */
-    	ProcessPDB.next            = NULL;
-    	ProcessPDB.winver          = 0xffff; /* to be determined */
+    ProcessTIBSel = tibsel;
+        ProcessPDB.exit_code       = 0x103; /* STILL_ACTIVE */
+        ProcessPDB.threads         = 1;
+        ProcessPDB.running_threads = 1;
+        ProcessPDB.ring0_threads   = 1;
+        ProcessPDB.system_heap     = GetProcessHeap();
+        ProcessPDB.parent          = 0;
+        ProcessPDB.group           = &ProcessPDB;
+        ProcessPDB.priority        = 8;  /* Normal */
+        ProcessPDB.heap            = ProcessPDB.system_heap;  /* will be changed later on */
+        ProcessPDB.next            = NULL;
+        ProcessPDB.winver          = 0xffff; /* to be determined */
         ProcessPDB.server_pid      = (void *)GetCurrentProcessId();
 
-	GetSystemTime(&ProcessPDB.creationTime);
+    GetSystemTime(&ProcessPDB.creationTime);
 
         /* Initialize the critical section */
@@ -182,12 +182,12 @@
    winteb = (TEB *)*TIBFlatPtr;
    if(winteb) {
-   	thdb = (THDB *)(winteb+1);
-   	orgtibsel = thdb->OrgTIBSel;
-
-   	//Restore our original FS selector
-      	SetFS(orgtibsel);
-
-      	//And free our own
-      	OSLibFreeSel(thdb->teb_sel);
+    thdb = (THDB *)(winteb+1);
+    orgtibsel = thdb->OrgTIBSel;
+
+    //Restore our original FS selector
+        SetFS(orgtibsel);
+
+        //And free our own
+        OSLibFreeSel(thdb->teb_sel);
    }
    else dprintf(("Already destroyed TIB"));
@@ -214,14 +214,14 @@
    //we don't switch FS selectors
    if(fIsOS2Image) {
-	return;
+    return;
    }
 
    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);
    }
 }
@@ -237,28 +237,28 @@
    //we don't switch FS selectors
    if(fIsOS2Image) {
-	return GetFS();
+    return GetFS();
    }
 
    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);
    }
    else {
-	//we didn't create this thread, so allocate a selector now
-	//NOTE: Possible memory leak (i.e. DART threads in WINMM)
-	winteb = InitializeTIB();
-	if(winteb == NULL) {
-		DebugInt3();
-		return GetFS();
-	}
-   	thdb = (THDB *)(winteb+1);
-   	win32tibsel = thdb->teb_sel;
-
-   	//Restore our win32 FS selector
-      	return SetReturnFS(win32tibsel);
+    //we didn't create this thread, so allocate a selector now
+    //NOTE: Possible memory leak (i.e. DART threads in WINMM)
+    winteb = InitializeTIB();
+    if(winteb == NULL) {
+        DebugInt3();
+        return GetFS();
+    }
+    thdb = (THDB *)(winteb+1);
+    win32tibsel = thdb->teb_sel;
+
+    //Restore our win32 FS selector
+        return SetReturnFS(win32tibsel);
    }
    // nested calls are OK, OS2ToWinCallback for instance
@@ -289,5 +289,5 @@
 
   Win32DllExitList(0);
- 
+
   //Note: Needs to be done after Win32DllExitList (destruction of exe + dll objects)
   //Flush and delete all open memory mapped files
@@ -316,6 +316,6 @@
   winmod = Win32DllBase::findModule(hinstance);
   if(winmod) {
-    	winmod->Release();
-    	return(TRUE);
+        winmod->Release();
+        return(TRUE);
   }
   dprintf(("KERNEL32: FreeLibrary %s %X\n", OSLibGetDllName(hinstance), hinstance));
@@ -338,7 +338,7 @@
   module = Win32DllBase::findModule((LPSTR)lpszLibFile);
   if(module) {
-    	module->AddRef();
-	dprintf(("iLoadLibrary: found %s -> handle %x", lpszLibFile, module->getInstanceHandle()));
-    	return module->getInstanceHandle();
+        module->AddRef();
+    dprintf(("iLoadLibrary: found %s -> handle %x", lpszLibFile, module->getInstanceHandle()));
+        return module->getInstanceHandle();
   }
 
@@ -359,36 +359,36 @@
 
   if(!strstr(modname, ".")) {
-	strcat(modname,".DLL");
+    strcat(modname,".DLL");
   }
 
   if(Win32ImageBase::isPEImage((char *)modname))
   {
-    	module = Win32DllBase::findModule((char *)modname);
-    	if(module) {//don't load it again
-        	module->AddRef();
-        	return module->getInstanceHandle();
-    	}
-
-    	Win32PeLdrDll *peldrDll = new Win32PeLdrDll((char *)modname);
-    	if(peldrDll == NULL)
-        	return(0);
-
-    	peldrDll->init(0);
-    	if(peldrDll->getError() != NO_ERROR) {
-        	dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile));
-        	delete(peldrDll);
-        	return(0);
-    	}
-    	if(dwFlags & DONT_RESOLVE_DLL_REFERENCES) {
-        	peldrDll->setNoEntryCalls();
-    	}
-
-    	if(peldrDll->attachProcess() == FALSE) {
-        	dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile));
-        	delete(peldrDll);
-        	return(0);
-    	}
-    	peldrDll->AddRef();
-    	return peldrDll->getInstanceHandle();
+        module = Win32DllBase::findModule((char *)modname);
+        if(module) {//don't load it again
+            module->AddRef();
+            return module->getInstanceHandle();
+        }
+
+        Win32PeLdrDll *peldrDll = new Win32PeLdrDll((char *)modname);
+        if(peldrDll == NULL)
+            return(0);
+
+        peldrDll->init(0);
+        if(peldrDll->getError() != NO_ERROR) {
+            dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile));
+            delete(peldrDll);
+            return(0);
+        }
+        if(dwFlags & DONT_RESOLVE_DLL_REFERENCES) {
+            peldrDll->setNoEntryCalls();
+        }
+
+        if(peldrDll->attachProcess() == FALSE) {
+            dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile));
+            delete(peldrDll);
+            return(0);
+        }
+        peldrDll->AddRef();
+        return peldrDll->getInstanceHandle();
   }
   else  return(0);
@@ -528,17 +528,17 @@
   dprintf(("GetModuleFileName %X", hinstModule));
   if(hinstModule == 0 || hinstModule == -1 || (WinExe && hinstModule == WinExe->getInstanceHandle())) {
-    	module = (Win32ImageBase *)WinExe;
+        module = (Win32ImageBase *)WinExe;
   }
   else {
-    	module = (Win32ImageBase *)Win32DllBase::findModule(hinstModule);
+        module = (Win32ImageBase *)Win32DllBase::findModule(hinstModule);
   }
 
   if(module) {
-    	fpath = module->getFullPath();
+        fpath = module->getFullPath();
   }
   if(fpath) {
-    	//SvL: 13-9-98: +1
-    	rc = min(strlen(fpath)+1, cchPath);
-    	strncpy(lpszPath, fpath, rc);
+        //SvL: 13-9-98: +1
+        rc = min(strlen(fpath)+1, cchPath);
+        strncpy(lpszPath, fpath, rc);
   }
   else  rc = O32_GetModuleFileName(hinstModule, lpszPath, cchPath);
@@ -574,35 +574,35 @@
 
   if(lpszModule == NULL) {
-	if(WinExe)
-		hMod = WinExe->getInstanceHandle();
-	else	hMod = -1;
+    if(WinExe)
+        hMod = WinExe->getInstanceHandle();
+    else    hMod = -1;
   }
   else {
-  	strcpy(szModule, OSLibStripPath((char *)lpszModule));
-  	strupr(szModule);
-	if(strstr(szModule, ".DLL")) {
-		fDllModule = TRUE;
-	}
-	else {
-		if(!strstr(szModule, ".")) {
-			//if there's no extension or trainling dot, we
+    strcpy(szModule, OSLibStripPath((char *)lpszModule));
+    strupr(szModule);
+    if(strstr(szModule, ".DLL")) {
+        fDllModule = TRUE;
+    }
+    else {
+        if(!strstr(szModule, ".")) {
+            //if there's no extension or trainling dot, we
                         //assume it's a dll (see Win32 SDK docs)
-			fDllModule = TRUE;
-		}
-	}
-  	char *dot = strstr(szModule, ".");
-  	if(dot)
-		*dot = 0;
-
-  	if(!fDllModule && WinExe && !strcmpi(szModule, WinExe->getModuleName())) {
-		hMod = WinExe->getInstanceHandle();
-	}
-	else {
-  		windll = Win32DllBase::findModule(szModule);
-		if(windll) {
-			hMod = windll->getInstanceHandle();
-		}
-		else    hMod = OSLibiGetModuleHandleA((char *)lpszModule);
-	}
+            fDllModule = TRUE;
+        }
+    }
+    char *dot = strstr(szModule, ".");
+    if(dot)
+        *dot = 0;
+
+    if(!fDllModule && WinExe && !strcmpi(szModule, WinExe->getModuleName())) {
+        hMod = WinExe->getInstanceHandle();
+    }
+    else {
+        windll = Win32DllBase::findModule(szModule);
+        if(windll) {
+            hMod = windll->getInstanceHandle();
+        }
+        else    hMod = OSLibiGetModuleHandleA((char *)lpszModule);
+    }
   }
 
@@ -634,6 +634,5 @@
 {
  BOOL  rc;
- char *cmdline;
- BOOL  fAllocStr = FALSE;
+ char *cmdline = NULL;
 
     dprintf(("KERNEL32: CreateProcessA %s cline:%s inherit:%d cFlags:%x Env:%x CurDir:%s StartupFlags:%x\n",
@@ -645,23 +644,27 @@
                          lpEnvironment, lpCurrentDirectory, lpStartupInfo,
                          lpProcessInfo) == TRUE)
-    	return(TRUE);
+        return(TRUE);
 
     //probably a win32 exe, so run it in the pe loader
     if(lpApplicationName) {
-       if(lpCommandLine) {
-          cmdline = (char *)malloc(strlen(lpApplicationName)+strlen(lpCommandLine) + 16); 
-          sprintf(cmdline, "PE.EXE %s %s", lpApplicationName, lpCommandLine);
-        	fAllocStr = TRUE;
-     	 }
-     	 else {
-          cmdline = (char *)malloc(strlen(lpApplicationName) + 16);
-          sprintf(cmdline, "PE.EXE %s", lpApplicationName);
-        	fAllocStr = TRUE;
-	 }
+        if(lpCommandLine) {
+            //skip exe name in lpCommandLine
+            while(*lpCommandLine != 0 && *lpCommandLine != ' ')
+                lpCommandLine++;
+
+            if(*lpCommandLine != 0) {
+                lpCommandLine++;
+            }
+            cmdline = (char *)malloc(strlen(lpApplicationName)+strlen(lpCommandLine) + 16);
+            sprintf(cmdline, "PE.EXE %s %s", lpApplicationName, lpCommandLine);
+         }
+         else {
+            cmdline = (char *)malloc(strlen(lpApplicationName) + 16);
+            sprintf(cmdline, "PE.EXE %s", lpApplicationName);
+        }
     }
     else {
         cmdline = (char *)malloc(strlen(lpCommandLine) + 16);
         sprintf(cmdline, "PE.EXE %s", lpCommandLine);
-       	fAllocStr = TRUE;
     }
     dprintf(("KERNEL32:  CreateProcess %s\n", cmdline));
@@ -670,6 +673,6 @@
                          lpEnvironment, lpCurrentDirectory, lpStartupInfo,
                          lpProcessInfo);
-    if(fAllocStr)
-    	free(cmdline);
+    if(cmdline)
+        free(cmdline);
 
     if(lpProcessInfo)
@@ -697,5 +700,4 @@
     astring2 = UnicodeToAsciiString(arg2);
     astring3 = UnicodeToAsciiString((LPWSTR)arg8);
-    // NOTE: This will not work as is (needs UNICODE support)
     rc = CreateProcessA(astring1, astring2, arg3, arg4, arg5, arg6, arg7,
                            astring3, (LPSTARTUPINFOA)arg9, arg10);
@@ -715,7 +717,7 @@
     startinfo.dwFlags = nCmdShow;
     if(CreateProcessA(NULL, (LPSTR)lpCmdLine, NULL, NULL, FALSE, 0, NULL, NULL,
-                      &startinfo, &procinfo) == FALSE) 
+                      &startinfo, &procinfo) == FALSE)
     {
-	return 0;
+    return 0;
     }
     return procinfo.hProcess; //correct?
@@ -730,22 +732,22 @@
 
   if(hModule == 0 || hModule == -1 || (WinExe && hModule == WinExe->getInstanceHandle())) {
-	winmod = WinExe;
+    winmod = WinExe;
   }
   else  winmod = (Win32ImageBase *)Win32DllBase::findModule((HINSTANCE)hModule);
 
   if(winmod) {
-    	ulAPIOrdinal = (ULONG)lpszProc;
-    	if (ulAPIOrdinal <= 0x0000FFFF) {
-        	proc = (FARPROC)winmod->getApi((int)ulAPIOrdinal);
-    	}
-    	else    proc = (FARPROC)winmod->getApi((char *)lpszProc);
-	if(proc == 0) {
-		SetLastError(ERROR_PROC_NOT_FOUND);
-	}
-	return proc;
+        ulAPIOrdinal = (ULONG)lpszProc;
+        if (ulAPIOrdinal <= 0x0000FFFF) {
+            proc = (FARPROC)winmod->getApi((int)ulAPIOrdinal);
+        }
+        else    proc = (FARPROC)winmod->getApi((char *)lpszProc);
+    if(proc == 0) {
+        SetLastError(ERROR_PROC_NOT_FOUND);
+    }
+    return proc;
   }
   proc = O32_GetProcAddress(hModule, lpszProc);
-  if(HIWORD(lpszProc)) 
-  	dprintf(("KERNEL32:  GetProcAddress %s from %X returned %X\n", lpszProc, hModule, proc));
+  if(HIWORD(lpszProc))
+    dprintf(("KERNEL32:  GetProcAddress %s from %X returned %X\n", lpszProc, hModule, proc));
   else  dprintf(("KERNEL32:  GetProcAddress %x from %X returned %X\n", lpszProc, hModule, proc));
   return(proc);
@@ -761,46 +763,46 @@
   dprintf(("GetVersionStruct of module %s", lpszModName));
   if(WinExe && !stricmp(WinExe->getFullPath(), lpszModName)) {
-    	winimage = (Win32ImageBase *)WinExe;
+        winimage = (Win32ImageBase *)WinExe;
   }
   else {
-    	winimage = (Win32ImageBase *)Win32DllBase::findModule(lpszModName);
-    	if(winimage == NULL) 
+        winimage = (Win32ImageBase *)Win32DllBase::findModule(lpszModName);
+        if(winimage == NULL)
         {
-	 char modname[CCHMAXPATH];
-
-		strcpy(modname, lpszModName);
-  		//rename dll if necessary (i.e. OLE32 -> OLE32OS2)
-  		Win32DllBase::renameDll(modname);
-		
-		if(Win32ImageBase::isPEImage(modname) == FALSE) 
+     char modname[CCHMAXPATH];
+
+        strcpy(modname, lpszModName);
+        //rename dll if necessary (i.e. OLE32 -> OLE32OS2)
+        Win32DllBase::renameDll(modname);
+
+        if(Win32ImageBase::isPEImage(modname) == FALSE)
                 {
-		 HINSTANCE hInstance;
-                  
-			//must be an LX dll, just load it (app will probably load it anyway)
-			hInstance = LoadLibraryA(modname);
-			if(hInstance == 0)
-				return 0;
-		    	winimage = (Win32ImageBase *)Win32DllBase::findModule(hInstance);
-		    	if(winimage) {
-				return winimage->getVersionStruct(verstruct, bufLength);
-			}
-			return 0;
-		}
-		//SvL: Try to load it
-		rsrcimg = new Win32PeLdrRsrcImg(modname);
-		if(rsrcimg == NULL)
-			return 0;
-
-	    	rsrcimg->init(0);
-		if(rsrcimg->getError() != NO_ERROR)
-		{
-	        	dprintf(("GetVersionStruct can't load %s\n", modname));
-			delete rsrcimg;
-	        	return(FALSE);
-		}
-		BOOL rc = rsrcimg->getVersionStruct(verstruct, bufLength);
-		delete rsrcimg;
-		return rc;
-    	}
+         HINSTANCE hInstance;
+
+            //must be an LX dll, just load it (app will probably load it anyway)
+            hInstance = LoadLibraryA(modname);
+            if(hInstance == 0)
+                return 0;
+                winimage = (Win32ImageBase *)Win32DllBase::findModule(hInstance);
+                if(winimage) {
+                return winimage->getVersionStruct(verstruct, bufLength);
+            }
+            return 0;
+        }
+        //SvL: Try to load it
+        rsrcimg = new Win32PeLdrRsrcImg(modname);
+        if(rsrcimg == NULL)
+            return 0;
+
+            rsrcimg->init(0);
+        if(rsrcimg->getError() != NO_ERROR)
+        {
+                dprintf(("GetVersionStruct can't load %s\n", modname));
+            delete rsrcimg;
+                return(FALSE);
+        }
+        BOOL rc = rsrcimg->getVersionStruct(verstruct, bufLength);
+        delete rsrcimg;
+        return rc;
+        }
   }
   return winimage->getVersionStruct(verstruct, bufLength);
@@ -816,47 +818,47 @@
 
   if(WinExe && !stricmp(WinExe->getFullPath(), lpszModName)) {
-    	winimage = (Win32ImageBase *)WinExe;
+        winimage = (Win32ImageBase *)WinExe;
   }
   else {
-    	winimage = (Win32ImageBase *)Win32DllBase::findModule(lpszModName);
-    	if(winimage == NULL) 
+        winimage = (Win32ImageBase *)Win32DllBase::findModule(lpszModName);
+        if(winimage == NULL)
         {
-	 char modname[CCHMAXPATH];
-
-		strcpy(modname, lpszModName);
-  		//rename dll if necessary (i.e. OLE32 -> OLE32OS2)
-  		Win32DllBase::renameDll(modname);
-
-		if(Win32ImageBase::isPEImage(modname) == FALSE) 
+     char modname[CCHMAXPATH];
+
+        strcpy(modname, lpszModName);
+        //rename dll if necessary (i.e. OLE32 -> OLE32OS2)
+        Win32DllBase::renameDll(modname);
+
+        if(Win32ImageBase::isPEImage(modname) == FALSE)
                 {
-		 HINSTANCE hInstance;
-                  
-			//must be an LX dll, just load it (app will probably load it anyway)
-			hInstance = LoadLibraryA(modname);
-			if(hInstance == 0)
-				return 0;
-		    	winimage = (Win32ImageBase *)Win32DllBase::findModule(hInstance);
-		    	if(winimage) {
-				return winimage->getVersionSize();
-			}
-			return 0;
-		}
-
-		//SvL: Try to load it
-		rsrcimg = new Win32PeLdrRsrcImg(modname);
-		if(rsrcimg == NULL)
-			return 0;
-
-	    	rsrcimg->init(0);
-		if(rsrcimg->getError() != NO_ERROR)
-		{
-        		dprintf(("GetVersionSize can't load %s\n", modname));
-			delete rsrcimg;
-	        	return(FALSE);
-		}
-		int size = rsrcimg->getVersionSize();
-		delete rsrcimg;
-		return size;
-    	}
+         HINSTANCE hInstance;
+
+            //must be an LX dll, just load it (app will probably load it anyway)
+            hInstance = LoadLibraryA(modname);
+            if(hInstance == 0)
+                return 0;
+                winimage = (Win32ImageBase *)Win32DllBase::findModule(hInstance);
+                if(winimage) {
+                return winimage->getVersionSize();
+            }
+            return 0;
+        }
+
+        //SvL: Try to load it
+        rsrcimg = new Win32PeLdrRsrcImg(modname);
+        if(rsrcimg == NULL)
+            return 0;
+
+            rsrcimg->init(0);
+        if(rsrcimg->getError() != NO_ERROR)
+        {
+                dprintf(("GetVersionSize can't load %s\n", modname));
+            delete rsrcimg;
+                return(FALSE);
+        }
+        int size = rsrcimg->getVersionSize();
+        delete rsrcimg;
+        return size;
+        }
   }
   return winimage->getVersionSize();
