mirror of
https://github.com/reactos/reactos.git
synced 2025-06-04 17:00:31 +00:00
[NTOSKRNL] Deny page file creation on floppy disk
This commit is contained in:
parent
2969c28a27
commit
36c20dc56b
1 changed files with 11 additions and 0 deletions
|
@ -504,6 +504,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
KPROCESSOR_MODE PreviousMode;
|
KPROCESSOR_MODE PreviousMode;
|
||||||
UNICODE_STRING CapturedFileName;
|
UNICODE_STRING CapturedFileName;
|
||||||
LARGE_INTEGER SafeInitialSize, SafeMaximumSize, AllocationSize;
|
LARGE_INTEGER SafeInitialSize, SafeMaximumSize, AllocationSize;
|
||||||
|
FILE_FS_DEVICE_INFORMATION FsDeviceInfo;
|
||||||
|
|
||||||
DPRINT("NtCreatePagingFile(FileName %wZ, InitialSize %I64d)\n",
|
DPRINT("NtCreatePagingFile(FileName %wZ, InitialSize %I64d)\n",
|
||||||
FileName, InitialSize->QuadPart);
|
FileName, InitialSize->QuadPart);
|
||||||
|
@ -660,6 +661,16 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Deny page file creation on a floppy disk */
|
||||||
|
FsDeviceInfo.Characteristics = 0;
|
||||||
|
IoQueryVolumeInformation(FileObject, FileFsDeviceInformation, sizeof(FsDeviceInfo), &FsDeviceInfo, &Count);
|
||||||
|
if (BooleanFlagOn(FsDeviceInfo.Characteristics, FILE_FLOPPY_DISKETTE))
|
||||||
|
{
|
||||||
|
ObDereferenceObject(FileObject);
|
||||||
|
ZwClose(FileHandle);
|
||||||
|
return STATUS_FLOPPY_VOLUME;
|
||||||
|
}
|
||||||
|
|
||||||
CurrentRetDescList = RetDescList = MmAllocRetrievelDescriptorList(PAIRS_PER_RUN);
|
CurrentRetDescList = RetDescList = MmAllocRetrievelDescriptorList(PAIRS_PER_RUN);
|
||||||
|
|
||||||
if (CurrentRetDescList == NULL)
|
if (CurrentRetDescList == NULL)
|
||||||
|
|
Loading…
Reference in a new issue