none
IOCTL example execution problem RRS feed

  • Question

  • Hi All,

    I tried to run and study IOCTL driver given in 

    https://github.com/Microsoft/Windows-driver-samples

    The build successfully finishes and I copy the exe and driver debug folder in windows 10 virtual box.

    I run and I get two errors

    1.VCRUNTIME140.dll is missing.

    2.ucrtbased.dll not found ioctl

    How to solve this problem?

    Monday, April 9, 2018 4:23 PM

Answers

  • These are both runtime DLL's for the user space program.   The VCRUNTIME140.dll is in the Visual Studio\VC\redist directory the ucrtbased.dll is part of the SDK and should be in the bin directory of where the WDK and SDK are installed.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, April 9, 2018 6:37 PM

All replies

  • These are both runtime DLL's for the user space program.   The VCRUNTIME140.dll is in the Visual Studio\VC\redist directory the ucrtbased.dll is part of the SDK and should be in the bin directory of where the WDK and SDK are installed.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, April 9, 2018 6:37 PM
  • Hi Don,

    Thanks for the reply.

    How do we know while writing user space drivers, that these dependency of DLLs?

    I have just provisioned my target machine for test, and installed minimum required tools.

    Do I need to download visual studio 2017 again, and will that solve all such DLL problems? 

    How and where by putting these DLLs solves problems? Where does it search for the path for DLLs?

    I downloaded ucrtbased.dll and vcruntime140.dll in the debug directory of my driver.

    This is the screenshot of my driver debug directory where I have copied ioctlapp, ucrtbased.dll and vcruntime140.dll.

      

    Regards,

    Mrigendra Chaubey


    Tuesday, April 10, 2018 5:51 AM
  • Actually, the IOCTL exe is just a user space test program not a driver.  This has always been a challenge for building applications, see https://msdn.microsoft.com/en-us/library/ms235265.aspx?f=255&MSPPError=-2147217396 for a good discussion and recommendations.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, April 10, 2018 11:12 AM
  • You can ameliorate this issue considerably by selecting the static runtime library (/MT) instead of the DLL-based runtime library (/MD) in your properties.  That way, the runtime library gets linked into your application, and you don't need any DLLs.

    And I want to reiterate something that Don has already told you.  This example is NOT a user-mode driver.  This is a kernel driver (sioctl.sys) that happens to have a user-mode test application.  It is the test app that is causing your trouble.


    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Tuesday, April 10, 2018 6:16 PM
  • Hi Tim, 

    According to your suggestion I change driver settings as

    c/c++ > code generation > runtime library  > multi-threaded.

    Now am I compiling with static library of those dlls?

    According to the driver's README.md file 

    Run the sample
    --------------

    To test this driver, copy the test app, Ioctlapp.exe, and the driver to the same directory, and run the application. The application will automatically load the driver, if it's not already loaded, and interact with the driver. When you exit the application, the driver will be stopped, unloaded and removed.

    1. Now I want to know where does these logs, prints and outputs comes and are stored?

    2. How do I verify that all of these stuff happened?

    Thank for taking time and replying.

    I tried looking into C:\Windows\INF\setupapi.app file and,

    C:\Windows\INF\setupapi.app\setupapi.dev

    I do not see anything with ioctl string in these files.

    Regards,

    Mrigendra Chaubey

    Friday, April 13, 2018 12:13 PM