ReactOS 0.4.15-dev-8116-gf69e256
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}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat p
Definition: glext.h:8902
#define _tcscpy
Definition: tchar.h:623
#define _tcsrchr
Definition: utility.h:116
#define SHGetFileInfo
Definition: shellapi.h:697
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:166
CHAR szDisplayName[MAX_PATH]
Definition: shellapi.h:368
char TCHAR
Definition: xmlstorage.h:189

Referenced by EnumFilesInDirectory().