Detect Net Stop

Hi,

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

TIA!!

0
David
12/30/2009 11:23:18 PM
development.device.drivers 941 articles. 0 followers. Follow

4 Replies
788 Views

Similar Articles

[PageSpeed] 20

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." <df2705@community.nospam> wrote in message 
news:3EEF0CD9-6FC7-40E9-8FD2-FB736A5C512E@microsoft.com...
> 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




0
Don
12/30/2009 11:37:36 PM
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" <burn@stopspam.windrvr.com> wrote in message 
news:uwWRWkaiKHA.1536@TK2MSFTNGP06.phx.gbl...
> 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." <df2705@community.nospam> wrote in message 
> news:3EEF0CD9-6FC7-40E9-8FD2-FB736A5C512E@microsoft.com...
>> 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
>
>
>
> 

0
David
12/31/2009 12:35:50 AM
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." <df2705@community.nospam> wrote in message 
news:O73o0EbiKHA.5520@TK2MSFTNGP06.phx.gbl...
> 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" <burn@stopspam.windrvr.com> wrote in message 
> news:uwWRWkaiKHA.1536@TK2MSFTNGP06.phx.gbl...
>> 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." <df2705@community.nospam> wrote in message 
>> news:3EEF0CD9-6FC7-40E9-8FD2-FB736A5C512E@microsoft.com...
>>> 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




0
Don
12/31/2009 2:10:50 AM
> my driver/device has an open handle (or something like that) the net =
stop=20
> hangs for a while then says it can't do it. =20

Correct.

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

Correct.

> clear the stop_pending .. how does the service control manager =
determine if=20
> 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.

--=20
Maxim S. Shatskih
Windows DDK MVP
maxim@storagecraft.com
http://www.storagecraft.com

0
Maxim
12/31/2009 10:34:25 AM
Reply:

Similar Artilces:

Using XSL in VB.net
All I want to do is execute a simple transformation in VB.net.... I know this has to be simple. I tried the following as suggested by a web page I found.... Dim xslt as New XslTransform() xslt.Load("Filename") xslt.Transform("InFile", "ResultFile") This appears to be very straightforward to me. However, this causes an error saying the code is obsolete... (I thought the whole Framework version concept meant backwards compatability, but I guess not.) it further says "You should pass XmlResolver to Transform() method" Can anyone tell me how / where...

.NET Framework 1.1
I have Vista Home Basic. In the Control Panel\Programs and Features I find: Microsoft .NET Framework 1.1 Microsoft .NET Framework 3.5 SPI Microsoft Corporation Under Publisher there is nothing in the fist. Is it OK? Should I redownload it? Also, do I need both of them? Also, in Control Panel\Windows Update\View Update History, I see that Microsoft .NET Framework 1.1 Service Pack 1 has failed, and was not tried again. Should I download it manually? Thanks, emf -- It ain't THAT, babe! - A radical reinterpretation https://files.nyu.edu/emf202/public/bd/itaintm...

MultiWorkbook Change Event Detection / Spell Checker
Excel 2003 or 2007. Looking to be able to force spell checking whenever any cell content is is changed. I've been successful on a single workbooks by adding Spell Check execution on Worksheet_Change. I'm hoping to take this one step further - make it an 'Add-In' so the check will run for any workbook. It looks like the Worksheet_Change event only triggers for the host workbook so an 'Add-in' will not do the job. Any suggestions to force spell checking on a change for any workbook/worksheet I modifiy? TIA, - Pat The way I would go about this i...

How to detect changes in a column?
If I have a table with sales forecast data (columns) like Customer, Amount and Status, what would be the best way to track changes in this table so I can compare my forecast week after week? -- inomata ------------------------------------------------------------------------ inomata's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=18938 View this thread: http://www.excelforum.com/showthread.php?threadid=493571 ...

System Standby Failed & .Net Framework v1.0.3705 message
I am getting a "System Standby Failed" error message. This pops up on it's own. The full length message is: The service 'Microsoft .NET Framework v1.0.3705 Update' is preventing the machine from entering standby. Try stopping this service and try again. Except for a Windows udpate that came through recently I can't think of anything that's changed. How do I correct this? See the "How to obtain help" section of http://support.microsoft.com/kb/979909 For home users, no-charge support is available by calling 1-866-PCSAFETY (1-866-727-23...

detect and repair
my outlook 2002 had some hyperlink problems which were corrected when i used the 'detect and repair' option in help. now i have lost my addresses and all the e-mail that was in my inbox. How do i recover these items? Check this page for all you need to know: http://www.slipstick.com/config/backup.htm -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP http://home.hawaii.rr.com/schorr **I apologize but I am unable to respond to direct requests for assistance. Please post questions and replies here in the newsgroup. Mahalo! "Mark Conner" <mdconner@prodigy.net> wrote ...

