*/
static void RunShell(client_t *client)
{
- DWORD threadID;
+ HANDLE threadHandle;
HANDLE hChildStdinRd;
HANDLE hChildStdinWr;
HANDLE hChildStdoutRd;
if (!CloseHandle(hChildStdinRd))
ErrorExit("Closing handle failed");
- CreateThread(NULL, 0, WriteToPipeThread, client, 0, &threadID);
- CreateThread(NULL, 0, ReadFromPipeThread, client, 0, &threadID);
- CreateThread(NULL, 0, MonitorChildThread, client, 0, &threadID);
+ threadHandle = CreateThread(NULL, 0, WriteToPipeThread, client, 0, NULL);
+ if (threadHandle != NULL)
+ CloseHandle(threadHandle);
+
+ threadHandle = CreateThread(NULL, 0, ReadFromPipeThread, client, 0, NULL);
+ if (threadHandle != NULL)
+ CloseHandle(threadHandle);
+
+ threadHandle = CreateThread(NULL, 0, MonitorChildThread, client, 0, NULL);
+ if (threadHandle != NULL)
+ CloseHandle(threadHandle);
}
/*