Fix IRP_MJ_QUERY_INFORMATION/FileStandardInformation (current code was trying to dereference NULL pointer)

Replace MmGetSystemAddressForMdl by MmGetSystemAddressForMdlSafe

svn path=/trunk/; revision=17514
This commit is contained in:
Hervé Poussineau 2005-08-24 15:37:04 +00:00
parent 66c8fe47e0
commit 6b3b47323d
3 changed files with 3 additions and 2 deletions

View file

@ -31,7 +31,7 @@ SerialGetUserBuffers(
case METHOD_IN_DIRECT:
case METHOD_OUT_DIRECT:
*BufferIn = Irp->AssociatedIrp.SystemBuffer;
*BufferOut = MmGetSystemAddressForMdl(Irp->MdlAddress);
*BufferOut = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority);
break;
case METHOD_NEITHER:
*BufferIn = IoGetCurrentIrpStackLocation(Irp)->Parameters.DeviceIoControl.Type3InputBuffer;

View file

@ -38,6 +38,7 @@ SerialQueryInformation(
Status = STATUS_BUFFER_OVERFLOW;
else if (!StandardInfo)
Status = STATUS_INVALID_PARAMETER;
else
{
StandardInfo->AllocationSize.QuadPart = 0;
StandardInfo->EndOfFile.QuadPart = 0;

View file

@ -274,7 +274,7 @@ SerialPnpStartDevice(
if (NT_SUCCESS(Status))
{
/* Key = \Device\Serialx, Value = COMx */
ZwSetValueKey(hKey, &DeviceName, 0, REG_SZ, &ComPortBuffer, ComPort.Length + sizeof(WCHAR));
ZwSetValueKey(hKey, &DeviceName, 0, REG_SZ, ComPortBuffer, ComPort.Length + sizeof(WCHAR));
ZwClose(hKey);
}