Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 16937 invoked by uid 500); 11 Jun 2000 21:26:48 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 16922 invoked from network); 11 Jun 2000 21:26:48 -0000 From: "William A. Rowe, Jr." To: Subject: RE: [patch 1.3.13-dev] Win9x Services Date: Sun, 11 Jun 2000 16:26:37 -0500 Message-ID: <000901bfd3eb$bd46c3d0$345985d0@corecomm.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000A_01BFD3C1.D470BBD0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <000001bfd33c$c65dd580$3c00a8c0@beast> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_000A_01BFD3C1.D470BBD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > From: Andrew Braund [mailto:abraund_news@mail.com] > Sent: Saturday, June 10, 2000 7:34 PM > > Testing on Win 2000 5.00.2195; > > apache -v > Server version: Apache/1.3.13-dev-service9x.200006091127 (Win32) > Server built: Jun 10 2000 13:26:09 > > apache > First impression was that Ctrl-C does not seem to to shutdown > Apache, apache -k stop in another dos window closes it down > quickly. Further testing revealed that this was due to the new > way the command prompt window works, it has a select mode and an edit > mode, unless you are in edit mode apache does not get the Ctrl-C. This bugs me -SO MUCH- that I've attached the source for my Win32 console diagnostics module. (A simple [cl -c TestConsole.c] and [link TestConsole.obj kernel32.lib] will build it.) You might want to see if we get any extra 'bits' in the console mode flag when that state is toggled, so that we might override it. Bill This code is really for trying (yet again) to grab win95's close button... and I'm off to test it there (if you haven't guessed, I never installed my email to that boot path). ------=_NextPart_000_000A_01BFD3C1.D470BBD0 Content-Type: text/plain; name="TestConsole.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="TestConsole.c" #define _WIN32_WINNT 0x0400 #define NOGDI #define NONLS #define NOMCX #define NOIME #include #include #include static BOOL CALLBACK console_control_handler(DWORD ctrl_type) { int i; switch (ctrl_type) { case CTRL_C_EVENT: fprintf(stderr, "Ignoring CTRL+C signal...\n"); return TRUE; case CTRL_BREAK_EVENT: fprintf(stderr, "CTRL+BREAK Signalled\n"); break; case CTRL_CLOSE_EVENT: fprintf(stderr, "CLOSE Signalled\n"); break; case CTRL_LOGOFF_EVENT: fprintf(stderr, "LOGOFF Signalled\n"); break; case CTRL_SHUTDOWN_EVENT: fprintf(stderr, "SHUTDOWN Signalled\n"); break; default: fprintf(stderr, "Ignorning UNKNOWN signal 0x%04x\n", ctrl_type); return FALSE; } for (i = 4; i; --i) { fprintf(stderr, "%d seconds till termination...\n", i); Sleep(1000); } exit(1); } static void stop_console_control_handler(void) { SetConsoleCtrlHandler(console_control_handler, FALSE); } struct { DWORD flag; char *text; } controlkeystates[] = { CAPSLOCK_ON, "CapsLock ", ENHANCED_KEY, "Enhanced ", LEFT_ALT_PRESSED, "LeftAlt ", LEFT_CTRL_PRESSED, "LeftCtrl ", NUMLOCK_ON, "NumLock ", RIGHT_ALT_PRESSED, "RightAlt ", RIGHT_CTRL_PRESSED, "RightCtrl ", SCROLLLOCK_ON, "ScrollLock ", SHIFT_PRESSED, "Shift ", 0, NULL }; char *controlkeystatetext(DWORD flags) { static char text[256]; int i; *text = '\0'; for (i = 0; controlkeystates[i].text; ++i) if (flags & controlkeystates[i].flag) strcat (text, controlkeystates[i].text); return text; } char *buttonstatetext(DWORD flags) { static char text[256]; DWORD btn; int i; *text = '\0'; if (btn & 1) sprintf (strchr (text,'\0'), "LeftButton ", i); for (btn = i = 2; btn < 0x8000; btn <<= 1, ++i) if (flags & btn) sprintf (strchr (text,'\0'), "Button%d ", i); if (flags & btn) sprintf (strchr (text,'\0'), "RightButton ", i); return text; } char *syntax = "TestConsole modeflag [modeflag...]\n\n" " You may specify flags by value using #, 0# or 0x# arguments.\n" " A value of 0x# is treated as hex, of 0# is treated as octal.\n\n" " The following built-in flags are recognized...\n" "\t-p ENABLE_PROCESSED_INPUT 0x0001\n" "\t-l ENABLE_LINE_INPUT 0x0002\n" "\t-e ENABLE_ECHO_INPUT 0x0004\n" "\t-w ENABLE_WINDOW_INPUT 0x0008\n" "\t-m ENABLE_MOUSE_INPUT 0x0010\n\n"; int main(int argc, char **argv) { HANDLE hin; INPUT_RECORD inrec; DWORD incnt, dmode, cmode = 0; char *btntext, *ctrltext, *endarg; int i; if (argc < 2) { fprintf (stderr, syntax); exit (1); } while (*(++argv)) { strtoul(*argv, &endarg, 0); if ((**argv == '-') && !argv[0][2]) { switch (argv[0][1]) { case 'p': cmode |= ENABLE_PROCESSED_INPUT; break; case 'l': cmode |= ENABLE_LINE_INPUT; break; case 'e': cmode |= ENABLE_ECHO_INPUT; break; case 'w': cmode |= ENABLE_WINDOW_INPUT; break; case 'm': cmode |= ENABLE_MOUSE_INPUT; break; default: fprintf (stderr, syntax); fprintf (stderr, "Error: could not understand %s\n", *argv); exit (1); } } else if (!*endarg) { cmode |= strtoul(*argv, &endarg, 0); } else { fprintf (stderr, syntax); fprintf (stderr, "Error: could not understand %s\n", *argv); exit(1); } } hin = GetStdHandle(STD_INPUT_HANDLE); if (!GetConsoleMode(hin, &dmode)) { fprintf (stderr, syntax); fprintf (stderr, "Error %d: could not get default console mode!\n", GetLastError(), cmode); exit(1); } if (!SetConsoleMode(hin, cmode)) { fprintf (stderr, syntax); fprintf (stderr, "Error %d: could not set console mode to 0x%04x!\n", GetLastError(), cmode); exit(1); } printf ("Default console mode was 0x%04x, mode changed to 0x%04x\n\n" "Dumping console activity... press Ctrl+Break or Close to terminate.\n\n", dmode, cmode); SetConsoleCtrlHandler(console_control_handler, TRUE); atexit(stop_console_control_handler); while (ReadConsoleInput(hin, &inrec, 1, &incnt)) { switch (inrec.EventType) { case KEY_EVENT: ctrltext = controlkeystatetext(inrec.Event.KeyEvent.dwControlKeyState); printf ("Key 0x%02x (OEM 0x%02x) %s %d times for '%c' code %d (0x%02x)%s%s\n", inrec.Event.KeyEvent.wVirtualKeyCode, inrec.Event.KeyEvent.wVirtualScanCode, inrec.Event.KeyEvent.bKeyDown ? "Pressed" : "Released", inrec.Event.KeyEvent.wRepeatCount, isprint(inrec.Event.KeyEvent.uChar.AsciiChar) ? inrec.Event.KeyEvent.uChar.AsciiChar : '?', inrec.Event.KeyEvent.uChar.AsciiChar, inrec.Event.KeyEvent.uChar.AsciiChar, *ctrltext ? "with\n " : "", ctrltext); break; case MOUSE_EVENT: ctrltext = controlkeystatetext(inrec.Event.MouseEvent.dwControlKeyState); btntext = buttonstatetext(inrec.Event.MouseEvent.dwButtonState); printf ("Mouse %s at (%d, %d) %s%s%s\n", inrec.Event.MouseEvent.dwEventFlags & DOUBLE_CLICK ? "DoubleClicked" : (inrec.Event.MouseEvent.dwEventFlags & MOUSE_MOVED ? "Moved" : "Clicked"), inrec.Event.MouseEvent.dwMousePosition.X, inrec.Event.MouseEvent.dwMousePosition.Y, (*ctrltext || *btntext) ? "with\n " : "", btntext, ctrltext); break; case WINDOW_BUFFER_SIZE_EVENT: printf ("Command Window buffer resized to (%d, %d)\n", inrec.Event.WindowBufferSizeEvent.dwSize.X, inrec.Event.WindowBufferSizeEvent.dwSize.Y); break; case MENU_EVENT: printf ("Command Menu ID %d (0x%04x)\n", inrec.Event.MenuEvent.dwCommandId, inrec.Event.MenuEvent.dwCommandId); break; case FOCUS_EVENT: printf ("Command Window %s Focus\n", inrec.Event.FocusEvent.bSetFocus ? "Received" : "Lost"); break; default: printf ("Unknown event type %04x\n", inrec.EventType); break; } if (GetConsoleMode(hin, &cmode)) printf (" Console mode is 0x%04x\n", cmode); } } ------=_NextPart_000_000A_01BFD3C1.D470BBD0--