Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Detect Net Stop

Reply
Thread Tools Display Modes

Detect Net Stop

 
 
David F.
Guest
Posts: n/a

 
      12-30-2009
Hi,

How does a driver detect a "net stop" request (if possible)?

TIA!!

 
Reply With Quote
 
 
 
 
Don Burn
Guest
Posts: n/a

 
      12-30-2009
If you mean the command NET STOP <driver service> the driver will get a call
to the unload routine for a legacy driver, for a PNP driver this command
does not work.


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply



"David F." <> wrote in message
news:3EEF0CD9-6FC7-40E9-8FD2-...
> Hi,
>
> How does a driver detect a "net stop" request (if possible)?
>
> TIA!!
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4730 (20091230) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>




__________ Information from ESET NOD32 Antivirus, version of virus signature database 4730 (20091230) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




 
Reply With Quote
 
David F.
Guest
Posts: n/a

 
      12-31-2009
Well, it's weird to me ... when I "net stop drivername" and my device
doesn't have any handles of its own open everything seems to work well. If
my driver/device has an open handle (or something like that) the net stop
hangs for a while then says it can't do it. From then on I assume it's
STOP_PENDING state but unload was never called (this is XP) ? what would
clear the stop_pending .. how does the service control manager determine if
it can stop it or not?


"Don Burn" <> wrote in message
news:...
> If you mean the command NET STOP <driver service> the driver will get a
> call to the unload routine for a legacy driver, for a PNP driver this
> command does not work.
>
>
> --
> Don Burn (MVP, Windows DKD)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
> Remove StopSpam to reply
>
>
>
> "David F." <> wrote in message
> news:3EEF0CD9-6FC7-40E9-8FD2-...
>> Hi,
>>
>> How does a driver detect a "net stop" request (if possible)?
>>
>> TIA!!
>>
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4730 (20091230) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>

>
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4730 (20091230) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
>


 
Reply With Quote
 
Don Burn
Guest
Posts: n/a

 
      12-31-2009
You can't use NET STOP on a driver that has open handles to its devices. If
there are references to the DEVICE_OBJECTS you will not be able to stop the
driver.


--
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply



"David F." <> wrote in message
news:...
> Well, it's weird to me ... when I "net stop drivername" and my device
> doesn't have any handles of its own open everything seems to work well.
> If my driver/device has an open handle (or something like that) the net
> stop hangs for a while then says it can't do it. From then on I assume
> it's STOP_PENDING state but unload was never called (this is XP) ? what
> would clear the stop_pending .. how does the service control manager
> determine if it can stop it or not?
>
>
> "Don Burn" <> wrote in message
> news:...
>> If you mean the command NET STOP <driver service> the driver will get a
>> call to the unload routine for a legacy driver, for a PNP driver this
>> command does not work.
>>
>>
>> --
>> Don Burn (MVP, Windows DKD)
>> Windows Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/WinDrvr
>> Remove StopSpam to reply
>>
>>
>>
>> "David F." <> wrote in message
>> news:3EEF0CD9-6FC7-40E9-8FD2-...
>>> Hi,
>>>
>>> How does a driver detect a "net stop" request (if possible)?
>>>
>>> TIA!!
>>>
>>>
>>> __________ Information from ESET NOD32 Antivirus, version of virus
>>> signature database 4730 (20091230) __________
>>>
>>> The message was checked by ESET NOD32 Antivirus.
>>>
>>> http://www.eset.com
>>>
>>>
>>>

>>
>>
>>
>> __________ Information from ESET NOD32 Antivirus, version of virus
>> signature database 4730 (20091230) __________
>>
>> The message was checked by ESET NOD32 Antivirus.
>>
>> http://www.eset.com
>>
>>
>>
>>

>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4730 (20091230) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>




__________ Information from ESET NOD32 Antivirus, version of virus signature database 4730 (20091230) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




 
Reply With Quote
 
Maxim S. Shatskih
Guest
Posts: n/a

 
      12-31-2009
> my driver/device has an open handle (or something like that) the net stop
> hangs for a while then says it can't do it.


Correct.

>From then on I assume it's
> STOP_PENDING state but unload was never called (this is XP) ?


Correct.

> clear the stop_pending .. how does the service control manager determine if
> it can stop it or not?


It cannot. Only PnP can.

And, even PnP will leave you with half-destroyed devnode if there are open handles to it. Usually, the apps register for "please close this handle - the driver is unloading" situation, but not always.

--
Maxim S. Shatskih
Windows DDK MVP

http://www.storagecraft.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solution to STOP 0x00000124 dzomlija Windows Vista Hardware 9 01-14-2009 06:57 PM
Run Vista legally for at least one year/ Vista Activation doesn't stop Piracy Chad Harris Windows Vista Installation 56 12-25-2008 02:34 PM
Re: Windows update error 80070246 Robert Aldwinckle Windows Vista Performance 7 12-31-2007 08:44 PM
READY-RECKONER : Windows Vista 'Stop Errors' or The BSOD's. anandk Windows Vista Performance 0 08-21-2007 10:24 AM
Some general information on Blue Screens and Stop messages Adam Albright Windows Vista Installation 1 03-04-2007 09:31 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59