[PATCH v3] find: First simple implementation and tests

Alexandre Julliard julliard at winehq.org
Fri Sep 14 07:10:25 CDT 2018


Fabian Maurer <dark.shadow4 at web.de> writes:

> +/* Reads a line from a handle, returns TRUE if there is more to be read */
> +BOOL read_line_from_handle(HANDLE handle, WCHAR **line_out)
> +{
> +    int buffer_size = 4096;
> +    char c;
> +    DWORD bytes_read;
> +    int length = 0;
> +    WCHAR *line_converted;
> +    int line_converted_length;
> +    BOOL success;
> +    char *line = heap_alloc(buffer_size);
> +
> +    for (;;)
> +    {
> +        success = ReadFile(handle, &c, 1, &bytes_read, NULL);

This is very inefficient, ReadFile() is not buffered.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list