You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Mladen Turk <ml...@mail.inet.hr> on 2001/09/09 19:34:16 UTC

[PATCH] WIN9x shutdown/logoff -- Win9xConHook

Hi all,

There has been some thoughts to "adopt" the Win9xConHook from 1.3 branch. I
even posted the patch last month and Bill already put the Win9xConHook to
CVS.

Now, I have some doubts if this is the right way to go, and here is why:
Apache2 already has a service monitor thread (monitor_service_9x_thread),
but the problem with it is that it is called prior the
mpm_start_child_control_handler and IMO that is why the console window stays
open.

The other thing I can't figure out is why the winnt_post_config hook is
called twice?

The patch only calls FreeConsole and the logoff and shutdown events are
handled without nasty "Could Close APACHE" message.


--- server/mpm/winnt/service.c.old	Sun Sep  9 19:09:42 2001
+++ server/mpm/winnt/service.c	Sun Sep  9 19:09:52 2001
@@ -364,6 +364,7 @@
     }
     else
     {
+        FreeConsole();
         SetConsoleCtrlHandler(child_control_handler, TRUE);
         atexit(stop_child_console_handler);
     }


Now, IMO there is no need for Win9xConHook because monitor_service_9x_proc
already handles that.

MT.


Re: [PATCH] WIN9x shutdown/logoff -- Win9xConHook

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Mladen Turk" <ml...@mail.inet.hr>
Sent: Sunday, September 09, 2001 12:34 PM


> There has been some thoughts to "adopt" the Win9xConHook from 1.3 branch. I
> even posted the patch last month and Bill already put the Win9xConHook to
> CVS.
> 
> Now, I have some doubts if this is the right way to go, and here is why:
> Apache2 already has a service monitor thread (monitor_service_9x_thread),

That should disappear.  The reason I created Win9xConHook was to remove the 
dirty Win9x service emulation code from service.c (as I'd done in 1.3.)  If 
there is a problem with that code (and there is, with system shutdown) we 
need to fix it there.  If we don't change the API, we can backport the 
changes (easily) to 1.3.

> but the problem with it is that it is called prior the
> mpm_start_child_control_handler and IMO that is why the console window stays
> open.

Hmmm.  Will have to look at this.

> The other thing I can't figure out is why the winnt_post_config hook is
> called twice?

Ummm, because we pre-parse the config before detaching from the console on 
Unix (so the logs can be opened and the errors reported to the right place.)
So we should probably do the same on Win32.

> The patch only calls FreeConsole and the logoff and shutdown events are
> handled without nasty "Could Close APACHE" message.

> Now, IMO there is no need for Win9xConHook because monitor_service_9x_proc
> already handles that.

-1 for the reasons I cited above.  The service.c code needs significant 
refactoring.  If there is an error in the Win9xConHook, let's fix it, and 
incorporate it.  If it looks 'too different' from the WinNT SCM layer, let's 
fix that too.

You can't use the 'close' button on the Win9x port without this code.  That's 
what the hook is for, to fix the broken wintty implementation on Win9x.  
Whatever we need to do to fix the interactions with some other Microsoft hooks,
well, let's do it.

Bill