14{
18
21 if ( szDirectory_ )
22 _tcscpy ( szDirectory, szDirectory_ );
23 else
24#ifdef UNDER_CE
26#else
27 getcwd ( szDirectory,
sizeof(szDirectory)-1 );
28#endif
29 int dirlen =
_tcslen(szDirectory);
30 if ( dirlen > 0 && szDirectory[dirlen-1] != '\\' )
32
33
34 _sntprintf ( szSearchPath,
sizeof(szSearchPath)-1,
_T(
"%s%s"), szDirectory, szFileSpec );
38 {
39 do
40 {
42 continue;
44 {
45 if ( !bSubsMustMatchFileSpec )
46 continue;
47 _sntprintf ( szTemp,
sizeof(szTemp)-1,
_T(
"%s%s"), szDirectory, wfd.cFileName );
48 if ( bSubsToo )
49 {
51 {
54 }
55 }
56 }
57 _sntprintf ( szTemp,
sizeof(szTemp)-1,
_T(
"%s%s"), szDirectory, wfd.cFileName );
59 if ( !pProc ( &wfd, szTemp,
lParam ) )
60 {
63 }
66 }
67 if ( !bSubsToo || bSubsMustMatchFileSpec )
69
70
71 _sntprintf ( szSearchPath,
sizeof(szSearchPath)-1,
_T(
"%s*.*"), szDirectory );
74 {
75 do
76 {
78 continue;
80 continue;
81 _sntprintf ( szTemp,
sizeof(szTemp)-1,
_T(
"%s%s"), szDirectory, wfd.cFileName );
83 {
86 }
89 }
90
92}
BOOL EnumFilesInDirectory(const TCHAR *szDirectory_, const TCHAR *szFileSpec, MYENUMFILESPROC pProc, long lParam, BOOL bSubsToo, BOOL bSubsMustMatchFileSpec)
int FixLFN(const TCHAR *pBadFileName, TCHAR *pGoodFileName)
_Check_return_ _Ret_opt_z_ _CRTIMP char *__cdecl getcwd(_Out_writes_opt_(_SizeInBytes) char *_DstBuf, _In_ int _SizeInBytes)
#define INVALID_HANDLE_VALUE
BOOL WINAPI FindClose(HANDLE hFindFile)
#define FILE_ATTRIBUTE_DIRECTORY
size_t safestrlen(const tchar *string)