Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ctrlHandler (0.21 sec)

  1. src/runtime/testdata/testwinlibsignal/main.c

    #include <windows.h>
    #include <stdio.h>
    
    HANDLE waitForCtrlBreakEvent;
    
    BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
    {
        switch (fdwCtrlType)
        {
        case CTRL_BREAK_EVENT:
            SetEvent(waitForCtrlBreakEvent);
            return TRUE;
        default:
            return FALSE;
        }
    }
    
    int main(void)
    {
        waitForCtrlBreakEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
        if (!waitForCtrlBreakEvent) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 21 13:21:00 UTC 2021
    - 1.5K bytes
    - Viewed (0)
  2. build/pause/windows/pause.c

    */
    
    #include <windows.h>
    #include <stdio.h>
    #include <string.h>
    
    #define STRINGIFY(x) #x
    #define VERSION_STRING(x) STRINGIFY(x)
    
    #ifndef VERSION
    #define VERSION HEAD
    #endif
    
    BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
    {
    	switch (fdwCtrlType)
    	{
    	case CTRL_C_EVENT:
    		fprintf(stderr, "Shutting down, got signal\n");
    		exit(0);
    
    	case CTRL_BREAK_EVENT:
    		fprintf(stderr, "Shutting down, got signal\n");
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 23 13:09:17 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  3. src/runtime/os_windows.go

    	}
    
    	stdcall1(_FreeEnvironmentStringsW, uintptr(strings))
    
    	// We call these all the way here, late in init, so that malloc works
    	// for the callback functions these generate.
    	var fn any = ctrlHandler
    	ctrlHandlerPC := compileCallback(*efaceOf(&fn), true)
    	stdcall2(_SetConsoleCtrlHandler, ctrlHandlerPC, 1)
    
    	monitorSuspendResume()
    }
    
    // exiting is set to non-zero when the process is exiting.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 22:55:25 UTC 2024
    - 41.5K bytes
    - Viewed (0)
Back to top