Ignore:
Timestamp:
Jan 13, 2003, 5:51:40 PM (23 years ago)
Author:
sandervl
Message:

Don't allocate selectors anymore. Allocate tiled memory and call Dos32FlatToSel; Get default stack size from PE header; Thread handles not closed properly

File:
1 edited

Legend:

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

    r9582 r9667  
    1 /* $Id: oslibmisc.cpp,v 1.14 2003-01-02 11:50:46 sandervl Exp $ */
     1/* $Id: oslibmisc.cpp,v 1.15 2003-01-13 16:51:39 sandervl Exp $ */
    22/*
    33 * Misc OS/2 util. procedures
     
    135135ULONG OSLibAllocSel(ULONG size, USHORT *selector)
    136136{
     137#if 1
     138   PVOID  pSelMem;
     139   ULONG  sel;
     140   APIRET rc;
     141
     142   rc = DosAllocMem(&pSelMem, size, PAG_COMMIT|PAG_READ|PAG_WRITE|OBJ_TILE);
     143   if(rc != NO_ERROR) {
     144       dprintf(("OSLibAllocSel: DosAllocMem failed with %d", rc));
     145       DebugInt3();
     146       return FALSE;
     147   }
     148   *selector = (DosFlatToSel((ULONG)pSelMem) >> 16);
     149   return *selector != 0;
     150#else
    137151   return (Dos16AllocSeg(size, selector, SEG_NONSHARED) == 0);
     152#endif
    138153}
    139154//******************************************************************************
     
    142157ULONG OSLibFreeSel(USHORT selector)
    143158{
     159#if 1
     160   PVOID  pSelMem;
     161   APIRET rc;
     162
     163   pSelMem = (PVOID)((ULONG)selector * 64*1024);
     164   rc = DosFreeMem(pSelMem);
     165   return rc == NO_ERROR;
     166#else
    144167   return (Dos16FreeSeg(selector) == 0);
     168#endif
    145169}
    146170//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.