mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 08:17:09 +08:00
[NTOSKRNL] Check that caller has appropriate right before creating page file
This commit is contained in:
@@ -509,13 +509,18 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||
|
||||
if (MmNumberOfPagingFiles >= MAX_PAGING_FILES)
|
||||
{
|
||||
return(STATUS_TOO_MANY_PAGING_FILES);
|
||||
return STATUS_TOO_MANY_PAGING_FILES;
|
||||
}
|
||||
|
||||
PreviousMode = ExGetPreviousMode();
|
||||
|
||||
if (PreviousMode != KernelMode)
|
||||
{
|
||||
if (SeSinglePrivilegeCheck(SeCreatePagefilePrivilege, PreviousMode) != TRUE)
|
||||
{
|
||||
return STATUS_PRIVILEGE_NOT_HELD;
|
||||
}
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
SafeInitialSize = ProbeForReadLargeInteger(InitialSize);
|
||||
|
||||
Reference in New Issue
Block a user