Re: Dynamically unload and load serial driver




Hello Michel,
Thank you for the reply. I think you are correct, but unfortunately I had
to restart my system and it is no longer in the same state.
Before the restart, I did notice in the "Active" area of the registry that
there was an entry with many of the same features as the other two COM ports.
It didn't have the "COM1" key and I had thought it was completely unloaded.
Perhaps due to the RAS/unimodem problem, it couldn't completely deactivate.
I will be testing this system again and if it gets into the same state, I
will attempt to do more to unload the driver completely.

Thank you,
Craig


"Michel Verhagen (eMVP)" wrote:

Error 110 is "The system cannot open the device or file specified."
meaning it can't find, or more probable; can't open the driver dll
because it is still in use.

- Are you sure the driver unloaded?
- How did you get the handle to the serial driver?
- Can you still find "COM1:" using FindFirst/NextDevice after unloading it?


Good luck,

Michel Verhagen, eMVP
Check out my blog: http://GuruCE.com/blog

GuruCE
Microsoft Embedded Partner
http://GuruCE.com
Consultancy, training and development services.

Craig wrote:
Hello,
Due to a problem with RAS, the COM port cannot be opened (in RasDial calls).
I don't want to have to reset my device to let the driver reload. I have
been able to unload the serial driver using DeactivateDevice. However, when
I attempt to reload the serial driver using ActivateDeviceEx, I always get
the error 110.
This is the typical COM1 driver found in [HKLM\Drivers\BuiltIn\Serial].

I call: ActivateDeviceEx(_T("Drivers\\BuiltIn\\Serial"), NULL, 0, NULL );

My OS is CE 5.0. I don't have any access to PB debug information.

Please let me know if this is possible and what I might be doing wrong.

Thank you,
Craig

.



Relevant Pages

  • Re: 1394 + WinXP SP2
    ... >> all unload paths for your device. ... My own drivers do very light async I/O, ... I did not do extensive SP2 testing. ... you try your device with CUV and driver verifier with SP1? ...
    (microsoft.public.development.device.drivers)
  • Re: Self-removing driver
    ... I ended up following Volodymyr M. Shcherbyna's suggestion: ... Incremented HandleCount on IRP_MJ_CREATE ... to my Unload routine to prevent a closing conflict as suggested by Pavel A. ... Windows Filesystem and Driver Consulting ...
    (microsoft.public.development.device.drivers)
  • Re: newbus integration of MOD_QUIESCE
    ... an unload request is treated as a blocking quiesce request. ... such as "State transition driver into 'shutting ... load overlap? ... it" may mean one thing for a driver, but something else for a file system. ...
    (freebsd-arch)
  • Re: Notification of Driver Unloading
    ... I am not sure if you can force a driver not to unload, ... that this happens becuase the applications is communicating with the COM ... Is there any notification like this? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: WdfControlDeviceInitSetShutdownNotification
    ... why wouuldn't you just do it on device unload as well? ... Please do not send e-mail directly to this alias. ... I tried using EvtDeviceD0Exit but my driver gets called when it is unloaded, ... register shutdown notification. ...
    (microsoft.public.development.device.drivers)