reactos/lib/sdk/crt/stdio/access.c
Cameron Gutman 29fa274d6d - Create another branch for networking fixes
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers)
 - If someone wants to delete aicom-network-fixes, they are welcome to
 - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea

svn path=/branches/aicom-network-branch/; revision=44353
2009-12-02 03:23:19 +00:00

36 lines
560 B
C

#include <precomp.h>
#include <tchar.h>
#ifdef _UNICODE
#define _TS S
#define sT "S"
#else
#define _TS s
#define sT "s"
#endif
#define MK_STR(s) #s
/*
* INTERNAL
*/
int access_dirT(const _TCHAR *_path)
{
DWORD Attributes = GetFileAttributes(_path);
TRACE(MK_STR(is_dirT)"('%"sT"')\n", _path);
if (Attributes == (DWORD)-1) {
_dosmaperr(GetLastError());
return -1;
}
if ((Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY)
{
__set_errno(EACCES);
return -1;
}
return 0;
}