Ticket #2558: powerreq.patch
File powerreq.patch, 747 bytes (added by , 7 years ago) |
---|
-
Service.cpp
483 483 if (!nServiceRunning) 484 484 PostQuitMessage(0); 485 485 486 // force system working power state (S0) while service is running. 487 EXECUTION_STATE prevState = SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED); 488 if (!prevState) 489 PostQuitMessage(0); 490 486 491 MSG msg; 487 492 while (GetMessage(&msg, 0, 0, 0)) { 488 493 TranslateMessage(&msg); … … 492 497 delete pServer; 493 498 WSACleanup(); 494 499 500 // Revert power state. 501 SetThreadExecutionState(prevState); 502 495 503 SetEvent(killServiceEvent); 496 504 return 0; 497 505 } … … 607 615 } 608 616 609 617 return 1; 610 } 611 No newline at end of file 618 }