Changeset 1490 for trunk/src


Ignore:
Timestamp:
Oct 28, 1999, 2:01:12 PM (26 years ago)
Author:
sandervl
Message:

misc changes

Location:
trunk/src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.CPP

    r1481 r1490  
    1 /* $Id: KERNEL32.CPP,v 1.25 1999-10-27 18:11:38 sandervl Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.26 1999-10-28 12:01:11 sandervl Exp $ */
    22
    33/*
     
    840840
    841841//  return(WIN32OS2_VERSION);
    842   return (0x00000400);
     842  return (0x0000004);
    843843}
    844844//******************************************************************************
  • trunk/src/kernel32/KERNEL32.DEF

    r1476 r1490  
    1 ; $Id: KERNEL32.DEF,v 1.46 1999-10-27 12:38:44 phaller Exp $
     1; $Id: KERNEL32.DEF,v 1.47 1999-10-28 12:01:11 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    10401040    PROFILE_SetOdinIniBool     = _PROFILE_SetOdinIniBool@12       @1269
    10411041    PROFILE_SaveOdinIni        = _PROFILE_SaveOdinIni@0           @1270
     1042
     1043;shared memory allocation
     1044    _smalloc__FUi                                                 @1271
  • trunk/src/kernel32/directory.cpp

    r1410 r1490  
    1 /* $Id: directory.cpp,v 1.7 1999-10-23 12:34:46 sandervl Exp $ */
     1/* $Id: directory.cpp,v 1.8 1999-10-28 12:01:12 sandervl Exp $ */
    22
    33/*
     
    189189    len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"SYSTEM","",lpBuffer,uSize);
    190190    if (len > 2) {
     191        if(lpBuffer[len-1] == '\\') {
     192                lpBuffer[len-1] = 0;
     193                len--;
     194        }
    191195        return len;
    192196    }
    193197    else {//SvL: Use path of kernel32.dll instead of calling Open32 api (which returns \OS2\SYSTEM)
    194198        lstrcpynA(lpBuffer, kernel32Path, uSize);
    195         return lstrlenA(lpBuffer);
     199        len = lstrlenA(lpBuffer);;
     200        if(lpBuffer[len-1] == '\\') {
     201                lpBuffer[len-1] = 0;
     202                len--;
     203        }
     204        return len;
    196205    }
    197206  }
     
    247256              uSize);
    248257    return (lstrlenA(lpBuffer));                /* return number of copies bytes */
    249   } else
     258  }
     259  else
    250260  {
    251261    int len;
    252262
    253263    len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",lpBuffer,uSize);
    254     if (len > 2) return len;
     264    if (len > 2) {
     265        if(lpBuffer[len-1] == '\\') {
     266                lpBuffer[len-1] = 0;
     267                len--;
     268        }
     269        return len;
     270    }
    255271    else
    256 
    257                                /* if no override by environment is available */
    258       return O32_GetWindowsDirectory(lpBuffer,uSize);
     272        /* if no override by environment is available */
     273        return O32_GetWindowsDirectory(lpBuffer,uSize);
    259274  }
    260275}
  • trunk/src/kernel32/heapshared.cpp

    r1432 r1490  
    1 /* $Id: heapshared.cpp,v 1.1 1999-10-24 22:53:24 sandervl Exp $ */
     1/* $Id: heapshared.cpp,v 1.2 1999-10-28 12:01:12 sandervl Exp $ */
    22/*
    33 * Shared heap functions for OS/2
     
    55 * Initially commit 16 kb, add more when required
    66 *
    7  * NOTE: Hardcoded limit of 256 KB per process (increase when required)
     7 * NOTE: Hardcoded limit of 256 KB (increase when required)
    88 *
    99 * TODO: Not process/thread safe (initializing/destroying heap)
     
    1919#include <os2wrap.h>
    2020#include <misc.h>
    21 #include "heapshared.h"
     21#include <heapshared.h>
    2222
    2323//Global DLL Data
     
    6969                return FALSE;
    7070        }
     71        if(_uopen(sharedHeap) != 0) {
     72                dprintf(("InitializeSharedHeap: unable to open shared heap!"));
     73                return FALSE;
     74        }
    7175  }
    7276  refCount++;
     
    8892                pSharedMem = NULL;
    8993        }
     94  }
     95  else {
     96        _uclose(sharedHeap);
    9097  }
    9198}
  • trunk/src/kernel32/initterm.cpp

    r1481 r1490  
    1 /* $Id: initterm.cpp,v 1.18 1999-10-27 18:11:39 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.19 1999-10-28 12:01:12 sandervl Exp $ */
    22
    33/*
     
    4141#include <odinlx.h>
    4242#include "oslibmisc.h"
    43 #include "heapshared.h"
     43#include <heapshared.h>
    4444#include "mmap.h"
    4545
     
    155155    WriteOutProfiles();
    156156    DestroyTIB();
     157    DestroySharedHeap();
    157158    //NOTE: Must be done after DestroyTIB
    158159    CloseLogFile();
  • trunk/src/kernel32/makefile

    r1481 r1490  
    1 # $Id: makefile,v 1.49 1999-10-27 18:11:39 sandervl Exp $
     1# $Id: makefile,v 1.50 1999-10-28 12:01:12 sandervl Exp $
    22
    33#
     
    132132    os2heap.h
    133133
    134 initterm.OBJ: .\initterm.cpp initterm.h  heapshared.h  mmap.h
     134initterm.OBJ: .\initterm.cpp initterm.h  $(PDWIN32_INCLUDE)\heapshared.h  mmap.h
    135135
    136136thunk.OBJ: \
     
    310310        .\hmopen32.h
    311311
    312 hmmmap.obj: hmmmap.cpp hmdevice.h hmopen32.h mmap.h heapshared.h
     312hmmmap.obj: hmmmap.cpp hmdevice.h hmopen32.h mmap.h $(PDWIN32_INCLUDE)\heapshared.h
    313313
    314314conprop.OBJ: \
     
    327327
    328328virtual.obj:   virtual.cpp $(PDWIN32_INCLUDE)\win\virtual.h $(PDWIN32_INCLUDE)\handlemanager.h mmap.h
    329 mmap.obj:      mmap.cpp mmap.h $(PDWIN32_INCLUDE)\vmutex.h oslibdos.h heapshared.h
     329mmap.obj:      mmap.cpp mmap.h $(PDWIN32_INCLUDE)\vmutex.h oslibdos.h $(PDWIN32_INCLUDE)\heapshared.h
    330330
    331331pefile.OBJ:    pefile.cpp $(PDWIN32_INCLUDE)\pefile.h $(PDWIN32_INCLUDE)\winres.h
     
    362362toolhelp.obj: toolhelp.cpp
    363363
    364 heapshared.obj: heapshared.cpp heapshared.h
     364heapshared.obj: heapshared.cpp $(PDWIN32_INCLUDE)\heapshared.h
    365365
    366366
  • trunk/src/user32/Makefile

    r1453 r1490  
    1 # $Id: Makefile,v 1.37 1999-10-26 11:14:51 sandervl Exp $
     1# $Id: Makefile,v 1.38 1999-10-28 12:00:33 sandervl Exp $
    22
    33#
     
    2525
    2626OBJS =  user32.obj loadres.obj \
    27         dde.obj heapshared.obj win32wndhandle.obj \
     27        dde.obj win32wndhandle.obj \
    2828        icon.obj hook.obj hooks.obj winmenu.obj \
    2929        defwndproc.obj syscolor.obj char.obj initterm.obj \
     
    9191defwndproc.obj: defwndproc.cpp syscolor.h win32wmdiclient.h win32wbase.h win32wnd.h win32dlg.h
    9292hooks.obj: hooks.cpp hooks.h
    93 initterm.obj: initterm.cpp $(PDWIN32_INCLUDE)\spy.h pmwindow.h heapshared.h initterm.h
     93initterm.obj: initterm.cpp $(PDWIN32_INCLUDE)\spy.h pmwindow.h initterm.h
    9494uitools.obj: uitools.cpp win32wbase.h
    9595unknown.obj: unknown.cpp
     
    121121pmwindow.obj:   pmwindow.cpp win32class.h win32wbase.h win32dlg.h pmwindow.h win32wndchild.h $(PDWIN32_INCLUDE)\wprocess.h oslibgdi.h oslibwin.h dc.h
    122122pmframe.obj: pmframe.cpp win32class.h win32wbase.h pmframe.h win32wndchild.h
    123 win32class.obj: win32class.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h
    124 win32wbase.obj:   win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h
    125 win32wbasepos.obj: win32wbasepos.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h
    126 win32wnd.obj:   win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h
    127 win32dlg.obj:   win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h oslibmsg.h controls.h
     123win32class.obj: win32class.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h
     124win32wbase.obj:   win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h
     125win32wbasepos.obj: win32wbasepos.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h dc.h pmframe.h win32wdesktop.h
     126win32wnd.obj:   win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h  $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h
     127win32dlg.obj:   win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h $(PDWIN32_INCLUDE)\heapshared.h oslibwin.h win32wndchild.h oslibmsg.h controls.h
    128128win32wndchild.obj: win32wndchild.cpp win32wndchild.h gen_object.h
    129129win32wmdiclient.obj: win32wmdiclient.cpp win32wbase.h win32wmdiclient.h win32wmdichild.h gen_object.h
    130130win32wmdichild.obj: win32wmdichild.cpp win32wbase.h win32wmdiclient.h win32wmdichild.h gen_object.h
    131131win32wdesktop.obj: win32wdesktop.cpp win32wbase.h win32wdesktop.h gen_object.h
    132 gen_object.obj: gen_object.cpp gen_object.h heapshared.h
     132gen_object.obj: gen_object.cpp gen_object.h $(PDWIN32_INCLUDE)\heapshared.h
    133133oslibwin.obj:   oslibwin.cpp oslibwin.h oslibutil.h oslibgdi.h $(PDWIN32_INCLUDE)\winconst.h
    134134oslibutil.obj:  oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h
     
    145145dib.obj:        dib.cpp dib.h
    146146
    147 heapshared.obj: heapshared.cpp heapshared.h
    148 
    149147clean:
    150148        $(RM) *.obj *.lib *.dll *.map *.pch *.res
  • trunk/src/user32/gen_object.h

    r949 r1490  
    1 /* $Id: gen_object.h,v 1.1 1999-09-15 23:18:50 sandervl Exp $ */
     1/* $Id: gen_object.h,v 1.2 1999-10-28 12:00:33 sandervl Exp $ */
    22/*
    33 * Generic Object Class for OS/2
     
    99#define __GEN_OBJECT_H__
    1010
    11 #include "heapshared.h"
     11#include <heapshared.h>
    1212
    1313#define OBJTYPE_WINDOW          0
     
    4343        void *operator new(size_t size, const char *filename, size_t lineno)
    4444        {
    45                 return _umalloc(sharedHeap, size);
     45                return _smalloc(size);
    4646        }
    4747        void operator delete(void *location, const char *filename, size_t lineno)
     
    5252        void *operator new(size_t size)
    5353        {
    54                 return _umalloc(sharedHeap, size);
     54                return _smalloc(size);
    5555        }
    5656        void operator delete(void *location)
  • trunk/src/user32/initterm.cpp

    r1425 r1490  
    1 /* $Id: initterm.cpp,v 1.13 1999-10-23 23:04:34 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.14 1999-10-28 12:00:34 sandervl Exp $ */
    22
    33/*
     
    3838#include <spy.h>
    3939#include "pmwindow.h"
    40 #include "heapshared.h"
    4140#include "win32wdesktop.h"
    4241#include "syscolor.h"
     
    108107         InitSpyQueue();
    109108
    110          if(InitializeSharedHeap() == FALSE)
    111                 return 0UL;
    112 
    113109         //SvL: Init win32 PM classes
    114110         if(InitPM() == FALSE) {
     
    151147   DestroyDesktopWindow();
    152148   UnregisterSystemClasses();
    153    DestroySharedHeap();
    154149   _ctordtorTerm();
    155150   dprintf(("user32 exit done\n"));
  • trunk/src/user32/pmframe.cpp

    r1425 r1490  
    1 /* $Id: pmframe.cpp,v 1.11 1999-10-23 23:04:36 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.12 1999-10-28 12:00:34 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    377377
    378378PosChangedEnd:
     379        RestoreOS2TIB();
    379380        return rc;
    380381    }
  • trunk/src/user32/win32class.cpp

    r1433 r1490  
    1 /* $Id: win32class.cpp,v 1.3 1999-10-24 22:56:09 sandervl Exp $ */
     1/* $Id: win32class.cpp,v 1.4 1999-10-28 12:00:34 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Managment Code for OS/2
     
    123123Win32WndClass::~Win32WndClass()
    124124{
    125   if(classNameA && (windowStyle & CS_GLOBALCLASS)) {
     125  //SvL: Don't delete global classes
     126  if(classNameA && !(windowStyle & CS_GLOBALCLASS)) {
    126127        GlobalDeleteAtom(classAtom);
    127128  }
  • trunk/src/user32/win32wbase.cpp

    r1425 r1490  
    1 /* $Id: win32wbase.cpp,v 1.62 1999-10-23 23:04:38 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.63 1999-10-28 12:00:34 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    3535#include "syscolor.h"
    3636#include "win32wndhandle.h"
    37 #include "heapshared.h"
    3837#include "dc.h"
    3938#include "pmframe.h"
     
    508507  DWORD dwOSWinStyle, dwOSFrameStyle;
    509508
    510   OSLibWinConvertStyle(cs->style, &cs->dwExStyle, &dwOSWinStyle, &dwOSFrameStyle, &borderWidth, &borderHeight);
    511   dwExStyle = cs->dwExStyle;
     509  OSLibWinConvertStyle(dwStyle, &dwExStyle, &dwOSWinStyle, &dwOSFrameStyle, &borderWidth, &borderHeight);
    512510
    513511  rectWindow.left   = cs->x;
     
    576574  }
    577575  if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) {
    578         dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
    579         SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error
    580         return FALSE;
    581   }
    582   //SvL: Need to store the shared memory base, or else other apps can map it into their memory space
    583   if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_SHAREDMEM, HeapGetSharedMemBase()) == FALSE) {
    584576        dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
    585577        SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error
     
    594586    }
    595587    if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) {
    596             dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame));
    597             SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error
    598             return FALSE;
    599     }
    600     //SvL: Need to store the shared memory base, or else other apps can map it into their memory space
    601     if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32PM_SHAREDMEM, HeapGetSharedMemBase()) == FALSE) {
    602588            dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame));
    603589            SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error
     
    23142300
    23152301            if(wnd) {
    2316                 LPVOID sharedmembase = (LPVOID)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_SHAREDMEM);
    2317 
    2318                 if(OSLibDosGetSharedMem(sharedmembase, MAX_HEAPSIZE, OSLIB_PAG_READ) != 0) {
    2319                     dprintf(("OSLibDosGetSharedMem returned error for %x", wnd));
    2320                     break;
    2321                 }
    23222302                if(wnd->getWindowClass()->hasClassName(lpszClass, fUnicode) &&
    23232303                   (!lpszWindow || wnd->hasWindowName(lpszWindow, fUnicode)))
  • trunk/src/user32/win32wbase.h

    r1425 r1490  
    1 /* $Id: win32wbase.h,v 1.34 1999-10-23 23:04:39 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.35 1999-10-28 12:00:35 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    2828#define OFFSET_WIN32WNDPTR        0
    2929#define OFFSET_WIN32PM_MAGIC      4
    30 #define OFFSET_WIN32PM_SHAREDMEM  8
    31 #define NROF_WIN32WNDBYTES        12
     30#define NROF_WIN32WNDBYTES        8
    3231
    3332#define WIN32PM_MAGIC           0x12345678
  • trunk/src/user32/win32wbasepos.cpp

    r1391 r1490  
    1 /* $Id: win32wbasepos.cpp,v 1.5 1999-10-21 12:19:29 sandervl Exp $ */
     1/* $Id: win32wbasepos.cpp,v 1.6 1999-10-28 12:00:35 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (nonclient/position methods)
     
    2424#include <assert.h>
    2525#include <misc.h>
    26 #include <heapstring.h>
    2726#include <win32wbase.h>
    2827#include <winres.h>
     
    3837#include "syscolor.h"
    3938#include "win32wndhandle.h"
    40 #include "heapshared.h"
    4139#include "dc.h"
    4240#include "pmframe.h"
  • trunk/src/user32/win32wmdichild.cpp

    r1433 r1490  
    1 /* $Id: win32wmdichild.cpp,v 1.7 1999-10-24 22:56:10 sandervl Exp $ */
     1/* $Id: win32wmdichild.cpp,v 1.8 1999-10-28 12:00:36 sandervl Exp $ */
    22/*
    33 * Win32 MDI Child Window Class for OS/2
     
    3939#include "syscolor.h"
    4040#include "win32wndhandle.h"
    41 #include "heapshared.h"
    4241
    4342
  • trunk/src/user32/win32wmdiclient.cpp

    r1433 r1490  
    1 /* $Id: win32wmdiclient.cpp,v 1.10 1999-10-24 22:56:10 sandervl Exp $ */
     1/* $Id: win32wmdiclient.cpp,v 1.11 1999-10-28 12:00:36 sandervl Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    3535#include "syscolor.h"
    3636#include "win32wndhandle.h"
    37 #include "heapshared.h"
    3837
    3938
  • trunk/src/user32/win32wnd.cpp

    r949 r1490  
    1 /* $Id: win32wnd.cpp,v 1.1 1999-09-15 23:19:01 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.2 1999-10-28 12:00:37 sandervl Exp $ */
    22/*
    33 * Win32 Window Class for OS/2
     
    2121#include <assert.h>
    2222#include <misc.h>
     23#include <win32wnd.h>
    2324#include <heapstring.h>
    24 #include <win32wnd.h>
    2525#include <spy.h>
    2626#include "wndmsg.h"
     
    3434#include "syscolor.h"
    3535#include "win32wndhandle.h"
    36 #include "heapshared.h"
    3736
    3837
Note: See TracChangeset for help on using the changeset viewer.