Programmatically creating memory dump in kernel mode

Maybe I should send this topic to group. Sorry about that.

Hi, is there anyway that I can programmatically create memory dump (kernel
memory dump or complete memory dump) in my FSFD without crashing the system?
I just want to implement something like the ‘.dump’ command of WinDbg in my
FSFD’s exception handler. I know in user mode I can dump one of the
processes by using DbgHelp.dll. Is this possible in kernel mode? If it is
possible, how can I prevent Windows from swapping the memory during the
memory dump? Thanks. Any suggestion is appreciated.