Advertisement

05.01.2007 at 04:59PM PDT, ID: 22546431
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

How to disallow Windows Service from stopping/terminated

Asked by cyanidex in Microsoft Visual Basic.Net

Tags: , , , ,

Dear Gurus,

I've created a windows service using VB 2005. This windows service will check and determine whether a dongle is attached to the computer. For your information, a dongle is a usb device which contains encrypted information. Dongle is usually used to counter software piracy problems. Usually a software which implements this kind of security measures will fail to operate if the dongle is being detached from the system.

So my windows service will check to see if the dongle is still attached to the system on a fixed interval. If the dongle is not attached, then the windows service will shut down the SQL Server database engine. By shutting down the database engine, my other software which is a point-of-sales system will not be able to connect to the database and ultimately fail to function properly. In other words, I do not want anyone to be able to use the point-of-sales system without a dongle attached to their system.

Well, my windows service is doing its job well except for a tiny problem. If the user is able to identify the name of my service, he or she can actually stop or disable my service from the Services Management Console accessible from Control Panel -> Administrative Tools. However, in order to counter this, I've added a piece of code in the OnStop() event of my windows service by instructing it to shut down the computer where the database engine resides. Although it's not elegant, but it serves its purpose.

However, this is where the main problem comes into the picture. A user can actually press CTRL+ALT+DEL to bring up the Windows Task Manager and locate the executable file which my windows service runs on, and hit the End Process button. Poof!!! My windows service is terminated without even triggering the OnStop() event. Without the windows service running, the point-of-sales system can be used even without a dongle attached. This is not something that I want. Although I must admit that it will be very difficult for a user to identify the executable file of my windows service, unless i tell him/her, but I do not want to rule out the possibility that a user will know how to shut down the security measure that I have taken in the future.

I know that there are some processes in the Windows Task Manager which belong to the operating system such as "System". This type of processes can't be "End Process". Is there anyway that I can make my windows service to behave like that? I have tried making my service running under accounts such as LocalService, NetworkService, LocalSystem and User but to no avail.

Is there anyway that I can disallow my Windows Service from stopping or being terminated? Even if that can't be helped, is there anyway for my windows service in its last attempt to shut down the whole system when being hit the "End Process" button? Please don't suggest that I implement the dongle check inside the point-of-sales system as I do not have the source codes for that system.

Please help, I'm really stranded on this one.Start Free Trial
 
Keywords: How to disallow Windows Service fro…
 
Loading Advertisement...
 
[+][-]05.01.2007 at 07:33PM PDT, ID: 19013260

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Tags: onstop, service, disable, disallow, stop
Sign Up Now!
Solution Provided By: NickGeorghiou
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.01.2007 at 07:40PM PDT, ID: 19013296

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.05.2007 at 01:41PM PDT, ID: 19037330

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32