SocksOverRDP-Plugin/SocksOverRDP-Plugin.cpp
/*
Terminate all running threads that handle communication
by setting the loop condition to FALSE and closing socket.
*/
Terminate all running threads that handle communication
by setting the loop condition to FALSE and closing socket.
Terminate all running threads that handle communication by setting the loop condition to FALSE and closing socket .
VOID SocksOverRDPPlugin::TerminateThreads()
{
	struct threads *rolling;
	DWORD dwWaitResult = WaitForSingleObject(ghLLMutex, INFINITE);
	switch (dwWaitResult)
	{
	case WAIT_OBJECT_0:
		rolling = ThreadHead;
		if (rolling == NULL)
		{
			if (bVerbose) DebugPrint(0, L"[*] Nothing to terminate. Threadhead empty. %08X", GetCurrentThreadId());
		}
		while (rolling)
		{
			rolling->run = FALSE;
			closesocket(rolling->s);
			rolling = rolling->next;
		}
		if (!ReleaseMutex(ghLLMutex))
		{
			if (bVerbose) DebugPrint(0, L"[*] TerminateThreads Release failed: %08X", GetCurrentThreadId());
		}
		return;
		break;
	case WAIT_ABANDONED:
		if (bVerbose) DebugPrint(0, L"[*] TerminateThreads abandoned: %08X", GetCurrentThreadId());
		return;
	}
}
VOID SocksOverRDPPlugin :: TerminateThreads ( ) { struct threads * rolling ; DWORD dwWaitResult = WaitForSingleObject ( ghLLMutex , INFINITE ) ; switch ( dwWaitResult ) { case WAIT_OBJECT_0 : rolling = ThreadHead ; if ( rolling == NULL ) { if ( bVerbose ) DebugPrint ( 0 , L" " , GetCurrentThreadId ( ) ) ; } while ( rolling ) { rolling -> run = FALSE ; closesocket ( rolling -> s ) ; rolling = rolling -> next ; } if ( ! ReleaseMutex ( ghLLMutex ) ) { if ( bVerbose ) DebugPrint ( 0 , L" " , GetCurrentThreadId ( ) ) ; } return ; break ; case WAIT_ABANDONED : if ( bVerbose ) DebugPrint ( 0 , L" " , GetCurrentThreadId ( ) ) ; return ; } }
Terminate all running threads that handle communication
by setting the loop condition to FALSE and closing socket.
Terminate all running threads that handle communication by setting the loop condition to FALSE and closing socket .