/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"Hal.h" #include"HalLog.h" #include"nsWindowsHelpers.h"// for nsAutoHandle and nsModuleHandle #include"mozilla/StaticPrefs_dom.h"
if (::SetPriorityClass(processHandle, priority)) {
HAL_LOG("WindowsProcessPriority - priority set to %d for pid %d\n",
aPriority, aPid);
}
// Set the process into or out of EcoQoS. staticbool alreadyInitialized = false; static decltype(::SetProcessInformation)* setProcessInformation = nullptr; if (!alreadyInitialized) { if (aPriority == PROCESS_PRIORITY_PARENT_PROCESS ||
!StaticPrefs::dom_ipc_processPriorityManager_backgroundUsesEcoQoS()) { return;
}
alreadyInitialized = true; // SetProcessInformation only exists on Windows 8 and later.
nsModuleHandle module(LoadLibrary(L"Kernel32.dll")); if (module) {
setProcessInformation =
(decltype(::SetProcessInformation)*)GetProcAddress(
module, "SetProcessInformation");
}
} if (!setProcessInformation) { return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.