#pragma once #include "../../Include/Winheaders.h" #include "Thread.h" #include #include namespace blackbone { class ProcessThreads { public: BLACKBONE_API ProcessThreads( class ProcessCore& core ); BLACKBONE_API ~ProcessThreads(); ProcessThreads( const ProcessThreads& ) = delete; ProcessThreads& operator =( const ProcessThreads& ) = delete; /// /// Create the thread. /// /// Thread enty point /// Thread argument. /// Thread creation flags /// New thread object BLACKBONE_API call_result_t CreateNew( ptr_t threadProc, ptr_t arg, enum CreateThreadFlags flags = static_cast(0) ); /// /// Gets all process threads /// /// Threads collection BLACKBONE_API std::vector getAll() const; /// /// Get main process thread /// /// Pointer to thread object, nullptr if failed BLACKBONE_API ThreadPtr getMain() const; /// /// Get least executed thread /// /// Pointer to thread object, nullptr if failed BLACKBONE_API ThreadPtr getLeastExecuted() const; /// /// Get most executed thread /// /// Pointer to thread object, nullptr if failed BLACKBONE_API ThreadPtr getMostExecuted() const; /// /// Get random thread /// /// Pointer to thread object, nullptr if failed BLACKBONE_API ThreadPtr getRandom() const; /// /// Get thread by ID /// /// Thread ID /// Pointer to thread object, nullptr if failed BLACKBONE_API ThreadPtr get( DWORD id ) const; private: class ProcessCore& _core; // Core process functions }; }