Fabian Maurer dark.shadow4@web.de writes:
if (attributes == INVALID_FILE_ATTRIBUTES || (attributes & FILE_ATTRIBUTE_DIRECTORY))
{
WCHAR buffer_message[64];
WCHAR message[300];
LoadStringW(GetModuleHandleW(NULL), IDS_FILE_NOT_FOUND, buffer_message, ARRAY_SIZE(buffer_message));
wsprintfW(message, buffer_message, file_path_upper);
write_to_stdout(message);
continue;
}
input = CreateFileW(file_paths[i], GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
You need to check for failure here, instead of checking attributes first and assuming that the file can be opened.