[NTOSKRNL] Don't use anonymus allocations for MM objects

This commit is contained in:
Pierre Schweitzer 2018-08-13 08:29:17 +02:00
parent 34e8f45122
commit 1ea68d0510
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -651,13 +651,13 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
return STATUS_FLOPPY_VOLUME;
}
PagingFile = ExAllocatePool(NonPagedPool, sizeof(*PagingFile));
PagingFile = ExAllocatePoolWithTag(NonPagedPool, sizeof(*PagingFile), TAG_MM);
if (PagingFile == NULL)
{
ObDereferenceObject(FileObject);
ZwClose(FileHandle);
ExFreePoolWithTag(Buffer, TAG_MM);
return STATUS_NO_MEMORY;
return STATUS_INSUFFICIENT_RESOURCES;
}
RtlZeroMemory(PagingFile, sizeof(*PagingFile));
@ -677,11 +677,11 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
TAG_MM);
if (PagingFile->AllocMap == NULL)
{
ExFreePool(PagingFile);
ExFreePoolWithTag(PagingFile, TAG_MM);
ObDereferenceObject(FileObject);
ZwClose(FileHandle);
ExFreePoolWithTag(Buffer, TAG_MM);
return STATUS_NO_MEMORY;
return STATUS_INSUFFICIENT_RESOURCES;
}
RtlInitializeBitMap(PagingFile->AllocMap,
@ -698,7 +698,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
MmSwapSpaceMessage = FALSE;
return(STATUS_SUCCESS);
return STATUS_SUCCESS;
}
/* EOF */