28#define ALL_FILES_PATTERN L"*.*"
78#ifdef EXTENDED_ATTRIBUTES
87#ifdef EXTENDED_ATTRIBUTES
114 dwAttributes = ((pFindData->dwFileAttributes & ~AttribsMasks->dwMask) | AttribsMasks->
dwAttrib);
119#define ENUM_RECURSE 0x01
120#define ENUM_DIRECTORIES 0x02
158 PWSTR findFileName = EnumCtx->findData.cFileName;
159 PWSTR pFilePart = EnumCtx->FullPathBuffer + offFilePart;
160 size_t cchRemaining = EnumCtx->cchBuffer - offFilePart;
176 ConPrintf(
StdErr,
L"Directory level too deep: %s\n", EnumCtx->FullPathBuffer);
180 hFind =
FindFirstFileW(EnumCtx->FullPathBuffer, &EnumCtx->findData);
196 size_t offNewFilePart;
208 if (EnumCtx->uReparseLevel < 2)
209 EnumCtx->uReparseLevel++;
215 NULL, &offNewFilePart, 0,
216 L"%s\\", findFileName);
218 offNewFilePart = EnumCtx->cchBuffer - offNewFilePart;
224 pFilePart = EnumCtx->FullPathBuffer + offFilePart;
225 cchRemaining = EnumCtx->cchBuffer - offFilePart;
229 EnumCtx->uReparseLevel--;
236 hRes =
StringCchCopyW(pFilePart, cchRemaining, EnumCtx->FileName);
239 hFind =
FindFirstFileW(EnumCtx->FullPathBuffer, &EnumCtx->findData);
246 BOOL bExactMatch = (
_wcsicmp(findFileName, EnumCtx->FileName) == 0);
260 EnumCtx->Callback(&EnumCtx->findData, EnumCtx->FullPathBuffer, EnumCtx->Context);
281 EnumContext.
Flags = fFlags;
283 EnumContext.
Context = (AttribsMasks->dwMask == 0 ?
NULL : AttribsMasks);
297 offFilePart = EnumContext.
cchBuffer - offFilePart;
311 DWORD dwEnumFlags = 0;
363 AttribsMasks.
dwAttrib &= ~FILE_ATTRIBUTE_ARCHIVE;
371 AttribsMasks.
dwAttrib &= ~FILE_ATTRIBUTE_SYSTEM;
379 AttribsMasks.
dwAttrib &= ~FILE_ATTRIBUTE_HIDDEN;
387 AttribsMasks.
dwAttrib &= ~FILE_ATTRIBUTE_READONLY;
390#ifdef EXTENDED_ATTRIBUTES
396 AttribsMasks.
dwAttrib &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED;
struct _ENUMFILES_CTX ENUMFILES_CTX
static BOOL PrintAttributes(_In_ PWIN32_FIND_DATAW pFindData, _In_ PCWSTR pszFullName, _Inout_opt_ PVOID Context)
Displays attributes for the given file.
struct _ATTRIBS_MASKS ATTRIBS_MASKS
struct _ATTRIBS_MASKS * PATTRIBS_MASKS
static BOOL EnumFilesWorker(_Inout_ PENUMFILES_CTX EnumCtx, _Inout_ _off_t offFilePart)
BOOL(* PENUMFILES_CALLBACK)(_In_ PWIN32_FIND_DATAW pFindData, _In_ PCWSTR pszFullName, _Inout_opt_ PVOID Context)
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
static BOOL ChangeAttributes(_In_ PWIN32_FIND_DATAW pFindData, _In_ PCWSTR pszFullName, _Inout_opt_ PVOID Context)
Changes attributes for the given file.
static BOOL AttribEnumFiles(_In_ PCWSTR pszPath, _In_ PCWSTR pszFile, _In_ DWORD fFlags, _In_ PATTRIBS_MASKS AttribsMasks)
struct _ENUMFILES_CTX * PENUMFILES_CTX
#define ALL_FILES_PATTERN
#define STRING_ATTRIB_HELP
#define STRING_ERROR_INVALID_PARAM_FORMAT
#define STRING_CONSOLE_ERROR
#define STRING_FILE_NOT_FOUND
#define ConInitStdStreams()
void ConPrintf(FILE *fp, LPCWSTR psz,...)
void ConResPrintf(FILE *fp, UINT nID,...)
void ConResPuts(FILE *fp, UINT nID)
#define GetCurrentDirectoryW(x, y)
#define INVALID_HANDLE_VALUE
BOOL WINAPI SetFileAttributesW(LPCWSTR lpFileName, DWORD dwFileAttributes)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ERROR_FILE_NOT_FOUND
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_ARCHIVE
#define FILE_ATTRIBUTE_DIRECTORY
#define UNREFERENCED_PARAMETER(P)
#define FILE_ATTRIBUTE_REPARSE_POINT
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
INT ConMsgPrintfV(IN PCON_STREAM Stream, IN DWORD dwFlags, IN LPCVOID lpSource OPTIONAL, IN DWORD dwMessageId, IN DWORD dwLanguageId, IN va_list *Arguments OPTIONAL)
static WCHAR szFilePath[]
#define INIT_CON_SCREEN(pStream)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
STRSAFEAPI StringCchCopyExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
STRSAFEAPI StringCchPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
#define STRSAFE_E_INSUFFICIENT_BUFFER
WIN32_FIND_DATAW findData
WCHAR FullPathBuffer[MAX_PATH+_countof("\\" ALL_FILES_PATTERN)]
_In_ PENUMFILES_CALLBACK Callback
#define LANG_USER_DEFAULT
WORD WORD PSZ PSZ pszFileName
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_SYSTEM
#define ERROR_SHARING_VIOLATION