Ken Brubaker

The ClavèCoder

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


Navigation

Subscriptions

News

Kenneth Brubaker
Senior Application Architect

Locations of visitors to this page

Post Categories



Self Identifying Services

Once upon a time in C++-land I had a NT Service base class. Now that .NET has a fine base class, it's no longer needed. However, my old class had a nice feature that would run the app as a console app unless it was started by the SCM. It used the trick of having a command line parameter that the SCM was configured to send when it started the application. I'm wanting to add this kind of functionality to my .NET Windows Services. The command line option seems much harder with the new .NET Installer functionality so I thought I would Google Groups around for a more intrinsic solution.

Here's that less than 100% solution as Win32 code. It's SID code so it may be hard to P/Invoke.
As MS employee described
As C-code implemented

Here's a heuristic way

posted on Monday, February 02, 2004 8:00 AM by kenbrubaker





Powered by Dot Net Junkies, by Telligent Systems