jit support improved
This commit is contained in:
parent
ce1064c7cc
commit
ed0f837dfd
|
@ -1570,7 +1570,11 @@ static bool readwritejitkey(wchar_t* jit_key_value, DWORD* jit_key_vale_size, ch
|
|||
{
|
||||
lRv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, JIT_REG_KEY, 0, key_flags, &hKey);
|
||||
if(lRv != ERROR_SUCCESS)
|
||||
{
|
||||
if(error != NULL)
|
||||
*error = ERROR_RW_FILE_NOT_FOUND;
|
||||
return false;
|
||||
}
|
||||
|
||||
lRv = RegQueryValueExW(hKey, ConvertUtf8ToUtf16(key).c_str(), 0, NULL, (LPBYTE)jit_key_value, jit_key_vale_size);
|
||||
if(lRv != ERROR_SUCCESS)
|
||||
|
|
|
@ -1564,13 +1564,12 @@ CMDRESULT cbDebugSetJIT(int argc, char* argv[])
|
|||
char path[JIT_ENTRY_DEF_SIZE];
|
||||
dbggetdefjit(path);
|
||||
char get_entry[JIT_ENTRY_MAX_SIZE] = "";
|
||||
bool get_last_jit = true;
|
||||
|
||||
if(!dbggetjit(get_entry, notfound, & actual_arch, NULL))
|
||||
{
|
||||
dprintf("Error getting JIT %s\n", (actual_arch == x64) ? "x64" : "x32");
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
strcpy_s(oldjit, get_entry);
|
||||
get_last_jit = false;
|
||||
else
|
||||
strcpy_s(oldjit, get_entry);
|
||||
|
||||
jit_debugger_cmd = path;
|
||||
if(!dbgsetjit(jit_debugger_cmd, notfound, & actual_arch, NULL))
|
||||
|
@ -1578,8 +1577,11 @@ CMDRESULT cbDebugSetJIT(int argc, char* argv[])
|
|||
dprintf("Error setting JIT %s\n", (actual_arch == x64) ? "x64" : "x32");
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
if(_stricmp(oldjit, path))
|
||||
BridgeSettingSet("JIT", "Old", oldjit);
|
||||
if(get_last_jit)
|
||||
{
|
||||
if(_stricmp(oldjit, path))
|
||||
BridgeSettingSet("JIT", "Old", oldjit);
|
||||
}
|
||||
}
|
||||
else if(!_strcmpi(argv[1], "restore"))
|
||||
{
|
||||
|
|
|
@ -173,39 +173,39 @@ void SettingsDialog::LoadSettings()
|
|||
#ifndef _WIN64
|
||||
isx64 = false;
|
||||
#endif
|
||||
if(DbgFunctions()->GetJit)
|
||||
{
|
||||
bool jit_auto_on;
|
||||
DbgFunctions()->GetJit(jit_entry, isx64);
|
||||
DbgFunctions()->GetDefJit(jit_def_entry);
|
||||
bool jit_auto_on;
|
||||
bool get_jit_works;
|
||||
get_jit_works = DbgFunctions()->GetJit(jit_entry, isx64);
|
||||
DbgFunctions()->GetDefJit(jit_def_entry);
|
||||
|
||||
if(get_jit_works)
|
||||
{
|
||||
if(_strcmpi(jit_entry, jit_def_entry) == 0)
|
||||
settings.miscSetJIT = true;
|
||||
else
|
||||
settings.miscSetJIT = false;
|
||||
ui->editJIT->setText(jit_entry);
|
||||
ui->editJIT->setCursorPosition(0);
|
||||
}
|
||||
else
|
||||
settings.miscSetJIT = false;
|
||||
ui->editJIT->setText(jit_entry);
|
||||
ui->editJIT->setCursorPosition(0);
|
||||
|
||||
ui->chkSetJIT->setCheckState(bool2check(settings.miscSetJIT));
|
||||
ui->chkSetJIT->setCheckState(bool2check(settings.miscSetJIT));
|
||||
|
||||
if(DbgFunctions()->GetJitAuto(&jit_auto_on))
|
||||
{
|
||||
if(!jit_auto_on)
|
||||
settings.miscSetJITAuto = true;
|
||||
else
|
||||
settings.miscSetJITAuto = false;
|
||||
bool get_jit_auto_works = DbgFunctions()->GetJitAuto(&jit_auto_on);
|
||||
if(!get_jit_auto_works || !jit_auto_on)
|
||||
settings.miscSetJITAuto = true;
|
||||
else
|
||||
settings.miscSetJITAuto = false;
|
||||
|
||||
ui->chkConfirmBeforeAtt->setCheckState(bool2check(settings.miscSetJITAuto));
|
||||
}
|
||||
ui->chkConfirmBeforeAtt->setCheckState(bool2check(settings.miscSetJITAuto));
|
||||
|
||||
if(!DbgFunctions()->IsProcessElevated())
|
||||
{
|
||||
ui->chkSetJIT->setDisabled(true);
|
||||
ui->chkConfirmBeforeAtt->setDisabled(true);
|
||||
ui->lbladminwarning->setText(QString("Warning: Run the debugger as Admin to enable JIT."));
|
||||
}
|
||||
if(!DbgFunctions()->IsProcessElevated())
|
||||
{
|
||||
ui->chkSetJIT->setDisabled(true);
|
||||
ui->chkConfirmBeforeAtt->setDisabled(true);
|
||||
ui->lbladminwarning->setText(QString("Warning: Run the debugger as Admin to enable JIT."));
|
||||
}
|
||||
}
|
||||
|
||||
bJitOld = settings.miscSetJIT;
|
||||
bJitAutoOld = settings.miscSetJITAuto;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue