/** Restores state after guard page hit. */ void restore_state(void* ctx, dr_mcontext_t* mcontext, struct tag_info_t* tag_info) { struct instr_info_t* instr_info; instr_info = &tag_info->instr_info; if(instr_info->restore_tls_reg) { reg_set_value(instr_info->tls_reg, mcontext, dr_read_saved_reg(ctx, SPILL_SLOT_2)); } if(instr_info->restore_current_reg) { reg_set_value(instr_info->current_reg, mcontext, dr_read_saved_reg(ctx, SPILL_SLOT_3)); } }
/** * Changes the content of a string registry entry or created the entry if its not already * * @param const char *reg_path - Path of key * @param const char *keyname - Name of the subkey * @param const char *string - String to insert into registry, ensure that it has a terminator * * @return bool - states if string set happened OK */ bool reg_set_sz(const char *reg_path, const char *keyname, const char *string) { return reg_set_value( reg_path, keyname, REG_SZ, (void *) string, (strlen(string) + 1) * sizeof(char)); }
void save_settings() { reg_set_value(L"Main3D", values.main3d); reg_set_value(L"AntiAlias", values.anti_alias); reg_set_value(L"AntiAliasSamples", values.anti_alias_samples); reg_set_value(L"MLF", values.mlf); reg_set_value(L"AAF", values.aaf); reg_set_value(L"AnisoDegree", values.aniso_degree); reg_set_value(L"TextureLod", values.texture_lod); reg_set_value(L"TFQ", values.tfq); reg_set_value(L"VSyncControl", values.vsync_control); reg_set_value(L"Tessellation", values.tessellation); reg_set_value(L"Tessellation_OPTION", values.tessellation_option); reg_set_value(L"SurfaceFormatReplacements", values.surface_format_replacements); reg_set_value(L"EnableTripleBuffering", values.triple_buffering); }
/** * Changes the value of a value registry entry or created the entry if its not already * * @param const char *reg_path - Path of key * @param const char *keyname - Name of the subkey * @param DWORD value - Value to be inserted into the registry * * @return bool - states if value set happened OK */ bool reg_set_dword(const char *reg_path, const char *keyname, DWORD value) { return reg_set_value(reg_path, keyname, REG_DWORD, &value, sizeof(DWORD)); }