Mr. Arnold said:
That link doesn't indicate what you are talking, and the only thing it
indicates is the statement below, which a Windows service doesn't have
to run with System rights.
<copied>
Important We strongly recommend that services do not run as interactive
services if the services run in an elevated security context such as
SYSTEM.
<copied>
Your advise doesn't seem to be correct for all situations here.
A service is an always-on, background process. For this reason alone it's
fundamentally flawed to have it interact with the desktop: there need never
be anyone sitting in front of the computer, so what exactly is the service
trying to achieve with that?
Second, services usually run with elevated credentials. It needn't be SYSTEM
-- that's just the worst-case scenario. The point is that a service will
usually run under credentials that allow it to do things any other logged-on
user can't do directly, as that's often the point of having a service in the
first place (though admittedly not always). For example, SQL Server can run
under limited credentials, but even in this setup those are usually the only
credentials with file system access to the database, for obvious reasons.
All interactive services open themselves up to shatter attacks, and there's
not much they can do against it. It's a security vulnerability, which is why
Microsoft closed it off altogether.
Heck, even in the MCSD MSPress Certification book for Windows desktop
solutions in C# and VB back for VS 2003 had a whole application
exercise that was using a Windows form base solution that was in
communications with a Windows service on the backend and passing data
to/from each other.
And there's nothing wrong with that -- I assume it wasn't the *service* that
was displaying UI.
I don't know man. If I wanted to communicate interactively with a
Windows service from a Windows desktop solution on Vista, I would be
using .Net Remoting, MSMQ, or (WCF using a Named Pipe or MSMQ) locally
if I had to go that route.
Sure, all fine solutions. All these channels are securable and provide
isolation.
You can also use this too on Vista for cross process communications,
locally.
http://www.codeproject.com/KB/dotnet/XDMessaging.aspx
Maybe we are talking two different things in going into communications
with a Windows service from a desktop solution interactively.
Let's be clear here: there's nothing wrong with communicating with a service
in a cross-process scenario. What's strongly discouraged is your *service*
interacting with the desktop *directly*.