[rc5] Re: rc5-digest V1 #44

Bill Plein bill at diablo.net
Tue Jul 15 09:40:59 EDT 1997

>Fix: Install the service when you're Administrator. That way the
>service will run under the system account, which means that they will
>run _always_ even when no one is logged on.

It doesn't work that way.

When you install a service under NT, you have the option of setting it to
run as the local system account (you can only choose this if you have
Administrative rights, it isn't limited to the Administrator account only,
but to anyone with administrative rights to the local machine.

I have done this.  You should try it too, and then maybe you'll stop
telling us we are wrong.

If you install a service to run the client, it WILL run as soon as the
system comes up. BUT, if you log off and log in as another user, it shuts
down and doesn't restart. Why? Because the client app (not the service)
gets a KILL signal or the Win32 equivalent, and shuts down. The service
keeps running, it is just the client app CALLED by the services that dies. 

By the way, this also happens if you use the NT resource kit SRVANY.EXE
service to run an app. This client is not a service itself, and doesn't
understand service calls. It does erroneously respond to kill signals from
NT that kill the client if you log out. 

I will forward this on to one of the programming team to make sure they
know what the problem is.

client: Win32 V2.002
Problem: If installed with RC5SVC, or with SRVANY from the NT resource kit,
the client will interpret the WM_QUERYENDSESSION and WM_ENDSESSION messages
as a kill signal, so logoffs will kill the RC5V2 client.

Here is a note from the SRVANY.WRI file in the Resource kit:
Programming Considerations:

For WIN32 graphical applications: when the currently logged-in user is
logging-off, all WIN32 top-level windows receive WM_QUERYENDSESSION and
WM_ENDSESSION messages. Some WIN32 applications choose to terminate upon
receipt of such messages. In order for your WIN32 application to survive
logoff, it must not do that: instead, your windows procedure should call
the default windows procedure on these messages.

For WIN32 Console (i.e. character-mode) applications: when the currently
logged-in user is logging-off, all Console applications receive a
CTRL_LOGOFF_EVENT event from the Console. 
If your Console application has registered a Console event handler (via
SetConsoleCtrlHandler), it must ignore CTRL_LOGOFF_EVENT in order  to
survive the logoff.

Bill Plein
bill at diablo.net
To unsubscribe, send email to majordomo at llamas.net with 'unsubscribe rc5' in the body.

More information about the rc5 mailing list