Ignore:
Timestamp:
Apr 13, 2002, 9:47:24 AM (23 years ago)
Author:
bird
Message:

Moved the cdrom hot fix a bit to prevent memory leaks.

File:
1 edited

Legend:

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

    r8261 r8263  
    1 /* $Id: oslibdos.cpp,v 1.98 2002-04-13 07:41:31 bird Exp $ */
     1/* $Id: oslibdos.cpp,v 1.99 2002-04-13 07:47:24 bird Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    29672967  BOOL  flagTiledData = FALSE;
    29682968
    2969 #define MEM_TILED_CEILING 0x1fffffff
    2970 
    2971   // bounce buffer support
    2972   // make sure no parameter or data buffer can pass the tiled memory region
    2973   // barrier (usually 512MB). OS/2 kernel does not correctly translate these
    2974   // addresses to a 16:16 address used in device driver land. In fact,
    2975   // DosDevIOCtl is not a high memory enabled API!
    2976 
    2977   if (pTiledParm && (((DWORD)pTiledParm + max(dwParmMaxLen, *pdwParmLen)) > MEM_TILED_CEILING))
    2978   {
    2979     rc = DosAllocMem(&pTiledParm, dwParmMaxLen, PAG_READ | PAG_WRITE);
    2980     if (rc)
    2981       goto _exit_ioctl;
    2982 
    2983     flagTiledParm = TRUE;
    2984   }
    2985 
    2986   if (pTiledData && (((DWORD)pTiledData + max(dwDataMaxLen, *pdwDataLen)) > MEM_TILED_CEILING))
    2987   {
    2988     rc = DosAllocMem(&pTiledData, dwDataMaxLen, PAG_READ | PAG_WRITE);
    2989     if (rc)
    2990         goto _exit_ioctl;
    2991 
    2992     flagTiledData = TRUE;
    2993   }
    2994 
    2995   // copy data from real buffers to
    2996   // bounce buffers if necessary
    2997   if (pTiledParm != pParm)
    2998     memcpy(pTiledParm, pParm, *pdwParmLen);
    2999 
    3000   if (pTiledData != pData)
    3001     memcpy(pTiledData, pData, *pdwDataLen);
    3002 
    30032969#if 1
    30042970    /*
     
    30543020
    30553021#endif
     3022
     3023#define MEM_TILED_CEILING 0x1fffffff
     3024
     3025  // bounce buffer support
     3026  // make sure no parameter or data buffer can pass the tiled memory region
     3027  // barrier (usually 512MB). OS/2 kernel does not correctly translate these
     3028  // addresses to a 16:16 address used in device driver land. In fact,
     3029  // DosDevIOCtl is not a high memory enabled API!
     3030
     3031  if (pTiledParm && (((DWORD)pTiledParm + max(dwParmMaxLen, *pdwParmLen)) > MEM_TILED_CEILING))
     3032  {
     3033    rc = DosAllocMem(&pTiledParm, dwParmMaxLen, PAG_READ | PAG_WRITE);
     3034    if (rc)
     3035      goto _exit_ioctl;
     3036
     3037    flagTiledParm = TRUE;
     3038  }
     3039
     3040  if (pTiledData && (((DWORD)pTiledData + max(dwDataMaxLen, *pdwDataLen)) > MEM_TILED_CEILING))
     3041  {
     3042    rc = DosAllocMem(&pTiledData, dwDataMaxLen, PAG_READ | PAG_WRITE);
     3043    if (rc)
     3044        goto _exit_ioctl;
     3045
     3046    flagTiledData = TRUE;
     3047  }
     3048
     3049  // copy data from real buffers to
     3050  // bounce buffers if necessary
     3051  if (pTiledParm != pParm)
     3052    memcpy(pTiledParm, pParm, *pdwParmLen);
     3053
     3054  if (pTiledData != pData)
     3055    memcpy(pTiledData, pData, *pdwDataLen);
     3056
    30563057
    30573058  rc = DosDevIOCtl( (HFILE)hFile, dwCat, dwFunc,
Note: See TracChangeset for help on using the changeset viewer.