Duplicate detection detecting inactive records?
Is there any way to configure duplicate detection to not look at inactive records? I can't find any way to set this on the rules. Thank you! ...

How to Detect and prevent CD burn
HI, How can i stop to CD burn of any file from my system to CD.How to detect the event of CD burn and how can i stop CD burn.Basically i want to secure my file from CD burn. plz reply soon. regds vinay sheel vinays@aditi.com Vinay wrote: > HI, > How can i stop to CD burn of any file from my system to CD.How to detect the > event of CD burn and how can i stop CD burn.Basically i want to secure my > file from CD burn. You can restrict access to a file only to a certain users through NT/win200 access privileges. You can encrypt a file and therefore restrict access to a file on...

Exchange Powershell cmdlets from VB.NET
Hi, I want to run New-Mailbox but I get this: "The term 'New-Mailbox' is not recognized as the name of a cmdlet" This is when running on a machine with exchange 32 bit management tools installed. Here is my code: Imports System.DirectoryServices Imports System.Data Imports Microsoft.PowerShell Imports System.Collections.ObjectModel Imports System.Management.Automation Imports System.Management.Automation.Runspaces Imports System.IO Imports System.Text If txtUsername.Text.Length > 1 Then If UserExists(txtUsername.Text) Then ...

Net Framework 1.0 service pack 3
My auto update wants to install Net Framework 1.0 service pack 3. Can't install, keep getting Error Code: 0x643. I have an HP Pavilion ze 4500 series notebook, running windows xp now with service pack 3. Have been trying to update everything and this is thing only I can't install. This is an older PC and have upgraded memory, ran an opitimizer and got thngs working pretty well. My current .Net Framework 1.0.3705.288 Does anyone have any suggestions? I would appreciate any help. Thank you. -- kim Hello Kim, See <http://support.microsoft.com/kb/976982>...

.net passport #2
Somehow I have this silly net.passport login id to open my Money files. I don't want a password/passport, ANYTHING, to get into Money and I don't know to get it off. Also, somehow, all of a sudden, after years of using Money, it won't let me in at all, says my log in name is not associated with my file and I can't use my Money program. Help! And I don't even know who to call for help! In microsoft.public.money, cam wrote: >Somehow I have this silly net.passport login id to open >my Money files. I don't want a password/passport, >ANYTHING, to get...

GUID is not detected by server .& cannot go offline...SFO.
why is the server not detecting the GUID attached to the subject line of email...what could be the problem... Also i am not able to go offline ..I get an error Domain canot be contacted or does not exist... Any sugestions... Thanks a million. ...

ASP.NET App How to convert AVI to WMV
I need to convert AVI files to WMV format in a ASP.NET app. The App, being hosted on external IIS provider, can't shell any EXE program, so I'm looking for a DLL library. I didn't find any solution on the web. Any suggestions? -- bruno On Feb 26, 9:31=A0am, bruno <br...@community.nospam> wrote: > I need to convert AVI files to WMV format in a ASP.NET app. > The App, being hosted on external IIS provider, can't shell any EXE progr= am, > so I'm looking for a DLL library. I didn't find any solution on the web. > Any suggestions? > ...

My Computer not detecting my external harddrive
I have a IDE hard drive with USB casing and connected to my USB port. The problem is the hard drive partitions are not shown up in My computer. But My Computer->Manage->Storage->Disk management shows the hard drive with 3 partitions and all the three are healthy.I know there are a few bad sectors. I am sure I have not made any changes in registry that prevents drives from being shown. Please help me. Do the partitions have drive letters assigned? karthikaravind wrote: > I have a IDE hard drive with USB casing and connected to my USB port. > The problem is the ha...

Stop Outlook starting with windows
How do I stop Outlook starting with Windows. Remove shortcut from Startup Folder? "Teddy" <Teddy@discussions.microsoft.com> wrote in message news:91F28579-AF14-4453-8A77-7BE56FF4C22F@microsoft.com... > How do I stop Outlook starting with Windows. ...

How to stop sending email out with SPAM in the subject line ?
I have exchange 2003 and SMSE security program. We want all our email to be delivered but if it is a spam email then I setup SMSE to put SPAM in front of subject line and then deliver to our users and user will decide what to do. This way we won't miss any email. I dont how and why all our outgoing email are going out with SPAM in the suject line and other servers are blocking our ip address because of SPAM word in subject line. I dont know where to start. So please help me to take SPAM word out of subject line for my out going email only. Thanks On Thu, 16 Nov 2006 15:36:24 ...

