[CLASS2]: Cosmetic fixes by Thomas

This commit is contained in:
Pierre Schweitzer 2017-10-03 21:21:09 +02:00
parent fdb72d7f85
commit e48d6a658f

View File

@ -4068,7 +4068,7 @@ Return Value:
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;
@ -4081,7 +4081,7 @@ Return Value:
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;
}