153{
157 PWSTR findFileName = EnumCtx->findData.cFileName;
158 PWSTR pFilePart = EnumCtx->FullPathBuffer + offFilePart;
159 size_t cchRemaining = EnumCtx->cchBuffer - offFilePart;
160
161
163 {
164
167 {
169 {
170
171
172
173 }
174
175 ConPrintf(
StdErr,
L"Directory level too deep: %s\n", EnumCtx->FullPathBuffer);
177 }
178
179 hFind =
FindFirstFileW(EnumCtx->FullPathBuffer, &EnumCtx->findData);
181 {
186 {
188 }
190 }
191
192 do
193 {
195 size_t offNewFilePart;
196
198 continue;
199
201 continue;
202
203
205 if (bIsReparse)
206 {
207 if (EnumCtx->uReparseLevel < 2)
208 EnumCtx->uReparseLevel++;
209 else
210 continue;
211 }
212
214 NULL, &offNewFilePart, 0,
215 L"%s\\", findFileName);
216
217 offNewFilePart = EnumCtx->cchBuffer - offNewFilePart;
218
220
221
222
223 pFilePart = EnumCtx->FullPathBuffer + offFilePart;
224 cchRemaining = EnumCtx->cchBuffer - offFilePart;
225
226
227 if (bIsReparse)
228 EnumCtx->uReparseLevel--;
229 }
232 }
233
234
235 hRes =
StringCchCopyW(pFilePart, cchRemaining, EnumCtx->FileName);
236
237
238 hFind =
FindFirstFileW(EnumCtx->FullPathBuffer, &EnumCtx->findData);
240 return bFound;
241
242 do
243 {
245 BOOL bExactMatch = (
_wcsicmp(findFileName, EnumCtx->FileName) == 0);
246
248 continue;
249
251 continue;
252
253
254
256 continue;
257
259 EnumCtx->Callback(&EnumCtx->findData, EnumCtx->FullPathBuffer, EnumCtx->Context);
261 }
264
265 return bFound;
266}
static VOID ErrorMessage(_In_ DWORD dwErrorCode, _In_opt_ PCWSTR pszMsg,...)
#define ALL_FILES_PATTERN
void ConPrintf(FILE *fp, LPCWSTR psz,...)
#define INVALID_HANDLE_VALUE
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)
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
#define ERROR_FILE_NOT_FOUND
#define FILE_ATTRIBUTE_DIRECTORY
#define FILE_ATTRIBUTE_REPARSE_POINT
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
DWORD WINAPI GetLastError(void)
#define ERROR_SHARING_VIOLATION