Steven Edwards wrote:
Documented here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/se... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/se...
Changelog: Hervé Poussineau (hpoussin(a)reactos.com) Implement SetupGetInfFileListW and SetupGetInfInformationW Inf file parser now accept UNICODE files with FF FE header
------------------------------------------------------------------------
Index: dlls/setupapi/parser.c =================================================================== RCS file: /home/wine/wine/dlls/setupapi/parser.c,v retrieving revision 1.20 diff -u -r1.20 parser.c --- dlls/setupapi/parser.c 12 Sep 2005 22:07:53 -0000 1.20 +++ dlls/setupapi/parser.c 24 Sep 2005 06:52:23 -0000
...
@@ -951,12 +956,20 @@ WCHAR *new_buff = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ); if (new_buff) { - DWORD len = MultiByteToWideChar( CP_ACP, 0, buffer, size, new_buff, size ); + DWORD len = MultiByteToWideChar( CP_ACP, 0, buffer, size, new_buff, + size * sizeof(WCHAR) ); err = parse_buffer( file, new_buff, new_buff + len, error_line ); HeapFree( GetProcessHeap(), 0, new_buff ); } } - else err = parse_buffer( file, buffer, (WCHAR *)((char *)buffer + size), error_line ); + else + { + WCHAR *new_buff = (WCHAR *)buffer; + /* Some UNICODE files may start with the UNICODE marker */ + if (*new_buff == 0xfeff) + new_buff++; + err = parse_buffer( file, new_buff, (WCHAR *)((char *)new_buff + size), error_line ); + }
Any time a Zero-Width Non-breaking Space is specifically skipped like this it is a bug. You should *never* have to do this if you use the right functions (isspaceW, etc). Is there some other bug lurking that made this change necessary? -- Rob Shearman