ReactOS  0.4.13-dev-247-g0f29b3f
FixLFN.h File Reference
#include <string.h>
#include <tchar.h>
#include <shellapi.h>
Include dependency graph for FixLFN.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int FixLFN (const TCHAR *pBadFileName, TCHAR *pGoodFileName)
 

Function Documentation

◆ FixLFN()

int FixLFN ( const TCHAR pBadFileName,
TCHAR pGoodFileName 
)
inline

Definition at line 12 of file FixLFN.h.

13 {
14  SHFILEINFO sfi;
15  TCHAR* p;
16 
17  DWORD dwResult = SHGetFileInfo ( pBadFileName, 0, &sfi, sizeof(sfi), SHGFI_DISPLAYNAME );
18  if ( dwResult )
19  {
20  if ( pGoodFileName != pBadFileName )
21  _tcscpy ( pGoodFileName, pBadFileName );
22  if ( (p = _tcsrchr ( pGoodFileName, '\\' )) )
23  _tcscpy ( p+1, sfi.szDisplayName );
24  else if ( (p = _tcsrchr ( pGoodFileName, '/' )) )
25  _tcscpy ( p+1, sfi.szDisplayName );
26  else
27  _tcscpy ( pGoodFileName, sfi.szDisplayName );
28  }
29  return dwResult;
30 }
_TCHAR * _tcscpy(_TCHAR *to, const _TCHAR *from)
Definition: tcscpy.h:8
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:164
char TCHAR
Definition: xmlstorage.h:189
CHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:366
unsigned long DWORD
Definition: ntddk_ex.h:95
_TCHAR * _tcsrchr(const _TCHAR *s, _XINT c)
Definition: tcsrchr.h:4
#define SHGetFileInfo
Definition: shellapi.h:693
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by EnumFilesInDirectory().