Since OS/2 kLIBC v0.6.6, DosDevIOCtl() is high-memory safe. So the wrapper is not needed any more. --- lib/driver/os2.c | 75 -------------------------------------------------------- 1 file changed, 75 deletions(-)
diff --git a/lib/driver/os2.c b/lib/driver/os2.c index 23df59c..758c6c7 100644 --- a/lib/driver/os2.c +++ b/lib/driver/os2.c @@ -90,81 +90,6 @@ run_mmc_cmd_os2( void *p_user_data, unsigned int i_timeout_ms, unsigned int i_buf, /*in/out*/ void *p_buf ); /*! - High memory safe wrapper for DosDevIOCtl() -*/ -static APIRET -SafeDosDevIOCtl( HFILE hdevice, ULONG category, ULONG function, - PVOID pParams, ULONG cbParamLenMax, PULONG pcbParamLen, - PVOID pData, ULONG cbDataLenMax, PULONG pcbDataLen ) -{ - PVOID pParamsLow = NULL; - PVOID pDataLow = NULL; - PULONG pcbParamLenLow = NULL; - PULONG pcbDataLenLow = NULL; - ULONG cbParamLenLow; - ULONG cbDataLenLow; - - APIRET rc = 0; - - if( pParams ) - rc = DosAllocMem( &pParamsLow, cbParamLenMax, fALLOC ); - - if( rc ) - goto exit_free; - - if( pData ) - rc = DosAllocMem( &pDataLow, cbDataLenMax, fALLOC ); - - if( rc ) - goto exit_free; - - if( pParams ) - memcpy( pParamsLow, pParams, cbParamLenMax ); - - if( pData ) - memcpy( pDataLow, pData, cbDataLenMax ); - - if( pcbParamLen ) - { - pcbParamLenLow = &cbParamLenLow; - *pcbParamLenLow = *pcbParamLen; - } - - if( pcbDataLen ) - { - pcbDataLenLow = &cbDataLenLow; - *pcbDataLenLow = *pcbDataLen; - } - - rc = DosDevIOCtl( hdevice, category, function, - pParamsLow, cbParamLenMax, pcbParamLenLow, - pDataLow, cbDataLenMax, pcbDataLenLow ); - - if( !rc ) - { - if( pParams ) - memcpy( pParams, pParamsLow, cbParamLenMax ); - - if( pData ) - memcpy( pData, pDataLow, cbDataLenMax ); - - if( pcbParamLen ) - *pcbParamLen = *pcbParamLenLow; - - if( pcbDataLen ) - *pcbDataLen = *pcbDataLenLow; - } - -exit_free: - DosFreeMem( pParamsLow); - DosFreeMem( pDataLow); - - return rc; -} - -#define DosDevIOCtl SafeDosDevIOCtl - -/*! Set the volume of an audio CD. @param p_cdio the CD object to be acted upon. -- 2.9.2