Changeset 6090 for trunk/src


Ignore:
Timestamp:
Jun 24, 2001, 4:13:05 PM (24 years ago)
Author:
sandervl
Message:

Rewrote CopyFile, MoveFile & RemoveDirectory

Location:
trunk/src/kernel32
Files:
5 edited

Legend:

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

    r5587 r6090  
    1 /* $Id: Fileio.cpp,v 1.49 2001-04-26 13:22:42 sandervl Exp $ */
     1/* $Id: Fileio.cpp,v 1.50 2001-06-24 14:13:03 sandervl Exp $ */
    22
    33/*
     
    281281              BOOL, arg3)
    282282{
    283   return O32_CopyFile(arg1, arg2, arg3);
     283  return OSLibDosCopyFile(arg1, arg2, arg3);
    284284}
    285285//******************************************************************************
     
    296296  astring1 = UnicodeToAsciiString((LPWSTR)arg1);
    297297  astring2 = UnicodeToAsciiString((LPWSTR)arg2);
    298   rc = O32_CopyFile(astring1, astring2, arg3);
     298  rc = CALL_ODINFUNC(CopyFileA)(astring1, astring2, arg3);
    299299  FreeAsciiString(astring2);
    300300  FreeAsciiString(astring1);
     
    770770                    nNumberOfBytesToLockHigh));
    771771}
    772 
    773 
    774 
    775 
    776772//******************************************************************************
    777773//******************************************************************************
     
    781777{
    782778    dprintf(("KERNEL32: MoveFileA %s %s", arg1, arg2));
    783     return O32_MoveFile(arg1, arg2);
     779    return OSLibDosMoveFile(arg1, arg2);
    784780}
    785781//******************************************************************************
     
    790786              DWORD, fdwFlags)
    791787{
    792     dprintf(("KERNEL32:  MoveFileExA %s to %s, not complete!\n", arg1, arg2));
    793     return O32_MoveFile(arg1, arg2);
     788    dprintf(("KERNEL32:  MoveFileExA %s to %s %x, not complete!\n", arg1, arg2, fdwFlags));
     789    return OSLibDosMoveFile(arg1, arg2);
    794790}
    795791//******************************************************************************
     
    804800  asciisrc  = UnicodeToAsciiString((LPWSTR)lpSrc);
    805801  asciidest = UnicodeToAsciiString((LPWSTR)lpDest);
    806   rc = O32_MoveFile(asciisrc, asciidest);
     802  rc = MoveFileA(asciisrc, asciidest);
    807803  FreeAsciiString(asciisrc);
    808804  FreeAsciiString(asciidest);
     
    816812              DWORD, fdwFlags)
    817813{
    818     dprintf(("KERNEL32:  MoveFileExW %s to %s, not complete!\n", arg1, arg2));
     814    dprintf(("KERNEL32:  MoveFileExW %ls to %ls %x, not complete!", arg1, arg2, fdwFlags));
    819815    return MoveFileW(arg1, arg2);
    820816}
  • trunk/src/kernel32/directory.cpp

    r5819 r6090  
    1 /* $Id: directory.cpp,v 1.36 2001-05-28 16:23:42 phaller Exp $ */
     1/* $Id: directory.cpp,v 1.37 2001-06-24 14:13:04 sandervl Exp $ */
    22
    33/*
     
    144144  int  rc;
    145145
    146   rc = O32_GetCurrentDirectory(nBufferLength, asciidir);
     146  rc = CALL_ODINFUNC(GetCurrentDirectoryA)(nBufferLength, asciidir);
    147147  if(rc != 0)
    148148    AsciiToUnicode(asciidir, lpBuffer);
     
    507507
    508508
    509 ODINFUNCTION1(BOOL,   RemoveDirectoryA,
    510               LPCSTR, lpstrDirectory)
     509ODINFUNCTION1(BOOL, RemoveDirectoryA, LPCSTR, lpstrDirectory)
    511510{
    512511  int len = strlen(lpstrDirectory);
    513512 
     513  if(lpstrDirectory == NULL) {
     514     SetLastError(ERROR_INVALID_PARAMETER);
     515     return FALSE;
     516  }
    514517  // cut off trailing backslashes
    515518  if ( (lpstrDirectory[len - 1] == '\\') ||
     
    523526  }
    524527 
    525   dprintf(("RemoveDirectory %s",
    526           lpstrDirectory));
    527 
    528   return O32_RemoveDirectory(lpstrDirectory);
     528  dprintf(("RemoveDirectory %s", lpstrDirectory));
     529
     530  return OSLibDosRemoveDir(lpstrDirectory);
    529531}
    530532
  • trunk/src/kernel32/heapstring.cpp

    r5478 r6090  
    1 /* $Id: heapstring.cpp,v 1.39 2001-04-04 14:20:32 sandervl Exp $ */
     1/* $Id: heapstring.cpp,v 1.40 2001-06-24 14:13:04 sandervl Exp $ */
    22
    33/*
     
    5858           arg1));
    5959
    60   return O32_lstrlen(arg1);
     60  return strlen(arg1);
    6161}
    6262
     
    160160      return 1;
    161161
    162     return O32_lstrcmp(arg1, arg2);
     162    return strcmp(arg1, arg2);
    163163}
    164164
     
    428428      return 1;
    429429
    430   return O32_lstrcmpi(arg1, arg2);
     430  return strcmpi(arg1, arg2);
    431431}
    432432
  • trunk/src/kernel32/oslibdos.cpp

    r6086 r6090  
    1 /* $Id: oslibdos.cpp,v 1.69 2001-06-23 19:43:50 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.70 2001-06-24 14:13:04 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    521521
    522522  rc = DosClose(hFile);
     523  SetLastError(error2WinError(rc));
     524  return (rc == NO_ERROR);
     525}
     526//******************************************************************************
     527//******************************************************************************
     528BOOL OSLibDosCopyFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile, BOOL fFailIfExist)
     529{
     530 APIRET rc;
     531
     532  rc = DosCopy((PSZ)lpszOldFile, (PSZ)lpszNewFile, fFailIfExist ? 0: DCPY_EXISTING);
     533  SetLastError(error2WinError(rc));
     534  return (rc == NO_ERROR);
     535}
     536//******************************************************************************
     537//******************************************************************************
     538BOOL OSLibDosMoveFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile)
     539{
     540 APIRET rc;
     541
     542  rc = DosMove((PSZ)lpszOldFile, (PSZ)lpszNewFile);
     543  SetLastError(error2WinError(rc));
     544  return (rc == NO_ERROR);
     545}
     546//******************************************************************************
     547//******************************************************************************
     548BOOL OSLibDosRemoveDir(LPCSTR lpszDir)
     549{
     550 APIRET rc;
     551
     552  rc = DosDeleteDir((PSZ)lpszDir);
    523553  SetLastError(error2WinError(rc));
    524554  return (rc == NO_ERROR);
  • trunk/src/kernel32/oslibdos.h

    r6053 r6090  
    1 /* $Id: oslibdos.h,v 1.32 2001-06-20 20:51:59 sandervl Exp $ */
     1/* $Id: oslibdos.h,v 1.33 2001-06-24 14:13:05 sandervl Exp $ */
    22
    33/*
     
    7777BOOL OSLibDosClose(DWORD hFile);
    7878BOOL OSLibDosDelete(char *lpszFileName);
     79BOOL OSLibDosCopyFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile, BOOL fFailIfExist);
     80BOOL OSLibDosMoveFile(LPCSTR lpszOldFile, LPCSTR lpszNewFile);
     81BOOL OSLibDosRemoveDir(LPCSTR lpszDir);
    7982
    8083#define OSLIB_SETPTR_FILE_CURRENT       0
Note: See TracChangeset for help on using the changeset viewer.