Add manual refresh option and configuration files to describe interfaces

This commit is contained in:
silverf0x 2017-12-11 22:43:44 +01:00
parent 940bff0824
commit e71a2006b7
4 changed files with 34 additions and 2 deletions

View File

@ -4,7 +4,7 @@ project(RpcView)
set(RPCVIEW_VERSION_MAJOR 0)
set(RPCVIEW_VERSION_MINOR 3)
set(RPCVIEW_VERSION_RELEASE 0)
set(RPCVIEW_VERSION_RELEASE 1)
if($ENV{APPVEYOR_BUILD_NUMBER})
set(RPCVIEW_VERSION_BUILD $ENV{APPVEYOR_BUILD_NUMBER})
else()

View File

@ -8,6 +8,10 @@
#include "../RpcCommon/Misc.h"
#include "Pdb.h"
#include <Dbghelp.h>
#include <strsafe.h>
static WCHAR FullPath[MAX_PATH];
static RPC_WSTR pUuidString = NULL;
//------------------------------------------------------------------------------
InterfaceSelectedVisitor_C::InterfaceSelectedVisitor_C(quint32 Pid, RPC_IF_ID* pIf,RpcCore_T* pRpcCore,void* pRpcCoreCtxt)
@ -18,12 +22,15 @@ InterfaceSelectedVisitor_C::InterfaceSelectedVisitor_C(quint32 Pid, RPC_IF_ID* p
this->pRpcCoreCtxt = pRpcCoreCtxt;
this->pRpcInterfaceInfo = pRpcCore->RpcCoreGetInterfaceInfoFn( pRpcCoreCtxt, Pid, pIf, RPC_INTERFACE_INFO_ALL );
UuidToStringW(&pIf->Uuid, &pUuidString);
GetFullPathNameW(L"RpcView.ini", _countof(FullPath), FullPath, NULL);
}
//------------------------------------------------------------------------------
InterfaceSelectedVisitor_C::~InterfaceSelectedVisitor_C()
{
RpcStringFreeW(&pUuidString);
if (pRpcInterfaceInfo != NULL)
{
pRpcCore->RpcCoreFreeInterfaceInfoFn(pRpcCoreCtxt, pRpcInterfaceInfo);
@ -146,6 +153,12 @@ void InterfaceSelectedVisitor_C::Visit(ProceduresWidget_C* pProceduresWidget)
{
PdbGetSymbolName(hPdb, (UCHAR*)pRpcInterfaceInfo->pLocationBase + pRpcInterfaceInfo->ppProcAddressTable[ProcIdx], SymbolName, sizeof(SymbolName));
}
if (SymbolName[0] == 0) {
WCHAR ProcIdxName[10];
StringCbPrintfW(ProcIdxName, sizeof(ProcIdxName), L"Proc%u", ProcIdx);
GetPrivateProfileStringW((LPCWSTR)pUuidString, ProcIdxName, NULL, SymbolName, sizeof(SymbolName)/sizeof(SymbolName[0]), FullPath);
}
if ( (pRpcInterfaceInfo->pFormatStringOffsetTable==NULL)||
(pRpcInterfaceInfo->pProcFormatString==NULL))
{

View File

@ -19,6 +19,7 @@
#define BELOW_NORMAL_REFRESH_SPEED 2000
#define SLOW_REFRESH_SPEED 5000
#define VERY_SLOW_REFRESH_SPEED 10000
#define MANUAL_REFRESH_SPEED 0
#define SHELL_EXECUTE_SUCCESS ((HINSTANCE)42) // According to the doc, welcome the 16-bit compatibilty
@ -458,6 +459,7 @@ void MainWindow_C::ConfigureSymbols()
void MainWindow_C::SetUpdateSpeedAsFast()
{
this->RefreshSpeedInMs = FAST_REFRESH_SPEED;
pRefreshTimer->start();
pRefreshTimer->setInterval(this->RefreshSpeedInMs);
}
@ -466,6 +468,7 @@ void MainWindow_C::SetUpdateSpeedAsFast()
void MainWindow_C::SetUpdateSpeedAsNormal()
{
this->RefreshSpeedInMs = NORMAL_REFRESH_SPEED;
pRefreshTimer->start();
pRefreshTimer->setInterval(this->RefreshSpeedInMs);
}
@ -474,6 +477,7 @@ void MainWindow_C::SetUpdateSpeedAsNormal()
void MainWindow_C::SetUpdateSpeedAsBelowNormal()
{
this->RefreshSpeedInMs = BELOW_NORMAL_REFRESH_SPEED;
pRefreshTimer->start();
pRefreshTimer->setInterval(this->RefreshSpeedInMs);
}
@ -482,6 +486,7 @@ void MainWindow_C::SetUpdateSpeedAsBelowNormal()
void MainWindow_C::SetUpdateSpeedAsSlow()
{
this->RefreshSpeedInMs = SLOW_REFRESH_SPEED;
pRefreshTimer->start();
pRefreshTimer->setInterval(this->RefreshSpeedInMs);
}
@ -490,9 +495,17 @@ void MainWindow_C::SetUpdateSpeedAsSlow()
void MainWindow_C::SetUpdateSpeedAsVerySlow()
{
this->RefreshSpeedInMs = VERY_SLOW_REFRESH_SPEED;
pRefreshTimer->start();
pRefreshTimer->setInterval(this->RefreshSpeedInMs);
}
//------------------------------------------------------------------------------
void MainWindow_C::SetUpdateSpeedAsManual()
{
this->RefreshSpeedInMs = MANUAL_REFRESH_SPEED;
pRefreshTimer->stop();
}
//------------------------------------------------------------------------------
void MainWindow_C::InvokeFindShortcut()
@ -583,12 +596,14 @@ void MainWindow_C::SetupMenu()
pActionSpeedBelowNormal = pSubMenupdateSpeed->addAction("2 seconds", this, SLOT(SetUpdateSpeedAsBelowNormal()));
pActionSpeedSlow = pSubMenupdateSpeed->addAction("5 seconds", this, SLOT(SetUpdateSpeedAsSlow()));
pActionSpeedVerySlow = pSubMenupdateSpeed->addAction("10 seconds", this, SLOT(SetUpdateSpeedAsVerySlow()));
pActionSpeedManual = pSubMenupdateSpeed->addAction("manual", this, SLOT(SetUpdateSpeedAsManual()));
pActionSpeedFast->setCheckable(true);
pActionSpeedNormal->setCheckable(true);
pActionSpeedBelowNormal->setCheckable(true);
pActionSpeedSlow->setCheckable(true);
pActionSpeedVerySlow->setCheckable(true);
pActionSpeedManual->setCheckable(true);
QActionGroup* pSpeedActionGroup = new QActionGroup(this);
@ -597,6 +612,7 @@ void MainWindow_C::SetupMenu()
pSpeedActionGroup->addAction(pActionSpeedBelowNormal);
pSpeedActionGroup->addAction(pActionSpeedSlow);
pSpeedActionGroup->addAction(pActionSpeedVerySlow);
pSpeedActionGroup->addAction(pActionSpeedManual);
//
// View
//
@ -655,6 +671,7 @@ void MainWindow_C::InitMenuRefreshSpeed()
case BELOW_NORMAL_REFRESH_SPEED : pActionSpeedBelowNormal->setChecked(true); break;
case SLOW_REFRESH_SPEED : pActionSpeedSlow->setChecked(true); break;
case VERY_SLOW_REFRESH_SPEED : pActionSpeedVerySlow->setChecked(true); break;
case MANUAL_REFRESH_SPEED : pActionSpeedManual->setChecked(true); break;
//--
default:
break;
@ -798,7 +815,7 @@ MainWindow_C::MainWindow_C(RpcCore_T* pRpcCore)
//
pRefreshTimer = new QTimer(this);
connect(pRefreshTimer, SIGNAL(timeout()), this, SLOT(RefreshViews()));
pRefreshTimer->start(this->RefreshSpeedInMs);
if (this->RefreshSpeedInMs) pRefreshTimer->start(this->RefreshSpeedInMs);
InitColumnsDialog();
}

View File

@ -51,6 +51,7 @@ private slots:
void SetUpdateSpeedAsBelowNormal();
void SetUpdateSpeedAsSlow();
void SetUpdateSpeedAsVerySlow();
void SetUpdateSpeedAsManual();
void ShowColumnsDialog();
void UpdateColumns();
//--
@ -86,6 +87,7 @@ private:
QAction* pActionSpeedBelowNormal;
QAction* pActionSpeedSlow;
QAction* pActionSpeedVerySlow;
QAction* pActionSpeedManual;
QAction* pAddressAbsolute;
QAction* pAddressRva;