https://git.reactos.org/?p=reactos.git;a=commitdiff;h=02b0ca08e40c40601a72a…
commit 02b0ca08e40c40601a72aea0b10876d60810a942
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sat Aug 11 23:34:08 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sat Aug 11 23:34:08 2018 +0200
[NTOSKRNL] Misc fixes:
- Rename page file struct to MMPAGING_FILE
- Increment page files count after current page file was put in the list
---
ntoskrnl/mm/pagefile.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/ntoskrnl/mm/pagefile.c b/ntoskrnl/mm/pagefile.c
index cbc7c9a854..347ffec4a5 100644
--- a/ntoskrnl/mm/pagefile.c
+++ b/ntoskrnl/mm/pagefile.c
@@ -21,6 +21,7 @@
* FILE: ntoskrnl/mm/pagefile.c
* PURPOSE: Paging file functions
* PROGRAMMER: David Welch (welch(a)mcmail.com)
+ * Pierre Schweitzer
* UPDATE HISTORY:
* Created 22/05/98
*/
@@ -38,7 +39,7 @@
/* TYPES *********************************************************************/
-typedef struct _PAGINGFILE
+typedef struct _MMPAGING_FILE
{
PFILE_OBJECT FileObject;
HANDLE FileHandle;
@@ -49,7 +50,7 @@ typedef struct _PAGINGFILE
PRTL_BITMAP AllocMap;
KSPIN_LOCK AllocMapLock;
}
-PAGINGFILE, *PPAGINGFILE;
+MMPAGING_FILE, *PMMPAGING_FILE;
/* GLOBALS *******************************************************************/
@@ -58,7 +59,7 @@ PAGINGFILE, *PPAGINGFILE;
#define MAX_PAGING_FILES (16)
/* List of paging files, both used and free */
-static PPAGINGFILE MmPagingFile[MAX_PAGING_FILES];
+static PMMPAGING_FILE MmPagingFile[MAX_PAGING_FILES];
/* Lock for examining the list of paging files */
static KSPIN_LOCK PagingFileListLock;
@@ -224,7 +225,7 @@ MiReadPageFile(
KEVENT Event;
UCHAR MdlBase[sizeof(MDL) + sizeof(ULONG)];
PMDL Mdl = (PMDL)MdlBase;
- PPAGINGFILE PagingFile;
+ PMMPAGING_FILE PagingFile;
DPRINT("MiReadSwapFile\n");
@@ -289,7 +290,7 @@ MmInitPagingFile(VOID)
}
static ULONG
-MiAllocPageFromPagingFile(PPAGINGFILE PagingFile)
+MiAllocPageFromPagingFile(PMMPAGING_FILE PagingFile)
{
KIRQL oldIrql;
ULONG off;
@@ -308,7 +309,7 @@ MmFreeSwapPage(SWAPENTRY Entry)
ULONG i;
ULONG_PTR off;
KIRQL oldIrql;
- PPAGINGFILE PagingFile;
+ PMMPAGING_FILE PagingFile;
i = FILE_FROM_ENTRY(Entry);
off = OFFSET_FROM_ENTRY(Entry) - 1;
@@ -388,7 +389,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
HANDLE FileHandle;
IO_STATUS_BLOCK IoStatus;
PFILE_OBJECT FileObject;
- PPAGINGFILE PagingFile;
+ PMMPAGING_FILE PagingFile;
KIRQL oldIrql;
ULONG AllocMapSize;
ULONG Count;
@@ -662,8 +663,9 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
RtlClearAllBits(PagingFile->AllocMap);
KeAcquireSpinLock(&PagingFileListLock, &oldIrql);
- MmNumberOfPagingFiles++;
+ ASSERT(MmPagingFile[MmNumberOfPagingFiles] == NULL);
MmPagingFile[MmNumberOfPagingFiles] = PagingFile;
+ MmNumberOfPagingFiles++;
MiFreeSwapPages = MiFreeSwapPages + PagingFile->FreePages;
KeReleaseSpinLock(&PagingFileListLock, oldIrql);