Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Mar : How can a Delphi service stop logging off XP?
| Subject: | How can a Delphi service stop logging off XP? |
| Posted by: | "Bo Berglund" (bo.berglu..@telia.com) |
| Date: | Wed, 12 Mar 2008 23:54:05 |
I have written a service application in Delphi that uses sockets to
communicate with a client application.
When the service starts it starts listen via a TServerSocket component
I have put on the service application's form.
If someone connects then the service will create a handler for the
client and pass it the socket variable over which all future
communications will happen. This has worked fine for several years.
Now something has happened that seems to be connected to my service:
If I log on to the remote desktop of the PC while the service is
running I cannot log off. Nothing happens if I try.
A Windows update install that required a reboot also failed when
trying.
If I stop my service then it is possible to log off/restart.
If I then log on I can immediately log off, but if I log on and then
start the service it blocks the logoff again.
Where should I start looking here?
The main service app does nothing else than listens on the socket
until a client connects and my tests show that it is enough that the
service has been started (no client connected) for the logoff/restart
block to be there.
I have not touched the main service in a long time, the only
development I have done is in the objects that will be created once
the client connects, so these are not even created at the time the
block appears...
Is there some kind of CloseQuery that a service app receives that I
can implement and handle? I need at least to try and log what happens
when Windows tries to log off (it should really not communicate with
the service at this time, the whole idea with a service is that it is
logon independent).
Any hints welcome!
/BoB