Zebediah Figura : mountmgr: Assign a unique nonzero serial to all volumes.

Alexandre Julliard julliard at winehq.org
Thu Apr 9 16:04:45 CDT 2020


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Apr  8 16:06:05 2020 -0500

mountmgr: Assign a unique nonzero serial to all volumes.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mountmgr.sys/device.c | 3 +++
 dlls/ntdll/tests/file.c    | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index 8fb984579e..f68ab4de9b 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -1123,6 +1123,9 @@ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive,
         }
     }
 
+    if (!volume->serial)
+        memcpy(&volume->serial, &volume->guid.Data4[4], sizeof(DWORD));
+
     if (!volume->mount)
         volume->mount = add_volume_mount_point( disk_device->dev_obj, &disk_device->name, &volume->guid );
     if (drive && !drive->mount)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 33b8ead552..68c6a79e79 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -3908,7 +3908,7 @@ static void test_query_volume_information_file(void)
      io.Information);
 
     todo_wine ok(ffvi->VolumeCreationTime.QuadPart != 0, "Missing VolumeCreationTime\n");
-    todo_wine ok(ffvi->VolumeSerialNumber != 0, "Missing VolumeSerialNumber\n");
+    ok(ffvi->VolumeSerialNumber != 0, "Missing VolumeSerialNumber\n");
     ok(ffvi->SupportsObjects == 1,"expected 1, got %d\n", ffvi->SupportsObjects);
     ok(ffvi->VolumeLabelLength == lstrlenW(ffvi->VolumeLabel) * sizeof(WCHAR), "got %d\n", ffvi->VolumeLabelLength);
 




More information about the wine-cvs mailing list