Ignore:
Timestamp:
Oct 12, 2001, 11:10:01 PM (24 years ago)
Author:
achimha
Message:

use bounce buffer if end of buffer crosses boundary, not start

File:
1 edited

Legend:

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

    r7032 r7034  
    1 /* $Id: oslibdos.cpp,v 1.77 2001-10-12 18:10:59 phaller Exp $ */
     1/* $Id: oslibdos.cpp,v 1.78 2001-10-12 21:10:01 achimha Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    25912591 
    25922592  // bounce buffer support
    2593   if ( (DWORD)pTiledParm > MEM_TILED_CEILING)
     2593  // make sure no parameter or data buffer can pass the tiled memory region
     2594  // barrier (usually 512MB). OS/2 kernel does not correctly translate these
     2595  // addresses to a 16:16 address used in device driver land. In fact,
     2596  // DosDevIOCtl is not a high memory enabled API!
     2597
     2598  if (pTiledParm && (((DWORD)pTiledParm + max(dwParmMaxLen, *pdwParmLen)) > MEM_TILED_CEILING))
    25942599  {
    25952600    rc = DosAllocMem(&pTiledParm, dwParmMaxLen, PAG_READ | PAG_WRITE);
     
    26002605  }
    26012606 
    2602   if ( (DWORD)pTiledData > MEM_TILED_CEILING)
     2607  if (pTiledData && (((DWORD)pTiledData + max(dwDataMaxLen, *pdwDataLen)) > MEM_TILED_CEILING))
    26032608  {
    26042609    rc = DosAllocMem(&pTiledData, dwDataMaxLen, PAG_READ | PAG_WRITE);
     
    26312636    DosFreeMem(pTiledData);
    26322637 
    2633   SetLastError(error2WinError(rc,ERROR_INVALID_HANDLE));
     2638  SetLastError(error2WinError(rc, ERROR_INVALID_HANDLE));
    26342639  return (DWORD)rc;
    26352640}
Note: See TracChangeset for help on using the changeset viewer.