@@ -2419,6 +2419,7 @@ query_volume_information(PDEVICE_OBJECT DeviceObject, PIRP Irp,
2419
2419
int space ;
2420
2420
int error = 0 ;
2421
2421
uint64_t refdbytes , availbytes , usedobjs , availobjs ;
2422
+ uint64_t guid = 0ULL ;
2422
2423
2423
2424
mount_t * zmo = DeviceObject -> DeviceExtension ;
2424
2425
if (!zmo ||
@@ -2438,6 +2439,9 @@ query_volume_information(PDEVICE_OBJECT DeviceObject, PIRP Irp,
2438
2439
if (zfsvfs -> z_os && zfsvfs -> z_os -> os_spa )
2439
2440
sectorsz = zfsvfs -> z_os -> os_spa -> spa_min_alloc ;
2440
2441
2442
+ if (zfsvfs -> z_os )
2443
+ guid = dmu_objset_fsid_guid (zfsvfs -> z_os );
2444
+
2441
2445
switch (IrpSp -> Parameters .QueryVolume .FsInformationClass ) {
2442
2446
2443
2447
case FileFsAttributeInformation :
@@ -2590,7 +2594,6 @@ query_volume_information(PDEVICE_OBJECT DeviceObject, PIRP Irp,
2590
2594
FILE_FS_OBJECTID_INFORMATION * ffoi =
2591
2595
Irp -> AssociatedIrp .SystemBuffer ;
2592
2596
RtlZeroMemory (ffoi -> ObjectId , sizeof (ffoi -> ObjectId ));
2593
- uint64_t guid = dmu_objset_fsid_guid (zfsvfs -> z_os );
2594
2597
RtlCopyMemory (ffoi -> ObjectId , & guid , sizeof (ffoi -> ObjectId ));
2595
2598
RtlZeroMemory (ffoi -> ExtendedInfo , sizeof (ffoi -> ExtendedInfo ));
2596
2599
Irp -> IoStatus .Information =
@@ -2617,7 +2620,11 @@ query_volume_information(PDEVICE_OBJECT DeviceObject, PIRP Irp,
2617
2620
// PVPB Vpb = zmo->vpb;
2618
2621
WCHAR * wstr ;
2619
2622
2620
- ffvi -> VolumeSerialNumber = 0x19831116 ;
2623
+ uint32_t serial = 0x19831116 ;
2624
+ if (guid )
2625
+ serial = (uint32_t )(guid ^ (guid >> 32 ));
2626
+
2627
+ ffvi -> VolumeSerialNumber = serial ;
2621
2628
#if 0
2622
2629
ffvi -> VolumeLabelLength =
2623
2630
sizeof (VOLUME_LABEL ) - sizeof (WCHAR );
0 commit comments