mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 00:32:57 +00:00
- Tree cleanups proposed on the mailing list. Move all non-Core OS modules to rosapps. Tests were already moved by Fireball to rostests.
svn path=/trunk/; revision=26033
This commit is contained in:
parent
ad07a1e58f
commit
1e3d5d70e9
420 changed files with 78215 additions and 0 deletions
42
rosapps/sysutils/utils/sdkparse/EnumDirsImpl.h
Normal file
42
rosapps/sysutils/utils/sdkparse/EnumDirsImpl.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
//
|
||||
// EnumDirs.cpp
|
||||
//
|
||||
|
||||
#include "EnumDirs.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(UNDER_CE) && !defined(assert)
|
||||
#define assert(x)
|
||||
#endif
|
||||
|
||||
BOOL EnumDirs ( const TCHAR* szDirectory_, const TCHAR* szFileSpec, MYENUMDIRSPROC pProc, long lParam )
|
||||
{
|
||||
assert ( szDirectory_ && szFileSpec && pProc );
|
||||
TCHAR szDirectory[MAX_PATH+1];
|
||||
TCHAR szSearchPath[MAX_PATH+1];
|
||||
TCHAR szTemp[MAX_PATH+1];
|
||||
_tcscpy ( szDirectory, szDirectory_ );
|
||||
if ( szDirectory[_tcslen(szDirectory)-1] != '\\' )
|
||||
_tcscat ( szDirectory, _T("\\") );
|
||||
_sntprintf ( szSearchPath, _MAX_PATH, _T("%s%s"), szDirectory, szFileSpec );
|
||||
WIN32_FIND_DATA wfd;
|
||||
HANDLE hfind = FindFirstFile ( szSearchPath, &wfd );
|
||||
if ( hfind == INVALID_HANDLE_VALUE )
|
||||
return TRUE;
|
||||
do
|
||||
{
|
||||
if ( !_tcscmp ( wfd.cFileName, _T(".") ) || !_tcscmp ( wfd.cFileName, _T("..") ) )
|
||||
continue;
|
||||
_sntprintf ( szTemp, _MAX_PATH, _T("%s%s"), szDirectory, wfd.cFileName );
|
||||
if ( wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY )
|
||||
{
|
||||
if ( !pProc ( &wfd, lParam ) )
|
||||
{
|
||||
FindClose ( hfind );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
} while ( FindNextFile ( hfind, &wfd ) );
|
||||
FindClose ( hfind );
|
||||
return TRUE;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue