added operator= in ThreadInfo + removed redundant null check

This commit is contained in:
Mr. eXoDia 2015-07-15 07:32:08 +02:00
parent 59574f105f
commit 43415e12aa
3 changed files with 20 additions and 2 deletions

View File

@ -21,6 +21,18 @@ namespace GleeBug
{
}
ThreadInfo & ThreadInfo::operator=(const ThreadInfo& other)
{
dwThreadId = other.dwThreadId;
hThread = other.hThread;
lpThreadLocalBase = other.lpThreadLocalBase;
lpStartAddress = other.lpStartAddress;
registers = Registers(); //create new registers
stepCallbacks = other.stepCallbacks;
isSingleStepping = other.isSingleStepping;
return *this;
}
bool ThreadInfo::RegReadContext()
{
SuspendThread(this->hThread);

View File

@ -34,6 +34,13 @@ namespace GleeBug
*/
ThreadInfo(const ThreadInfo & other);
/**
\brief Assignment operator.
\param other The other object.
\return A shallow copy of this object.
*/
ThreadInfo & operator=(const ThreadInfo & other);
/**
\brief Read the register context from the thread. This fills the RegistersInfo member.
\return true if it succeeds, false if it fails.

View File

@ -45,7 +45,6 @@ namespace GleeBug
&si,
&_mainProcess);
if (szCreateWithCmdLine)
delete[] szCreateWithCmdLine;
return result;