sys: FspMountdevMake: use non-repeatable (i.e. non UUIDv5) GUID when non-persistent mountdev

This commit is contained in:
Bill Zissimopoulos 2019-09-06 14:34:33 -07:00
parent 4655926d03
commit 430d7a5650
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3

View File

@ -158,15 +158,21 @@ NTSTATUS FspMountdevMake(
FsvrtDeviceExtension->Persistent = Persistent;
/* make UUID v5 from the fsvrt device GUID and a unique string derived from the VolumeParams */
RtlInitEmptyUnicodeString(&String, StringBuf, sizeof StringBuf);
Result = RtlUnicodeStringPrintf(&String,
L"%s:%08lx:%08lx",
FsvolDeviceExtension->VolumeParams.FileSystemName,
FsvolDeviceExtension->VolumeParams.VolumeSerialNumber,
FsvolDeviceExtension->VolumeParams.VolumeCreationTime);
ASSERT(NT_SUCCESS(Result));
Result = FspUuid5Make(&FspFsvrtDeviceClassGuid, String.Buffer, String.Length, &Guid);
if (Persistent)
{
/* make UUID v5 from the fsvrt device GUID and a unique string derived from VolumeParams */
RtlInitEmptyUnicodeString(&String, StringBuf, sizeof StringBuf);
Result = RtlUnicodeStringPrintf(&String,
L"%s:%08lx:%08lx",
FsvolDeviceExtension->VolumeParams.FileSystemName,
FsvolDeviceExtension->VolumeParams.VolumeSerialNumber,
FsvolDeviceExtension->VolumeParams.VolumeCreationTime);
ASSERT(NT_SUCCESS(Result));
Result = FspUuid5Make(&FspFsvrtDeviceClassGuid, String.Buffer, String.Length, &Guid);
}
else
/* create volume guid */
Result = FspCreateGuid(&Guid);
if (!NT_SUCCESS(Result))
goto exit;