Skip to content

vyefremov/InternshipTask

Repository files navigation

General info

• Language – C++11.
• IDE&Compiler– MS Visual Studio 2012+.
• OS – Windows 8+.
• Don’t use additional libraries. Task can be accomplished using only std lib of �++ and WinAPI.

Task

Create class to launch and monitor win32 process. Class constructor accepts command line path and arguments. Class instance must launch a process and watch it's state. In case of crash or exit it must restart process using command line from constructor.

Class must

• Start and restart process.
• Allow to retrieve process info (handle, id, status (is working, restarting, stopped)).
• Allow to stop process via method call (without restart) and start it again.
• Log all events (start, crash, manual shutdown) to EventLog or file.
Logger instance must be configurable OOP-style.
• Allow to add callbacks to all events (std::function). For example OnProcStart, OnProcCrash, OnProcManuallyStopped.
• All methods must be thread-safe.
• All resources (process handles, threads, file handles, logger, etc.) must be properly released.

Advanced

Make class able to watch already running process. User can specify process ID and your code must start watching this process and extract command line for this process. In case of exit or crash your code must start process with exact same arguments as it was started before. Assume that target process doesn't defend itself from such operations and doesn`t overwrite memory of process start info structures.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published