473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Forcing Dr. Watson via WMI from asp.net web app

I'm looking for a way to force a service to take Dr. Watson dump and
terminate from within an asp.net web application (in C#).

A bit of background: I am try to code a web/WMI equivalent to an
existing C++ utility that we developed to force a Dr. Watson. The C++
version simply uses --
HRESULT result = ControlService( hService, command, &status );
where command is set to 128.
I figured I could simply call the Win32_BaseService.UserControlService
(WMI) and pass in 128 (type byte) for the control code. This returns a
error status = 21, which is Invalid Parameter.

Is the UserControlService simply catching the case where an undefined
user control code is passed in, whereas ControlService takes an
exception in the same case? If so, what's an alternative way to force
a Dr. Watson from C#? If not, do you have any idea what I may be
doing wrong?

Any and all help, or links to possible answers, greatly appreciated.

-Michael Rose
Unisys Corp.

Nov 17 '05 #1
2 1594
A colleague of mine came up with a very simple answer:

string serviceName = "someservicename";
System.ServiceProcess.ServiceController sc = null;
sc = new System.ServiceProcess.ServiceController( serviceName );

if( sc != null )
{
try
{
sc.ExecuteCommand( 128 );
}
catch( System.Exception e )
{
System.Console.WriteLine( "Exception " + e.Message );
}
}

Note that in order to get this to compile, you'll need to add a
reference that includes the namespace System.ServiceProcess, which can
be found in the .NET component System.ServiceProcess.dll.

One note: as this is not using WMI it will only kill services on the
local machine -- that is, where the web is hosted.

Michael Rose
-Unisys Corp.
On Wed, 01 Oct 2003 13:45:27 -0500, Dr. StrangeDub
<st********@yahoo.com> wrote:
I'm looking for a way to force a service to take Dr. Watson dump and
terminate from within an asp.net web application (in C#).

A bit of background: I am try to code a web/WMI equivalent to an
existing C++ utility that we developed to force a Dr. Watson. The C++
version simply uses --
HRESULT result = ControlService( hService, command, &status );
where command is set to 128.
I figured I could simply call the Win32_BaseService.UserControlService
(WMI) and pass in 128 (type byte) for the control code. This returns a
error status = 21, which is Invalid Parameter.

Is the UserControlService simply catching the case where an undefined
user control code is passed in, whereas ControlService takes an
exception in the same case? If so, what's an alternative way to force
a Dr. Watson from C#? If not, do you have any idea what I may be
doing wrong?

Any and all help, or links to possible answers, greatly appreciated.

-Michael Rose
Unisys Corp.


Nov 17 '05 #2
A colleague of mine came up with a very simple answer:

string serviceName = "someservicename";
System.ServiceProcess.ServiceController sc = null;
sc = new System.ServiceProcess.ServiceController( serviceName );

if( sc != null )
{
try
{
sc.ExecuteCommand( 128 );
}
catch( System.Exception e )
{
System.Console.WriteLine( "Exception " + e.Message );
}
}

Note that in order to get this to compile, you'll need to add a
reference that includes the namespace System.ServiceProcess, which can
be found in the .NET component System.ServiceProcess.dll.

One note: as this is not using WMI it will only kill services on the
local machine -- that is, where the web is hosted.

Michael Rose
-Unisys Corp.

==================
On Wed, 01 Oct 2003 13:45:27 -0500, Dr. StrangeDub
<st********@yahoo.com> wrote:
I'm looking for a way to force a service to take Dr. Watson dump and
terminate from within an asp.net web application (in C#).

A bit of background: I am try to code a web/WMI equivalent to an
existing C++ utility that we developed to force a Dr. Watson. The C++
version simply uses --
HRESULT result = ControlService( hService, command, &status );
where command is set to 128.
I figured I could simply call the Win32_BaseService.UserControlService
(WMI) and pass in 128 (type byte) for the control code. This returns a
error status = 21, which is Invalid Parameter.

Is the UserControlService simply catching the case where an undefined
user control code is passed in, whereas ControlService takes an
exception in the same case? If so, what's an alternative way to force
a Dr. Watson from C#? If not, do you have any idea what I may be
doing wrong?

Any and all help, or links to possible answers, greatly appreciated.

-Michael Rose
Unisys Corp.


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Julie Paten | last post by:
Hello, I receive an Inetinfo.exe dr. watson error when I run any .dll from any client computer. I have tried installing sp6a on my NT4 server but the error keeps coming up and halting my...
0
by: Barak Turovsky | last post by:
Hi all, I have a web site running on IIS 4.0 on Windows NT 4.0 Server. The site is working perfectly for 3 years. Recently i have a strange problem while the IIS is crashing giving the Dr....
2
by: Dr. StrangeDub | last post by:
I'm looking for a way to force a service to take Dr. Watson dump and terminate from within an asp.net web application (in C#). A bit of background: I am try to code a web/WMI equivalent to an...
3
by: Greg B | last post by:
Created a simple Win32 application (using Visual Studio wizard)... Am using Visual Studio (Enterprise Edition) 6.0, as well as Service Pack 5. At the start of 'WinMain' function, added the...
1
by: Oliver | last post by:
I have a database developed fully in Access 2000 which I make available to users of both Access 97 and Access 2000. I use a split front end/back end arrangement; with the BE in Access 97. When I...
10
by: Steven | last post by:
The following program runs alright until the return statement, where it crashes, and consequently, Dr. Watson (drwtsn32.exe) also crashes. Deleting the call to fgets() and everything runs fine. I...
0
by: Bob Allen | last post by:
I have a few programs out that are getting the following error. This error only started since people have done the last windows updates in the past week. I appears that it is only affecting...
5
by: Hazzard | last post by:
..aspx pages work fine and vsnet.2003 runs fine with all functionality(edit,build, execute, etc) except when I try to open a .html file in the project or a .xml file. Dr. Watson comes up...
3
by: srinin008 | last post by:
Does any one implemented Bowyer watson algorithm in C++
0
by: markusa | last post by:
Hello all, my .NET 1.1 application runs on many desktop pc and sometimes produces a crash which is recorded by dr. watson. Although I log all exceptions at least in the Main method and in the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.