core/win32/os.c
/* checks for compatibility OS specific options, returns true if
 * modified the value of any options to make them compatible
 */
checks for compatibility OS specific options, returns true if
modified the value of any options to make them compatible
checks for compatibility OS specific options returns true if modified the value of any options to make them compatible
bool
os_check_option_compatibility(void)
{
    bool changed_options = false;
    bool os_has_aslr = get_os_version() >= (int)INTERNAL_OPTION(os_aslr_version);
    if (!os_has_aslr)
        return false;
    if (TEST(OS_ASLR_DISABLE_PCACHE_ALL, DYNAMO_OPTION(os_aslr))) {
        if (DYNAMO_OPTION(coarse_enable_freeze)) {
            dynamo_options.coarse_enable_freeze = false;
            changed_options = true;
        }
        if (DYNAMO_OPTION(coarse_freeze_at_unload)) {
            dynamo_options.coarse_freeze_at_unload = false;
            changed_options = true;
        }
        if (DYNAMO_OPTION(use_persisted)) {
            dynamo_options.use_persisted = false;
            changed_options = true;
        }
        if (changed_options)
            SYSLOG_INTERNAL_WARNING_ONCE("pcache completely disabled, Vista+");
    }
    if (TEST(OS_ASLR_DISABLE_PCACHE_ALL, DYNAMO_OPTION(os_aslr))) {
        if (DYNAMO_OPTION(aslr) != 0) {
            dynamo_options.aslr = 0;
            changed_options = true;
            SYSLOG_INTERNAL_WARNING_ONCE("ASLR completely disabled, Vista+");
        }
        if (DYNAMO_OPTION(aslr_cache) != 0) {
            dynamo_options.aslr_cache = 0;
            changed_options = true;
        }
    }
    ASSERT(os_has_aslr);
    return changed_options;
}
bool os_check_option_compatibility ( void ) { bool changed_options = false ; bool os_has_aslr = get_os_version ( ) >= ( int ) INTERNAL_OPTION ( os_aslr_version ) ; if ( ! os_has_aslr ) return false ; if ( TEST ( OS_ASLR_DISABLE_PCACHE_ALL , DYNAMO_OPTION ( os_aslr ) ) ) { if ( DYNAMO_OPTION ( coarse_enable_freeze ) ) { dynamo_options . coarse_enable_freeze = false ; changed_options = true ; } if ( DYNAMO_OPTION ( coarse_freeze_at_unload ) ) { dynamo_options . coarse_freeze_at_unload = false ; changed_options = true ; } if ( DYNAMO_OPTION ( use_persisted ) ) { dynamo_options . use_persisted = false ; changed_options = true ; } if ( changed_options ) SYSLOG_INTERNAL_WARNING_ONCE ( " " ) ; } if ( TEST ( OS_ASLR_DISABLE_PCACHE_ALL , DYNAMO_OPTION ( os_aslr ) ) ) { if ( DYNAMO_OPTION ( aslr ) != 0 ) { dynamo_options . aslr = 0 ; changed_options = true ; SYSLOG_INTERNAL_WARNING_ONCE ( " " ) ; } if ( DYNAMO_OPTION ( aslr_cache ) != 0 ) { dynamo_options . aslr_cache = 0 ; changed_options = true ; } } ASSERT ( os_has_aslr ) ; return changed_options ; }
checks for compatibility OS specific options, returns true if
 modified the value of any options to make them compatible
checks for compatibility OS specific options returns true if modified the value of any options to make them compatible
/* ASLR introduced in Vista Beta2, but we support only RTM+ so
     * WINDOWS_VERSION_VISTA */ /* completely disable pcache */ /* enabled by -desktop, but can be enabled independently as well */ /* note dynamorio.dll is not marked as ASLR friendly so we keep
     * using our own -aslr_dr */ /* completely disable ASLR */ /* enabled by -client, but can be enabled independently as well */