Index: trunk/src/kernel32/Fileio.cpp
===================================================================
--- trunk/src/kernel32/Fileio.cpp	(revision 4229)
+++ trunk/src/kernel32/Fileio.cpp	(revision 4230)
@@ -1,3 +1,3 @@
-/* $Id: Fileio.cpp,v 1.37 2000-09-03 09:32:04 sandervl Exp $ */
+/* $Id: Fileio.cpp,v 1.38 2000-09-10 21:54:05 sandervl Exp $ */
 
 /*
@@ -601,5 +601,5 @@
 	rc = O32_GetFileAttributes((LPSTR)lpszFileName);
 	if(rc == -1 && lpszFileName[strlen(lpszFileName)-1] != '\\') {
-		char *filename = (char *)alloca(strlen(lpszFileName)+1);
+		char *filename = (char *)alloca(strlen(lpszFileName)+2); //+2!!!!!!
 		strcpy(filename, lpszFileName);
                 strcat(filename, "\\");
Index: trunk/src/kernel32/hmfile.cpp
===================================================================
--- trunk/src/kernel32/hmfile.cpp	(revision 4229)
+++ trunk/src/kernel32/hmfile.cpp	(revision 4230)
@@ -1,3 +1,3 @@
-/* $Id: hmfile.cpp,v 1.19 2000-09-03 09:32:19 sandervl Exp $ */
+/* $Id: hmfile.cpp,v 1.20 2000-09-10 21:54:06 sandervl Exp $ */
 
 /*
@@ -314,12 +314,20 @@
     if(fdwOdinOptions) 
     {
-    	if(CreateFile(srcfileinfo->lpszFileName, pHMHandleData,
+        HMHANDLEDATA duphdata;
+
+	memcpy(&duphdata, pHMHandleData, sizeof(duphdata));
+	duphdata.dwCreation = OPEN_EXISTING;
+
+    	if(CreateFile(srcfileinfo->lpszFileName, &duphdata,
                       srcfileinfo->lpSecurityAttributes, NULL) == NO_ERROR) 
         {
+		memcpy(pHMHandleData, &duphdata, sizeof(duphdata));
+		SetLastError(ERROR_SUCCESS);
       		return TRUE;
         }
-    	dprintf(("ERROR: DuplicateHandle; CreateFile %s failed!", 
+    	dprintf(("ERROR: DuplicateHandle; CreateFile %s failed -> trying DosDupHandle instead!", 
                   srcfileinfo->lpszFileName));
-        return FALSE;
+	//SvL: IE5 setup opens file with DENYREADWRITE, so CreateFile can't
+        //     be used for duplicating the handle; try DosDupHandle instead
     }
     
@@ -339,4 +347,5 @@
     }
     else {
+      SetLastError(ERROR_SUCCESS);
       pHMHandleData->hHMHandle = *desthandle;
       return TRUE;    // OK
Index: trunk/src/kernel32/hmmmap.cpp
===================================================================
--- trunk/src/kernel32/hmmmap.cpp	(revision 4229)
+++ trunk/src/kernel32/hmmmap.cpp	(revision 4230)
@@ -1,3 +1,3 @@
-/* $Id: hmmmap.cpp,v 1.14 2000-08-04 21:12:07 sandervl Exp $ */
+/* $Id: hmmmap.cpp,v 1.15 2000-09-10 21:54:06 sandervl Exp $ */
 
 /*
@@ -215,5 +215,5 @@
   }
   //Although an application may close the file handle used to create a file
-  //mapping object, the system holds the corresponding file open until the last
+  //mapping object, the system keeps the corresponding file open until the last
   //view of the file is unmapped.
   map = (Win32MemMap *)pHMHandleData->dwUserData;
Index: trunk/src/kernel32/initsystem.cpp
===================================================================
--- trunk/src/kernel32/initsystem.cpp	(revision 4229)
+++ trunk/src/kernel32/initsystem.cpp	(revision 4230)
@@ -1,3 +1,3 @@
-/* $Id: initsystem.cpp,v 1.14 2000-08-31 12:47:51 sandervl Exp $ */
+/* $Id: initsystem.cpp,v 1.15 2000-09-10 21:54:06 sandervl Exp $ */
 /*
  * Odin system initialization (registry, directories & environment)
@@ -99,4 +99,5 @@
  DWORD val;
  char  digbuf[16];
+ char  shellpath[260];
 
    if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Control\\Windows",&hkey)!=ERROR_SUCCESS) {
@@ -116,4 +117,28 @@
    RegSetValueExA(hkey,"ShutdownTime",0,REG_DWORD, (LPBYTE)ShutdownTime, sizeof(ShutdownTime));
    RegCloseKey(hkey);
+
+   //CurrentVersion\RunOnce
+   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce",&hkey)!=ERROR_SUCCESS) {
+      	dprintf(("InitRegistry: Unable to register system information (2)"));
+	return FALSE;
+   }
+   RegCloseKey(hkey);
+
+   //System\CurrentControlSet\Control\Session Manager
+   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Control\\Session Manager",&hkey)!=ERROR_SUCCESS) {
+      	dprintf(("InitRegistry: Unable to register system information (2)"));
+	return FALSE;
+   }
+   RegCloseKey(hkey);
+
+   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\iexplore.exe",&hkey)!=ERROR_SUCCESS) {
+      	dprintf(("InitRegistry: Unable to register system information (2)"));
+	return FALSE;
+   }
+   strcpy(shellpath, InternalGetWindowsDirectoryA());
+   strcat(shellpath, "\\IEXPLORE.EXE");
+   RegSetValueExA(hkey, "", 0, REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
+   RegCloseKey(hkey);
+
 
    if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",&hkey)!=ERROR_SUCCESS) {
@@ -151,6 +176,4 @@
    //"NetHood"="C:\WINDOWS\NetHood"
    //"Personal"="C:\My Documents"
-
-   char shellpath[260];
 
    if(RegCreateKeyA(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",&hkey)!=ERROR_SUCCESS) {
Index: trunk/src/kernel32/mmap.cpp
===================================================================
--- trunk/src/kernel32/mmap.cpp	(revision 4229)
+++ trunk/src/kernel32/mmap.cpp	(revision 4230)
@@ -1,3 +1,3 @@
-/* $Id: mmap.cpp,v 1.43 2000-08-04 21:12:08 sandervl Exp $ */
+/* $Id: mmap.cpp,v 1.44 2000-09-10 21:54:07 sandervl Exp $ */
 
 /*
@@ -122,4 +122,5 @@
 		goto fail;
      	}
+	mSize = SetFilePointer(hMemFile, 0, NULL, FILE_BEGIN);
 	mSize = SetFilePointer(hMemFile, 0, NULL, FILE_END);
 	if(mSize == -1) {
