1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 19:09:01 +00:00

Prevent system from going to sleep during scans. Fixes #1192

This commit is contained in:
dmiller
2022-09-21 21:31:14 +00:00
parent e3ab97215d
commit e8271b7070
4 changed files with 17 additions and 0 deletions

View File

@@ -1173,6 +1173,10 @@ int FPEngine6::os_scan(std::vector<Target *> &Targets) {
(int) curr_hosts.size(), (int) left_hosts.size(), (int) done_hosts.size());
}
#ifdef WIN32
// Reset system idle timer to avoid going to sleep
SetThreadExecutionState(ES_SYSTEM_REQUIRED);
#endif
/* Go through the list of hosts and ask them to schedule their probes */
for (unsigned int i = 0; i < curr_hosts.size(); i++) {