setupapi: pointer arithmetics fix in SetupCreateDiskSpaceListW

Thomas Weidenmueller wine-patches at reactsoft.com
Fri Jul 8 14:35:58 CDT 2005


Fixes enumerating the drive strings.

Best Regards,
Thomas Weidenmueller
-------------- next part --------------
Index: dlls/setupapi/diskspace.c
===================================================================
RCS file: /home/wine/wine/dlls/setupapi/diskspace.c,v
retrieving revision 1.4
diff -u -r1.4 diskspace.c
--- dlls/setupapi/diskspace.c	24 Mar 2005 21:01:37 -0000	1.4
+++ dlls/setupapi/diskspace.c	8 Jul 2005 19:29:56 -0000
@@ -67,7 +67,6 @@
     while (*ptr)
     {
         DWORD type = GetDriveTypeW(ptr);
-        DWORD len;
         if (type == DRIVE_FIXED)
         {
             DWORD clusters;
@@ -81,9 +80,7 @@
             list->Drives[list->dwDriveCount].dwWantedSpace = 0;
             list->dwDriveCount++;
         }
-       len = lstrlenW(ptr);
-       len++;
-       ptr+=sizeof(WCHAR)*len;
+       ptr += lstrlenW(ptr) + 1;
     }
     return  (HANDLE)list;
 }


More information about the wine-patches mailing list