setupapi: implement SetupGetInfFileListW and SetupGetInfInformationW

Robert Shearman rob at codeweavers.com
Sat Sep 24 12:19:58 CDT 2005


Steven Edwards wrote:

>Documented here:
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/setup/setupgetinffilelist.asp
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/setup/setupgetinfinformation.asp
>
>Changelog:
>Hervé Poussineau (hpoussin at 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




More information about the wine-devel mailing list