[PATCH v3 2/2] find.exe: Implement file searching
Gabriel Ivăncescu
gabrielopcode at gmail.com
Tue Feb 18 10:56:21 CST 2020
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.
More information about the wine-devel
mailing list