Changeset 2973 for trunk/src


Ignore:
Timestamp:
Mar 2, 2000, 8:17:21 PM (25 years ago)
Author:
sandervl
Message:

setcurrentdir fix + create shell dirs + keys during kernel32 init

Location:
trunk/src/kernel32
Files:
5 edited

Legend:

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

    r2802 r2973  
    1 /* $Id: directory.cpp,v 1.15 2000-02-16 14:25:38 sandervl Exp $ */
     1/* $Id: directory.cpp,v 1.16 2000-03-02 19:17:20 sandervl Exp $ */
    22
    33/*
     
    131131
    132132  strcpy(tmp, lpPathName);
    133   if(tmp[len -1] == '\\')
     133  //SvL: Don't remove terminating backslash if it wants to chdir to root dir
     134  if(tmp[len -1] == '\\' && len != 1)
    134135    tmp[len -1] = 0;
    135136
  • trunk/src/kernel32/hmmmap.cpp

    r2802 r2973  
    1 /* $Id: hmmmap.cpp,v 1.10 2000-02-16 14:23:59 sandervl Exp $ */
     1/* $Id: hmmmap.cpp,v 1.11 2000-03-02 19:17:21 sandervl Exp $ */
    22
    33/*
     
    197197 Win32MemMap *map;
    198198
     199  dprintf(("HMDeviceMemMapClass::CloseHandle %x", pHMHandleData->dwUserData));
    199200  if(pHMHandleData->dwUserData == NULL || pHMHandleData->dwInternalType != HMTYPE_MEMMAP) {
    200201        dprintf(("MapViewOfFileEx: invalid handle data!"));
  • trunk/src/kernel32/hmopen32.cpp

    r2802 r2973  
    1 /* $Id: hmopen32.cpp,v 1.17 2000-02-16 14:24:00 sandervl Exp $ */
     1/* $Id: hmopen32.cpp,v 1.18 2000-03-02 19:17:21 sandervl Exp $ */
    22
    33/*
     
    846846                                               DWORD         dwTimeout)
    847847{
     848 DWORD rc, starttime, endtime;
     849
    848850  dprintfl(("KERNEL32: HandleManager::Open32::WaitForSingleObject(%08xh,%08h)\n",
    849851            pHMHandleData->hHMHandle,
    850852            dwTimeout));
    851 
    852   return (O32_WaitForSingleObject(pHMHandleData->hHMHandle,
    853                                   dwTimeout));
     853 
     854  if(dwTimeout) {
     855        starttime = O32_GetCurrentTime();
     856  }
     857  rc =  (O32_WaitForSingleObject(pHMHandleData->hHMHandle,
     858                                 dwTimeout));
     859  if(dwTimeout) {
     860        endtime = O32_GetCurrentTime();
     861        dprintf(("KERNEL32: HandleManager::WaitForSingleObject delta = %x (rc=%x)", endtime - starttime, rc));
     862  }
     863  else dprintf(("KERNEL32: HandleManager::WaitForSingleObject rc=%x", rc));
     864  return rc;
    854865}
    855866
  • trunk/src/kernel32/initsystem.cpp

    r2802 r2973  
    1 /* $Id: initsystem.cpp,v 1.4 2000-02-16 14:25:40 sandervl Exp $ */
     1/* $Id: initsystem.cpp,v 1.5 2000-03-02 19:17:21 sandervl Exp $ */
    22/*
    33 * Odin system initialization (registry & directories)
     4 *
     5 *
     6 * NOTE: Most of this has to be moved into the Odin install program!!!!!
    47 *
    58 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
     
    2932
    3033LONG (WIN32API *ADVAPI32_RegCloseKey)(HKEY) = 0;
     34LONG (WIN32API *ADVAPI32_RegOpenKeyA)(HKEY,LPCSTR,LPHKEY) = 0;
    3135LONG (WIN32API *ADVAPI32_RegCreateKeyA)(HKEY,LPCSTR,LPHKEY) = 0;
    3236LONG (WIN32API *ADVAPI32_RegSetValueExA)(HKEY,LPSTR,DWORD,DWORD,LPBYTE,DWORD) = 0;
     
    3943   if(hInstance) {
    4044        *(VOID **)&ADVAPI32_RegCloseKey=(void*)GetProcAddress(hInstance, (LPCSTR)"RegCloseKey");
     45        *(VOID **)&ADVAPI32_RegOpenKeyA=(void*)GetProcAddress(hInstance, (LPCSTR)"RegOpenKeyA");
    4146        *(VOID **)&ADVAPI32_RegCreateKeyA=(void*)GetProcAddress(hInstance, (LPCSTR)"RegCreateKeyA");
    4247        *(VOID **)&ADVAPI32_RegSetValueExA=(void*)GetProcAddress(hInstance, (LPCSTR)"RegSetValueExA");
     
    100105   ADVAPI32_RegCloseKey(hkey);
    101106   //todo: productid, registered org/owner, sourcepath,   
     107
     108   //Create Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders keys
     109   //"Favorites"="C:\WINDOWS\Favorites"
     110   //"StartUp"="C:\WINDOWS\Start Menu\Programs\Startup"
     111   //"Desktop"="C:\WINDOWS\Desktop"
     112   //"Programs"="C:\WINDOWS\Start Menu\Programs"
     113   //"Fonts"="C:\WINDOWS\Fonts"
     114   //"SendTo"="C:\WINDOWS\SendTo"
     115   //"Start Menu"="C:\WINDOWS\Start Menu"
     116   //"Templates"="C:\WINDOWS\ShellNew"
     117   //"Recent"="C:\WINDOWS\Recent"
     118   //"NetHood"="C:\WINDOWS\NetHood"
     119   //"Personal"="C:\My Documents"
     120
     121   char shellpath[260];
     122
     123   if(ADVAPI32_RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey) != ERROR_SUCCESS)
     124   {
     125        if(ADVAPI32_RegCreateKeyA(HKEY_CURRENT_USER,"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",&hkey)!=ERROR_SUCCESS) {
     126                dprintf(("InitRegistry: Unable to register system information (3)"));
     127                return FALSE;
     128        }
     129        strcpy(shellpath, InternalGetSystemDirectoryA());
     130        strcat(shellpath, "\\Favorites");
     131        CreateDirectoryA(shellpath, NULL);
     132        ADVAPI32_RegSetValueExA(hkey,"Favorites",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     133        strcpy(shellpath, InternalGetSystemDirectoryA());
     134        strcat(shellpath, "\\Programs\\Startup");
     135        CreateDirectoryA(shellpath, NULL);
     136        ADVAPI32_RegSetValueExA(hkey,"Startup",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     137        strcpy(shellpath, InternalGetSystemDirectoryA());
     138        strcat(shellpath, "\\Desktop");
     139        CreateDirectoryA(shellpath, NULL);
     140        ADVAPI32_RegSetValueExA(hkey,"Desktop",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     141        strcpy(shellpath, InternalGetSystemDirectoryA());
     142        strcat(shellpath, "\\Start Menu\\Programs");
     143        CreateDirectoryA(shellpath, NULL);
     144        ADVAPI32_RegSetValueExA(hkey,"Programs",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     145        strcpy(shellpath, InternalGetSystemDirectoryA());
     146        strcat(shellpath, "\\Fonts");
     147        CreateDirectoryA(shellpath, NULL);
     148        ADVAPI32_RegSetValueExA(hkey,"Fonts",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     149        strcpy(shellpath, InternalGetSystemDirectoryA());
     150        strcat(shellpath, "\\SendTo");
     151        CreateDirectoryA(shellpath, NULL);
     152        ADVAPI32_RegSetValueExA(hkey,"SendTo",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     153        strcpy(shellpath, InternalGetSystemDirectoryA());
     154        strcat(shellpath, "\\Start Menu");
     155        CreateDirectoryA(shellpath, NULL);
     156        ADVAPI32_RegSetValueExA(hkey,"Start Menu",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     157        strcpy(shellpath, InternalGetSystemDirectoryA());
     158        strcat(shellpath, "\\ShellNew");
     159        CreateDirectoryA(shellpath, NULL);
     160        ADVAPI32_RegSetValueExA(hkey,"Templates",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     161        strcpy(shellpath, InternalGetSystemDirectoryA());
     162        strcat(shellpath, "\\Recent");
     163        CreateDirectoryA(shellpath, NULL);
     164        ADVAPI32_RegSetValueExA(hkey,"Recent",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     165        strcpy(shellpath, InternalGetSystemDirectoryA());
     166        strcat(shellpath, "\\NetHood");
     167        CreateDirectoryA(shellpath, NULL);
     168        ADVAPI32_RegSetValueExA(hkey,"NetHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     169        strcpy(shellpath, InternalGetSystemDirectoryA());
     170        strcat(shellpath, "\\My Documents");
     171        CreateDirectoryA(shellpath, NULL);
     172        ADVAPI32_RegSetValueExA(hkey,"Personal",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);
     173   }
     174   ADVAPI32_RegCloseKey(hkey);
    102175   return TRUE;
    103176}
  • trunk/src/kernel32/mmap.cpp

    r2811 r2973  
    1 /* $Id: mmap.cpp,v 1.34 2000-02-17 14:08:51 sandervl Exp $ */
     1/* $Id: mmap.cpp,v 1.35 2000-03-02 19:17:21 sandervl Exp $ */
    22
    33/*
     
    270270BOOL Win32MemMap::unmapViewOfFile(Win32MemMapView *view)
    271271{
     272  dprintf(("Win32MemMap::unmapViewOfFile %x (nrmaps=%d)", view, nrMappings));
    272273  mapMutex.enter();
    273274
Note: See TracChangeset for help on using the changeset viewer.