setupapi: Fix parsing of UCS-16 files.

Fix parsing of UCS-16 files prefixed with the Unicode BOM. Based on a 
patch by Hervé Poussineau.
This commit is contained in:
Robert Shearman 2006-04-26 15:42:14 +01:00 committed by Alexandre Julliard
parent 32d39ea6ed
commit 4d7946464a
1 changed files with 8 additions and 1 deletions

View File

@ -967,7 +967,14 @@ static struct inf_file *parse_file( HANDLE handle, const WCHAR *class, UINT *err
HeapFree( GetProcessHeap(), 0, new_buff );
}
}
else err = parse_buffer( file, buffer, (WCHAR *)((char *)buffer + size), error_line );
else
{
WCHAR *new_buff = (WCHAR *)buffer;
/* UCS-16 files should start with the Unicode BOM; we should skip it */
if (*new_buff == 0xfeff)
new_buff++;
err = parse_buffer( file, new_buff, (WCHAR *)((char *)buffer + size), error_line );
}
if (!err) /* now check signature */
{