Changeset 529 for trunk/src


Ignore:
Timestamp:
Aug 17, 1999, 6:35:30 PM (26 years ago)
Author:
phaller
Message:

Fix: removed ODINCRT remains

Location:
trunk/src/kernel32
Files:
1 added
10 edited

Legend:

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

    r461 r529  
    1 /* $Id: HandleManager.cpp,v 1.8 1999-08-09 22:10:07 phaller Exp $ */
     1/* $Id: HandleManager.cpp,v 1.9 1999-08-17 16:35:08 phaller Exp $ */
    22
    33/*
     
    4646#include <stdlib.h>
    4747#include <string.h>
    48 #include <odincrt.h>
    4948
    5049#include "unicode.h"
     
    310309
    311310                        /* create handle manager instance for Open32 handles */
    312     ODIN_FS_BEGIN
    313311    HMGlobals.pHMOpen32     = new HMDeviceOpen32Class("\\\\.\\");
    314312    HMGlobals.pHMEvent      = new HMDeviceEventClass("\\\\EVENT\\");
    315313    HMGlobals.pHMMutex      = new HMDeviceMutexClass("\\\\MUTEX\\");
    316314    HMGlobals.pHMSemaphore  = new HMDeviceSemaphoreClass("\\\\SEM\\");
    317     ODIN_FS_END
    318315  }
    319316  return (NO_ERROR);
     
    337334  /* @@@PH we could deallocate the device list here */
    338335
    339   ODIN_FS_BEGIN
    340336  delete HMGlobals.pHMOpen32;
    341337  delete HMGlobals.pHMEvent;
    342338  delete HMGlobals.pHMMutex;
    343339  delete HMGlobals.pHMSemaphore;
    344   ODIN_FS_END
    345340
    346341  return (NO_ERROR);
  • trunk/src/kernel32/KERNEL32.CPP

    r462 r529  
    1 /* $Id: KERNEL32.CPP,v 1.12 1999-08-09 22:38:01 phaller Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.13 1999-08-17 16:35:09 phaller Exp $ */
    22
    33/*
     
    2626#include <stdlib.h>
    2727#include <string.h>
    28 #include <odincrt.h>
     28//#include <odincrt.h>
    2929
    3030#include "misc.h"
  • trunk/src/kernel32/heap.cpp

    r469 r529  
    1 /* $Id: heap.cpp,v 1.11 1999-08-10 12:43:22 phaller Exp $ */
     1/* $Id: heap.cpp,v 1.12 1999-08-17 16:35:09 phaller Exp $ */
    22
    33/*
     
    1616#define  _WIN32
    1717#include "os2heap.h"
    18 #include <odincrt.h>
    1918#include <heap.h>
    2019
     
    6766    return(NULL);
    6867
    69   ODIN_FS_BEGIN
    7068  curheap = new OS2Heap(hHeap, flOptions, dwInitialSize, dwMaximumSize);
    71   ODIN_FS_END
    7269
    7370  if(curheap == NULL)
     
    8077  {
    8178    O32_HeapDestroy(hHeap);
    82     ODIN_delete(curheap);
     79    delete(curheap);
    8380    return(NULL);
    8481  }
     
    9592
    9693  O32_HeapDestroy(curheap->getHeapHandle());
    97   ODIN_delete(curheap);
     94  delete curheap;
    9895  return(TRUE);
    9996}
     
    157154      hHeap = O32_HeapCreate(HEAP_GENERATE_EXCEPTIONS, 1, 0x4000);
    158155
    159       ODIN_FS_BEGIN
    160156      OS2ProcessHeap = new OS2Heap(hHeap, HEAP_GENERATE_EXCEPTIONS, 0x4000, 0);
    161       ODIN_FS_END
    162157
    163158      if(OS2ProcessHeap == NULL) {
  • trunk/src/kernel32/initterm.cpp

    r511 r529  
    1 /* $Id: initterm.cpp,v 1.9 1999-08-16 16:55:32 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.10 1999-08-17 16:35:09 phaller Exp $ */
    22
    33/*
     
    2828#define  INCL_DOSMISC
    2929#define  INCL_DOSPROCESS
    30 #include <os2wrap.h>    //Odin32 OS/2 api wrappers
     30#include <os2wrap.h>    //Odin32 OS/2 api wrappers
    3131#include <stdlib.h>
    3232#include <stdio.h>
     
    3535#include <wprocess.h>
    3636#include "handlemanager.h"
     37#include "profile.h"
    3738
    3839/*-------------------------------------------------------------------*/
     
    106107            else   flAllocMem = 0;        // no high memory support
    107108
    108             InitializeTIB(TRUE);
    109             //SvL: Do it here instead of during the exe object creation
    110             //(std handles can be used in win32 dll initialization routines
    111             HMInitialize();             /* store standard handles within HandleManager */
     109            InitializeTIB(TRUE);
     110            //SvL: Do it here instead of during the exe object creation
     111            //(std handles can be used in win32 dll initialization routines
     112            HMInitialize();             /* store standard handles within HandleManager */
    112113            break;
    113114        case 1 :
     
    127128{
    128129    dprintf(("kernel32 exit %d\n", ulReason));
     130    WriteOutProfiles();
    129131    _ctordtorTerm();
    130132    DestroyTIB();
  • trunk/src/kernel32/os2heap.cpp

    r461 r529  
    1 /* $Id: os2heap.cpp,v 1.6 1999-08-09 22:10:08 phaller Exp $ */
     1/* $Id: os2heap.cpp,v 1.7 1999-08-17 16:35:09 phaller Exp $ */
    22
    33/*
     
    1717#include <stdlib.h>
    1818#include <string.h>
    19 #include <odincrt.h>
    2019
    2120#include "win32type.h"
     
    5453  if(!(flOptions & HEAP_NO_SERIALIZE))
    5554  {
    56     ODIN_FS_BEGIN
    5755    hmutex = new VMutex();
    58     ODIN_FS_END
    5956    dassert(hmutex, ("ERROR: new VMutex\n"));
    6057  }
     
    9491  {
    9592    hmutex->leave();
    96     ODIN_delete(hmutex);
     93    delete hmutex;
    9794  }
    9895
  • trunk/src/kernel32/profile.cpp

    r436 r529  
    1 /* $Id: profile.cpp,v 1.8 1999-08-06 12:14:12 phaller Exp $ */
     1/* $Id: profile.cpp,v 1.9 1999-08-17 16:35:10 phaller Exp $ */
    22
    33/*
     
    1010 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
    1111 * Copyright 1998 Patrick Haller
     12 * Copyright 1999 Christoph Bratschi
    1213 */
    1314
     
    6364    BOOL             changed;
    6465    PROFILESECTION  *section;
    65     char            *filename;
     66    char            *filename; //first open name
     67    char            *fullname; //name with path
    6668    time_t           mtime;
    6769} PROFILE;
     
    7981
    8082#define PROFILE_MAX_LINE_LEN   1024
     83#define WINININAME "WIN.INI"
    8184
    8285/* Wine profile name in $HOME directory; must begin with slash */
     
    9194#define WINE_INI_GLOBAL ETCDIR "/wine.conf"
    9295
    93 static LPCWSTR wininiW = NULL;
     96static LPCWSTR wininiW = NULL; //CB: never freed
    9497
    9598static CRITICAL_SECTION PROFILE_CritSect;
     
    398401
    399402    // try to open file
    400     file = fopen(CurProfile->filename, "w");
     403    file = fopen(CurProfile->fullname, "w");
    401404    if (!file)
    402405    {
    403         dprintf(("Kernel32:Profile:could not save profile file %s\n", CurProfile->filename));
     406        dprintf(("Kernel32:Profile:could not save profile file %s\n", CurProfile->fullname));
    404407        return FALSE;
    405408    }
    406409
    407     dprintf(("Kernel32:Profile:Saving %s\n", CurProfile->filename ));
     410    dprintf(("Kernel32:Profile:Saving %s\n", CurProfile->fullname ));
    408411    PROFILE_Save( file, CurProfile->section );
    409412    fclose( file );
    410413    CurProfile->changed = FALSE;
    411     if(!stat(CurProfile->filename,&buf))
     414    if(!stat(CurProfile->fullname,&buf))
    412415       CurProfile->mtime=buf.st_mtime;
    413416    return TRUE;
     
    425428    PROFILE_Free( CurProfile->section );
    426429    if (CurProfile->filename) HeapFree( SystemHeap, 0, CurProfile->filename );
     430    if (CurProfile->fullname) HeapFree(SystemHeap,0,CurProfile->fullname);
    427431    CurProfile->changed   = FALSE;
    428432    CurProfile->section   = NULL;
    429433    CurProfile->filename  = NULL;
     434    CurProfile->fullname  = NULL;
    430435    CurProfile->mtime     = 0;
    431436}
     
    439444static BOOL PROFILE_Open( LPCSTR filename )
    440445{
    441     char buffer[MAX_PATHNAME_LEN];
    442446    FILE *file = NULL;
    443447    int i,j;
    444448    struct stat buf;
    445449    PROFILE *tempProfile;
     450
     451    if (!filename || filename[0] == 0) return FALSE;
    446452
    447453    /* First time around */
     
    454460          MRUProfile[i]->section=NULL;
    455461          MRUProfile[i]->filename=NULL;
     462          MRUProfile[i]->fullname=NULL;
    456463          MRUProfile[i]->mtime=0;
    457464         }
     
    459466    /* Check for a match */
    460467
    461     if (!strchr( filename, '/' ) &&
    462         !strchr( filename, '\\' ) &&
    463         !strchr( filename, ':' ))
    464     {
    465         GetWindowsDirectoryA( buffer, sizeof(buffer) );
    466         strcat( buffer, "\\" );
    467         strcat( buffer, filename );
    468     }
    469 
    470468    for(i=0;i<N_CACHED_PROFILES;i++)
    471469      {
    472        if ((MRUProfile[i]->filename && !strcmp( filename, MRUProfile[i]->filename )))
     470       if (MRUProfile[i]->filename && (!strcmp(filename,MRUProfile[i]->filename) || !strcmp(filename,MRUProfile[i]->fullname)))
    473471         {
    474472          if(i)
     
    480478             CurProfile=tempProfile;
    481479            }
    482           if(!stat(CurProfile->filename,&buf) && CurProfile->mtime==buf.st_mtime)
     480          if(!stat(CurProfile->fullname,&buf) && CurProfile->mtime==buf.st_mtime)
    483481             dprintf(("Kernel32:Profile:(%s): already opened (mru=%d)\n",
    484482                              filename, i ));
     
    504502    if(CurProfile->filename) PROFILE_ReleaseFile();
    505503
    506     CurProfile->filename  = HEAP_strdupA( SystemHeap, 0, filename );
    507 
    508     file = fopen( filename, "r" );
     504    CurProfile->filename  = HEAP_strdupA(SystemHeap,0,filename);
     505
     506    /* check for path */
     507
     508    if (!strchr( filename,'/') ||
     509        !strchr( filename,'\\') ||
     510        !strchr( filename,':'))
     511    {
     512      char fullname[MAX_PATHNAME_LEN];
     513
     514      GetWindowsDirectoryA(fullname,sizeof(fullname));
     515      strcat(fullname,"\\");
     516      strcat(fullname,filename);
     517      CurProfile->fullname  = HEAP_strdupA(SystemHeap,0,fullname);
     518    } else CurProfile->fullname  = HEAP_strdupA(SystemHeap,0,filename);
     519
     520    file = fopen(CurProfile->fullname,"r");
    509521    if (file)
    510522    {
    511523      dprintf(("Kernel32:Profile:(%s): found it in %s\n",
    512                filename, filename ));
     524               filename, CurProfile->fullname ));
    513525
    514526        CurProfile->section = PROFILE_Load( file );
    515527        fclose( file );
    516         if(!stat(CurProfile->filename,&buf))
     528        if(!stat(CurProfile->fullname,&buf))
    517529           CurProfile->mtime=buf.st_mtime;
    518530    }
     
    520532    {
    521533        /* Does not exist yet, we will create it in PROFILE_FlushFile */
    522         dprintf(("Kernel32:Profile:profile file %s not found\n", filename ));
     534        dprintf(("Kernel32:Profile:profile file %s not found\n", CurProfile->fullname ));
    523535    }
    524536    return TRUE;
     
    966978UINT WINAPI GetProfileIntA( LPCSTR section, LPCSTR entry, INT def_val )
    967979{
    968     return GetPrivateProfileIntA( section, entry, def_val, "win.ini" );
     980    return GetPrivateProfileIntA( section, entry, def_val, WINININAME );
    969981}
    970982
     
    974986UINT WINAPI GetProfileIntW( LPCWSTR section, LPCWSTR entry, INT def_val )
    975987{
    976     if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini" );
     988    if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME );
    977989    return GetPrivateProfileIntW( section, entry, def_val, wininiW );
    978990}
     
    985997{
    986998    return GetPrivateProfileStringA( section, entry, def_val,
    987                  buffer, len, "win.ini" );
     999                 buffer, len, WINININAME );
    9881000}
    9891001
     
    9941006               LPCWSTR def_val, LPWSTR buffer, UINT len )
    9951007{
    996     if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini" );
     1008    if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME );
    9971009    return GetPrivateProfileStringW( section, entry, def_val,
    9981010                 buffer, len, wininiW );
     
    10051017             LPCSTR string )
    10061018{
    1007     return WritePrivateProfileStringA( section, entry, string, "win.ini" );
     1019    return WritePrivateProfileStringA( section, entry, string, WINININAME );
    10081020}
    10091021
     
    10141026                                     LPCWSTR string )
    10151027{
    1016     if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini" );
     1028    if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME );
    10171029    return WritePrivateProfileStringW( section, entry, string, wininiW );
    10181030}
     
    10621074
    10631075    if (!filename)
    1064    filename = "win.ini";
     1076   filename = WINININAME;
    10651077
    10661078    EnterCriticalSection( &PROFILE_CritSect );
     
    11451157INT WINAPI GetProfileSectionA( LPCSTR section, LPSTR buffer, DWORD len )
    11461158{
    1147     return GetPrivateProfileSectionA( section, buffer, len, "win.ini" );
     1159    return GetPrivateProfileSectionA( section, buffer, len, WINININAME );
    11481160}
    11491161
     
    11531165INT WINAPI GetProfileSectionW( LPCWSTR section, LPWSTR buffer, DWORD len )
    11541166{
    1155     if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini" );
     1167    if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME );
    11561168    return GetPrivateProfileSectionW( section, buffer, len, wininiW );
    11571169}
     
    12331245
    12341246{
    1235     return WritePrivateProfileSectionA( section, keys_n_values, "win.ini");
     1247    return WritePrivateProfileSectionA( section, keys_n_values, WINININAME);
    12361248}
    12371249
     
    12411253BOOL WINAPI WriteProfileSectionW( LPCWSTR section, LPCWSTR keys_n_values)
    12421254{
    1243    if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");
     1255   if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME);
    12441256
    12451257   return (WritePrivateProfileSectionW (section,keys_n_values, wininiW));
     
    13751387    return ret;
    13761388}
     1389
     1390/***********************************************************************
     1391 *           WriteOutProfiles   (KERNEL.315)
     1392 * CB: original: 16 bit function
     1393 *     here: necessary to save open ini files
     1394 */
     1395void WINAPI WriteOutProfiles(void)
     1396{
     1397    PROFILE *lastCurProfile;
     1398    INT x;
     1399
     1400    EnterCriticalSection(&PROFILE_CritSect);
     1401    PROFILE_FlushFile(); //flash current
     1402    lastCurProfile = CurProfile;
     1403    for(x = 1;x < N_CACHED_PROFILES;x++)
     1404    {
     1405      if (MRUProfile[x]->filename)
     1406      {
     1407        CurProfile = MRUProfile[x];
     1408        PROFILE_FlushFile();
     1409      }
     1410    }
     1411    CurProfile = lastCurProfile;
     1412    LeaveCriticalSection(&PROFILE_CritSect);
     1413}
     1414
  • trunk/src/kernel32/thread.cpp

    r461 r529  
    1 /* $Id: thread.cpp,v 1.8 1999-08-09 22:10:08 phaller Exp $ */
     1/* $Id: thread.cpp,v 1.9 1999-08-17 16:35:10 phaller Exp $ */
    22
    33/*
     
    1212#include <os2win.h>
    1313#include <stdarg.h>
    14 #include <odincrt.h>
     14//#include <odincrt.h>
    1515#include "thread.h"
    1616#include "except.h"
     
    3232 Win32Thread *winthread;
    3333
    34  ODIN_FS_BEGIN
    3534 winthread = new Win32Thread(lpStartAddr, lpvThreadParm, fdwCreate);
    36  ODIN_FS_END
    3735
    3836  if(winthread == 0)
     
    162160 DWORD            rc;
    163161
    164  ODIN_delete(me)    //only called once
     162 delete(me);    //only called once
    165163
    166164  dprintf(("Win32ThreadProc %d\n", GetCurrentThreadId()));
  • trunk/src/kernel32/winimage.cpp

    r484 r529  
    1 /* $Id: winimage.cpp,v 1.7 1999-08-11 22:27:56 phaller Exp $ */
     1/* $Id: winimage.cpp,v 1.8 1999-08-17 16:35:10 phaller Exp $ */
    22
    33/*
     
    2424#include <string.h>
    2525#include <stdlib.h>
    26 
    27 #include <odincrt.h>
    2826
    2927//#include <iostream.h>
     
    146144  {
    147145    res    = winres->next;
    148     ODIN_delete(winres);
     146    delete winres;
    149147    winres = res;
    150148  }
     
    983981    if(WinDll == NULL)
    984982     {  //not found, so load it
    985         ODIN_FS_BEGIN
    986983        WinDll = new Win32Dll(pszCurModule);
    987         ODIN_FS_END
    988984
    989985        if(WinDll == NULL) {
  • trunk/src/kernel32/winimgres.cpp

    r464 r529  
    1 /* $Id: winimgres.cpp,v 1.5 1999-08-09 22:55:11 phaller Exp $ */
     1/* $Id: winimgres.cpp,v 1.6 1999-08-17 16:35:11 phaller Exp $ */
    22
    33/*
     
    1616#include <stdlib.h>
    1717#include <string.h>
    18 #include <odincrt.h>
    1918
    2019#include "misc.h"
     
    161160        unicodestr += *unicodestr;
    162161    }
    163     ODIN_FS_BEGIN
     162
    164163    res = new Win32Resource(this, id, NTRT_STRING, (ULONG)*unicodestr, (char *)unicodestr);
    165     ODIN_FS_END
    166164    if(res == NULL) {
    167165        dprintf(("new Win32Resource failed!\n"));
     
    170168  }
    171169  else
    172     ODIN_FS_BEGIN
    173170    res = new Win32Resource(this, id, type, pData->Size, resdata);
    174     ODIN_FS_END
    175171
    176172  return res;
     
    307303    if(hres)
    308304    {
    309       ODIN_FS_BEGIN
    310305      res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
    311       ODIN_FS_END
    312306    }
    313307
     
    316310      if(hres)
    317311      {
    318          ODIN_FS_BEGIN
    319312         res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
    320          ODIN_FS_END
    321313      }
    322314      else    dprintf(("FindResourceA can't find string %d\n", (int)lpszName));
     
    408400    if(hres)
    409401    {
    410       ODIN_FS_BEGIN
    411402      res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
    412       ODIN_FS_END
    413403    }
    414404
     
    417407      if(hres)
    418408      {
    419         ODIN_FS_BEGIN
    420409        res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType);
    421         ODIN_FS_END
    422410      }
    423411      else    dprintf(("FindResourceW can't find string %d\n", (int)lpszName));
  • trunk/src/kernel32/wprocess.cpp

    r484 r529  
    1 /* $Id: wprocess.cpp,v 1.18 1999-08-11 22:27:56 phaller Exp $ */
     1/* $Id: wprocess.cpp,v 1.19 1999-08-17 16:35:11 phaller Exp $ */
    22
    33/*
     
    1414#include <stdlib.h>
    1515#include <string.h>
    16 #include <odincrt.h>
    1716#include <odinwrap.h>
    1817
     
    4342extern "C" ULONG QueryExceptionChain();
    4443
    45 
    46 ODINDEBUGCHANNEL(KERNEL32-WPROCESS)
    4744
    4845//******************************************************************************
     
    211208{
    212209  if(WinExe != NULL) //should never happen
    213     ODIN_delete(WinExe);
     210    delete WinExe;
    214211
    215212
     
    223220  Win32Exe *winexe;
    224221
    225   ODIN_FS_BEGIN
    226222  winexe = new Win32Exe(0, NameTableId, Win32TableId);
    227   ODIN_FS_END
    228223
    229224  if(winexe) {
     
    288283   else {
    289284      //converted win32 dll loaded by OS/2 loader
    290       ODIN_FS_BEGIN
    291285      winmod = new Win32Dll(hinstance, NameTableId, Win32TableId, pfnDllEntry);
    292       ODIN_FS_END
    293286      if(winmod == NULL) {
    294287            eprintf(("Failed to allocate module object!\n"));
     
    328321
    329322  if(WinExe) {
    330     ODIN_delete(WinExe);
     323    delete WinExe;
    331324    WinExe = NULL;
    332325  }
     
    400393    }
    401394
    402     ODIN_FS_BEGIN
    403395    module = new Win32Dll((char *)lpszLibFile);
    404     ODIN_FS_END
    405396    if(module == NULL)
    406397        return(0);
     
    409400    if(module->getError() != NO_ERROR) {
    410401        dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile));
    411         ODIN_delete(module);
     402        delete module;
    412403        return(0);
    413404    }
    414405    if(module->attachProcess() == FALSE) {
    415406        dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile));
    416         ODIN_delete(module);
     407        delete module;
    417408        return(0);
    418409    }
     
    425416
    426417
    427 ODINFUNCTION1(HINSTANCE,LoadLibraryA,LPCTSTR,lpszLibFile)
    428 //HINSTANCE WIN32API LoadLibraryA(LPCTSTR lpszLibFile)
     418HINSTANCE WIN32API LoadLibraryA(LPCTSTR lpszLibFile)
    429419{
    430420  HINSTANCE hDll;
     
    474464    }
    475465
    476     ODIN_FS_BEGIN
    477466    module = new Win32Dll((char *)lpszLibFile);
    478     ODIN_FS_END
    479 
    480467    if(module == NULL)
    481468        return(0);
     
    484471    if(module->getError() != NO_ERROR) {
    485472        dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile));
    486         ODIN_delete(module);
     473        delete module;
    487474        return(0);
    488475    }
     
    492479    if(module->attachProcess() == FALSE) {
    493480        dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile));
    494         ODIN_delete(module);
     481        delete module;
    495482        return(0);
    496483    }
Note: See TracChangeset for help on using the changeset viewer.