[CLASS2]: Cosmetic fixes by Thomas
authorPierre Schweitzer <pierre@reactos.org>
Tue, 3 Oct 2017 19:21:09 +0000 (21:21 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Tue, 3 Oct 2017 19:34:00 +0000 (21:34 +0200)
drivers/storage/class/class2/class2.c

index 48598e3..2f81022 100644 (file)
@@ -4068,7 +4068,7 @@ Return Value:
         RtlZeroMemory(name, sizeof(MOUNTDEV_NAME));
         name->NameLength = deviceExtension->DeviceName.Length;
 
         RtlZeroMemory(name, sizeof(MOUNTDEV_NAME));
         name->NameLength = deviceExtension->DeviceName.Length;
 
-        if (irpStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(USHORT) + name->NameLength) {
+        if (irpStack->Parameters.DeviceIoControl.OutputBufferLength < FIELD_OFFSET(MOUNTDEV_NAME, Name) + name->NameLength) {
 
             Irp->IoStatus.Information = sizeof(MOUNTDEV_NAME);
             Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW;
 
             Irp->IoStatus.Information = sizeof(MOUNTDEV_NAME);
             Irp->IoStatus.Status = STATUS_BUFFER_OVERFLOW;
@@ -4081,7 +4081,7 @@ Return Value:
                       name->NameLength);
         status = STATUS_SUCCESS;
         Irp->IoStatus.Status = STATUS_SUCCESS;
                       name->NameLength);
         status = STATUS_SUCCESS;
         Irp->IoStatus.Status = STATUS_SUCCESS;
-        Irp->IoStatus.Information = sizeof(USHORT) + name->NameLength;
+        Irp->IoStatus.Information = FIELD_OFFSET(MOUNTDEV_NAME, Name) + name->NameLength;
         IoCompleteRequest(Irp, IO_NO_INCREMENT);
         goto SetStatusAndReturn;
     }
         IoCompleteRequest(Irp, IO_NO_INCREMENT);
         goto SetStatusAndReturn;
     }