473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1595
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.