Changeset 4230 for trunk/src


Ignore:
Timestamp:
Sep 10, 2000, 11:54:07 PM (25 years ago)
Author:
sandervl
Message:

memory map fixes + extra reg keys for init

Location:
trunk/src/kernel32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/Fileio.cpp

    r4171 r4230  
    1 /* $Id: Fileio.cpp,v 1.37 2000-09-03 09:32:04 sandervl Exp $ */
     1/* $Id: Fileio.cpp,v 1.38 2000-09-10 21:54:05 sandervl Exp $ */
    22
    33/*
     
    601601        rc = O32_GetFileAttributes((LPSTR)lpszFileName);
    602602        if(rc == -1 && lpszFileName[strlen(lpszFileName)-1] != '\\') {
    603                 char *filename = (char *)alloca(strlen(lpszFileName)+1);
     603                char *filename = (char *)alloca(strlen(lpszFileName)+2); //+2!!!!!!
    604604                strcpy(filename, lpszFileName);
    605605                strcat(filename, "\\");
  • trunk/src/kernel32/hmfile.cpp

    r4171 r4230  
    1 /* $Id: hmfile.cpp,v 1.19 2000-09-03 09:32:19 sandervl Exp $ */
     1/* $Id: hmfile.cpp,v 1.20 2000-09-10 21:54:06 sandervl Exp $ */
    22
    33/*
     
    314314    if(fdwOdinOptions)
    315315    {
    316         if(CreateFile(srcfileinfo->lpszFileName, pHMHandleData,
     316        HMHANDLEDATA duphdata;
     317
     318        memcpy(&duphdata, pHMHandleData, sizeof(duphdata));
     319        duphdata.dwCreation = OPEN_EXISTING;
     320
     321        if(CreateFile(srcfileinfo->lpszFileName, &duphdata,
    317322                      srcfileinfo->lpSecurityAttributes, NULL) == NO_ERROR)
    318323        {
     324                memcpy(pHMHandleData, &duphdata, sizeof(duphdata));
     325                SetLastError(ERROR_SUCCESS);
    319326                return TRUE;
    320327        }
    321         dprintf(("ERROR: DuplicateHandle; CreateFile %s failed!",
     328        dprintf(("ERROR: DuplicateHandle; CreateFile %s failed -> trying DosDupHandle instead!",
    322329                  srcfileinfo->lpszFileName));
    323         return FALSE;
     330        //SvL: IE5 setup opens file with DENYREADWRITE, so CreateFile can't
     331        //     be used for duplicating the handle; try DosDupHandle instead
    324332    }
    325333   
     
    339347    }
    340348    else {
     349      SetLastError(ERROR_SUCCESS);
    341350      pHMHandleData->hHMHandle = *desthandle;
    342351      return TRUE;    // OK
  • trunk/src/kernel32/hmmmap.cpp

    r3948 r4230  
    1 /* $Id: hmmmap.cpp,v 1.14 2000-08-04 21:12:07 sandervl Exp $ */
     1/* $Id: hmmmap.cpp,v 1.15 2000-09-10 21:54:06 sandervl Exp $ */
    22
    33/*
     
    215215  }
    216216  //Although an application may close the file handle used to create a file
    217   //mapping object, the system holds the corresponding file open until the last
     217  //mapping object, the system keeps the corresponding file open until the last
    218218  //view of the file is unmapped.
    219219  map = (Win32MemMap *)pHMHandleData->dwUserData;
  • trunk/src/kernel32/initsystem.cpp

    r4134 r4230  
    1 /* $Id: initsystem.cpp,v 1.14 2000-08-31 12:47:51 sandervl Exp $ */
     1/* $Id: initsystem.cpp,v 1.15 2000-09-10 21:54:06 sandervl Exp $ */
    22/*
    33 * Odin system initialization (registry, directories & environment)
     
    9999 DWORD val;
    100100 char  digbuf[16];
     101 char  shellpath[260];
    101102
    102103   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Control\\Windows",&hkey)!=ERROR_SUCCESS) {
     
    116117   RegSetValueExA(hkey,"ShutdownTime",0,REG_DWORD, (LPBYTE)ShutdownTime, sizeof(ShutdownTime));
    117118   RegCloseKey(hkey);
     119
     120   //CurrentVersion\RunOnce
     121   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce",&hkey)!=ERROR_SUCCESS) {
     122        dprintf(("InitRegistry: Unable to register system information (2)"));
     123        return FALSE;
     124   }
     125   RegCloseKey(hkey);
     126
     127   //System\CurrentControlSet\Control\Session Manager
     128   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Control\\Session Manager",&hkey)!=ERROR_SUCCESS) {
     129        dprintf(("InitRegistry: Unable to register system information (2)"));
     130        return FALSE;
     131   }
     132   RegCloseKey(hkey);
     133
     134   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\iexplore.exe",&hkey)!=ERROR_SUCCESS) {
     135        dprintf(("InitRegistry: Unable to register system information (2)"));
     136        return FALSE;
     137   }
     138   strcpy(shellpath, InternalGetWindowsDirectoryA());
     139   strcat(shellpath, "\\IEXPLORE.EXE");
     140   RegSetValueExA(hkey, "", 0, REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     141   RegCloseKey(hkey);
     142
    118143
    119144   if(RegCreateKeyA(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",&hkey)!=ERROR_SUCCESS) {
     
    151176   //"NetHood"="C:\WINDOWS\NetHood"
    152177   //"Personal"="C:\My Documents"
    153 
    154    char shellpath[260];
    155178
    156179   if(RegCreateKeyA(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",&hkey)!=ERROR_SUCCESS) {
  • trunk/src/kernel32/mmap.cpp

    r3948 r4230  
    1 /* $Id: mmap.cpp,v 1.43 2000-08-04 21:12:08 sandervl Exp $ */
     1/* $Id: mmap.cpp,v 1.44 2000-09-10 21:54:07 sandervl Exp $ */
    22
    33/*
     
    122122                goto fail;
    123123        }
     124        mSize = SetFilePointer(hMemFile, 0, NULL, FILE_BEGIN);
    124125        mSize = SetFilePointer(hMemFile, 0, NULL, FILE_END);
    125126        if(mSize == -1) {
Note: See TracChangeset for help on using the changeset viewer.