projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
315867d
)
[NTOSKRNL] Page files don't have an init size, but a minimum size
author
Pierre Schweitzer
<pierre@reactos.org>
Thu, 16 Aug 2018 10:42:34 +0000
(12:42 +0200)
committer
Pierre Schweitzer
<pierre@reactos.org>
Thu, 16 Aug 2018 10:42:34 +0000
(12:42 +0200)
NFC
ntoskrnl/mm/pagefile.c
patch
|
blob
|
history
diff --git
a/ntoskrnl/mm/pagefile.c
b/ntoskrnl/mm/pagefile.c
index
38c93d6
..
15d8ae0
100644
(file)
--- a/
ntoskrnl/mm/pagefile.c
+++ b/
ntoskrnl/mm/pagefile.c
@@
-345,7
+345,7
@@
MmAllocSwapPage(VOID)
NTSTATUS NTAPI
NtCreatePagingFile(IN PUNICODE_STRING FileName,
NTSTATUS NTAPI
NtCreatePagingFile(IN PUNICODE_STRING FileName,
- IN PLARGE_INTEGER
Initial
Size,
+ IN PLARGE_INTEGER
Minimum
Size,
IN PLARGE_INTEGER MaximumSize,
IN ULONG Reserved)
{
IN PLARGE_INTEGER MaximumSize,
IN ULONG Reserved)
{
@@
-359,14
+359,14
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
ULONG Count;
KPROCESSOR_MODE PreviousMode;
UNICODE_STRING PageFileName;
ULONG Count;
KPROCESSOR_MODE PreviousMode;
UNICODE_STRING PageFileName;
- LARGE_INTEGER Safe
Initial
Size, SafeMaximumSize, AllocationSize;
+ LARGE_INTEGER Safe
Minimum
Size, SafeMaximumSize, AllocationSize;
FILE_FS_DEVICE_INFORMATION FsDeviceInfo;
SECURITY_DESCRIPTOR SecurityDescriptor;
PACL Dacl;
PWSTR Buffer;
FILE_FS_DEVICE_INFORMATION FsDeviceInfo;
SECURITY_DESCRIPTOR SecurityDescriptor;
PACL Dacl;
PWSTR Buffer;
- DPRINT("NtCreatePagingFile(FileName %wZ,
Initial
Size %I64d)\n",
- FileName,
Initial
Size->QuadPart);
+ DPRINT("NtCreatePagingFile(FileName %wZ,
Minimum
Size %I64d)\n",
+ FileName,
Minimum
Size->QuadPart);
PAGED_CODE();
PAGED_CODE();
@@
-386,7
+386,7
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
_SEH2_TRY
{
_SEH2_TRY
{
- Safe
InitialSize = ProbeForReadLargeInteger(Initial
Size);
+ Safe
MinimumSize = ProbeForReadLargeInteger(Minimum
Size);
SafeMaximumSize = ProbeForReadLargeInteger(MaximumSize);
PageFileName.Length = FileName->Length;
SafeMaximumSize = ProbeForReadLargeInteger(MaximumSize);
PageFileName.Length = FileName->Length;
@@
-402,7
+402,7
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
}
else
{
}
else
{
- Safe
InitialSize = *Initial
Size;
+ Safe
MinimumSize = *Minimum
Size;
SafeMaximumSize = *MaximumSize;
PageFileName.Length = FileName->Length;
SafeMaximumSize = *MaximumSize;
PageFileName.Length = FileName->Length;
@@
-412,7
+412,7
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
/* Pagefiles can't be larger than 4GB and ofcourse the minimum should be
smaller than the maximum */
/* Pagefiles can't be larger than 4GB and ofcourse the minimum should be
smaller than the maximum */
- if (0 != Safe
Initial
Size.u.HighPart)
+ if (0 != Safe
Minimum
Size.u.HighPart)
{
return STATUS_INVALID_PARAMETER_2;
}
{
return STATUS_INVALID_PARAMETER_2;
}
@@
-420,7
+420,7
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
{
return STATUS_INVALID_PARAMETER_3;
}
{
return STATUS_INVALID_PARAMETER_3;
}
- if (SafeMaximumSize.u.LowPart < Safe
Initial
Size.u.LowPart)
+ if (SafeMaximumSize.u.LowPart < Safe
Minimum
Size.u.LowPart)
{
return STATUS_INVALID_PARAMETER_MIX;
}
{
return STATUS_INVALID_PARAMETER_MIX;
}
@@
-535,7
+535,7
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
* of the paging file is cluster 3042 but cluster 3043 is NOT part of the
* paging file but of another file. We can't write a complete page (4096
* bytes) to the physical location of cluster 3042 then. */
* of the paging file is cluster 3042 but cluster 3043 is NOT part of the
* paging file but of another file. We can't write a complete page (4096
* bytes) to the physical location of cluster 3042 then. */
- AllocationSize.QuadPart = Safe
Initial
Size.QuadPart + PAGE_SIZE;
+ AllocationSize.QuadPart = Safe
Minimum
Size.QuadPart + PAGE_SIZE;
/* First, attempt to replace the page file, if existing */
Status = IoCreateFile(&FileHandle,
/* First, attempt to replace the page file, if existing */
Status = IoCreateFile(&FileHandle,
@@
-669,10
+669,10
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
/* DACL is no longer needed, free it */
ExFreePoolWithTag(Dacl, 'lcaD');
/* DACL is no longer needed, free it */
ExFreePoolWithTag(Dacl, 'lcaD');
- /* Set its end of file to
initi
al size */
+ /* Set its end of file to
minim
al size */
Status = ZwSetInformationFile(FileHandle,
&IoStatus,
Status = ZwSetInformationFile(FileHandle,
&IoStatus,
- &Safe
Initial
Size,
+ &Safe
Minimum
Size,
sizeof(LARGE_INTEGER),
FileEndOfFileInformation);
if (!NT_SUCCESS(Status) || !NT_SUCCESS(IoStatus.Status))
sizeof(LARGE_INTEGER),
FileEndOfFileInformation);
if (!NT_SUCCESS(Status) || !NT_SUCCESS(IoStatus.Status))
@@
-720,8
+720,8
@@
NtCreatePagingFile(IN PUNICODE_STRING FileName,
PagingFile->FileHandle = FileHandle;
PagingFile->FileObject = FileObject;
PagingFile->MaximumSize.QuadPart = SafeMaximumSize.QuadPart;
PagingFile->FileHandle = FileHandle;
PagingFile->FileObject = FileObject;
PagingFile->MaximumSize.QuadPart = SafeMaximumSize.QuadPart;
- PagingFile->CurrentSize.QuadPart = Safe
Initial
Size.QuadPart;
- PagingFile->FreePages = (ULONG)(Safe
Initial
Size.QuadPart / PAGE_SIZE);
+ PagingFile->CurrentSize.QuadPart = Safe
Minimum
Size.QuadPart;
+ PagingFile->FreePages = (ULONG)(Safe
Minimum
Size.QuadPart / PAGE_SIZE);
PagingFile->UsedPages = 0;
PagingFile->PageFileName = PageFileName;
PagingFile->UsedPages = 0;
PagingFile->PageFileName = PageFileName;