Ignore:
Timestamp:
Aug 22, 1999, 1:11:11 PM (26 years ago)
Author:
sandervl
Message:

Exception handler changes

File:
1 edited

Legend:

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

    r130 r617  
    1 /* $Id: os2native.cpp,v 1.4 1999-06-20 12:46:09 sandervl Exp $ */
     1/* $Id: os2native.cpp,v 1.5 1999-08-22 11:11:10 sandervl Exp $ */
    22
    33/*
     
    5252//******************************************************************************
    5353LPVOID WIN32API VirtualAlloc(LPVOID lpvAddress, DWORD cbSize, DWORD fdwAllocationType,
    54                                  DWORD fdwProtect)
     54                             DWORD fdwProtect)
    5555{
    5656 PVOID Address = lpvAddress;
    57  ULONG flag = 0;
     57 ULONG flag = 0, base;
    5858 APIRET rc;
    5959
    6060  dprintf(("VirtualAlloc at %X; %d bytes, fAlloc %d, fProtect %d\n", (int)lpvAddress, cbSize, fdwAllocationType, fdwProtect));
     61
     62  if (cbSize > 0x7fc00000)  /* 2Gb - 4Mb */
     63  {
     64        dprintf(("VirtualAlloc: size too large"));
     65//        SetLastError( ERROR_OUTOFMEMORY );
     66        return NULL;
     67  }
     68
     69  if (!(fdwAllocationType & (MEM_COMMIT | MEM_RESERVE)) ||
     70       (fdwAllocationType & ~(MEM_COMMIT | MEM_RESERVE)))
     71  {
     72        dprintf(("VirtualAlloc: Invalid parameter"));
     73//        SetLastError( ERROR_INVALID_PARAMETER );
     74        return NULL;
     75  }
    6176
    6277  if(fdwAllocationType & MEM_COMMIT) {
     
    117132  }
    118133
    119 //TODO: Set last error in case rc != 0
     134  //TODO: Set last error in case rc != 0
    120135  if(rc) {
    121136        dprintf(("DosSetMem returned %d\n", rc));
     137//        SetLastError( ERROR_OUTOFMEMORY );
    122138        return(NULL);
    123139  }
Note: See TracChangeset for help on using the changeset viewer.