Ignore:
Timestamp:
Feb 23, 2000, 2:06:59 AM (25 years ago)
Author:
sandervl
Message:

SetLastError calling convention bugs fixed

File:
1 edited

Legend:

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

    r2803 r2866  
    1 /* $Id: oslibdos.cpp,v 1.19 2000-02-16 14:25:45 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.20 2000-02-23 01:06:58 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    3434 ***********************************/
    3535
    36 void _System SetLastError(ULONG ulError);
     36void _System _O32_SetLastError(ULONG ulError);
    3737
    3838APIRET APIENTRY DosAliasMem(PVOID pb, ULONG cb, PPVOID ppbAlias, ULONG fl);
     
    621621  if (nMaxInstances>0xff)
    622622  {
    623     SetLastError(87); // ERROR_INVALID_PARAMETER
     623    _O32_SetLastError(87); // ERROR_INVALID_PARAMETER
    624624    return -1; // INVALID_HANDLE_VALUE
    625625  }
     
    648648  if (rc)
    649649  {
    650      if ( rc == ERROR_PIPE_BUSY         ) SetLastError(ERROR_PIPE_BUSY_W);
     650     if ( rc == ERROR_PIPE_BUSY         ) _O32_SetLastError(ERROR_PIPE_BUSY_W);
    651651       else
    652      if ( rc == ERROR_PATH_NOT_FOUND    ) SetLastError(ERROR_PATH_NOT_FOUND_W);
     652     if ( rc == ERROR_PATH_NOT_FOUND    ) _O32_SetLastError(ERROR_PATH_NOT_FOUND_W);
    653653       else
    654      if ( rc == ERROR_NOT_ENOUGH_MEMORY ) SetLastError(ERROR_NOT_ENOUGH_MEMORY_W);
     654     if ( rc == ERROR_NOT_ENOUGH_MEMORY ) _O32_SetLastError(ERROR_NOT_ENOUGH_MEMORY_W);
    655655       else
    656      if ( rc == ERROR_INVALID_PARAMETER ) SetLastError(ERROR_INVALID_PARAMETER_W);
     656     if ( rc == ERROR_INVALID_PARAMETER ) _O32_SetLastError(ERROR_INVALID_PARAMETER_W);
    657657       else
    658      if ( rc == ERROR_OUT_OF_STRUCTURES ) SetLastError(ERROR_OUT_OF_STRUCTURES_W);
     658     if ( rc == ERROR_OUT_OF_STRUCTURES ) _O32_SetLastError(ERROR_OUT_OF_STRUCTURES_W);
    659659       else
    660660         // Unknown error
    661          SetLastError(ERROR_INVALID_PARAMETER_W); // fixme!
     661         _O32_SetLastError(ERROR_INVALID_PARAMETER_W); // fixme!
    662662     return -1; // INVALID_HANDLE_VALUE
    663663  }
     
    677677  if (!rc) return (TRUE);
    678678    else
    679   if (rc==ERROR_BROKEN_PIPE) SetLastError(ERROR_BROKEN_PIPE_W);   
    680     else
    681   if (rc==ERROR_BAD_PIPE) SetLastError(ERROR_BAD_PIPE_W);
    682     else
    683   if (rc==ERROR_PIPE_NOT_CONNECTED) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     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);
    684684    else
    685685  // TODO: Implemnt this using Windows Errors
    686686  // if (rc==ERROR_INTERRUPT)
    687   SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     687  _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    688688 
    689689  return (FALSE);
     
    724724  if (!rc) return (TRUE);
    725725   else
    726   if ( rc==ERROR_FILE_NOT_FOUND     ) SetLastError(ERROR_FILE_NOT_FOUND_W);   
    727     else
    728   if ( rc==ERROR_PATH_NOT_FOUND     ) SetLastError(ERROR_PATH_NOT_FOUND_W);   
    729     else
    730   if ( rc==ERROR_ACCESS_DENIED      ) SetLastError(ERROR_ACCESS_DENIED_W);   
    731     else
    732   if ( rc==ERROR_MORE_DATA          ) SetLastError(ERROR_MORE_DATA_W);   
    733     else
    734   if ( rc==ERROR_PIPE_BUSY          ) SetLastError(ERROR_PIPE_BUSY_W);   
    735     else
    736   if ( rc==ERROR_BAD_FORMAT         ) SetLastError(ERROR_BAD_FORMAT_W);   
    737     else
    738   if ( rc==ERROR_BROKEN_PIPE        ) SetLastError(ERROR_BROKEN_PIPE_W);   
    739     else
    740   if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
    741     else
    742   if ( rc==ERROR_PIPE_NOT_CONNECTED ) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     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);
    743743    else
    744744  // TODO: Implemnt this using Windows Errors
    745745  // if (rc==ERROR_INTERRUPT)
    746   SetLastError(233);
     746  _O32_SetLastError(233);
    747747
    748748  return (FALSE);
     
    771771  if (!rc) return (TRUE);
    772772   else
    773   if ( rc==ERROR_ACCESS_DENIED      ) SetLastError(ERROR_ACCESS_DENIED_W);   
    774     else
    775   if ( rc==ERROR_MORE_DATA          ) SetLastError(ERROR_MORE_DATA_W);   
    776     else
    777   if ( rc==ERROR_PIPE_BUSY          ) SetLastError(ERROR_PIPE_BUSY_W);   
    778     else
    779   if ( rc==ERROR_BAD_FORMAT         ) SetLastError(ERROR_BAD_FORMAT_W);   
    780     else
    781   if ( rc==ERROR_BROKEN_PIPE        ) SetLastError(ERROR_BROKEN_PIPE_W);   
    782     else
    783   if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
    784     else
    785   if ( rc==ERROR_PIPE_NOT_CONNECTED ) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     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);
    786786    else
    787787  // Unknown error
    788   SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     788  _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    789789
    790790  return (FALSE);
     
    815815  }
    816816   else
    817   if ( rc==ERROR_ACCESS_DENIED      ) SetLastError(ERROR_ACCESS_DENIED_W);   
    818     else
    819   if ( rc==ERROR_PIPE_BUSY          ) SetLastError(ERROR_PIPE_BUSY_W);   
    820     else
    821   if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
    822     else
    823   if ( rc==ERROR_PIPE_NOT_CONNECTED ) SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     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);
    824824    else
    825825  // Unknown error
    826   SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     826  _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    827827
    828828  return (FALSE);
     
    840840  if (!rc) return TRUE;
    841841    else
    842   if ( rc==ERROR_BROKEN_PIPE        ) SetLastError(ERROR_BROKEN_PIPE_W);   
    843     else
    844   if ( rc==ERROR_BAD_PIPE           ) SetLastError(ERROR_BAD_PIPE_W);
     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);
    845845    else
    846846     // Unknown error
    847      SetLastError(ERROR_PIPE_NOT_CONNECTED_W); // Maybe another?
     847     _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W); // Maybe another?
    848848
    849849  return (FALSE);
     
    873873  if (!rc) return TRUE;
    874874    else
    875   if ( rc == ERROR_PATH_NOT_FOUND ) SetLastError(ERROR_PATH_NOT_FOUND_W);
    876     else
    877   if ( rc==ERROR_BAD_PIPE         ) SetLastError(ERROR_BAD_PIPE_W);
    878     else
    879   if ( rc == ERROR_PIPE_BUSY      ) SetLastError(ERROR_PIPE_BUSY_W);
    880     else
    881   if ( rc == ERROR_SEM_TIMEOUT_W  ) SetLastError(ERROR_SEM_TIMEOUT_W);
     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);
    882882    else
    883883  // TODO: Implemnt this using Windows Errors
    884884  // if (rc==ERROR_INTERRUPT)
    885   SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
     885  _O32_SetLastError(ERROR_PIPE_NOT_CONNECTED_W);
    886886
    887887  return (FALSE);
Note: See TracChangeset for help on using the changeset viewer.