Hans Leidekker : wbemprox: Fix index in fill_diskdrive and fill_diskpartition.

Alexandre Julliard julliard at winehq.org
Tue Sep 10 16:49:29 CDT 2019


Module: wine
Branch: master
Commit: c69813bcd0c540a04910647fa19ecacc2aad0675
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=c69813bcd0c540a04910647fa19ecacc2aad0675

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Sep 10 17:09:13 2019 +0200

wbemprox: Fix index in fill_diskdrive and fill_diskpartition.

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wbemprox/builtin.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 105a2d3ec2..de793f3f7e 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -2424,7 +2424,7 @@ static enum fill_status fill_diskdrive( struct table *table, const struct expr *
             rec = (struct record_diskdrive *)(table->data + offset);
             swprintf( device_id, ARRAY_SIZE( device_id ), fmtW, index );
             rec->device_id     = heap_strdupW( device_id );
-            rec->index         = index;
+            rec->index         = index++;
             rec->interfacetype = diskdrive_interfacetypeW;
             rec->manufacturer  = diskdrive_manufacturerW;
             rec->mediatype     = (type == DRIVE_FIXED) ? diskdrive_mediatype_fixedW : diskdrive_mediatype_removableW;
@@ -2439,7 +2439,6 @@ static enum fill_status fill_diskdrive( struct table *table, const struct expr *
                 continue;
             }
             offset += sizeof(*rec);
-            index++;
             row++;
         }
     }
@@ -2591,7 +2590,7 @@ static enum fill_status fill_diskpartition( struct table *table, const struct ex
             rec->bootpartition  = (i == 2) ? -1 : 0;
             swprintf( device_id, ARRAY_SIZE( device_id ), fmtW, index );
             rec->device_id      = heap_strdupW( device_id );
-            rec->diskindex      = index;
+            rec->diskindex      = index++;
             rec->index          = 0;
             rec->pnpdevice_id   = heap_strdupW( device_id );
             get_freespace( root, &size );
@@ -2605,7 +2604,6 @@ static enum fill_status fill_diskpartition( struct table *table, const struct ex
             }
             offset += sizeof(*rec);
             row++;
-            index++;
         }
     }
     TRACE("created %u rows\n", row);




More information about the wine-cvs mailing list