1
0
Fork 0

Merge pull request #2713 from thejanit0r/patch-2

Added CB_STOPPINGDEBUG plugin callback in order to let plugins perform clean-up
This commit is contained in:
Duncan Ogilvie 2021-08-21 15:46:26 +02:00 committed by GitHub
commit b4f55233d3
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -68,6 +68,11 @@ typedef struct
void* reserved; void* reserved;
} PLUG_CB_STOPDEBUG; } PLUG_CB_STOPDEBUG;
typedef struct
{
void* reserved;
} PLUG_CB_STOPPINGDEBUG;
typedef struct typedef struct
{ {
CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo; CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo;
@ -285,6 +290,7 @@ typedef enum
CB_VALFROMSTRING, //PLUG_CB_VALFROMSTRING CB_VALFROMSTRING, //PLUG_CB_VALFROMSTRING
CB_VALTOSTRING, //PLUG_CB_VALTOSTRING CB_VALTOSTRING, //PLUG_CB_VALTOSTRING
CB_MENUPREPARE, //PLUG_CB_MENUPREPARE CB_MENUPREPARE, //PLUG_CB_MENUPREPARE
CB_STOPPINGDEBUG, //PLUG_CB_STOPDEBUG
CB_LAST CB_LAST
} CBTYPE; } CBTYPE;

View File

@ -147,6 +147,11 @@ bool cbDebugStop(int argc, char* argv[])
if(!hDebugLoopThread) if(!hDebugLoopThread)
return false; return false;
// Give the plugins a chance to perform clean-up
PLUG_CB_STOPPINGDEBUG stoppingInfo;
stoppingInfo.reserved = 0;
plugincbcall(CB_STOPPINGDEBUG, &stoppingInfo);
auto hDebugLoopThreadCopy = hDebugLoopThread; auto hDebugLoopThreadCopy = hDebugLoopThread;
hDebugLoopThread = nullptr; hDebugLoopThread = nullptr;

View File

@ -180,6 +180,7 @@ bool pluginload(const char* pluginName, bool loadall)
}; };
regExport("CBINITDEBUG", CB_INITDEBUG); regExport("CBINITDEBUG", CB_INITDEBUG);
regExport("CBSTOPDEBUG", CB_STOPDEBUG); regExport("CBSTOPDEBUG", CB_STOPDEBUG);
regExport("CB_STOPPINGDEBUG", CB_STOPPINGDEBUG);
regExport("CBCREATEPROCESS", CB_CREATEPROCESS); regExport("CBCREATEPROCESS", CB_CREATEPROCESS);
regExport("CBEXITPROCESS", CB_EXITPROCESS); regExport("CBEXITPROCESS", CB_EXITPROCESS);
regExport("CBCREATETHREAD", CB_CREATETHREAD); regExport("CBCREATETHREAD", CB_CREATETHREAD);