Changeset 2032 for trunk/src


Ignore:
Timestamp:
Dec 9, 1999, 1:52:21 AM (26 years ago)
Author:
sandervl
Message:

code heap added + changed back winres fix (breaks Notes) + heapstring fixes

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

Legend:

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

    r1986 r2032  
    1 ; $Id: KERNEL32.DEF,v 1.55 1999-12-05 21:11:40 sandervl Exp $
     1; $Id: KERNEL32.DEF,v 1.56 1999-12-09 00:52:19 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    10521052    _smalloc__FUi                                                 @1271
    10531053
     1054;code memory allocation
     1055    _cmalloc__FUi                                                 @1272
     1056
    10541057;Export for MSACM32
    10551058    _wsnprintfA                                                   @2000
  • trunk/src/kernel32/heap.cpp

    r1718 r2032  
    1 /* $Id: heap.cpp,v 1.16 1999-11-13 14:21:30 sandervl Exp $ */
     1/* $Id: heap.cpp,v 1.17 1999-12-09 00:52:20 sandervl Exp $ */
    22
    33/*
    4  * Project Odin Software License can be found in LICENSE.TXT
    5  *
    64 * Win32 heap API functions for OS/2
    75 *
    8  * Copyright 1998 Sander van Leeuwen
     6 * Copyright 1999 Sander van Leeuwen
     7 *
     8 * Project Odin Software License can be found in LICENSE.TXT
    99 *
    1010 */
  • trunk/src/kernel32/heapstring.cpp

    r1997 r2032  
    1 /* $Id: heapstring.cpp,v 1.21 1999-12-06 20:39:38 sandervl Exp $ */
     1/* $Id: heapstring.cpp,v 1.22 1999-12-09 00:52:20 sandervl Exp $ */
    22
    33/*
     
    552552    astring[unilen] = 0; //terminate
    553553
    554     return unilen;
    555 
     554    return unilen; //length of string (excluding terminator)
    556555  }
    557556  else
     
    628627    //SvL: Determine length of ascii string
    629628    in_bytes_left = strlen(in_buf)+1;
    630     in_bytes_left = min(in_bytes_left, asciilen); //buffer size in bytes
     629    in_bytes_left = asciilen = min(in_bytes_left, asciilen); //buffer size in bytes
    631630   
    632631    out_buf = (UniChar*)unicode;
     
    639638                        &num_subs );
    640639
    641     //@@@PH what's this?
    642     //unicode[asciilen-1-in_bytes_left] = 0;
    643 
    644     //@@@PH what's this?
    645     //return asciilen - 1;
    646     return asciilen;
     640    asciilen -= 1+uni_chars_left; //end + left bytes
     641
     642    unicode[asciilen] = 0; // always terminate string
     643    return asciilen; //length of string (excluding terminator)
    647644  }
    648645  else
  • trunk/src/kernel32/initterm.cpp

    r1820 r2032  
    1 /* $Id: initterm.cpp,v 1.28 1999-11-23 20:01:18 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.29 1999-12-09 00:52:20 sandervl Exp $ */
    22
    33/*
     
    4242#include "oslibmisc.h"
    4343#include <heapshared.h>
     44#include <heapcode.h>
    4445#include "mmap.h"
    4546#include "directory.h"
     
    111112                return 0UL;
    112113
     114            if(InitializeCodeHeap() == FALSE)
     115                return 0UL;
     116
    113117            PROFILE_LoadOdinIni();
    114118            if(RegisterLxDll(hModule, 0, 0) == FALSE)
     
    171175    DestroyTIB();
    172176    DestroySharedHeap();
     177    DestroyCodeHeap();
    173178    _ctordtorTerm();
    174179
  • trunk/src/kernel32/makefile

    r1924 r2032  
    1 # $Id: makefile,v 1.66 1999-12-01 18:40:48 sandervl Exp $
     1# $Id: makefile,v 1.67 1999-12-09 00:52:20 sandervl Exp $
    22
    33#
     
    3232CONBUFFER.OBJ CONOUT.OBJ UNICODE.OBJ network.OBJ HMDEVIO.OBJ \
    3333profile.obj THREAD.OBJ virtual.obj THUNK.OBJ OBSOLETE.OBJ COMM.OBJ\
    34 MESSAGE.OBJ RESOURCE.OBJ EXCEPTIONS.OBJ heapshared.obj cpuhlp.obj \
     34MESSAGE.OBJ RESOURCE.OBJ EXCEPTIONS.OBJ heapshared.obj cpuhlp.obj heapcode.obj \
    3535LFILE.OBJ NPIPE.OBJ oslibdos.obj oslibmisc.obj MISC.OBJ EXCEPTUTIL.OBJ \
    3636LANG.OBJ ICCIO.OBJ MAP.OBJ WIN32UTIL.OBJ heap.OBJ heapstring.obj \
     
    151151    initterm.h
    152152
    153 initterm.OBJ: .\initterm.cpp initterm.h  $(PDWIN32_INCLUDE)\heapshared.h  mmap.h directory.h hmdevio.h cpuhlp.h
     153initterm.OBJ: .\initterm.cpp initterm.h  $(PDWIN32_INCLUDE)\heapshared.h  mmap.h directory.h hmdevio.h cpuhlp.h $(PDWIN32_INCLUDE)\heapcode.h
    154154
    155155thunk.OBJ: \
     
    387387
    388388heapshared.obj: heapshared.cpp $(PDWIN32_INCLUDE)\heapshared.h
     389heapcode.obj: heapcode.cpp $(PDWIN32_INCLUDE)\heapshared.h $(PDWIN32_INCLUDE)\heapcode.h
    389390cpu.obj: cpu.cpp cpuhlp.h
    390391cpuhlp.obj: cpuhlp.asm
  • trunk/src/kernel32/mmap.cpp

    r2007 r2032  
    1 /* $Id: mmap.cpp,v 1.25 1999-12-07 12:28:41 sandervl Exp $ */
     1/* $Id: mmap.cpp,v 1.26 1999-12-09 00:52:21 sandervl Exp $ */
    22
    33/*
     
    327327                goto fail;
    328328        }
    329         if(hMemFile == -1 && !image) {//commit memory
     329        if(hMemFile == -1 && !image && (mProtFlags & SEC_COMMIT)) {//commit memory
    330330                VirtualAlloc(pMapping, mSize, MEM_COMMIT, PAGE_READWRITE);
    331331        }
     
    336336  }
    337337  if(mapview->everythingOk() == FALSE) {
     338        dprintf(("Win32MemMap::mapFileView: !mapview->everythingOk"));
    338339        delete mapview;
    339340        goto fail;
  • trunk/src/kernel32/winres.cpp

    r2007 r2032  
    1 /* $Id: winres.cpp,v 1.23 1999-12-07 12:28:41 sandervl Exp $ */
     1/* $Id: winres.cpp,v 1.24 1999-12-09 00:52:21 sandervl Exp $ */
    22
    33/*
     
    7171  this->type     = type;
    7272  this->ressize  = size;
    73   winresdata     = (char *)malloc(size+sizeof(WCHAR)); //+2 for 0 terminator (string res)
     73  winresdata     = (char *)malloc(size+sizeof(WCHAR));
    7474  if(winresdata == NULL) {
    7575    DebugInt3();
     
    8080  if(type == NTRT_STRING) {
    8181        memcpy(winresdata, resdata, size);
    82         ((USHORT *)winresdata)[size/sizeof(WCHAR)] = 0;
     82        ((USHORT *)winresdata)[size/sizeof(WCHAR)-1] = 0;
    8383  }
    8484  else  memcpy(winresdata, resdata, size);
Note: See TracChangeset for help on using the changeset viewer.