Ignore:
Timestamp:
Mar 3, 2000, 12:16:00 PM (25 years ago)
Author:
sandervl
Message:

moved registry apis into kernel32 + cleanup

File:
1 edited

Legend:

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

    r2866 r2984  
    1 /* $Id: oslibdos.cpp,v 1.20 2000-02-23 01:06:58 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.21 2000-03-03 11:15:58 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    2020#include <stdio.h>
    2121#include <string.h>
    22 #include <win32type.h>
     22#include <win32api.h>
    2323#include <winconst.h>
    2424#include <misc.h>
     
    2929#define DBG_LOCALLOG    DBG_oslibdos
    3030#include "dbglocal.h"
    31 
    32 /***********************************
    33  * PH: fixups for missing os2win.h *
    34  ***********************************/
    35 
    36 void _System _O32_SetLastError(ULONG ulError);
    37 
    38 APIRET APIENTRY DosAliasMem(PVOID pb, ULONG cb, PPVOID ppbAlias, ULONG fl);
    3931
    4032//******************************************************************************
     
    621613  if (nMaxInstances>0xff)
    622614  {
    623     _O32_SetLastError(87); // ERROR_INVALID_PARAMETER
     615    SetLastError(ERROR_INVALID_PARAMETER_W); // ERROR_INVALID_PARAMETER
    624616    return -1; // INVALID_HANDLE_VALUE
    625617  }
     
    648640  if (rc)
    649641  {
    650      if ( rc == ERROR_PIPE_BUSY         ) _O32_SetLastError(ERROR_PIPE_BUSY_W);
     642     if ( rc == ERROR_PIPE_BUSY         ) SetLastError(ERROR_PIPE_BUSY_W);
    651643       else
    652      if ( rc == ERROR_PATH_NOT_FOUND    ) _O32_SetLastError(ERROR_PATH_NOT_FOUND_W);
     644     if ( rc == ERROR_PATH_NOT_FOUND    ) SetLastError(ERROR_PATH_NOT_FOUND_W);
    653645       else
    654      if ( rc == ERROR_NOT_ENOUGH_MEMORY ) _O32_SetLastError(ERROR_NOT_ENOUGH_MEMORY_W);
     646     if ( rc == ERROR_NOT_ENOUGH_MEMORY ) SetLastError(ERROR_NOT_ENOUGH_MEMORY_W);
    655647       else
    656      if ( rc == ERROR_INVALID_PARAMETER ) _O32_SetLastError(ERROR_INVALID_PARAMETER_W);
     648     if ( rc == ERROR_INVALID_PARAMETER ) SetLastError(ERROR_INVALID_PARAMETER_W);
    657649       else
    658      if ( rc == ERROR_OUT_OF_STRUCTURES ) _O32_SetLastError(ERROR_OUT_OF_STRUCTURES_W);
     650     if ( rc == ERROR_OUT_OF_STRUCTURES ) SetLastError(ERROR_OUT_OF_STRUCTURES_W);
    659651       else
    660652         // Unknown error
    661          _O32_SetLastError(ERROR_INVALID_PARAMETER_W); // fixme!
     653         SetLastError(ERROR_INVALID_PARAMETER_W); // fixme!
    662654     return -1; // INVALID_HANDLE_VALUE
    663655  }
     
    677669  if (!rc) return (TRUE);
    678670    else
    679   if (rc==ERROR_BROKEN_PIPE) _O32_SetLastError(ERROR_BROKEN_PIPE_W);   
    680     else
    681   if (rc==ERROR_BAD_PIPE) _O32_SetLastError(ERROR_BAD_PIPE_W);
    682     else
    683   if (rc==ERROR_PIPE_NOT_CONNECTED) _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     671  if (rc==ERROR_BROKEN_PIPE) SetLastError(ERROR_BROKEN_PIPE_W);   
     672    else
     673  if (rc==ERROR_BAD_PIPE) SetLastError(ERROR_BAD_PIPE_W);
     674    else
     675  if (rc==ERROR_PIPE_NOT_CONNECTED) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    684676    else
    685677  // TODO: Implemnt this using Windows Errors
    686678  // if (rc==ERROR_INTERRUPT)
    687   _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     679  SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    688680 
    689681  return (FALSE);
     
    724716  if (!rc) return (TRUE);
    725717   else
    726   if ( rc==ERROR_FILE_NOT_FOUND     ) _O32_SetLastError(ERROR_FILE_NOT_FOUND_W);   
    727     else
    728   if ( rc==ERROR_PATH_NOT_FOUND     ) _O32_SetLastError(ERROR_PATH_NOT_FOUND_W);   
    729     else
    730   if ( rc==ERROR_ACCESS_DENIED      ) _O32_SetLastError(ERROR_ACCESS_DENIED_W);   
    731     else
    732   if ( rc==ERROR_MORE_DATA          ) _O32_SetLastError(ERROR_MORE_DATA_W);   
    733     else
    734   if ( rc==ERROR_PIPE_BUSY          ) _O32_SetLastError(ERROR_PIPE_BUSY_W);   
    735     else
    736   if ( rc==ERROR_BAD_FORMAT         ) _O32_SetLastError(ERROR_BAD_FORMAT_W);   
    737     else
    738   if ( rc==ERROR_BROKEN_PIPE        ) _O32_SetLastError(ERROR_BROKEN_PIPE_W);   
    739     else
    740   if ( rc==ERROR_BAD_PIPE           ) _O32_SetLastError(ERROR_BAD_PIPE_W);
    741     else
    742   if ( rc==ERROR_PIPE_NOT_CONNECTED ) _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     718  if ( rc==ERROR_FILE_NOT_FOUND     ) SetLastError(ERROR_FILE_NOT_FOUND_W);   
     719    else
     720  if ( rc==ERROR_PATH_NOT_FOUND     ) SetLastError(ERROR_PATH_NOT_FOUND_W);   
     721    else
     722  if ( rc==ERROR_ACCESS_DENIED      ) SetLastError(ERROR_ACCESS_DENIED_W);   
     723    else
     724  if ( rc==ERROR_MORE_DATA          ) SetLastError(ERROR_MORE_DATA_W);   
     725    else
     726  if ( rc==ERROR_PIPE_BUSY          ) SetLastError(ERROR_PIPE_BUSY_W);   
     727    else
     728  if ( rc==ERROR_BAD_FORMAT         ) SetLastError(ERROR_BAD_FORMAT_W);   
     729    else
     730  if ( rc==ERROR_BROKEN_PIPE        ) SetLastError(ERROR_BROKEN_PIPE_W);   
     731    else
     732  if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
     733    else
     734  if ( rc==ERROR_PIPE_NOT_CONNECTED ) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    743735    else
    744736  // TODO: Implemnt this using Windows Errors
    745737  // if (rc==ERROR_INTERRUPT)
    746   _O32_SetLastError(233);
     738  SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    747739
    748740  return (FALSE);
     
    771763  if (!rc) return (TRUE);
    772764   else
    773   if ( rc==ERROR_ACCESS_DENIED      ) _O32_SetLastError(ERROR_ACCESS_DENIED_W);   
    774     else
    775   if ( rc==ERROR_MORE_DATA          ) _O32_SetLastError(ERROR_MORE_DATA_W);   
    776     else
    777   if ( rc==ERROR_PIPE_BUSY          ) _O32_SetLastError(ERROR_PIPE_BUSY_W);   
    778     else
    779   if ( rc==ERROR_BAD_FORMAT         ) _O32_SetLastError(ERROR_BAD_FORMAT_W);   
    780     else
    781   if ( rc==ERROR_BROKEN_PIPE        ) _O32_SetLastError(ERROR_BROKEN_PIPE_W);   
    782     else
    783   if ( rc==ERROR_BAD_PIPE           ) _O32_SetLastError(ERROR_BAD_PIPE_W);
    784     else
    785   if ( rc==ERROR_PIPE_NOT_CONNECTED ) _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     765  if ( rc==ERROR_ACCESS_DENIED      ) SetLastError(ERROR_ACCESS_DENIED_W);   
     766    else
     767  if ( rc==ERROR_MORE_DATA          ) SetLastError(ERROR_MORE_DATA_W);   
     768    else
     769  if ( rc==ERROR_PIPE_BUSY          ) SetLastError(ERROR_PIPE_BUSY_W);   
     770    else
     771  if ( rc==ERROR_BAD_FORMAT         ) SetLastError(ERROR_BAD_FORMAT_W);   
     772    else
     773  if ( rc==ERROR_BROKEN_PIPE        ) SetLastError(ERROR_BROKEN_PIPE_W);   
     774    else
     775  if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
     776    else
     777  if ( rc==ERROR_PIPE_NOT_CONNECTED ) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    786778    else
    787779  // Unknown error
    788   _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     780  SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    789781
    790782  return (FALSE);
     
    815807  }
    816808   else
    817   if ( rc==ERROR_ACCESS_DENIED      ) _O32_SetLastError(ERROR_ACCESS_DENIED_W);   
    818     else
    819   if ( rc==ERROR_PIPE_BUSY          ) _O32_SetLastError(ERROR_PIPE_BUSY_W);   
    820     else
    821   if ( rc==ERROR_BAD_PIPE           ) _O32_SetLastError(ERROR_BAD_PIPE_W);
    822     else
    823   if ( rc==ERROR_PIPE_NOT_CONNECTED ) _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     809  if ( rc==ERROR_ACCESS_DENIED      ) SetLastError(ERROR_ACCESS_DENIED_W);   
     810    else
     811  if ( rc==ERROR_PIPE_BUSY          ) SetLastError(ERROR_PIPE_BUSY_W);   
     812    else
     813  if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
     814    else
     815  if ( rc==ERROR_PIPE_NOT_CONNECTED ) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    824816    else
    825817  // Unknown error
    826   _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     818  SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    827819
    828820  return (FALSE);
     
    840832  if (!rc) return TRUE;
    841833    else
    842   if ( rc==ERROR_BROKEN_PIPE        ) _O32_SetLastError(ERROR_BROKEN_PIPE_W);   
    843     else
    844   if ( rc==ERROR_BAD_PIPE           ) _O32_SetLastError(ERROR_BAD_PIPE_W);
     834  if ( rc==ERROR_BROKEN_PIPE        ) SetLastError(ERROR_BROKEN_PIPE_W);   
     835    else
     836  if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
    845837    else
    846838     // Unknown error
    847      _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W); // Maybe another?
     839     SetLastError(ERROR_PIPE_NOT_CONNECTED_W); // Maybe another?
    848840
    849841  return (FALSE);
     
    873865  if (!rc) return TRUE;
    874866    else
    875   if ( rc == ERROR_PATH_NOT_FOUND ) _O32_SetLastError(ERROR_PATH_NOT_FOUND_W);
    876     else
    877   if ( rc==ERROR_BAD_PIPE         ) _O32_SetLastError(ERROR_BAD_PIPE_W);
    878     else
    879   if ( rc == ERROR_PIPE_BUSY      ) _O32_SetLastError(ERROR_PIPE_BUSY_W);
    880     else
    881   if ( rc == ERROR_SEM_TIMEOUT_W  ) _O32_SetLastError(ERROR_SEM_TIMEOUT_W);
     867  if ( rc == ERROR_PATH_NOT_FOUND ) SetLastError(ERROR_PATH_NOT_FOUND_W);
     868    else
     869  if ( rc==ERROR_BAD_PIPE         ) SetLastError(ERROR_BAD_PIPE_W);
     870    else
     871  if ( rc == ERROR_PIPE_BUSY      ) SetLastError(ERROR_PIPE_BUSY_W);
     872    else
     873  if ( rc == ERROR_SEM_TIMEOUT_W  ) SetLastError(ERROR_SEM_TIMEOUT_W);
    882874    else
    883875  // TODO: Implemnt this using Windows Errors
    884876  // if (rc==ERROR_INTERRUPT)
    885   _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     877  SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    886878
    887879  return (FALSE);
Note: See TracChangeset for help on using the changeset viewer.