Fabian Maurer dark.shadow4@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.