none
Why doesn't the console window close when unloading a driver RRS feed

  • Question

  • Hi,

     

    From my device driver I am printing out some message to the console.

     

    When I unload the driver the console window doesn't close. On my development machine I can see the message that the driver is unloaded, but since the console window remains open I am doubtful.

     

    Why would this happen?

     

    Regards

    Wednesday, November 9, 2011 10:19 AM

Answers

  • The driver is not running the context of your application.   It is either running in the kernel or udevice.

    Your application may request that one of those load the driver (using AcivateDeviceEx) but the driver is not loaded by your application.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    • Marked as answer by deepak_WinCE Monday, November 14, 2011 4:23 AM
    Thursday, November 10, 2011 1:24 PM
    Moderator

All replies

  • I am not sure that it should close.  The EXE that it is associated with is still running.

    Take a look at http://geekswithblogs.net/BruceEitman/archive/2008/06/10/windows-ce-listing-running-drivers.aspx for code to list the running drivers.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Wednesday, November 9, 2011 1:27 PM
    Moderator
  • Thanks for the reply Bruce,

     

    I will try to find out from my application whether the driver is still running or not.

     

    My application also exits immediately after unloading the driver. Another observation is that on re-Loading the driver, all console output appears in the same console(the console that remained open).

    Thanks

     

     

     

    Thursday, November 10, 2011 4:34 AM
  • The driver is not running the context of your application.   It is either running in the kernel or udevice.

    Your application may request that one of those load the driver (using AcivateDeviceEx) but the driver is not loaded by your application.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    • Marked as answer by deepak_WinCE Monday, November 14, 2011 4:23 AM
    Thursday, November 10, 2011 1:24 PM
    Moderator