Service Stop issue on Windows8.1

Hi,
We have the driver which is started and stopped using windows service calls…
StartService, Control service and close handle…

I have seen some problem where service is not getting stopped and it is always in Pending state… This happens in below situation

  1. Do driver init Application
  2. Driver Init from DLL
  3. Driver Uninit from DLL
  4. Driver Uninit from Applicatiom

if i do multiple inits and Uninits from application it works without issues…

Any idea why this issue happens when application and DLL involved…
I have followed steps below to stop my driver,
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686335(v=vs.85).aspx

xxxxx@gmail.com wrote:

Hi,
We have the driver which is started and stopped using windows service calls…
StartService, Control service and close handle…

I have seen some problem where service is not getting stopped and it is always in Pending state… This happens in below situation

  1. Do driver init Application
  2. Driver Init from DLL
  3. Driver Uninit from DLL
  4. Driver Uninit from Applicatiom

if i do multiple inits and Uninits from application it works without issues…

I would hope it is clear there is no difference here. The system can’t
tell the difference between code that’s part of your application and
code that’s in a DLL. There must be some difference in the code
itself. Is the DLL running a separate thread? You may need to use a
mutex so only one thread at a time attempts to stop the service.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.