Hi Fabian,
On 18/02/2020 18:21, Fabian Maurer wrote:
input = CreateFileW(file_paths[i], GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if (!input)
{
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;
}
Doesn't CreateFileW return INVALID_HANDLE_VALUE on error instead of NULL? (which is -1, not zero)
Also I think you should check GetLastError to make sure the file was not found, instead of some other error, unless native find behaves as if all errors mean "file not found", of course. And display the error message appropriately.