I am looking at the swapBuffers sample and I have a question about swapping buffers in IRP_MJ_DIRECTORY_CONTROL. What if I'd like to return more entries to the user then was asked for? For example, let's say the user passed iopb->Parameters.DirectoryControl.QueryDirectory.Length = sizeof(FILE_FULL_DIR_INFORMATION) * 10 however, I'd like to return 11 entries instead of 10. Could I just allocate more space for the MDL, meaning:
newBuf = ExAllocatePoolWithTag( NonPagedPool, iopb->Parameters.DirectoryControl.QueryDirectory.Length + sizeof(FILE_FULL_DIR_INFORMATION) , BUFFER_SWAP_TAG );
newMdl = IoAllocateMdl( newBuf, iopb->Parameters.DirectoryControl.QueryDirectory.Length + sizeof(FILE_FULL_DIR_INFORMATION), FALSE, FALSE, NULL );
and after that do all the swapping. If I understand correctly the system VA will reflect the new size correctly after calling MmGetSystemAddressForMdlSafe() but what about the user VA? Would this approach work? and if not, what the best way to solve such a problem?
It looks like you're new here. If you want to get involved, click one of these buttons!
|Upcoming OSR Seminars|
|Developing Minifilters||29 July 2019||OSR Seminar Space|
|Writing WDF Drivers||23 Sept 2019||OSR Seminar Space|
|Kernel Debugging||21 Oct 2019||OSR Seminar Space|
|Internals & Software Drivers||18 Nov 2019||Dulles, VA|