Outlook removing stops from attachment path
Hi there, there is an issue with attachements that are sent by Outlook where full stops are removed from file names. This had me scratching my head for hours after sending someone a long named config file for a .Net library. The guy did not notice the full stops were missing and it had me flumoxed as to why it wasn't working until I noticed the stops had been changed to spaces. Is this deliberate or a bug? I suspect it may be for cross platform compatiblity. Cheers. outlook does not normally remove periods from file names. I've seen issues similar to this w...

VB.Net 2005
Hi all, I started with reading a GS1 XML file but keep getting all sorts of errors. Any advice? ------- Code ------------- 'read xml file and drop in Grid Dim strFileXML As String = "D:\Order.xml" Dim dsXML As New System.Data.DataSet Try dsXML.ReadXml(strFileXML, XmlReadMode.ReadSchema) Me.dgXML.DataSource = dsXML Catch ex As Exception MsgBox(ex.Message) Finally End Try ------- Code ------------- ------- XML File ------------- http://www.gs1.org/docs/gsmp/xml/2_0_2/BMS_Package_Order.zip ------- XML File ------------- -- Met vriendelijke groet / With regards / Sa...

how can i stop photographs from dissapearing in publisher
how can i stop photographs from disappering in publisher. after so long my images disappear and the text is left in place with no images. Is there a way of anchoring them or should I use seperate layers..? Help...! You are experiencing video driver problems. Do this, slide the acceleration down on your adapter, control panel, display, settings tab, advanced button, troubleshoot tab. If this solves your issue go to the manufacturer's web site and look around for an upgraded driver. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com...

Mic not detected
I upgraded from Vista to W7 when it first came out. I have just recently realized that it apparently cut off the mic and I cannot record anything. I can still hear cd's.etc. I did not discover this until I tried to send a video message to my son who just got deployed to Iraq. Dell customer support has been useless thus far. Thanks for any suggestions as to how to fix this problem. On May 17, 11:51=A0am, "andy jones" <jandy78...@aol.com> wrote: > I upgraded from Vista to W7 when it first came out. I have just recently > realized that it apparently cut...

IE has stopped working: windows check for solution
Unable to use search bars for Bing and yahoo. Everytime I try to search I get the subject message. Additionally Im also getting another window saying this tab has been recovered, a problem with this webpage caused IE to close and reopen this tab. Everthing else seems to be working fine. I am working on a new laptop which came with OS 7. These messages are annoying how can I solve these problems -- Eric2009 Have you run the IE8 Troubleshooters? http://support.microsoft.com/kb/967896 (Method 3) Have you tried doing a Reset? http://windows.microsoft.com/en-US/windows7/Reset-In...

Record is locked (deadlock was detected)
when trying to run a CM Transaction I get "A get/change next operation on table 'CM_Transaction' deadlock was detected. when I click on more details i am given the following. [microsoft][ODBC SQL Server Driver][SQL Server] Transaction (process ID 77) was deadlocked on thread | communication buffer resources with another process and has been chosen as the deadlock victim. Return the transaction. currently I have ensured that no one is logged in. I view the odb.dex_lock table in the tempDB and cleared it. At this point I can run a reconciliation with no errors where I ...

XML performance in .net?
Hi there Anyone know how fast for XML performance when I use dataset to save and read data from XML file? my client need those answers. Thanks in advance Sandra sandra wrote: > Anyone know how fast for XML performance when I use dataset to save and read > data from XML file? my client need those answers. Basically DataSet is not the fastest XML API, actually that's not XML API altogether. -- Oleg Tkachenko [XML MVP, XmlInsider] http://blog.tkachenko.com ...

detecting which control has focus
I have an application that I am writing and I need to be able to detect which control has focus (I am using edit controls). I figured out how to set the focus by creating a member control variable and using the setfocus() function, but how do detect which control has focus? There is a getfocus() in the control member variable, but I have been unsuccessful in using it? I am using the PreTranslateMessage(MSG* pMsg) function to detect when the Return key is pressed and then I automatically go the the next edit control, but I want to do different code depending on which Edit control has focus a...

Cannot detect previous login you need to run frontstep crm at least once
We have a user who was on extended leave for a few months and now when ever he opens up outlook 2000 sr-1 on his computer (Windows 98se) he gets a message that "Cannot detect previous login you need to run frontstep crm at least once. Front step outlook extension will be disabled for current outlook session." When I say OK you get another message that "The add-in "psExcExt.dll" could not be installed or loaded. This problem may be resolved by useing detect and repair in the help menu. Unable to load "psExcExt.dll" you may be out of memory or out ...