Ignore:
Timestamp:
Jan 9, 2011, 5:54:29 PM (15 years ago)
Author:
dmik
Message:

kernel32: Fixed debug output in GetFullPathName*.

File:
1 edited

Legend:

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

    r21388 r21549  
    242242 *             If the function fails, the return value is INVALID_HANDLE_VALUE
    243243 * Remark    :
    244  * Status    : 
     244 * Status    :
    245245 *
    246246 * Author    : SvL
     
    251251                                 LPVOID lpSearchFilter,
    252252                                 DWORD dwAdditionalFlags)
    253 {   
     253{
    254254  HANDLE hFind;
    255255
    256     if(lpFileName == NULL || lpFindFileData == NULL || lpSearchFilter != NULL) 
     256    if(lpFileName == NULL || lpFindFileData == NULL || lpSearchFilter != NULL)
    257257    {
    258258        dprintf(("!ERROR!: invalid parameter(s)"));
     
    267267    }
    268268    else
    269     if(fSearchOp == FindExSearchLimitToDirectories) {     
     269    if(fSearchOp == FindExSearchLimitToDirectories) {
    270270        //NOTE: According to the SDK docs we are allowed to silently ignore this option
    271271        dprintf(("!WARNING!: FindExSearchLimitToDirectories IGNORED"));
     
    296296            filename[namelen-1] = 0;
    297297        }
    298         else 
     298        else
    299299            filename = (char *)lpFileName;
    300  
     300
    301301        return (HANDLE)OSLibDosFindFirst(filename, (WIN32_FIND_DATAA *)lpFindFileData);
    302302    }
     
    306306        SetLastError(ERROR_INVALID_PARAMETER);
    307307        break;
    308     }     
     308    }
    309309    return INVALID_HANDLE_VALUE;
    310310}
     
    334334 *             If the function fails, the return value is INVALID_HANDLE_VALUE
    335335 * Remark    :
    336  * Status    : 
     336 * Status    :
    337337 *
    338338 * Author    : Wine
     
    367367    HeapFree( GetProcessHeap(), 0, pathA );
    368368    if (handle == INVALID_HANDLE_VALUE) return handle;
    369    
     369
    370370    switch(fInfoLevelId)
    371371    {
     
    608608  }
    609609  //If the app is deleting a shellink file (.lnk), then we must delete the WPS object
    610   if(OSLibIsShellLink((LPSTR)lpszFile)) 
     610  if(OSLibIsShellLink((LPSTR)lpszFile))
    611611  {
    612612      OSLibWinDeleteObject((LPSTR)lpszFile);
     
    638638//******************************************************************************
    639639//******************************************************************************
    640 UINT WIN32API GetTempFileNameA(LPCSTR lpPathName, LPCSTR lpPrefixString, 
     640UINT WIN32API GetTempFileNameA(LPCSTR lpPathName, LPCSTR lpPrefixString,
    641641                               UINT uUnique, LPSTR lpTempFileName)
    642642{
     
    848848    DWORD rc;
    849849
    850     dprintf(("KERNEL32:  GetFullPathName called with %s %d %x", lpFileName, nBufferLength, lpBuffer));
     850    dprintf(("KERNEL32: GetFullPathName(%s,%d,0x%X)", lpFileName, nBufferLength, lpBuffer));
    851851
    852852    lpszFileName = strdup(lpFileName);
     
    857857    rc = O32_GetFullPathName(lpszFileName, nBufferLength, lpBuffer, lpFilePart);
    858858
     859#ifdef DEBUG
     860    if (rc > nBufferLength) {
     861        dprintf(("KERNEL32: GetFullPathName returns %d (needs a bgger buffer)", rc));
     862    } else if (rc > 0) {
     863        dprintf(("KERNEL32: GetFullPathName returns %d (%s,%s)", lpBuffer, *lpFilePart));
     864    }
     865#endif
     866
    859867    free(lpszFileName);
    860868
     
    876884  rc = GetFullPathNameA(astring, nBufferLength,
    877885                        asciibuffer, &asciipart);
    878 
    879   dprintf(("KERNEL32: GetFullPathNameW %s returns %s\n%s",
    880            astring,
    881            asciibuffer, asciipart));
    882886
    883887  if(rc>0 && rc<nBufferLength && asciibuffer)
     
    925929                          DWORD fdwFlags)
    926930{
    927   dprintf(("KERNEL32:  MoveFileExA %s to %s %x, not complete!\n", 
    928            lpszOldFilename, 
     931  dprintf(("KERNEL32:  MoveFileExA %s to %s %x, not complete!\n",
     932           lpszOldFilename,
    929933           lpszNewFilename,
    930934           fdwFlags));
    931  
     935
    932936  // this parameter combination is illegal
    933937  if ( (fdwFlags & MOVEFILE_DELAY_UNTIL_REBOOT) &&
     
    938942    return FALSE;
    939943  }
    940  
     944
    941945  // first, we take care about the special cases
    942946  if (fdwFlags && MOVEFILE_DELAY_UNTIL_REBOOT)
     
    946950    // this call is Microsoft ACMSETUP wanting to replace OLEPRO32.DLL
    947951    // in the ODIN system directory, we are better skipping the call.
    948    
     952
    949953    // Anyway, this is only supported under Windows NT
    950954    fdwFlags &= ~MOVEFILE_DELAY_UNTIL_REBOOT;
    951    
     955
    952956    // Until we support this, we have to intercept
    953957    // lpszNewFilename == NULL
     
    957961      dprintf(("KERNEL32-MoveFileExA: trying to delete file [%s], skipped.",
    958962               lpszOldFilename));
    959      
     963
    960964      SetLastError( NO_ERROR );
    961965      return TRUE;
    962966    }
    963967  }
    964  
     968
    965969  if (fdwFlags && MOVEFILE_COPY_ALLOWED)
    966970  {
     
    968972    // volumes, this flag controls if a copy operation is allowed.
    969973  }
    970  
     974
    971975  if (fdwFlags && MOVEFILE_REPLACE_EXISTING)
    972976  {
    973     // We can only attempt to 
     977    // We can only attempt to
    974978    // 1 move away the current file if existing,
    975979    // 2 do the current move operation
     
    977981    //   otherwise restore the original file
    978982  }
    979  
    980   return OSLibDosMoveFile(lpszOldFilename, 
     983
     984  return OSLibDosMoveFile(lpszOldFilename,
    981985                          lpszNewFilename);
    982986}
     
    9991003BOOL WIN32API MoveFileExW(LPCWSTR lpSrc, LPCWSTR lpDest, DWORD fdwFlags)
    10001004{
    1001   dprintf(("KERNEL32: MoveFileExW %ls to %ls %x", 
    1002            lpSrc, 
     1005  dprintf(("KERNEL32: MoveFileExW %ls to %ls %x",
     1006           lpSrc,
    10031007           lpDest,
    10041008           fdwFlags));
    1005  
    1006   char *asciisrc, 
     1009
     1010  char *asciisrc,
    10071011       *asciidest;
    10081012  BOOL rc;
     
    10131017  else
    10141018    asciidest = NULL;
    1015  
    1016   rc = MoveFileExA(asciisrc, 
     1019
     1020  rc = MoveFileExA(asciisrc,
    10171021                   asciidest,
    10181022                   fdwFlags);
    1019  
     1023
    10201024  if (NULL != asciidest)
    10211025    FreeAsciiString(asciidest);
    1022  
     1026
    10231027  FreeAsciiString(asciisrc);
    1024  
     1028
    10251029  return(rc);
    10261030}
     
    10451049  DWORD attr, sp = 0, lp = 0;
    10461050  int tmplen, drive;
    1047  
     1051
    10481052  dprintf(("KERNEL32:  GetShortPathNameA %s", lpszLongPath));
    10491053
     
    10661070      return 0;
    10671071  }
    1068  
     1072
    10691073  lstrcpyA(tmplongpath,lpszLongPath);
    1070    
     1074
    10711075  /* check for drive letter */
    10721076  if ( lpszLongPath[1] == ':' ) {
     
    10831087      /* check for path delimiters and reproduce them */
    10841088      if ( lpszLongPath[lp] == '\\' || lpszLongPath[lp] == '/' ) {
    1085         if (!sp || tmpshortpath[sp-1]!= '\\') 
     1089        if (!sp || tmpshortpath[sp-1]!= '\\')
    10861090        {
    10871091            /* strip double "\\" */
     
    10941098      }
    10951099
    1096       tmplen = strcspn ( lpszLongPath + lp, "\\/" ); 
     1100      tmplen = strcspn ( lpszLongPath + lp, "\\/" );
    10971101      lstrcpynA ( tmpshortpath+sp, lpszLongPath + lp, tmplen+1 );
    10981102
     
    11051109
    11061110      if (tmplongpath[lp + tmplen] == '\\')
    1107       { 
     1111      {
    11081112         tmplongpath[lp + tmplen] = 0;
    11091113         marker = 1;
     
    11121116      attr = GetFileAttributesA(tmplongpath);
    11131117
    1114       if (attr == -1) 
     1118      if (attr == -1)
    11151119      {
    11161120         SetLastError ( ERROR_FILE_NOT_FOUND );
     
    11201124      }
    11211125
    1122       DOSFS_Hash(tmpshortpath+sp, short_name, FALSE, TRUE );         
    1123        
     1126      DOSFS_Hash(tmpshortpath+sp, short_name, FALSE, TRUE );
     1127
    11241128      strcpy( tmpshortpath+sp, short_name);
    11251129      sp += strlen ( tmpshortpath+sp );
     
    11271131         tmplongpath[lp + tmplen] = '\\';
    11281132      lp += tmplen;
    1129      
     1133
    11301134    }
    11311135
     
    11821186
    11831187   dprintf(("GetLongPathNameA %s %x %d", lpszShortPath, lpszLongPath, cchBuffer));
    1184  
     1188
    11851189   if(!lpszShortPath) {
    11861190     SetLastError(ERROR_INVALID_PARAMETER);
     
    12181222      /* check for path delimiters and reproduce them */
    12191223      if ( lpszShortPath1[lp] == '\\' || lpszShortPath1[lp] == '/' ) {
    1220         if (!sp || tmplongpath[sp-1]!= '\\') 
     1224        if (!sp || tmplongpath[sp-1]!= '\\')
    12211225        {
    12221226            /* strip double "\\" */
     
    12331237
    12341238      attr = GetFileAttributesA(tmplongpath);
    1235       if (attr != -1) 
     1239      if (attr != -1)
    12361240      {
    12371241        sp += tmplen;
     
    12491253            (tmplongpath+sp)[0] = '*';
    12501254            (tmplongpath+sp)[1] = 0;
    1251           } 
     1255          }
    12521256          else
    12531257          {
     
    12571261          hFind = FindFirstFileExA(tmplongpath, FindExInfoStandard, &FindFileData,
    12581262                                   FindExSearchNameMatch, NULL, 0 );
    1259            
     1263
    12601264          if (hFind == INVALID_HANDLE_VALUE)
    12611265          {
     
    12691273           do
    12701274           {
    1271              DOSFS_Hash(FindFileData.cFileName, short_name, FALSE, TRUE );         
     1275             DOSFS_Hash(FindFileData.cFileName, short_name, FALSE, TRUE );
    12721276             //this happens on files like [hello world]
    12731277             if (!lstrncmpA(short_name, lpszShortPath1+lp, (lpszShortPath1+lp+tmplen)[-1] == '.' ? tmplen-1 : tmplen ))
     
    12801284            }
    12811285            while (FindNextFileA(hFind, &FindFileData));
    1282            
    1283           // no FindClose() here or else GetLastError() will not give its error   
     1286
     1287          // no FindClose() here or else GetLastError() will not give its error
    12841288          if (GetLastError() == ERROR_NO_MORE_FILES)
    12851289          {
     
    12921296          FindClose(hFind);
    12931297        }
    1294         else 
     1298        else
    12951299        {
    12961300            // if this file can't be found in common or hashed files
     
    14611465 *****************************************************************************/
    14621466
    1463 BOOL WIN32API GetFileAttributesExW(LPCWSTR lpFileName, 
     1467BOOL WIN32API GetFileAttributesExW(LPCWSTR lpFileName,
    14641468                                   GET_FILEEX_INFO_LEVELS fInfoLevelId,
    14651469                                   LPVOID lpFileInformation)
Note: See TracChangeset for help on using the changeset viewer.