Ignore:
Timestamp:
Sep 20, 2000, 11:32:58 PM (25 years ago)
Author:
hugh
Message:

Implemented Serial APIs

File:
1 edited

Legend:

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

    r4279 r4285  
    1 /* $Id: Fileio.cpp,v 1.40 2000-09-18 19:26:15 sandervl Exp $ */
     1/* $Id: Fileio.cpp,v 1.41 2000-09-20 21:32:50 hugh Exp $ */
    22
    33/*
     
    9191  dprintf(("FindFirstFileA %s", lpFileName));
    9292  if(lpFileName == NULL || lpFindFileData == NULL) {
    93         SetLastError(ERROR_INVALID_PARAMETER);
    94         return -1;
     93  SetLastError(ERROR_INVALID_PARAMETER);
     94  return -1;
    9595  }
    9696  namelen = strlen(lpFileName);
    9797  if(lpFileName[namelen-1] == '\\') {
    98         filename = (char *)alloca(namelen+1);
    99         strcpy(filename, lpFileName);
    100         filename[namelen-1] = 0;
    101   }
    102   else  filename = (char *)lpFileName;
     98  filename = (char *)alloca(namelen+1);
     99  strcpy(filename, lpFileName);
     100  filename[namelen-1] = 0;
     101  }
     102  else  filename = (char *)lpFileName;
    103103
    104104  return (HANDLE)OSLibDosFindFirst(filename,lpFindFileData);
     
    244244{
    245245   if (lpft1 == NULL || lpft2 == NULL) {
    246         SetLastError(ERROR_INVALID_PARAMETER);
    247         return -1;
    248    }     
     246  SetLastError(ERROR_INVALID_PARAMETER);
     247  return -1;
     248   }
    249249
    250250   if(lpft1->dwHighDateTime > lpft2->dwHighDateTime)
    251         return 1;
     251  return 1;
    252252
    253253   if(lpft1->dwHighDateTime < lpft2->dwHighDateTime)
    254         return -1;
     254  return -1;
    255255
    256256   if(lpft1->dwLowDateTime > lpft2->dwLowDateTime)
    257         return 1;
     257  return 1;
    258258
    259259   if(lpft1->dwLowDateTime < lpft2->dwLowDateTime)
    260         return -1;
     260  return -1;
    261261
    262262   return 0; //equal
     
    342342  if((dwCopyFlags & COPY_FILE_FAIL_IF_EXISTS) != 0)
    343343  {
    344         failIfExists = TRUE;
     344      failIfExists = TRUE;
    345345  }
    346346
     
    416416  rc = OSLibDosDelete((LPSTR)lpszFile);
    417417  if(!rc) {
    418         dprintf(("DeleteFileA %s returned FALSE; last error %x", lpszFile, GetLastError()));
    419         if(GetLastError() == 20) {
    420                 return TRUE;
    421         }
    422   } 
     418    dprintf(("DeleteFileA %s returned FALSE; last error %x", lpszFile, GetLastError()));
     419  if(GetLastError() == 20) {
     420    return TRUE;
     421  }
     422  }
    423423  else  dprintf(("DeleteFileA %s", lpszFile));
    424424
     
    509509//******************************************************************************
    510510//******************************************************************************
    511 ODINFUNCTION5(BOOL,         ReadFileEx, 
     511ODINFUNCTION5(BOOL,         ReadFileEx,
    512512              HANDLE,       hFile,
    513513              LPVOID,       lpBuffer,
     
    557557 *****************************************************************************/
    558558
    559 ODINFUNCTION5(BOOL,         WriteFileEx, 
     559ODINFUNCTION5(BOOL,         WriteFileEx,
    560560              HANDLE,       hFile,
    561561              LPVOID,       lpBuffer,
     
    599599    }
    600600    else {
    601         rc = O32_GetFileAttributes((LPSTR)lpszFileName);
    602         if(rc == -1 && lpszFileName[strlen(lpszFileName)-1] != '\\') {
    603                 char *filename = (char *)alloca(strlen(lpszFileName)+2); //+2!!!!!!
    604                 strcpy(filename, lpszFileName);
     601  rc = O32_GetFileAttributes((LPSTR)lpszFileName);
     602  if(rc == -1 && lpszFileName[strlen(lpszFileName)-1] != '\\') {
     603    char *filename = (char *)alloca(strlen(lpszFileName)+2); //+2!!!!!!
     604    strcpy(filename, lpszFileName);
    605605                strcat(filename, "\\");
    606                 rc = O32_GetFileAttributes((LPSTR)filename);
    607         }
     606    rc = O32_GetFileAttributes((LPSTR)filename);
     607  }
    608608    }
    609609    //SvL: Open32 returns FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_NORMAL for
    610610    //     directories whereas NT 4 (SP6) only returns FILE_ATTRIBUTE_DIRECTORY
    611611    if(rc != -1 && (rc & FILE_ATTRIBUTE_DIRECTORY)) {
    612         rc = FILE_ATTRIBUTE_DIRECTORY;
     612  rc = FILE_ATTRIBUTE_DIRECTORY;
    613613    }
    614614
     
    671671{
    672672    char *ptr;
    673     dprintf(("KERNEL32:  GetFullPathName %s\n", arg1));
     673    DWORD rc;
     674    dprintf(("KERNEL32:  GetFullPathName called with %s %d %s \n", arg1, arg2, arg3));
    674675      while((ptr = strchr(arg1, '/')) != NULL)
    675676        *ptr = '\\';
     
    913914  length = lstrlenA(lpszLongPath) + 1;
    914915  if(length > cchBuffer) {
    915         if(lpszShortPath) {
    916                 *lpszShortPath = 0;
    917         }
     916  if(lpszShortPath) {
     917          *lpszShortPath = 0;
     918  }
    918919        return(length); //return length required (including 0 terminator)
    919920  }
     
    938939  length = lstrlenW(lpszLongPath) + 1;
    939940  if(length > cchBuffer) {
    940         if(lpszShortPath) {
    941                 *lpszShortPath = 0;
    942         }
     941  if(lpszShortPath) {
     942          *lpszShortPath = 0;
     943  }
    943944        return(length); //return length required (including 0 terminator)
    944945  }
     
    11421143
    11431144    lpAsciiPath = UnicodeToAsciiString( (LPWSTR) lpPathName);
    1144     hChange = FindFirstChangeNotificationA(lpAsciiPath, bWatchSubtree, 
     1145    hChange = FindFirstChangeNotificationA(lpAsciiPath, bWatchSubtree,
    11451146                                           dwNotifyFilter );
    11461147    if (lpAsciiPath) FreeAsciiString(lpAsciiPath);
Note: See TracChangeset for help on using the changeset viewer.