icecat: add release icecat-140.8.0-2 for aramo
This commit is contained in:
parent
d9a6c0aa96
commit
d570f39e11
616 changed files with 39955 additions and 33937 deletions
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/DynamicallyLinkedFunctionPtr.h"
|
||||
#include "mozilla/WindowsVersion.h"
|
||||
|
||||
static_assert(sizeof(PROCESS_MITIGATION_DYNAMIC_CODE_POLICY) == 4);
|
||||
|
||||
|
|
@ -98,4 +99,54 @@ MFBT_API bool IsUserShadowStackEnabled() {
|
|||
return polInfo.EnableUserShadowStack;
|
||||
}
|
||||
|
||||
MFBT_API bool IsPreferLoadFromSystem32Available() {
|
||||
return mozilla::IsWin10AnniversaryUpdateOrLater();
|
||||
}
|
||||
|
||||
MFBT_API bool IsPreferLoadFromSystem32Enabled() {
|
||||
auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc();
|
||||
if (!pGetProcessMitigationPolicy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PROCESS_MITIGATION_IMAGE_LOAD_POLICY imgLoadPol{};
|
||||
if (!pGetProcessMitigationPolicy(::GetCurrentProcess(),
|
||||
ProcessImageLoadPolicy, &imgLoadPol,
|
||||
sizeof(imgLoadPol))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return imgLoadPol.PreferSystem32Images;
|
||||
}
|
||||
|
||||
MFBT_API bool EnablePreferLoadFromSystem32() {
|
||||
auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc();
|
||||
if (!pGetProcessMitigationPolicy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static const mozilla::StaticDynamicallyLinkedFunctionPtr<
|
||||
decltype(&::SetProcessMitigationPolicy)>
|
||||
pSetProcessMitigationPolicy(L"kernel32.dll",
|
||||
"SetProcessMitigationPolicy");
|
||||
if (!pSetProcessMitigationPolicy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PROCESS_MITIGATION_IMAGE_LOAD_POLICY imgLoadPol{};
|
||||
if (!pGetProcessMitigationPolicy(::GetCurrentProcess(),
|
||||
ProcessImageLoadPolicy, &imgLoadPol,
|
||||
sizeof(imgLoadPol))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (imgLoadPol.PreferSystem32Images) {
|
||||
return true;
|
||||
}
|
||||
|
||||
imgLoadPol.PreferSystem32Images = 1;
|
||||
return pSetProcessMitigationPolicy(ProcessImageLoadPolicy, &imgLoadPol,
|
||||
sizeof(imgLoadPol));
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue