зеркало из https://github.com/mozilla/pjs.git
Merge mozilla-central into mozilla-inbound
This commit is contained in:
Коммит
2f9276d061
|
@ -191,6 +191,18 @@ private:
|
|||
void* mRealView;
|
||||
};
|
||||
|
||||
bool
|
||||
IsVistaOrLater()
|
||||
{
|
||||
OSVERSIONINFO info;
|
||||
|
||||
ZeroMemory(&info, sizeof(OSVERSIONINFO));
|
||||
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&info);
|
||||
|
||||
return info.dwMajorVersion >= 6;
|
||||
}
|
||||
|
||||
bool
|
||||
CheckASLR(const wchar_t* path)
|
||||
{
|
||||
|
@ -454,7 +466,7 @@ continue_loading:
|
|||
return STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (!CheckASLR(full_fname)) {
|
||||
if (IsVistaOrLater() && !CheckASLR(full_fname)) {
|
||||
printf_stderr("LdrLoadDll: Blocking load of '%s'. XPCOM components must support ASLR.\n", dllName);
|
||||
return STATUS_DLL_NOT_FOUND;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,13 @@ const Ci = Components.interfaces;
|
|||
function run_test() {
|
||||
let manifest = do_get_file('testcompnoaslr.manifest');
|
||||
Components.manager.autoRegister(manifest);
|
||||
do_check_false("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID);
|
||||
var sysInfo = Cc["@mozilla.org/system-info;1"].
|
||||
getService(Ci.nsIPropertyBag2);
|
||||
var ver = parseFloat(sysInfo.getProperty("version"));
|
||||
if (ver < 6.0) {
|
||||
// This is disabled on pre-Vista OSs.
|
||||
do_check_true("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID);
|
||||
} else {
|
||||
do_check_false("{335fb596-e52d-418f-b01c-1bf16ce5e7e4}" in Components.classesByID);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче