Ignore:
Timestamp:
Apr 21, 2001, 1:22:25 PM (24 years ago)
Author:
sandervl
Message:

Added partial implementation of GetLongPathNameA/W

File:
1 edited

Legend:

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

    r4771 r5559  
    1 /* $Id: Fileio.cpp,v 1.46 2000-12-09 16:16:27 phaller Exp $ */
     1/* $Id: Fileio.cpp,v 1.47 2001-04-21 11:22:25 sandervl Exp $ */
    22
    33/*
     
    958958}
    959959//******************************************************************************
     960//Behaviour in NT 4, SP6: (presumably the same as GetShortPathNameA; TODO check)
     961//- converts short filename to long filenames (TODO: not yet done here!)
     962//- if lpszShortPath 0 or cchBuffer too small -> return required length
     963//  (INCLUDING 0 terminator)
     964//- if lpszLongPath == NULL -> ERROR_INVALID_PARAMETER (return 0)
     965//- if lpszLongPath empty -> proceed as if nothing is wrong
     966//- does NOT clear the last error if successful!
     967//- if successful -> return length of string (excluding 0 terminator)
     968//******************************************************************************
     969DWORD WINAPI GetLongPathNameA( LPCSTR lpszShortPath, LPSTR lpszLongPath,
     970                               DWORD cchBuffer )
     971{
     972 int length;
     973
     974  dprintf(("GetLongPathNameA %x %s %d", lpszShortPath, lpszLongPath, cchBuffer));
     975 
     976  if(!lpszShortPath) {
     977      SetLastError(ERROR_INVALID_PARAMETER);
     978      return 0;
     979  }
     980
     981  length = lstrlenA(lpszShortPath) + 1;
     982  if(length > cchBuffer) {
     983      if(lpszLongPath) {
     984          *lpszLongPath = 0;
     985      }
     986      return(length); //return length required (including 0 terminator)
     987  }
     988  lstrcpyA(lpszLongPath, lpszShortPath);
     989  return(length-1);
     990}
     991//******************************************************************************
     992//******************************************************************************
     993DWORD WINAPI GetLongPathNameW( LPCWSTR lpszShortPath, LPWSTR lpszLongPath,
     994                               DWORD cchBuffer )
     995{
     996 int length;
     997
     998  dprintf(("GetLongPathNameW %x %ls %d", lpszShortPath, lpszLongPath, cchBuffer));
     999
     1000  if(!lpszShortPath) {
     1001      SetLastError(ERROR_INVALID_PARAMETER);
     1002      return 0;
     1003  }
     1004
     1005  length = lstrlenW(lpszShortPath) + 1;
     1006  if(length > cchBuffer) {
     1007      if(lpszLongPath) {
     1008          *lpszLongPath = 0;
     1009      }
     1010      return(length); //return length required (including 0 terminator)
     1011  }
     1012  lstrcpyW(lpszLongPath, lpszShortPath);
     1013  return(length-1);
     1014}
     1015//******************************************************************************
    9601016//******************************************************************************
    9611017ODINPROCEDURE0(SetFileApisToANSI)
Note: See TracChangeset for help on using the changeset viewer.