cleanup critical section(SbieDll.dll is not included).

This commit is contained in:
david 2022-03-13 16:39:48 +08:00
parent 07862a28a5
commit 4fa3fdfd08
14 changed files with 55 additions and 2 deletions

View File

@ -601,6 +601,9 @@ do_kill_all:
} }
} }
// cleanup CS
DeleteCriticalSection(&ProcessCritSec);
// this process is no longer needed // this process is no longer needed
ExitProcess(0); ExitProcess(0);

View File

@ -174,6 +174,12 @@ _FX BOOL WINAPI DllMain(
File_DoAutoRecover(TRUE); File_DoAutoRecover(TRUE);
Gui_ResetClipCursor(); Gui_ResetClipCursor();
} }
#ifdef _WIN64
// cleanup CS
DeleteCriticalSection(&VT_CriticalSection);
#endif
} }
return TRUE; return TRUE;

View File

@ -65,6 +65,12 @@ DriverAssist::DriverAssist()
InitializeCriticalSection(&m_critSecHostInjectedSvcs); InitializeCriticalSection(&m_critSecHostInjectedSvcs);
} }
DriverAssist::~DriverAssist()
{
DeleteCriticalSection(&m_LogMessage_CritSec);
DeleteCriticalSection(&m_critSecHostInjectedSvcs);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Initialize // Initialize

View File

@ -45,6 +45,8 @@ private:
DriverAssist(); DriverAssist();
~DriverAssist();
bool InitializePortAndThreads(); bool InitializePortAndThreads();
void ShutdownPortAndThreads(); void ShutdownPortAndThreads();

View File

@ -131,6 +131,12 @@ GuiServer::GuiServer()
GetModuleHandle(L"user32.dll"), "SetProcessDpiAwarenessContext"); GetModuleHandle(L"user32.dll"), "SetProcessDpiAwarenessContext");
} }
GuiServer::~GuiServer()
{
// cleanup CS
DeleteCriticalSection(&m_SlavesLock);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// GuiServer // GuiServer
@ -4650,4 +4656,4 @@ ULONG GuiServer::KillJob(SlaveArgs* args)
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }

View File

@ -49,6 +49,8 @@ protected:
GuiServer(); GuiServer();
~GuiServer();
static void ReportError2336( static void ReportError2336(
ULONG session_id, ULONG errlvl, ULONG status); ULONG session_id, ULONG errlvl, ULONG status);

View File

@ -217,6 +217,9 @@ PipeServer::~PipeServer()
if (m_pool) if (m_pool)
Pool_Delete(m_pool); Pool_Delete(m_pool);
// cleanup CS
DeleteCriticalSection(&m_lock);
} }
@ -1187,4 +1190,4 @@ bool PipeServer::IsCallerAdmin()
// } // }
// //
// return NT_SUCCESS(status); // return NT_SUCCESS(status);
//} //}

View File

@ -66,6 +66,12 @@ ProxyHandle::ProxyHandle(HANDLE heap, ULONG size_of_data,
m_unique_id = 'sbox'; m_unique_id = 'sbox';
} }
ProxyHandle::~ProxyHandle()
{
// cleanup CS
DeleteCriticalSection(&m_lock);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Create // Create

View File

@ -36,6 +36,8 @@ public:
P_ProxyHandle_CloseCallback close_callback, P_ProxyHandle_CloseCallback close_callback,
void *context_for_callback); void *context_for_callback);
~ProxyHandle();
ULONG Create(HANDLE process_id, void *model_data); ULONG Create(HANDLE process_id, void *model_data);
void *Find(HANDLE process_id, ULONG unique_id); void *Find(HANDLE process_id, ULONG unique_id);

View File

@ -170,6 +170,12 @@ ComServer::ComServer(PipeServer *pipeServer)
pipeServer->Register(MSGID_COM, this, Handler); pipeServer->Register(MSGID_COM, this, Handler);
} }
ComServer::~ComServer()
{
// cleanup CS
DeleteCriticalSection(&m_SlavesLock);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Handler // Handler

View File

@ -33,6 +33,7 @@ class ComServer
public: public:
ComServer(PipeServer *pipeServer); ComServer(PipeServer *pipeServer);
~ComServer();
void DeleteAllSlaves(); void DeleteAllSlaves();

View File

@ -78,6 +78,12 @@ QueueServer::QueueServer(PipeServer *pipeServer)
pipeServer->Register(MSGID_QUEUE, this, Handler); pipeServer->Register(MSGID_QUEUE, this, Handler);
} }
QueueServer::~QueueServer()
{
// cleanup CS
DeleteCriticalSection(&m_lock);
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// CloseCallback // CloseCallback

View File

@ -33,6 +33,7 @@ class QueueServer
public: public:
QueueServer(PipeServer *pipeServer); QueueServer(PipeServer *pipeServer);
~QueueServer();
protected: protected:

View File

@ -82,6 +82,9 @@ SbieIniServer::~SbieIniServer()
delete m_pConfigIni; delete m_pConfigIni;
LeaveCriticalSection(&m_instance->m_critsec); LeaveCriticalSection(&m_instance->m_critsec);
// cleanup CS
DeleteCriticalSection(&m_instance->m_critsec);
} }