Skip to content

Commit d01184b

Browse files
committed
[NTOSKRNL] Use cache aligned buffer for devioctrl
1 parent 2cbc32e commit d01184b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ntoskrnl/io/iomgr/iofunc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
213213
ACCESS_MASK DesiredAccess;
214214
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
215215
ULONG BufferLength;
216+
POOL_TYPE PoolType;
216217

217218
PAGED_CODE();
218219

@@ -495,6 +496,8 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
495496
StackPtr->Parameters.DeviceIoControl.OutputBufferLength =
496497
OutputBufferLength;
497498

499+
PoolType = IsDevIoCtl ? NonPagedPoolCacheAligned : NonPagedPool;
500+
498501
/* Handle the Methods */
499502
switch (AccessType)
500503
{
@@ -513,7 +516,7 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
513516
{
514517
/* Allocate the System Buffer */
515518
Irp->AssociatedIrp.SystemBuffer =
516-
ExAllocatePoolWithTag(NonPagedPool,
519+
ExAllocatePoolWithTag(PoolType,
517520
BufferLength,
518521
TAG_SYS_BUF);
519522

@@ -560,7 +563,7 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
560563
{
561564
/* Allocate the System Buffer */
562565
Irp->AssociatedIrp.SystemBuffer =
563-
ExAllocatePoolWithTag(NonPagedPool,
566+
ExAllocatePoolWithTag(PoolType,
564567
InputBufferLength,
565568
TAG_SYS_BUF);
566569

0 commit comments

Comments
 (0)