Memory mapping file for driver usage RRS feed

  • Question

  • Is it possible to make a file available in usb flash drive available in kernel mode space ?

    I have a firmware related file in usb flash drive and this has to be accessed by kmdf driver.

    Should the file mapping be done in app or can it be done in driver ?

    will the below functions work ?

    ZwCreateSection, ObReferenceObjectByHandle, and MmMapViewInSystemSpace

    • Edited by Rexlin S Wednesday, March 18, 2020 5:11 PM
    Wednesday, March 18, 2020 4:55 PM


  • Yes, it can be done; however, validating the contents and format of the file in kernel-mode can be difficult. The sequence that you need is: ZwCreateFile, ZwQueryInformationFile, ZwCreateSection, ZwMapViewOfSection


    Azius Developer Training Windows device driver, internals, security, & forensics training and consulting. Blog at

    Wednesday, March 18, 2020 6:17 PM